15 #ifndef EIGEN_LMQRSOLV_H
16 #define EIGEN_LMQRSOLV_H
24 template <
typename Scalar,
int Rows,
int Cols,
typename PermIndex>
50 s.topLeftCorner(
n,
n).template triangularView<StrictlyLower>() = s.topLeftCorner(
n,
n).
transpose();
52 for (
j = 0;
j <
n; ++
j) {
56 const PermIndex l = iPerm.
indices()(
j);
66 for (k =
j; k <
n; ++k) {
73 s(k,k) = givens.
c() * s(k,k) + givens.
s() * sdiag[k];
74 temp = givens.
c() * wa[k] + givens.
s() * qtbpj;
75 qtbpj = -givens.
s() * wa[k] + givens.
c() * qtbpj;
79 for (
i = k+1;
i<
n; ++
i) {
80 temp = givens.
c() * s(
i,k) + givens.
s() * sdiag[
i];
81 sdiag[
i] = -givens.
s() * s(
i,k) + givens.
c() * sdiag[
i];
90 for(nsing=0; nsing<
n && sdiag[nsing]!=0; nsing++) {}
93 s.topLeftCorner(nsing, nsing).
transpose().template triangularView<Upper>().solveInPlace(wa.head(nsing));
103 template <
typename Scalar,
int Options_,
typename Index>
128 for (
j = 0;
j <
n; ++
j)
133 if (diag(l) == Scalar(0))
143 for (k =
j; k <
n; ++k)
145 typename FactorType::InnerIterator itk(R,k);
147 if (itk.index() < k)
continue;
157 itk.valueRef() = givens.
c() * itk.value() + givens.
s() * sdiag(k);
158 temp = givens.
c() * wa(k) + givens.
s() * qtbpj;
159 qtbpj = -givens.
s() * wa(k) + givens.
c() * qtbpj;
163 for (++itk; itk; ++itk)
166 temp = givens.
c() * itk.value() + givens.
s() * sdiag(
i);
167 sdiag(
i) = -givens.
s() * itk.value() + givens.
c() * sdiag(
i);
168 itk.valueRef() = temp;
176 for(nsing = 0; nsing<
n && sdiag(nsing) !=0; nsing++) {}
180 wa.head(nsing) = R.topLeftCorner(nsing,nsing).template triangularView<Upper>().solve(wa.head(nsing));
182 sdiag = R.diagonal();
TransposeReturnType transpose()
void makeGivens(const Scalar &p, const Scalar &q, Scalar *r=0)
DiagonalReturnType diagonal()
EIGEN_CONSTEXPR Index cols() const EIGEN_NOEXCEPT
Derived & setZero(Index rows, Index cols)
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)
: TensorContractionSycl.h, provides various tensor contraction kernel for SYCL backend
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index