6 template <
typename Scalar>
35 s.topLeftCorner(n,n).template triangularView<StrictlyLower>() = s.topLeftCorner(n,n).transpose();
38 for (j = 0; j < n; ++j) {
52 for (k = j; k < n; ++k) {
59 s(k,k) = givens.
c() * s(k,k) + givens.
s() * sdiag[k];
60 temp = givens.
c() * wa[k] + givens.
s() * qtbpj;
61 qtbpj = -givens.
s() * wa[k] + givens.
c() * qtbpj;
65 for (i = k+1; i<n; ++i) {
66 temp = givens.
c() * s(i,k) + givens.
s() * sdiag[i];
67 sdiag[i] = -givens.
s() * s(i,k) + givens.
c() * sdiag[i];
76 for(nsing=0; nsing<n && sdiag[nsing]!=0; nsing++) {}
79 s.topLeftCorner(nsing, nsing).transpose().template triangularView<Upper>().solveInPlace(wa.head(nsing));
86 for (j = 0; j < n; ++j) x[ipvt[j]] = wa[j];
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Index cols() const
EIGEN_DEVICE_FUNC Derived & setZero(Index size)
void makeGivens(const Scalar &p, const Scalar &q, Scalar *z=0)
Rotation given by a cosine-sine pair.
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
EIGEN_DEFAULT_DENSE_INDEX_TYPE DenseIndex
void qrsolv(Matrix< Scalar, Dynamic, Dynamic > &s, const VectorXi &ipvt, const Matrix< Scalar, Dynamic, 1 > &diag, const Matrix< Scalar, Dynamic, 1 > &qtb, Matrix< Scalar, Dynamic, 1 > &x, Matrix< Scalar, Dynamic, 1 > &sdiag)