Eigen  5.0.1-dev+master
 
Loading...
Searching...
No Matches
CompleteOrthogonalDecomposition.h
1// This file is part of Eigen, a lightweight C++ template library
2// for linear algebra.
3//
4// Copyright (C) 2016 Rasmus Munk Larsen <rmlarsen@gmail.com>
5//
6// This Source Code Form is subject to the terms of the Mozilla
7// Public License v. 2.0. If a copy of the MPL was not distributed
8// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
9// SPDX-License-Identifier: MPL-2.0
10
11#ifndef EIGEN_COMPLETEORTHOGONALDECOMPOSITION_H
12#define EIGEN_COMPLETEORTHOGONALDECOMPOSITION_H
13
14// IWYU pragma: private
15#include "./InternalHeaderCheck.h"
16
17namespace Eigen {
18
19namespace internal {
20
21template <typename MatrixType_, typename PermutationIndex_, template <typename, typename> class RankRevealingQR_>
22class CompleteOrthogonalDecompositionImpl;
23
24template <typename MatrixType_, typename PermutationIndex_, template <typename, typename> class RankRevealingQR_>
25struct traits<CompleteOrthogonalDecompositionImpl<MatrixType_, PermutationIndex_, RankRevealingQR_>>
26 : traits<MatrixType_> {
27 using XprKind = MatrixXpr;
28 using StorageKind = SolverStorage;
29 using PermutationIndex = PermutationIndex_;
30 enum { Flags = 0 };
31};
32
33template <typename MatrixType_, typename PermutationIndex_>
34struct traits<CompleteOrthogonalDecomposition<MatrixType_, PermutationIndex_>> : traits<MatrixType_> {
35 using XprKind = MatrixXpr;
36 using StorageKind = SolverStorage;
37 using PermutationIndex = PermutationIndex_;
38 enum { Flags = 0 };
39};
40
41template <typename MatrixType_, typename PermutationIndex_>
42struct traits<RandCompleteOrthogonalDecomposition<MatrixType_, PermutationIndex_>> : traits<MatrixType_> {
43 using XprKind = MatrixXpr;
44 using StorageKind = SolverStorage;
45 using PermutationIndex = PermutationIndex_;
46 enum { Flags = 0 };
47};
48
49} // end namespace internal
50
51namespace internal {
52
66template <typename MatrixType_, typename PermutationIndex_, template <typename, typename> class RankRevealingQR_>
67class CompleteOrthogonalDecompositionImpl
68 : public SolverBase<CompleteOrthogonalDecompositionImpl<MatrixType_, PermutationIndex_, RankRevealingQR_>> {
69 public:
70 using MatrixType = MatrixType_;
72
73 template <typename Derived>
74 friend struct internal::solve_assertion;
75 using PermutationIndex = PermutationIndex_;
76 EIGEN_GENERIC_PUBLIC_INTERFACE(CompleteOrthogonalDecompositionImpl)
77 enum {
78 MaxRowsAtCompileTime = MatrixType::MaxRowsAtCompileTime,
79 MaxColsAtCompileTime = MatrixType::MaxColsAtCompileTime
80 };
81 using HCoeffsType = typename internal::plain_diag_type<MatrixType>::type;
82 using PermutationType = PermutationMatrix<ColsAtCompileTime, MaxColsAtCompileTime, PermutationIndex>;
83 using IntRowVectorType = typename internal::plain_row_type<MatrixType, Index>::type;
84 using RowVectorType = typename internal::plain_row_type<MatrixType>::type;
85 using RealRowVectorType = typename internal::plain_row_type<MatrixType, RealScalar>::type;
86 using HouseholderSequenceType =
87 HouseholderSequence<MatrixType, internal::remove_all_t<typename HCoeffsType::ConjugateReturnType>>;
88 using PlainObject = typename MatrixType::PlainObject;
89 using RankRevealingQRType = RankRevealingQR_<MatrixType, PermutationIndex>;
90
91 public:
92 CompleteOrthogonalDecompositionImpl() : m_cpqr(), m_zCoeffs(), m_temp() {}
93
94 CompleteOrthogonalDecompositionImpl(Index rows, Index cols)
95 : m_cpqr(rows, cols), m_zCoeffs((std::min)(rows, cols)), m_temp(cols) {}
96
97 template <typename InputType>
98 explicit CompleteOrthogonalDecompositionImpl(const EigenBase<InputType>& matrix)
99 : m_cpqr(matrix.rows(), matrix.cols()),
100 m_zCoeffs((std::min)(matrix.rows(), matrix.cols())),
101 m_temp(matrix.cols()) {
102 compute(matrix.derived());
103 }
104
105 template <typename InputType>
106 explicit CompleteOrthogonalDecompositionImpl(EigenBase<InputType>& matrix)
107 : m_cpqr(matrix.derived()), m_zCoeffs((std::min)(matrix.rows(), matrix.cols())), m_temp(matrix.cols()) {
108 computeInPlace();
109 }
110
111 HouseholderSequenceType householderQ() const;
112 HouseholderSequenceType matrixQ() const { return m_cpqr.householderQ(); }
113
114 using MatrixZType = Matrix<Scalar, ColsAtCompileTime, ColsAtCompileTime, plain_object_options<MatrixType>::value,
115 MaxColsAtCompileTime, MaxColsAtCompileTime>;
116
117 MatrixZType matrixZ() const {
118 MatrixZType Z = MatrixZType::Identity(m_cpqr.cols(), m_cpqr.cols());
119 if (rank() < cols()) applyZOnTheLeftInPlace<false>(Z);
120 return Z;
121 }
122
123 const MatrixType& matrixQTZ() const { return m_cpqr.matrixQR(); }
124 const MatrixType& matrixT() const { return m_cpqr.matrixQR(); }
125
126 template <typename InputType>
127 CompleteOrthogonalDecompositionImpl& compute(const EigenBase<InputType>& matrix) {
128 m_cpqr.compute(matrix);
129 computeInPlace();
130 return *this;
131 }
132
133 const PermutationType& colsPermutation() const { return m_cpqr.colsPermutation(); }
134
135 typename MatrixType::Scalar determinant() const;
136 typename MatrixType::RealScalar absDeterminant() const;
137 typename MatrixType::RealScalar logAbsDeterminant() const;
138 typename MatrixType::Scalar signDeterminant() const;
139
140 inline Index rank() const {
141 eigen_assert(m_cpqr.m_isInitialized && "Decomposition is not initialized.");
142 return m_rank;
143 }
144 inline Index dimensionOfKernel() const { return cols() - rank(); }
145 inline bool isInjective() const { return rank() == cols(); }
146 inline bool isSurjective() const { return rank() == rows(); }
147 inline bool isInvertible() const { return isInjective() && isSurjective(); }
148
149 inline Index rows() const { return m_cpqr.rows(); }
150 inline Index cols() const { return m_cpqr.cols(); }
151
152 inline const HCoeffsType& hCoeffs() const { return m_cpqr.hCoeffs(); }
153 const HCoeffsType& zCoeffs() const { return m_zCoeffs; }
154
155 CompleteOrthogonalDecompositionImpl& setThreshold(const RealScalar& threshold) {
156 m_cpqr.setThreshold(threshold);
157 return *this;
158 }
159
160 CompleteOrthogonalDecompositionImpl& setThreshold(Default_t) {
161 m_cpqr.setThreshold(Default);
162 return *this;
163 }
164
170 RealScalar threshold() const { return m_cpqr.threshold(); }
171
172 inline Index nonzeroPivots() const { return m_cpqr.nonzeroPivots(); }
173 inline RealScalar maxPivot() const { return m_cpqr.maxPivot(); }
174
175 ComputationInfo info() const {
176 eigen_assert(m_cpqr.m_isInitialized && "Decomposition is not initialized.");
177 return Success;
178 }
179
181 void check_initialized() const {
182 eigen_assert(m_cpqr.m_isInitialized && "CompleteOrthogonalDecomposition is not initialized.");
183 }
184
185#ifndef EIGEN_PARSED_BY_DOXYGEN
186 template <typename RhsType, typename DstType>
187 void _solve_impl(const RhsType& rhs, DstType& dst) const;
188
189 template <bool Conjugate, typename RhsType, typename DstType>
190 void _solve_impl_transposed(const RhsType& rhs, DstType& dst) const;
191#endif
192
193 protected:
194 EIGEN_STATIC_ASSERT_NON_INTEGER(Scalar)
195
196 template <bool Transpose_, typename Rhs>
197 void _check_solve_assertion(const Rhs& b) const {
198 eigen_assert(m_cpqr.m_isInitialized && "CompleteOrthogonalDecomposition is not initialized.");
199 EIGEN_INTERNAL_ASSERT_SOLVER_RHS_MSG(
200 *this, b, Transpose_,
201 "CompleteOrthogonalDecomposition::solve(): invalid number of rows of the right hand side matrix b");
202 }
203
204 void computeInPlace();
205
206 template <bool Conjugate, typename Rhs>
207 void applyZOnTheLeftInPlace(Rhs& rhs) const;
208
209 template <typename Rhs>
210 void applyZAdjointOnTheLeftInPlace(Rhs& rhs) const;
211
212 RankRevealingQRType m_cpqr;
213 HCoeffsType m_zCoeffs;
214 RowVectorType m_temp;
215 // The rank for which Z was built by compute(). A threshold set later does not change it.
216 Index m_rank = 0;
217};
218
219template <typename MatrixType, typename PermutationIndex, template <typename, typename> class RankRevealingQR_>
220typename MatrixType::Scalar
221CompleteOrthogonalDecompositionImpl<MatrixType, PermutationIndex, RankRevealingQR_>::determinant() const {
222 return m_cpqr.determinant();
223}
224
225template <typename MatrixType, typename PermutationIndex, template <typename, typename> class RankRevealingQR_>
226typename MatrixType::RealScalar
227CompleteOrthogonalDecompositionImpl<MatrixType, PermutationIndex, RankRevealingQR_>::absDeterminant() const {
228 return m_cpqr.absDeterminant();
229}
230
231template <typename MatrixType, typename PermutationIndex, template <typename, typename> class RankRevealingQR_>
232typename MatrixType::RealScalar
233CompleteOrthogonalDecompositionImpl<MatrixType, PermutationIndex, RankRevealingQR_>::logAbsDeterminant() const {
234 return m_cpqr.logAbsDeterminant();
235}
236
237template <typename MatrixType, typename PermutationIndex, template <typename, typename> class RankRevealingQR_>
238typename MatrixType::Scalar
239CompleteOrthogonalDecompositionImpl<MatrixType, PermutationIndex, RankRevealingQR_>::signDeterminant() const {
240 return m_cpqr.signDeterminant();
241}
242
243template <typename MatrixType, typename PermutationIndex, template <typename, typename> class RankRevealingQR_>
244void CompleteOrthogonalDecompositionImpl<MatrixType, PermutationIndex, RankRevealingQR_>::computeInPlace() {
245 eigen_assert(m_cpqr.cols() <= NumTraits<PermutationIndex>::highest());
246
247 const Index rank = m_rank = m_cpqr.rank();
248 const Index cols = m_cpqr.cols();
249 const Index rows = m_cpqr.rows();
250 m_zCoeffs.resize((std::min)(rows, cols));
251 m_temp.resize(cols);
252
253 if (rank < cols) {
254 // We have reduced the (permuted) matrix to the form
255 // [R11 R12]
256 // [ 0 R22]
257 // where R11 is r-by-r (r = rank) upper triangular, R12 is
258 // r-by-(n-r), and R22 is empty or the norm of R22 is negligible.
259 // We now compute the complete orthogonal decomposition by applying
260 // Householder transformations from the right to the upper trapezoidal
261 // matrix X = [R11 R12] to zero out R12 and obtain the factorization
262 // [R11 R12] = [T11 0] * Z, where T11 is r-by-r upper triangular and
263 // Z = Z(0) * Z(1) ... Z(r-1) is an n-by-n orthogonal matrix.
264 // We store the data representing Z in R12 and m_zCoeffs.
265 for (Index k = rank - 1; k >= 0; --k) {
266 if (k != rank - 1) {
267 // Given the API for Householder reflectors, it is more convenient if
268 // we swap the leading parts of columns k and r-1 (zero-based) to form
269 // the matrix X_k = [X(0:k, k), X(0:k, r:n)]
270 m_cpqr.m_qr.col(k).head(k + 1).swap(m_cpqr.m_qr.col(rank - 1).head(k + 1));
271 }
272 // Construct Householder reflector Z(k) to zero out the last row of X_k,
273 // i.e. choose Z(k) such that
274 // [X(k, k), X(k, r:n)] * Z(k) = [beta, 0, .., 0].
275 RealScalar beta;
276 m_cpqr.m_qr.row(k).tail(cols - rank + 1).makeHouseholderInPlace(m_zCoeffs(k), beta);
277 m_cpqr.m_qr(k, rank - 1) = beta;
278 if (k > 0) {
279 // Apply Z(k) to the first k rows of X_k
280 m_cpqr.m_qr.topRightCorner(k, cols - rank + 1)
281 .applyHouseholderOnTheRight(m_cpqr.m_qr.row(k).tail(cols - rank).adjoint(), m_zCoeffs(k), &m_temp(0));
282 }
283 if (k != rank - 1) {
284 // Swap X(0:k,k) back to its proper location.
285 m_cpqr.m_qr.col(k).head(k + 1).swap(m_cpqr.m_qr.col(rank - 1).head(k + 1));
286 }
287 }
288 }
289}
290
291template <typename MatrixType, typename PermutationIndex, template <typename, typename> class RankRevealingQR_>
292template <bool Conjugate, typename Rhs>
293void CompleteOrthogonalDecompositionImpl<MatrixType, PermutationIndex, RankRevealingQR_>::applyZOnTheLeftInPlace(
294 Rhs& rhs) const {
295 const Index cols = this->cols();
296 const Index nrhs = rhs.cols();
297 const Index rank = this->rank();
298 Matrix<typename Rhs::Scalar, Dynamic, 1> temp((std::max)(cols, nrhs));
299 for (Index k = rank - 1; k >= 0; --k) {
300 if (k != rank - 1) {
301 rhs.row(k).swap(rhs.row(rank - 1));
302 }
303 rhs.middleRows(rank - 1, cols - rank + 1)
304 .applyHouseholderOnTheLeft(matrixQTZ().row(k).tail(cols - rank).transpose().template conjugateIf<!Conjugate>(),
305 zCoeffs().template conjugateIf<Conjugate>()(k), &temp(0));
306 if (k != rank - 1) {
307 rhs.row(k).swap(rhs.row(rank - 1));
308 }
309 }
310}
311
312template <typename MatrixType, typename PermutationIndex, template <typename, typename> class RankRevealingQR_>
313template <typename Rhs>
314void CompleteOrthogonalDecompositionImpl<MatrixType, PermutationIndex, RankRevealingQR_>::applyZAdjointOnTheLeftInPlace(
315 Rhs& rhs) const {
316 const Index cols = this->cols();
317 const Index nrhs = rhs.cols();
318 const Index rank = this->rank();
319 Matrix<typename Rhs::Scalar, Dynamic, 1> temp((std::max)(cols, nrhs));
320 for (Index k = 0; k < rank; ++k) {
321 if (k != rank - 1) {
322 rhs.row(k).swap(rhs.row(rank - 1));
323 }
324 rhs.middleRows(rank - 1, cols - rank + 1)
325 .applyHouseholderOnTheLeft(matrixQTZ().row(k).tail(cols - rank).adjoint(), zCoeffs()(k), &temp(0));
326 if (k != rank - 1) {
327 rhs.row(k).swap(rhs.row(rank - 1));
328 }
329 }
330}
331
332#ifndef EIGEN_PARSED_BY_DOXYGEN
333template <typename MatrixType, typename PermutationIndex, template <typename, typename> class RankRevealingQR_>
334template <typename RhsType, typename DstType>
335void CompleteOrthogonalDecompositionImpl<MatrixType, PermutationIndex, RankRevealingQR_>::_solve_impl(
336 const RhsType& rhs, DstType& dst) const {
337 const Index rank = this->rank();
338 if (rank == 0) {
339 dst.setZero();
340 return;
341 }
342
343 // Compute c = Q^* * rhs
344 typename RhsType::PlainObject c(rhs);
345 c.applyOnTheLeft(matrixQ().setLength(rank).adjoint());
346
347 // Solve T z = c(1:rank, :)
348 dst.topRows(rank) = matrixT().topLeftCorner(rank, rank).template triangularView<Upper>().solve(c.topRows(rank));
349
350 const Index cols = this->cols();
351 if (rank < cols) {
352 // Compute y = Z^* * [ z ]
353 // [ 0 ]
354 dst.bottomRows(cols - rank).setZero();
355 applyZAdjointOnTheLeftInPlace(dst);
356 }
357
358 // Undo permutation to get x = P^{-1} * y.
359 dst = colsPermutation() * dst;
360}
361
362template <typename MatrixType, typename PermutationIndex, template <typename, typename> class RankRevealingQR_>
363template <bool Conjugate, typename RhsType, typename DstType>
364void CompleteOrthogonalDecompositionImpl<MatrixType, PermutationIndex, RankRevealingQR_>::_solve_impl_transposed(
365 const RhsType& rhs, DstType& dst) const {
366 const Index rank = this->rank();
367
368 if (rank == 0) {
369 dst.setZero();
370 return;
371 }
372
373 typename RhsType::PlainObject c(colsPermutation().transpose() * rhs);
374
375 if (rank < cols()) {
376 applyZOnTheLeftInPlace<!Conjugate>(c);
377 }
378
379 matrixT()
380 .topLeftCorner(rank, rank)
381 .template triangularView<Upper>()
382 .transpose()
383 .template conjugateIf<Conjugate>()
384 .solveInPlace(c.topRows(rank));
385
386 dst.topRows(rank) = c.topRows(rank);
387 dst.bottomRows(rows() - rank).setZero();
388
389 dst.applyOnTheLeft(householderQ().setLength(rank).template conjugateIf<!Conjugate>());
390}
391#endif
392
393template <typename MatrixType, typename PermutationIndex, template <typename, typename> class RankRevealingQR_>
394typename CompleteOrthogonalDecompositionImpl<MatrixType, PermutationIndex, RankRevealingQR_>::HouseholderSequenceType
395CompleteOrthogonalDecompositionImpl<MatrixType, PermutationIndex, RankRevealingQR_>::householderQ() const {
396 return m_cpqr.householderQ();
397}
398
399} // end namespace internal
400
428template <typename MatrixType_, typename PermutationIndex_>
429class CompleteOrthogonalDecomposition
430 : public internal::CompleteOrthogonalDecompositionImpl<MatrixType_, PermutationIndex_, ColPivHouseholderQR> {
431 public:
432 using Base =
433 internal::CompleteOrthogonalDecompositionImpl<MatrixType_, PermutationIndex_, Eigen::ColPivHouseholderQR>;
434 using typename Base::RealScalar;
435
436 CompleteOrthogonalDecomposition() : Base() {}
437 CompleteOrthogonalDecomposition(Index rows, Index cols) : Base(rows, cols) {}
438
439 template <typename InputType>
440 explicit CompleteOrthogonalDecomposition(const EigenBase<InputType>& matrix) : Base(matrix.derived()) {}
441
442 template <typename InputType>
443 explicit CompleteOrthogonalDecomposition(EigenBase<InputType>& matrix) : Base(matrix.derived()) {}
444
446 template <typename InputType>
447 CompleteOrthogonalDecomposition& compute(const EigenBase<InputType>& matrix) {
448 Base::compute(matrix);
449 return *this;
450 }
451
460 CompleteOrthogonalDecomposition& setThreshold(const RealScalar& threshold) {
461 Base::setThreshold(threshold);
462 return *this;
463 }
464
466 CompleteOrthogonalDecomposition& setThreshold(Default_t) {
467 Base::setThreshold(Default);
468 return *this;
469 }
470
477 this->check_initialized();
479 }
480};
481
505template <typename MatrixType_, typename PermutationIndex_>
506class RandCompleteOrthogonalDecomposition
507 : public internal::CompleteOrthogonalDecompositionImpl<MatrixType_, PermutationIndex_, RandColPivHouseholderQR> {
508 public:
509 using Base =
510 internal::CompleteOrthogonalDecompositionImpl<MatrixType_, PermutationIndex_, Eigen::RandColPivHouseholderQR>;
511 using typename Base::RealScalar;
512
513 RandCompleteOrthogonalDecomposition() : Base() {}
514 RandCompleteOrthogonalDecomposition(Index rows, Index cols) : Base(rows, cols) {}
515
516 template <typename InputType>
517 explicit RandCompleteOrthogonalDecomposition(const EigenBase<InputType>& matrix) : Base(matrix.derived()) {}
518
519 template <typename InputType>
520 explicit RandCompleteOrthogonalDecomposition(EigenBase<InputType>& matrix) : Base(matrix.derived()) {}
521
522 template <typename InputType>
523 RandCompleteOrthogonalDecomposition& compute(const EigenBase<InputType>& matrix) {
524 Base::compute(matrix);
525 return *this;
526 }
527
536 RandCompleteOrthogonalDecomposition& setThreshold(const RealScalar& threshold) {
537 Base::setThreshold(threshold);
538 return *this;
539 }
540
542 RandCompleteOrthogonalDecomposition& setThreshold(Default_t) {
543 Base::setThreshold(Default);
544 return *this;
545 }
546
550 RandCompleteOrthogonalDecomposition& setBlockSize(Index b) {
551 this->m_cpqr.setBlockSize(b);
552 return *this;
553 }
554
558 RandCompleteOrthogonalDecomposition& setSeed(uint64_t seed) {
559 this->m_cpqr.setSeed(seed);
560 return *this;
561 }
562
563 inline Inverse<RandCompleteOrthogonalDecomposition> pseudoInverse() const {
564 this->check_initialized();
566 }
567};
568
569namespace internal {
570
571template <typename MatrixType, typename PermutationIndex>
572struct traits<Inverse<CompleteOrthogonalDecomposition<MatrixType, PermutationIndex>>>
573 : traits<typename Transpose<typename MatrixType::PlainObject>::PlainObject> {
574 enum { Flags = 0 };
575};
576
577template <typename DstXprType, typename MatrixType, typename PermutationIndex>
578struct Assignment<DstXprType, Inverse<CompleteOrthogonalDecomposition<MatrixType, PermutationIndex>>,
579 internal::assign_op<typename DstXprType::Scalar,
580 typename CompleteOrthogonalDecomposition<MatrixType, PermutationIndex>::Scalar>,
581 Dense2Dense> {
582 using CodType = CompleteOrthogonalDecomposition<MatrixType, PermutationIndex>;
583 using SrcXprType = Inverse<CodType>;
584 static void run(DstXprType& dst, const SrcXprType& src,
585 const internal::assign_op<typename DstXprType::Scalar, typename CodType::Scalar>&) {
586 using IdentityMatrixType = Matrix<typename CodType::Scalar, CodType::RowsAtCompileTime, CodType::RowsAtCompileTime,
587 0, CodType::MaxRowsAtCompileTime, CodType::MaxRowsAtCompileTime>;
588 dst = src.nestedExpression().solve(IdentityMatrixType::Identity(src.cols(), src.cols()));
589 }
590};
591
592template <typename MatrixType, typename PermutationIndex>
593struct traits<Inverse<RandCompleteOrthogonalDecomposition<MatrixType, PermutationIndex>>>
594 : traits<typename Transpose<typename MatrixType::PlainObject>::PlainObject> {
595 enum { Flags = 0 };
596};
597
598template <typename DstXprType, typename MatrixType, typename PermutationIndex>
599struct Assignment<DstXprType, Inverse<RandCompleteOrthogonalDecomposition<MatrixType, PermutationIndex>>,
600 internal::assign_op<typename DstXprType::Scalar, typename RandCompleteOrthogonalDecomposition<
601 MatrixType, PermutationIndex>::Scalar>,
602 Dense2Dense> {
603 using CodType = RandCompleteOrthogonalDecomposition<MatrixType, PermutationIndex>;
604 using SrcXprType = Inverse<CodType>;
605 static void run(DstXprType& dst, const SrcXprType& src,
606 const internal::assign_op<typename DstXprType::Scalar, typename CodType::Scalar>&) {
607 using IdentityMatrixType = Matrix<typename CodType::Scalar, CodType::RowsAtCompileTime, CodType::RowsAtCompileTime,
608 0, CodType::MaxRowsAtCompileTime, CodType::MaxRowsAtCompileTime>;
609 dst = src.nestedExpression().solve(IdentityMatrixType::Identity(src.cols(), src.cols()));
610 }
611};
612
613} // end namespace internal
614
619template <typename Derived>
620template <typename PermutationIndex>
622MatrixBase<Derived>::completeOrthogonalDecomposition() const {
624}
625
630template <typename Derived>
631template <typename PermutationIndex>
633MatrixBase<Derived>::randCompleteOrthogonalDecomposition() const {
635}
636
637} // end namespace Eigen
638
639#endif // EIGEN_COMPLETEORTHOGONALDECOMPOSITION_H
Complete orthogonal decomposition (COD) of a matrix.
Definition CompleteOrthogonalDecomposition.h:430
CompleteOrthogonalDecomposition & setThreshold(const RealScalar &threshold)
Definition CompleteOrthogonalDecomposition.h:460
CompleteOrthogonalDecomposition & compute(const EigenBase< InputType > &matrix)
Computes the COD of matrix.
Definition CompleteOrthogonalDecomposition.h:447
Inverse< CompleteOrthogonalDecomposition > pseudoInverse() const
Definition CompleteOrthogonalDecomposition.h:476
CompleteOrthogonalDecomposition & setThreshold(Default_t)
Definition CompleteOrthogonalDecomposition.h:466
EvalReturnType eval() const
Definition DenseBase.h:389
Expression of the inverse of another expression.
Definition Inverse.h:44
Complete orthogonal decomposition (COD) of a matrix, backed by RandColPivHouseholderQR.
Definition CompleteOrthogonalDecomposition.h:507
RandCompleteOrthogonalDecomposition & setThreshold(Default_t)
Definition CompleteOrthogonalDecomposition.h:542
RandCompleteOrthogonalDecomposition & setBlockSize(Index b)
Sets the panel block size of the underlying randomized QR.
Definition CompleteOrthogonalDecomposition.h:550
RandCompleteOrthogonalDecomposition & setThreshold(const RealScalar &threshold)
Definition CompleteOrthogonalDecomposition.h:536
RandCompleteOrthogonalDecomposition & setSeed(uint64_t seed)
Fixes the RNG seed of the underlying randomized QR.
Definition CompleteOrthogonalDecomposition.h:558
constexpr CompleteOrthogonalDecompositionImpl< MatrixType_, PermutationIndex_, RankRevealingQR_ > & derived()
ComputationInfo
Definition Constants.h:455
@ Success
Definition Constants.h:457
Definition EigenBase.h:34
constexpr Derived & derived()
Definition EigenBase.h:50