15 #ifndef EIGEN_LMQRSOLV_H 16 #define EIGEN_LMQRSOLV_H 22 template <
typename Scalar,
int Rows,
int Cols,
typename PermIndex>
48 s.topLeftCorner(n,n).template triangularView<StrictlyLower>() = s.topLeftCorner(n,n).transpose();
50 for (j = 0; j <
n; ++
j) {
64 for (k = j; k <
n; ++k) {
71 s(k,k) = givens.
c() *
s(k,k) + givens.
s() * sdiag[k];
72 temp = givens.
c() * wa[k] + givens.
s() * qtbpj;
73 qtbpj = -givens.
s() * wa[k] + givens.
c() * qtbpj;
77 for (i = k+1; i<
n; ++
i) {
78 temp = givens.
c() *
s(i,k) + givens.
s() * sdiag[
i];
79 sdiag[
i] = -givens.
s() *
s(i,k) + givens.
c() * sdiag[
i];
88 for(nsing=0; nsing<n && sdiag[nsing]!=0; nsing++) {}
91 s.topLeftCorner(nsing, nsing).transpose().template triangularView<Upper>().solveInPlace(wa.head(nsing));
101 template <
typename Scalar,
int _Options,
typename Index>
126 for (j = 0; j <
n; ++
j)
141 for (k = j; k <
n; ++k)
143 typename FactorType::InnerIterator itk(R,k);
145 if (itk.index() < k)
continue;
155 itk.valueRef() = givens.
c() * itk.value() + givens.
s() * sdiag(k);
156 temp = givens.
c() * wa(k) + givens.
s() * qtbpj;
157 qtbpj = -givens.
s() * wa(k) + givens.
c() * qtbpj;
161 for (++itk; itk; ++itk)
164 temp = givens.
c() * itk.value() + givens.
s() * sdiag(i);
165 sdiag(i) = -givens.
s() * itk.value() + givens.
c() * sdiag(i);
166 itk.valueRef() = temp;
174 for(nsing = 0; nsing<n && sdiag(nsing) !=0; nsing++) {}
178 wa.head(nsing) = R.topLeftCorner(nsing,nsing).template triangularView<Upper>().solve(wa.head(nsing));
180 sdiag = R.diagonal();
188 #endif // EIGEN_LMQRSOLV_H
EIGEN_DEVICE_FUNC Derived & setZero(Index size)
A versatible sparse matrix representation.
Matrix diag(const std::vector< Matrix > &Hs)
EIGEN_DEVICE_FUNC Scalar & c()
Rot2 R(Rot2::fromAngle(0.1))
Namespace containing all symbols from the Eigen library.
Rotation given by a cosine-sine pair.
static const Line3 l(Rot3(), 1, 1)
const IndicesType & indices() const
EIGEN_DEVICE_FUNC void makeGivens(const Scalar &p, const Scalar &q, Scalar *r=0)
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
void lmqrsolv(Matrix< Scalar, Rows, Cols > &s, const PermutationMatrix< Dynamic, Dynamic, PermIndex > &iPerm, const Matrix< Scalar, Dynamic, 1 > &diag, const Matrix< Scalar, Dynamic, 1 > &qtb, Matrix< Scalar, Dynamic, 1 > &x, Matrix< Scalar, Dynamic, 1 > &sdiag)
EIGEN_DEVICE_FUNC Scalar & s()
The matrix class, also used for vectors and row-vectors.
set noclip points set clip one set noclip two set bar set border lt lw set xdata set ydata set zdata set x2data set y2data set boxwidth set dummy x
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR Index cols() const EIGEN_NOEXCEPT