10 #ifndef EIGEN_JACOBISVD_H 11 #define EIGEN_JACOBISVD_H 18 template<
typename MatrixType,
int QRPreconditioner,
19 bool IsComplex = NumTraits<typename MatrixType::Scalar>::IsComplex>
29 enum { PreconditionIfMoreColsThanRows, PreconditionIfMoreRowsThanCols };
31 template<
typename MatrixType,
int QRPreconditioner,
int Case>
34 enum { a = MatrixType::RowsAtCompileTime !=
Dynamic &&
35 MatrixType::ColsAtCompileTime !=
Dynamic &&
36 MatrixType::ColsAtCompileTime <= MatrixType::RowsAtCompileTime,
37 b = MatrixType::RowsAtCompileTime !=
Dynamic &&
38 MatrixType::ColsAtCompileTime !=
Dynamic &&
39 MatrixType::RowsAtCompileTime <= MatrixType::ColsAtCompileTime,
41 (Case == PreconditionIfMoreColsThanRows &&
bool(a)) ||
42 (Case == PreconditionIfMoreRowsThanCols &&
bool(b)) )
46 template<
typename MatrixType,
int QRPreconditioner,
int Case,
50 template<
typename MatrixType,
int QRPreconditioner,
int Case>
54 typedef typename MatrixType::Index Index;
64 template<
typename MatrixType>
68 typedef typename MatrixType::Index Index;
72 RowsAtCompileTime = MatrixType::RowsAtCompileTime,
73 MaxRowsAtCompileTime = MatrixType::MaxRowsAtCompileTime
79 if (svd.rows() != m_qr.rows() || svd.cols() != m_qr.cols())
82 ::new (&m_qr)
QRType(svd.rows(), svd.cols());
84 if (svd.m_computeFullU) m_workspace.resize(svd.rows());
89 if(matrix.rows() > matrix.cols())
92 svd.m_workMatrix = m_qr.matrixQR().block(0,0,matrix.cols(),matrix.cols()).
template triangularView<Upper>();
93 if(svd.m_computeFullU) m_qr.matrixQ().evalTo(svd.m_matrixU, m_workspace);
94 if(svd.
computeV()) svd.m_matrixV = m_qr.colsPermutation();
102 WorkspaceType m_workspace;
105 template<
typename MatrixType>
109 typedef typename MatrixType::Index Index;
113 RowsAtCompileTime = MatrixType::RowsAtCompileTime,
114 ColsAtCompileTime = MatrixType::ColsAtCompileTime,
115 MaxRowsAtCompileTime = MatrixType::MaxRowsAtCompileTime,
116 MaxColsAtCompileTime = MatrixType::MaxColsAtCompileTime,
124 if (svd.cols() != m_qr.rows() || svd.rows() != m_qr.cols())
127 ::new (&m_qr)
QRType(svd.cols(), svd.rows());
129 m_adjoint.resize(svd.cols(), svd.rows());
130 if (svd.m_computeFullV) m_workspace.resize(svd.cols());
135 if(matrix.cols() > matrix.rows())
137 m_adjoint = matrix.adjoint();
138 m_qr.compute(m_adjoint);
139 svd.m_workMatrix = m_qr.matrixQR().block(0,0,matrix.rows(),matrix.rows()).
template triangularView<Upper>().adjoint();
140 if(svd.m_computeFullV) m_qr.matrixQ().evalTo(svd.m_matrixV, m_workspace);
141 if(svd.
computeU()) svd.m_matrixU = m_qr.colsPermutation();
149 TransposeTypeWithSameStorageOrder m_adjoint;
155 template<
typename MatrixType>
159 typedef typename MatrixType::Index Index;
163 if (svd.rows() != m_qr.rows() || svd.cols() != m_qr.cols())
166 ::new (&m_qr)
QRType(svd.rows(), svd.cols());
168 if (svd.m_computeFullU) m_workspace.resize(svd.rows());
169 else if (svd.m_computeThinU) m_workspace.resize(svd.cols());
174 if(matrix.rows() > matrix.cols())
177 svd.m_workMatrix = m_qr.matrixQR().block(0,0,matrix.cols(),matrix.cols()).
template triangularView<Upper>();
178 if(svd.m_computeFullU) m_qr.householderQ().evalTo(svd.m_matrixU, m_workspace);
179 else if(svd.m_computeThinU)
181 svd.m_matrixU.setIdentity(matrix.rows(), matrix.cols());
182 m_qr.householderQ().applyThisOnTheLeft(svd.m_matrixU, m_workspace);
184 if(svd.
computeV()) svd.m_matrixV = m_qr.colsPermutation();
196 template<
typename MatrixType>
200 typedef typename MatrixType::Index Index;
204 RowsAtCompileTime = MatrixType::RowsAtCompileTime,
205 ColsAtCompileTime = MatrixType::ColsAtCompileTime,
206 MaxRowsAtCompileTime = MatrixType::MaxRowsAtCompileTime,
207 MaxColsAtCompileTime = MatrixType::MaxColsAtCompileTime,
216 if (svd.cols() != m_qr.rows() || svd.rows() != m_qr.cols())
219 ::new (&m_qr)
QRType(svd.cols(), svd.rows());
221 if (svd.m_computeFullV) m_workspace.resize(svd.cols());
222 else if (svd.m_computeThinV) m_workspace.resize(svd.rows());
223 m_adjoint.resize(svd.cols(), svd.rows());
228 if(matrix.cols() > matrix.rows())
230 m_adjoint = matrix.adjoint();
231 m_qr.compute(m_adjoint);
233 svd.m_workMatrix = m_qr.matrixQR().block(0,0,matrix.rows(),matrix.rows()).
template triangularView<Upper>().adjoint();
234 if(svd.m_computeFullV) m_qr.householderQ().evalTo(svd.m_matrixV, m_workspace);
235 else if(svd.m_computeThinV)
237 svd.m_matrixV.setIdentity(matrix.cols(), matrix.rows());
238 m_qr.householderQ().applyThisOnTheLeft(svd.m_matrixV, m_workspace);
240 if(svd.
computeU()) svd.m_matrixU = m_qr.colsPermutation();
249 TransposeTypeWithSameStorageOrder m_adjoint;
255 template<
typename MatrixType>
259 typedef typename MatrixType::Index Index;
263 if (svd.rows() != m_qr.rows() || svd.cols() != m_qr.cols())
266 ::new (&m_qr)
QRType(svd.rows(), svd.cols());
268 if (svd.m_computeFullU) m_workspace.resize(svd.rows());
269 else if (svd.m_computeThinU) m_workspace.resize(svd.cols());
274 if(matrix.rows() > matrix.cols())
277 svd.m_workMatrix = m_qr.matrixQR().block(0,0,matrix.cols(),matrix.cols()).
template triangularView<Upper>();
278 if(svd.m_computeFullU) m_qr.householderQ().evalTo(svd.m_matrixU, m_workspace);
279 else if(svd.m_computeThinU)
281 svd.m_matrixU.setIdentity(matrix.rows(), matrix.cols());
282 m_qr.householderQ().applyThisOnTheLeft(svd.m_matrixU, m_workspace);
284 if(svd.
computeV()) svd.m_matrixV.setIdentity(matrix.cols(), matrix.cols());
295 template<
typename MatrixType>
299 typedef typename MatrixType::Index Index;
303 RowsAtCompileTime = MatrixType::RowsAtCompileTime,
304 ColsAtCompileTime = MatrixType::ColsAtCompileTime,
305 MaxRowsAtCompileTime = MatrixType::MaxRowsAtCompileTime,
306 MaxColsAtCompileTime = MatrixType::MaxColsAtCompileTime,
315 if (svd.cols() != m_qr.rows() || svd.rows() != m_qr.cols())
318 ::new (&m_qr)
QRType(svd.cols(), svd.rows());
320 if (svd.m_computeFullV) m_workspace.resize(svd.cols());
321 else if (svd.m_computeThinV) m_workspace.resize(svd.rows());
322 m_adjoint.resize(svd.cols(), svd.rows());
327 if(matrix.cols() > matrix.rows())
329 m_adjoint = matrix.adjoint();
330 m_qr.compute(m_adjoint);
332 svd.m_workMatrix = m_qr.matrixQR().block(0,0,matrix.rows(),matrix.rows()).
template triangularView<Upper>().adjoint();
333 if(svd.m_computeFullV) m_qr.householderQ().evalTo(svd.m_matrixV, m_workspace);
334 else if(svd.m_computeThinV)
336 svd.m_matrixV.setIdentity(matrix.cols(), matrix.rows());
337 m_qr.householderQ().applyThisOnTheLeft(svd.m_matrixV, m_workspace);
339 if(svd.
computeU()) svd.m_matrixU.setIdentity(matrix.rows(), matrix.rows());
348 TransposeTypeWithSameStorageOrder m_adjoint;
357 template<
typename MatrixType,
int QRPreconditioner>
361 typedef typename SVD::Index Index;
365 template<
typename MatrixType,
int QRPreconditioner>
370 typedef typename MatrixType::RealScalar RealScalar;
371 typedef typename SVD::Index Index;
377 RealScalar n = sqrt(numext::abs2(work_matrix.coeff(p,p)) + numext::abs2(work_matrix.coeff(q,p)));
381 z = abs(work_matrix.coeff(p,q)) / work_matrix.coeff(p,q);
382 work_matrix.row(p) *= z;
383 if(svd.
computeU()) svd.m_matrixU.col(p) *= conj(z);
384 if(work_matrix.coeff(q,q)!=
Scalar(0))
386 z = abs(work_matrix.coeff(q,q)) / work_matrix.coeff(q,q);
387 work_matrix.row(q) *= z;
388 if(svd.
computeU()) svd.m_matrixU.col(q) *= conj(z);
394 rot.c() = conj(work_matrix.coeff(p,p)) / n;
395 rot.s() = work_matrix.coeff(q,p) / n;
396 work_matrix.applyOnTheLeft(p,q,rot);
398 if(work_matrix.coeff(p,q) !=
Scalar(0))
400 Scalar z = abs(work_matrix.coeff(p,q)) / work_matrix.coeff(p,q);
401 work_matrix.col(q) *= z;
402 if(svd.
computeV()) svd.m_matrixV.col(q) *= z;
404 if(work_matrix.coeff(q,q) !=
Scalar(0))
406 z = abs(work_matrix.coeff(q,q)) / work_matrix.coeff(q,q);
407 work_matrix.row(q) *= z;
408 if(svd.
computeU()) svd.m_matrixU.col(q) *= conj(z);
414 template<
typename MatrixType,
typename RealScalar,
typename Index>
415 void real_2x2_jacobi_svd(
const MatrixType& matrix, Index p, Index q,
422 m << numext::real(matrix.coeff(p,p)), numext::real(matrix.coeff(p,q)),
423 numext::real(matrix.coeff(q,p)), numext::real(matrix.coeff(q,q));
425 RealScalar t = m.coeff(0,0) + m.coeff(1,1);
426 RealScalar d = m.coeff(1,0) - m.coeff(0,1);
427 if(t == RealScalar(0))
429 rot1.c() = RealScalar(0);
430 rot1.s() = d > RealScalar(0) ? RealScalar(1) : RealScalar(-1);
434 RealScalar t2d2 = numext::hypot(t,d);
435 rot1.c() = abs(t)/t2d2;
438 rot1.s() = -rot1.s();
440 m.applyOnTheLeft(0,1,rot1);
500 template<
typename _MatrixType,
int QRPreconditioner>
class JacobiSVD 507 typedef typename MatrixType::Index Index;
509 RowsAtCompileTime = MatrixType::RowsAtCompileTime,
510 ColsAtCompileTime = MatrixType::ColsAtCompileTime,
511 DiagSizeAtCompileTime = EIGEN_SIZE_MIN_PREFER_DYNAMIC(RowsAtCompileTime,ColsAtCompileTime),
512 MaxRowsAtCompileTime = MatrixType::MaxRowsAtCompileTime,
513 MaxColsAtCompileTime = MatrixType::MaxColsAtCompileTime,
514 MaxDiagSizeAtCompileTime = EIGEN_SIZE_MIN_PREFER_FIXED(MaxRowsAtCompileTime,MaxColsAtCompileTime),
515 MatrixOptions = MatrixType::Options
518 typedef Matrix<
Scalar, RowsAtCompileTime, RowsAtCompileTime,
519 MatrixOptions, MaxRowsAtCompileTime, MaxRowsAtCompileTime>
521 typedef Matrix<
Scalar, ColsAtCompileTime, ColsAtCompileTime,
522 MatrixOptions, MaxColsAtCompileTime, MaxColsAtCompileTime>
527 typedef Matrix<
Scalar, DiagSizeAtCompileTime, DiagSizeAtCompileTime,
528 MatrixOptions, MaxDiagSizeAtCompileTime, MaxDiagSizeAtCompileTime>
537 : m_isInitialized(false),
538 m_isAllocated(false),
539 m_usePrescribedThreshold(false),
540 m_computationOptions(0),
541 m_rows(-1), m_cols(-1), m_diagSize(0)
551 JacobiSVD(Index rows, Index cols,
unsigned int computationOptions = 0)
552 : m_isInitialized(false),
553 m_isAllocated(false),
554 m_usePrescribedThreshold(false),
555 m_computationOptions(0),
556 m_rows(-1), m_cols(-1)
558 allocate(rows, cols, computationOptions);
571 JacobiSVD(
const MatrixType& matrix,
unsigned int computationOptions = 0)
572 : m_isInitialized(false),
573 m_isAllocated(false),
574 m_usePrescribedThreshold(false),
575 m_computationOptions(0),
576 m_rows(-1), m_cols(-1)
578 compute(matrix, computationOptions);
591 JacobiSVD& compute(
const MatrixType& matrix,
unsigned int computationOptions);
601 return compute(matrix, m_computationOptions);
615 eigen_assert(m_isInitialized &&
"JacobiSVD is not initialized.");
616 eigen_assert(computeU() &&
"This JacobiSVD decomposition didn't compute U. Did you ask for it?");
631 eigen_assert(m_isInitialized &&
"JacobiSVD is not initialized.");
632 eigen_assert(computeV() &&
"This JacobiSVD decomposition didn't compute V. Did you ask for it?");
643 eigen_assert(m_isInitialized &&
"JacobiSVD is not initialized.");
644 return m_singularValues;
648 inline bool computeU()
const {
return m_computeFullU || m_computeThinU; }
650 inline bool computeV()
const {
return m_computeFullV || m_computeThinV; }
661 template<
typename Rhs>
665 eigen_assert(m_isInitialized &&
"JacobiSVD is not initialized.");
666 eigen_assert(computeU() && computeV() &&
"JacobiSVD::solve() requires both unitaries U and V to be computed (thin unitaries suffice).");
673 eigen_assert(m_isInitialized &&
"JacobiSVD is not initialized.");
674 return m_nonzeroSingularValues;
686 eigen_assert(m_isInitialized &&
"JacobiSVD is not initialized.");
687 if(m_singularValues.size()==0)
return 0;
688 RealScalar premultiplied_threshold = m_singularValues.coeff(0) * threshold();
689 Index i = m_nonzeroSingularValues-1;
690 while(i>=0 && m_singularValues.coeff(i) < premultiplied_threshold) --i;
710 m_usePrescribedThreshold =
true;
711 m_prescribedThreshold = threshold;
725 m_usePrescribedThreshold =
false;
735 eigen_assert(m_isInitialized || m_usePrescribedThreshold);
736 return m_usePrescribedThreshold ? m_prescribedThreshold
740 inline Index rows()
const {
return m_rows; }
741 inline Index cols()
const {
return m_cols; }
744 void allocate(Index rows, Index cols,
unsigned int computationOptions);
746 static void check_template_parameters()
748 EIGEN_STATIC_ASSERT_NON_INTEGER(Scalar);
752 MatrixUType m_matrixU;
753 MatrixVType m_matrixV;
754 SingularValuesType m_singularValues;
755 WorkMatrixType m_workMatrix;
756 bool m_isInitialized, m_isAllocated, m_usePrescribedThreshold;
757 bool m_computeFullU, m_computeThinU;
758 bool m_computeFullV, m_computeThinV;
759 unsigned int m_computationOptions;
760 Index m_nonzeroSingularValues, m_rows, m_cols, m_diagSize;
761 RealScalar m_prescribedThreshold;
763 template<
typename __MatrixType,
int _QRPreconditioner,
bool _IsComplex>
765 template<
typename __MatrixType,
int _QRPreconditioner,
int _Case,
bool _DoAnything>
770 MatrixType m_scaledMatrix;
773 template<
typename MatrixType,
int QRPreconditioner>
776 eigen_assert(rows >= 0 && cols >= 0);
781 computationOptions == m_computationOptions)
788 m_isInitialized =
false;
789 m_isAllocated =
true;
790 m_computationOptions = computationOptions;
791 m_computeFullU = (computationOptions &
ComputeFullU) != 0;
792 m_computeThinU = (computationOptions &
ComputeThinU) != 0;
793 m_computeFullV = (computationOptions &
ComputeFullV) != 0;
794 m_computeThinV = (computationOptions &
ComputeThinV) != 0;
795 eigen_assert(!(m_computeFullU && m_computeThinU) &&
"JacobiSVD: you can't ask for both full and thin U");
796 eigen_assert(!(m_computeFullV && m_computeThinV) &&
"JacobiSVD: you can't ask for both full and thin V");
797 eigen_assert(EIGEN_IMPLIES(m_computeThinU || m_computeThinV, MatrixType::ColsAtCompileTime==
Dynamic) &&
798 "JacobiSVD: thin U and V are only available when your matrix has a dynamic number of columns.");
801 eigen_assert(!(m_computeThinU || m_computeThinV) &&
802 "JacobiSVD: can't compute thin U or thin V with the FullPivHouseholderQR preconditioner. " 803 "Use the ColPivHouseholderQR preconditioner instead.");
805 m_diagSize = (std::min)(m_rows, m_cols);
806 m_singularValues.resize(m_diagSize);
808 m_matrixU.resize(m_rows, m_computeFullU ? m_rows
809 : m_computeThinU ? m_diagSize
812 m_matrixV.resize(m_cols, m_computeFullV ? m_cols
813 : m_computeThinV ? m_diagSize
815 m_workMatrix.resize(m_diagSize, m_diagSize);
817 if(m_cols>m_rows) m_qr_precond_morecols.allocate(*
this);
818 if(m_rows>m_cols) m_qr_precond_morerows.allocate(*
this);
819 if(m_rows!=m_cols) m_scaledMatrix.resize(rows,cols);
822 template<
typename MatrixType,
int QRPreconditioner>
826 check_template_parameters();
829 allocate(matrix.rows(), matrix.cols(), computationOptions);
836 const RealScalar considerAsZero = RealScalar(2) * std::numeric_limits<RealScalar>::denorm_min();
839 RealScalar scale = matrix.cwiseAbs().maxCoeff();
840 if(scale==RealScalar(0)) scale = RealScalar(1);
846 m_scaledMatrix = matrix / scale;
847 m_qr_precond_morecols.run(*
this, m_scaledMatrix);
848 m_qr_precond_morerows.run(*
this, m_scaledMatrix);
852 m_workMatrix = matrix.block(0,0,m_diagSize,m_diagSize) / scale;
853 if(m_computeFullU) m_matrixU.setIdentity(m_rows,m_rows);
854 if(m_computeThinU) m_matrixU.setIdentity(m_rows,m_diagSize);
855 if(m_computeFullV) m_matrixV.setIdentity(m_cols,m_cols);
856 if(m_computeThinV) m_matrixV.setIdentity(m_cols, m_diagSize);
861 bool finished =
false;
868 for(Index p = 1; p < m_diagSize; ++p)
870 for(Index q = 0; q < p; ++q)
876 RealScalar threshold = (max)(considerAsZero, precision * (max)(abs(m_workMatrix.coeff(p,p)),
877 abs(m_workMatrix.coeff(q,q))));
879 if(abs(m_workMatrix.coeff(p,q))>threshold || abs(m_workMatrix.coeff(q,p)) > threshold)
886 internal::real_2x2_jacobi_svd(m_workMatrix, p, q, &j_left, &j_right);
889 m_workMatrix.applyOnTheLeft(p,q,j_left);
890 if(computeU()) m_matrixU.applyOnTheRight(p,q,j_left.
transpose());
892 m_workMatrix.applyOnTheRight(p,q,j_right);
893 if(computeV()) m_matrixV.applyOnTheRight(p,q,j_right);
901 for(Index i = 0; i < m_diagSize; ++i)
903 RealScalar a = abs(m_workMatrix.coeff(i,i));
904 m_singularValues.coeffRef(i) = a;
905 if(computeU() && (a!=RealScalar(0))) m_matrixU.col(i) *= m_workMatrix.coeff(i,i)/a;
910 m_nonzeroSingularValues = m_diagSize;
911 for(Index i = 0; i < m_diagSize; i++)
914 RealScalar maxRemainingSingularValue = m_singularValues.tail(m_diagSize-i).maxCoeff(&pos);
915 if(maxRemainingSingularValue == RealScalar(0))
917 m_nonzeroSingularValues = i;
923 std::swap(m_singularValues.coeffRef(i), m_singularValues.coeffRef(pos));
924 if(computeU()) m_matrixU.col(pos).swap(m_matrixU.col(i));
925 if(computeV()) m_matrixV.col(pos).swap(m_matrixV.col(i));
929 m_singularValues *= scale;
931 m_isInitialized =
true;
936 template<
typename _MatrixType,
int QRPreconditioner,
typename Rhs>
941 EIGEN_MAKE_SOLVE_HELPERS(JacobiSVDType,Rhs)
943 template<
typename Dest>
void evalTo(Dest& dst)
const 945 eigen_assert(rhs().rows() == dec().rows());
951 Index rank = dec().rank();
953 tmp.noalias() = dec().matrixU().leftCols(rank).adjoint() * rhs();
954 tmp = dec().singularValues().head(rank).asDiagonal().inverse() * tmp;
955 dst = dec().matrixV().leftCols(rank) * tmp;
967 template<
typename Derived>
976 #endif // EIGEN_JACOBISVD_H Used in JacobiSVD to indicate that the square matrix U is to be computed.
Definition: Constants.h:327
Definition: ForwardDeclarations.h:124
ColPivHouseholderQR & compute(const MatrixType &matrix)
Performs the QR factorization of the given matrix matrix.
Definition: ColPivHouseholderQR.h:429
Index nonzeroSingularValues() const
Definition: JacobiSVD.h:671
JacobiSVD & setThreshold(Default_t)
Allows to come back to the default behavior, letting Eigen use its default formula for determining th...
Definition: JacobiSVD.h:723
JacobiSVD & setThreshold(const RealScalar &threshold)
Allows to prescribe a threshold to be used by certain methods, such as rank() and solve()...
Definition: JacobiSVD.h:708
Do not specify what is to be done if the SVD of a non-square matrix is asked for. ...
Definition: Constants.h:359
Used in JacobiSVD to indicate that the thin matrix V is to be computed.
Definition: Constants.h:333
bool computeV() const
Definition: JacobiSVD.h:650
iterative scaling algorithm to equilibrate rows and column norms in matrices
Definition: TestIMU_Common.h:87
Definition: ForwardDeclarations.h:228
Holds information about the various numeric (i.e.
Definition: NumTraits.h:88
Definition: JacobiSVD.h:20
Use a QR decomposition without pivoting as the first step.
Definition: Constants.h:361
JacobiSVD & compute(const MatrixType &matrix, unsigned int computationOptions)
Method performing the decomposition of given matrix using custom options.
Definition: JacobiSVD.h:824
const MatrixUType & matrixU() const
Definition: JacobiSVD.h:613
Use a QR decomposition with column pivoting as the first step.
Definition: Constants.h:363
JacobiSVD< PlainObject > jacobiSvd(unsigned int computationOptions=0) const
Definition: JacobiSVD.h:969
JacobiSVD()
Default Constructor.
Definition: JacobiSVD.h:536
const internal::solve_retval< JacobiSVD, Rhs > solve(const MatrixBase< Rhs > &b) const
Definition: JacobiSVD.h:663
bool makeJacobi(const MatrixBase< Derived > &, typename Derived::Index p, typename Derived::Index q)
Makes *this as a Jacobi rotation J such that applying J on both the right and left sides of the 2x2 s...
Definition: Jacobi.h:126
Use a QR decomposition with full pivoting as the first step.
Definition: Constants.h:365
const MatrixVType & matrixV() const
Definition: JacobiSVD.h:629
Definition: JacobiSVD.h:48
bool computeU() const
Definition: JacobiSVD.h:648
Definition: BandTriangularSolver.h:13
Index rank() const
Definition: JacobiSVD.h:683
JacobiSVD & compute(const MatrixType &matrix)
Method performing the decomposition of given matrix using current options.
Definition: JacobiSVD.h:599
Two-sided Jacobi SVD decomposition of a rectangular matrix.
Definition: ForwardDeclarations.h:224
JacobiRotation transpose() const
Returns the transposed transformation.
Definition: Jacobi.h:59
Definition: ForwardDeclarations.h:125
HouseholderQR & compute(const MatrixType &matrix)
Performs the QR factorization of the given matrix matrix.
Definition: HouseholderQR.h:356
const int Dynamic
This value means that a positive quantity (e.g., a size) is not known at compile-time, and that instead the value is stored in some runtime variable.
Definition: Constants.h:21
const SingularValuesType & singularValues() const
Definition: JacobiSVD.h:641
Used in JacobiSVD to indicate that the square matrix V is to be computed.
Definition: Constants.h:331
Used in JacobiSVD to indicate that the thin matrix U is to be computed.
Definition: Constants.h:329
JacobiSVD(Index rows, Index cols, unsigned int computationOptions=0)
Default Constructor with memory preallocation.
Definition: JacobiSVD.h:551
FullPivHouseholderQR & compute(const MatrixType &matrix)
Performs the QR factorization of the given matrix matrix.
Definition: FullPivHouseholderQR.h:414
Base class for all dense matrices, vectors, and expressions.
Definition: MatrixBase.h:48
Definition: osvr_print_tree.cpp:52
Definition: JacobiSVD.h:32
JacobiSVD(const MatrixType &matrix, unsigned int computationOptions=0)
Constructor performing the decomposition of given matrix.
Definition: JacobiSVD.h:571
double Scalar
Common scalar type.
Definition: FlexibleKalmanBase.h:48
JacobiRotation adjoint() const
Returns the adjoint transformation.
Definition: Jacobi.h:62
RealScalar threshold() const
Returns the threshold that will be used by certain methods such as rank().
Definition: JacobiSVD.h:733