Eigen  5.0.1
 
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 { return m_cpqr.rank(); }
141 inline Index dimensionOfKernel() const { return m_cpqr.dimensionOfKernel(); }
142 inline bool isInjective() const { return m_cpqr.isInjective(); }
143 inline bool isSurjective() const { return m_cpqr.isSurjective(); }
144 inline bool isInvertible() const { return m_cpqr.isInvertible(); }
145
146 inline Index rows() const { return m_cpqr.rows(); }
147 inline Index cols() const { return m_cpqr.cols(); }
148
149 inline const HCoeffsType& hCoeffs() const { return m_cpqr.hCoeffs(); }
150 const HCoeffsType& zCoeffs() const { return m_zCoeffs; }
151
152 CompleteOrthogonalDecompositionImpl& setThreshold(const RealScalar& threshold) {
153 m_cpqr.setThreshold(threshold);
154 return *this;
155 }
156
157 CompleteOrthogonalDecompositionImpl& setThreshold(Default_t) {
158 m_cpqr.setThreshold(Default);
159 return *this;
160 }
161
162 RealScalar threshold() const { return m_cpqr.threshold(); }
163
164 inline Index nonzeroPivots() const { return m_cpqr.nonzeroPivots(); }
165 inline RealScalar maxPivot() const { return m_cpqr.maxPivot(); }
166
167 ComputationInfo info() const {
168 eigen_assert(m_cpqr.m_isInitialized && "Decomposition is not initialized.");
169 return Success;
170 }
171
173 void check_initialized() const {
174 eigen_assert(m_cpqr.m_isInitialized && "CompleteOrthogonalDecomposition is not initialized.");
175 }
176
177#ifndef EIGEN_PARSED_BY_DOXYGEN
178 template <typename RhsType, typename DstType>
179 void _solve_impl(const RhsType& rhs, DstType& dst) const;
180
181 template <bool Conjugate, typename RhsType, typename DstType>
182 void _solve_impl_transposed(const RhsType& rhs, DstType& dst) const;
183#endif
184
185 protected:
186 EIGEN_STATIC_ASSERT_NON_INTEGER(Scalar)
187
188 template <bool Transpose_, typename Rhs>
189 void _check_solve_assertion(const Rhs& b) const {
190 EIGEN_ONLY_USED_FOR_DEBUG(b);
191 eigen_assert(m_cpqr.m_isInitialized && "CompleteOrthogonalDecomposition is not initialized.");
192 eigen_assert((Transpose_ ? this->cols() : this->rows()) == b.rows() &&
193 "CompleteOrthogonalDecomposition::solve(): invalid number of rows of the right hand side matrix b");
194 }
195
196 void computeInPlace();
197
198 template <bool Conjugate, typename Rhs>
199 void applyZOnTheLeftInPlace(Rhs& rhs) const;
200
201 template <typename Rhs>
202 void applyZAdjointOnTheLeftInPlace(Rhs& rhs) const;
203
204 RankRevealingQRType m_cpqr;
205 HCoeffsType m_zCoeffs;
206 RowVectorType m_temp;
207};
208
209template <typename MatrixType, typename PermutationIndex, template <typename, typename> class RankRevealingQR_>
210typename MatrixType::Scalar
211CompleteOrthogonalDecompositionImpl<MatrixType, PermutationIndex, RankRevealingQR_>::determinant() const {
212 return m_cpqr.determinant();
213}
214
215template <typename MatrixType, typename PermutationIndex, template <typename, typename> class RankRevealingQR_>
216typename MatrixType::RealScalar
217CompleteOrthogonalDecompositionImpl<MatrixType, PermutationIndex, RankRevealingQR_>::absDeterminant() const {
218 return m_cpqr.absDeterminant();
219}
220
221template <typename MatrixType, typename PermutationIndex, template <typename, typename> class RankRevealingQR_>
222typename MatrixType::RealScalar
223CompleteOrthogonalDecompositionImpl<MatrixType, PermutationIndex, RankRevealingQR_>::logAbsDeterminant() const {
224 return m_cpqr.logAbsDeterminant();
225}
226
227template <typename MatrixType, typename PermutationIndex, template <typename, typename> class RankRevealingQR_>
228typename MatrixType::Scalar
229CompleteOrthogonalDecompositionImpl<MatrixType, PermutationIndex, RankRevealingQR_>::signDeterminant() const {
230 return m_cpqr.signDeterminant();
231}
232
233template <typename MatrixType, typename PermutationIndex, template <typename, typename> class RankRevealingQR_>
234void CompleteOrthogonalDecompositionImpl<MatrixType, PermutationIndex, RankRevealingQR_>::computeInPlace() {
235 eigen_assert(m_cpqr.cols() <= NumTraits<PermutationIndex>::highest());
236
237 const Index rank = m_cpqr.rank();
238 const Index cols = m_cpqr.cols();
239 const Index rows = m_cpqr.rows();
240 m_zCoeffs.resize((std::min)(rows, cols));
241 m_temp.resize(cols);
242
243 if (rank < cols) {
244 // We have reduced the (permuted) matrix to the form
245 // [R11 R12]
246 // [ 0 R22]
247 // where R11 is r-by-r (r = rank) upper triangular, R12 is
248 // r-by-(n-r), and R22 is empty or the norm of R22 is negligible.
249 // We now compute the complete orthogonal decomposition by applying
250 // Householder transformations from the right to the upper trapezoidal
251 // matrix X = [R11 R12] to zero out R12 and obtain the factorization
252 // [R11 R12] = [T11 0] * Z, where T11 is r-by-r upper triangular and
253 // Z = Z(0) * Z(1) ... Z(r-1) is an n-by-n orthogonal matrix.
254 // We store the data representing Z in R12 and m_zCoeffs.
255 for (Index k = rank - 1; k >= 0; --k) {
256 if (k != rank - 1) {
257 // Given the API for Householder reflectors, it is more convenient if
258 // we swap the leading parts of columns k and r-1 (zero-based) to form
259 // the matrix X_k = [X(0:k, k), X(0:k, r:n)]
260 m_cpqr.m_qr.col(k).head(k + 1).swap(m_cpqr.m_qr.col(rank - 1).head(k + 1));
261 }
262 // Construct Householder reflector Z(k) to zero out the last row of X_k,
263 // i.e. choose Z(k) such that
264 // [X(k, k), X(k, r:n)] * Z(k) = [beta, 0, .., 0].
265 RealScalar beta;
266 m_cpqr.m_qr.row(k).tail(cols - rank + 1).makeHouseholderInPlace(m_zCoeffs(k), beta);
267 m_cpqr.m_qr(k, rank - 1) = beta;
268 if (k > 0) {
269 // Apply Z(k) to the first k rows of X_k
270 m_cpqr.m_qr.topRightCorner(k, cols - rank + 1)
271 .applyHouseholderOnTheRight(m_cpqr.m_qr.row(k).tail(cols - rank).adjoint(), m_zCoeffs(k), &m_temp(0));
272 }
273 if (k != rank - 1) {
274 // Swap X(0:k,k) back to its proper location.
275 m_cpqr.m_qr.col(k).head(k + 1).swap(m_cpqr.m_qr.col(rank - 1).head(k + 1));
276 }
277 }
278 }
279}
280
281template <typename MatrixType, typename PermutationIndex, template <typename, typename> class RankRevealingQR_>
282template <bool Conjugate, typename Rhs>
283void CompleteOrthogonalDecompositionImpl<MatrixType, PermutationIndex, RankRevealingQR_>::applyZOnTheLeftInPlace(
284 Rhs& rhs) const {
285 const Index cols = this->cols();
286 const Index nrhs = rhs.cols();
287 const Index rank = this->rank();
288 Matrix<typename Rhs::Scalar, Dynamic, 1> temp((std::max)(cols, nrhs));
289 for (Index k = rank - 1; k >= 0; --k) {
290 if (k != rank - 1) {
291 rhs.row(k).swap(rhs.row(rank - 1));
292 }
293 rhs.middleRows(rank - 1, cols - rank + 1)
294 .applyHouseholderOnTheLeft(matrixQTZ().row(k).tail(cols - rank).transpose().template conjugateIf<!Conjugate>(),
295 zCoeffs().template conjugateIf<Conjugate>()(k), &temp(0));
296 if (k != rank - 1) {
297 rhs.row(k).swap(rhs.row(rank - 1));
298 }
299 }
300}
301
302template <typename MatrixType, typename PermutationIndex, template <typename, typename> class RankRevealingQR_>
303template <typename Rhs>
304void CompleteOrthogonalDecompositionImpl<MatrixType, PermutationIndex, RankRevealingQR_>::applyZAdjointOnTheLeftInPlace(
305 Rhs& rhs) const {
306 const Index cols = this->cols();
307 const Index nrhs = rhs.cols();
308 const Index rank = this->rank();
309 Matrix<typename Rhs::Scalar, Dynamic, 1> temp((std::max)(cols, nrhs));
310 for (Index k = 0; k < rank; ++k) {
311 if (k != rank - 1) {
312 rhs.row(k).swap(rhs.row(rank - 1));
313 }
314 rhs.middleRows(rank - 1, cols - rank + 1)
315 .applyHouseholderOnTheLeft(matrixQTZ().row(k).tail(cols - rank).adjoint(), zCoeffs()(k), &temp(0));
316 if (k != rank - 1) {
317 rhs.row(k).swap(rhs.row(rank - 1));
318 }
319 }
320}
321
322#ifndef EIGEN_PARSED_BY_DOXYGEN
323template <typename MatrixType, typename PermutationIndex, template <typename, typename> class RankRevealingQR_>
324template <typename RhsType, typename DstType>
325void CompleteOrthogonalDecompositionImpl<MatrixType, PermutationIndex, RankRevealingQR_>::_solve_impl(
326 const RhsType& rhs, DstType& dst) const {
327 const Index rank = this->rank();
328 if (rank == 0) {
329 dst.setZero();
330 return;
331 }
332
333 // Compute c = Q^* * rhs
334 typename RhsType::PlainObject c(rhs);
335 c.applyOnTheLeft(matrixQ().setLength(rank).adjoint());
336
337 // Solve T z = c(1:rank, :)
338 dst.topRows(rank) = matrixT().topLeftCorner(rank, rank).template triangularView<Upper>().solve(c.topRows(rank));
339
340 const Index cols = this->cols();
341 if (rank < cols) {
342 // Compute y = Z^* * [ z ]
343 // [ 0 ]
344 dst.bottomRows(cols - rank).setZero();
345 applyZAdjointOnTheLeftInPlace(dst);
346 }
347
348 // Undo permutation to get x = P^{-1} * y.
349 dst = colsPermutation() * dst;
350}
351
352template <typename MatrixType, typename PermutationIndex, template <typename, typename> class RankRevealingQR_>
353template <bool Conjugate, typename RhsType, typename DstType>
354void CompleteOrthogonalDecompositionImpl<MatrixType, PermutationIndex, RankRevealingQR_>::_solve_impl_transposed(
355 const RhsType& rhs, DstType& dst) const {
356 const Index rank = this->rank();
357
358 if (rank == 0) {
359 dst.setZero();
360 return;
361 }
362
363 typename RhsType::PlainObject c(colsPermutation().transpose() * rhs);
364
365 if (rank < cols()) {
366 applyZOnTheLeftInPlace<!Conjugate>(c);
367 }
368
369 matrixT()
370 .topLeftCorner(rank, rank)
371 .template triangularView<Upper>()
372 .transpose()
373 .template conjugateIf<Conjugate>()
374 .solveInPlace(c.topRows(rank));
375
376 dst.topRows(rank) = c.topRows(rank);
377 dst.bottomRows(rows() - rank).setZero();
378
379 dst.applyOnTheLeft(householderQ().setLength(rank).template conjugateIf<!Conjugate>());
380}
381#endif
382
383template <typename MatrixType, typename PermutationIndex, template <typename, typename> class RankRevealingQR_>
384typename CompleteOrthogonalDecompositionImpl<MatrixType, PermutationIndex, RankRevealingQR_>::HouseholderSequenceType
385CompleteOrthogonalDecompositionImpl<MatrixType, PermutationIndex, RankRevealingQR_>::householderQ() const {
386 return m_cpqr.householderQ();
387}
388
389} // end namespace internal
390
418template <typename MatrixType_, typename PermutationIndex_>
419class CompleteOrthogonalDecomposition
420 : public internal::CompleteOrthogonalDecompositionImpl<MatrixType_, PermutationIndex_, ColPivHouseholderQR> {
421 public:
422 using Base =
423 internal::CompleteOrthogonalDecompositionImpl<MatrixType_, PermutationIndex_, Eigen::ColPivHouseholderQR>;
424 using typename Base::RealScalar;
425
426 CompleteOrthogonalDecomposition() : Base() {}
427 CompleteOrthogonalDecomposition(Index rows, Index cols) : Base(rows, cols) {}
428
429 template <typename InputType>
430 explicit CompleteOrthogonalDecomposition(const EigenBase<InputType>& matrix) : Base(matrix.derived()) {}
431
432 template <typename InputType>
433 explicit CompleteOrthogonalDecomposition(EigenBase<InputType>& matrix) : Base(matrix.derived()) {}
434
436 template <typename InputType>
437 CompleteOrthogonalDecomposition& compute(const EigenBase<InputType>& matrix) {
438 Base::compute(matrix);
439 return *this;
440 }
441
442 CompleteOrthogonalDecomposition& setThreshold(const RealScalar& threshold) {
443 Base::setThreshold(threshold);
444 return *this;
445 }
446
447 CompleteOrthogonalDecomposition& setThreshold(Default_t) {
448 Base::setThreshold(Default);
449 return *this;
450 }
451
458 this->check_initialized();
460 }
461};
462
486template <typename MatrixType_, typename PermutationIndex_>
487class RandCompleteOrthogonalDecomposition
488 : public internal::CompleteOrthogonalDecompositionImpl<MatrixType_, PermutationIndex_, RandColPivHouseholderQR> {
489 public:
490 using Base =
491 internal::CompleteOrthogonalDecompositionImpl<MatrixType_, PermutationIndex_, Eigen::RandColPivHouseholderQR>;
492 using typename Base::RealScalar;
493
494 RandCompleteOrthogonalDecomposition() : Base() {}
495 RandCompleteOrthogonalDecomposition(Index rows, Index cols) : Base(rows, cols) {}
496
497 template <typename InputType>
498 explicit RandCompleteOrthogonalDecomposition(const EigenBase<InputType>& matrix) : Base(matrix.derived()) {}
499
500 template <typename InputType>
501 explicit RandCompleteOrthogonalDecomposition(EigenBase<InputType>& matrix) : Base(matrix.derived()) {}
502
503 template <typename InputType>
504 RandCompleteOrthogonalDecomposition& compute(const EigenBase<InputType>& matrix) {
505 Base::compute(matrix);
506 return *this;
507 }
508
509 RandCompleteOrthogonalDecomposition& setThreshold(const RealScalar& threshold) {
510 Base::setThreshold(threshold);
511 return *this;
512 }
513
514 RandCompleteOrthogonalDecomposition& setThreshold(Default_t) {
515 Base::setThreshold(Default);
516 return *this;
517 }
518
522 RandCompleteOrthogonalDecomposition& setBlockSize(Index b) {
523 this->m_cpqr.setBlockSize(b);
524 return *this;
525 }
526
530 RandCompleteOrthogonalDecomposition& setSeed(uint64_t seed) {
531 this->m_cpqr.setSeed(seed);
532 return *this;
533 }
534
535 inline Inverse<RandCompleteOrthogonalDecomposition> pseudoInverse() const {
536 this->check_initialized();
538 }
539};
540
541namespace internal {
542
543template <typename MatrixType, typename PermutationIndex>
544struct traits<Inverse<CompleteOrthogonalDecomposition<MatrixType, PermutationIndex>>>
545 : traits<typename Transpose<typename MatrixType::PlainObject>::PlainObject> {
546 enum { Flags = 0 };
547};
548
549template <typename DstXprType, typename MatrixType, typename PermutationIndex>
550struct Assignment<DstXprType, Inverse<CompleteOrthogonalDecomposition<MatrixType, PermutationIndex>>,
551 internal::assign_op<typename DstXprType::Scalar,
552 typename CompleteOrthogonalDecomposition<MatrixType, PermutationIndex>::Scalar>,
553 Dense2Dense> {
554 using CodType = CompleteOrthogonalDecomposition<MatrixType, PermutationIndex>;
555 using SrcXprType = Inverse<CodType>;
556 static void run(DstXprType& dst, const SrcXprType& src,
557 const internal::assign_op<typename DstXprType::Scalar, typename CodType::Scalar>&) {
558 using IdentityMatrixType = Matrix<typename CodType::Scalar, CodType::RowsAtCompileTime, CodType::RowsAtCompileTime,
559 0, CodType::MaxRowsAtCompileTime, CodType::MaxRowsAtCompileTime>;
560 dst = src.nestedExpression().solve(IdentityMatrixType::Identity(src.cols(), src.cols()));
561 }
562};
563
564template <typename MatrixType, typename PermutationIndex>
565struct traits<Inverse<RandCompleteOrthogonalDecomposition<MatrixType, PermutationIndex>>>
566 : traits<typename Transpose<typename MatrixType::PlainObject>::PlainObject> {
567 enum { Flags = 0 };
568};
569
570template <typename DstXprType, typename MatrixType, typename PermutationIndex>
571struct Assignment<DstXprType, Inverse<RandCompleteOrthogonalDecomposition<MatrixType, PermutationIndex>>,
572 internal::assign_op<typename DstXprType::Scalar, typename RandCompleteOrthogonalDecomposition<
573 MatrixType, PermutationIndex>::Scalar>,
574 Dense2Dense> {
575 using CodType = RandCompleteOrthogonalDecomposition<MatrixType, PermutationIndex>;
576 using SrcXprType = Inverse<CodType>;
577 static void run(DstXprType& dst, const SrcXprType& src,
578 const internal::assign_op<typename DstXprType::Scalar, typename CodType::Scalar>&) {
579 using IdentityMatrixType = Matrix<typename CodType::Scalar, CodType::RowsAtCompileTime, CodType::RowsAtCompileTime,
580 0, CodType::MaxRowsAtCompileTime, CodType::MaxRowsAtCompileTime>;
581 dst = src.nestedExpression().solve(IdentityMatrixType::Identity(src.cols(), src.cols()));
582 }
583};
584
585} // end namespace internal
586
591template <typename Derived>
592template <typename PermutationIndex>
594MatrixBase<Derived>::completeOrthogonalDecomposition() const {
596}
597
602template <typename Derived>
603template <typename PermutationIndex>
605MatrixBase<Derived>::randCompleteOrthogonalDecomposition() const {
607}
608
609} // end namespace Eigen
610
611#endif // EIGEN_COMPLETEORTHOGONALDECOMPOSITION_H
Complete orthogonal decomposition (COD) of a matrix.
Definition CompleteOrthogonalDecomposition.h:420
CompleteOrthogonalDecomposition & compute(const EigenBase< InputType > &matrix)
Computes the COD of matrix.
Definition CompleteOrthogonalDecomposition.h:437
Inverse< CompleteOrthogonalDecomposition > pseudoInverse() const
Definition CompleteOrthogonalDecomposition.h:457
EvalReturnType eval() const
Definition DenseBase.h:385
Expression of the inverse of another expression.
Definition Inverse.h:44
Complete orthogonal decomposition (COD) of a matrix, backed by RandColPivHouseholderQR.
Definition CompleteOrthogonalDecomposition.h:488
RandCompleteOrthogonalDecomposition & setBlockSize(Index b)
Sets the panel block size of the underlying randomized QR.
Definition CompleteOrthogonalDecomposition.h:522
RandCompleteOrthogonalDecomposition & setSeed(uint64_t seed)
Fixes the RNG seed of the underlying randomized QR.
Definition CompleteOrthogonalDecomposition.h:530
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