12 #ifndef EIGEN_LMCOVAR_H 13 #define EIGEN_LMCOVAR_H 19 template <
typename Scalar>
27 Index i, j, k, l, ii, jj;
33 const Scalar tolr = tol *
abs(r(0,0));
39 for (k = 0; k < n; ++k)
40 if (
abs(r(k,k)) > tolr) {
42 for (j = 0; j <= k-1; ++j) {
43 temp = r(k,k) * r(j,k);
45 r.col(k).head(j+1) -= r.col(j).head(j+1) * temp;
52 for (k = 0; k <= l; ++k) {
53 for (j = 0; j <= k-1; ++j)
54 r.col(j).head(j+1) += r.col(k).head(j+1) * r(j,k);
55 r.col(k).head(k+1) *= r(k,k);
60 for (j = 0; j < n; ++j) {
63 for (i = 0; i <= j; ++i) {
76 r.topLeftCorner(n,n).template triangularView<StrictlyUpper>() = r.topLeftCorner(n,n).transpose();
84 #endif // EIGEN_LMCOVAR_H EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Index cols() const
EIGEN_DEVICE_FUNC const SqrtReturnType sqrt() const
Holds information about the various numeric (i.e. scalar) types allowed by Eigen. ...
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const AbsReturnType abs() const
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
void covar(Matrix< Scalar, Dynamic, Dynamic > &r, const VectorXi &ipvt, Scalar tol=std::sqrt(NumTraits< Scalar >::epsilon()))