12 #ifndef EIGEN_LMCOVAR_H
13 #define EIGEN_LMCOVAR_H
21 template <
typename Scalar>
35 const Scalar tolr = tol *
abs(r(0,0));
41 for (k = 0; k <
n; ++k)
42 if (
abs(r(k,k)) > tolr) {
44 for (
j = 0;
j <= k-1; ++
j) {
45 temp = r(k,k) * r(
j,k);
47 r.col(k).head(
j+1) -= r.col(
j).head(
j+1) * temp;
54 for (k = 0; k <= l; ++k) {
55 for (
j = 0;
j <= k-1; ++
j)
56 r.col(
j).head(
j+1) += r.col(k).head(
j+1) * r(
j,k);
57 r.col(k).head(k+1) *= r(k,k);
62 for (
j = 0;
j <
n; ++
j) {
65 for (
i = 0;
i <=
j; ++
i) {
78 r.topLeftCorner(
n,
n).template triangularView<StrictlyUpper>() = r.topLeftCorner(
n,
n).transpose();
EIGEN_CONSTEXPR Index size() const EIGEN_NOEXCEPT
EIGEN_CONSTEXPR Index cols() const EIGEN_NOEXCEPT
void covar(Matrix< Scalar, Dynamic, Dynamic > &r, const VectorXi &ipvt, Scalar tol=std::sqrt(NumTraits< Scalar >::epsilon()))
: TensorContractionSycl.h, provides various tensor contraction kernel for SYCL backend
Eigen::AutoDiffScalar< EIGEN_EXPR_BINARYOP_SCALAR_RETURN_TYPE(Eigen::internal::remove_all_t< DerType >, typename Eigen::internal::traits< Eigen::internal::remove_all_t< DerType >>::Scalar, product) > sqrt(const Eigen::AutoDiffScalar< DerType > &x)
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
const Eigen::CwiseUnaryOp< Eigen::internal::scalar_abs_op< typename Derived::Scalar >, const Derived > abs(const Eigen::ArrayBase< Derived > &x)
adouble abs(const adouble &x)