11 #ifndef EIGEN_JACOBISVD_H 12 #define EIGEN_JACOBISVD_H 19 template<
typename MatrixType,
int QRPreconditioner,
20 bool IsComplex = NumTraits<typename MatrixType::Scalar>::IsComplex>
21 struct svd_precondition_2x2_block_to_be_real {};
30 enum { PreconditionIfMoreColsThanRows, PreconditionIfMoreRowsThanCols };
32 template<
typename MatrixType,
int QRPreconditioner,
int Case>
33 struct qr_preconditioner_should_do_anything
35 enum { a = MatrixType::RowsAtCompileTime !=
Dynamic &&
36 MatrixType::ColsAtCompileTime !=
Dynamic &&
37 MatrixType::ColsAtCompileTime <= MatrixType::RowsAtCompileTime,
38 b = MatrixType::RowsAtCompileTime !=
Dynamic &&
39 MatrixType::ColsAtCompileTime !=
Dynamic &&
40 MatrixType::RowsAtCompileTime <= MatrixType::ColsAtCompileTime,
42 (Case == PreconditionIfMoreColsThanRows &&
bool(a)) ||
43 (Case == PreconditionIfMoreRowsThanCols &&
bool(b)) )
47 template<
typename MatrixType,
int QRPreconditioner,
int Case,
48 bool DoAnything = qr_preconditioner_should_do_anything<MatrixType, QRPreconditioner, Case>::ret
49 >
struct qr_preconditioner_impl {};
51 template<
typename MatrixType,
int QRPreconditioner,
int Case>
52 class qr_preconditioner_impl<MatrixType, QRPreconditioner, Case, false>
55 void allocate(
const JacobiSVD<MatrixType, QRPreconditioner>&) {}
56 bool run(JacobiSVD<MatrixType, QRPreconditioner>&,
const MatrixType&)
64 template<
typename MatrixType>
68 typedef typename MatrixType::Scalar Scalar;
71 RowsAtCompileTime = MatrixType::RowsAtCompileTime,
72 MaxRowsAtCompileTime = MatrixType::MaxRowsAtCompileTime
74 typedef Matrix<Scalar, 1, RowsAtCompileTime, RowMajor, 1, MaxRowsAtCompileTime> WorkspaceType;
76 void allocate(
const JacobiSVD<MatrixType, FullPivHouseholderQRPreconditioner>& svd)
78 if (svd.rows() != m_qr.rows() || svd.cols() != m_qr.cols())
81 ::new (&m_qr) QRType(svd.rows(), svd.cols());
83 if (svd.m_computeFullU) m_workspace.resize(svd.rows());
88 if(matrix.rows() > matrix.cols())
91 svd.m_workMatrix = m_qr.matrixQR().block(0,0,matrix.cols(),matrix.cols()).
template triangularView<Upper>();
92 if(svd.m_computeFullU) m_qr.matrixQ().evalTo(svd.m_matrixU, m_workspace);
93 if(svd.computeV()) svd.m_matrixV = m_qr.colsPermutation();
99 typedef FullPivHouseholderQR<MatrixType> QRType;
101 WorkspaceType m_workspace;
104 template<
typename MatrixType>
108 typedef typename MatrixType::Scalar Scalar;
111 RowsAtCompileTime = MatrixType::RowsAtCompileTime,
112 ColsAtCompileTime = MatrixType::ColsAtCompileTime,
113 MaxRowsAtCompileTime = MatrixType::MaxRowsAtCompileTime,
114 MaxColsAtCompileTime = MatrixType::MaxColsAtCompileTime,
115 Options = MatrixType::Options
117 typedef Matrix<Scalar, ColsAtCompileTime, RowsAtCompileTime, Options, MaxColsAtCompileTime, MaxRowsAtCompileTime>
118 TransposeTypeWithSameStorageOrder;
120 void allocate(
const JacobiSVD<MatrixType, FullPivHouseholderQRPreconditioner>& svd)
122 if (svd.cols() != m_qr.rows() || svd.rows() != m_qr.cols())
125 ::new (&m_qr) QRType(svd.cols(), svd.rows());
127 m_adjoint.resize(svd.cols(), svd.rows());
128 if (svd.m_computeFullV) m_workspace.resize(svd.cols());
133 if(matrix.cols() > matrix.rows())
135 m_adjoint = matrix.adjoint();
136 m_qr.compute(m_adjoint);
137 svd.m_workMatrix = m_qr.matrixQR().block(0,0,matrix.rows(),matrix.rows()).
template triangularView<Upper>().adjoint();
138 if(svd.m_computeFullV) m_qr.matrixQ().evalTo(svd.m_matrixV, m_workspace);
139 if(svd.computeU()) svd.m_matrixU = m_qr.colsPermutation();
145 typedef FullPivHouseholderQR<TransposeTypeWithSameStorageOrder> QRType;
147 TransposeTypeWithSameStorageOrder m_adjoint;
148 typename internal::plain_row_type<MatrixType>::type m_workspace;
153 template<
typename MatrixType>
157 void allocate(
const JacobiSVD<MatrixType, ColPivHouseholderQRPreconditioner>& svd)
159 if (svd.rows() != m_qr.rows() || svd.cols() != m_qr.cols())
162 ::new (&m_qr) QRType(svd.rows(), svd.cols());
164 if (svd.m_computeFullU) m_workspace.resize(svd.rows());
165 else if (svd.m_computeThinU) m_workspace.resize(svd.cols());
170 if(matrix.rows() > matrix.cols())
172 m_qr.compute(matrix);
173 svd.m_workMatrix = m_qr.matrixQR().block(0,0,matrix.cols(),matrix.cols()).
template triangularView<Upper>();
174 if(svd.m_computeFullU) m_qr.householderQ().evalTo(svd.m_matrixU, m_workspace);
175 else if(svd.m_computeThinU)
177 svd.m_matrixU.setIdentity(matrix.rows(), matrix.cols());
178 m_qr.householderQ().applyThisOnTheLeft(svd.m_matrixU, m_workspace);
180 if(svd.computeV()) svd.m_matrixV = m_qr.colsPermutation();
187 typedef ColPivHouseholderQR<MatrixType> QRType;
189 typename internal::plain_col_type<MatrixType>::type m_workspace;
192 template<
typename MatrixType>
196 typedef typename MatrixType::Scalar Scalar;
199 RowsAtCompileTime = MatrixType::RowsAtCompileTime,
200 ColsAtCompileTime = MatrixType::ColsAtCompileTime,
201 MaxRowsAtCompileTime = MatrixType::MaxRowsAtCompileTime,
202 MaxColsAtCompileTime = MatrixType::MaxColsAtCompileTime,
203 Options = MatrixType::Options
206 typedef Matrix<Scalar, ColsAtCompileTime, RowsAtCompileTime, Options, MaxColsAtCompileTime, MaxRowsAtCompileTime>
207 TransposeTypeWithSameStorageOrder;
209 void allocate(
const JacobiSVD<MatrixType, ColPivHouseholderQRPreconditioner>& svd)
211 if (svd.cols() != m_qr.rows() || svd.rows() != m_qr.cols())
214 ::new (&m_qr) QRType(svd.cols(), svd.rows());
216 if (svd.m_computeFullV) m_workspace.resize(svd.cols());
217 else if (svd.m_computeThinV) m_workspace.resize(svd.rows());
218 m_adjoint.resize(svd.cols(), svd.rows());
223 if(matrix.cols() > matrix.rows())
225 m_adjoint = matrix.adjoint();
226 m_qr.compute(m_adjoint);
228 svd.m_workMatrix = m_qr.matrixQR().block(0,0,matrix.rows(),matrix.rows()).
template triangularView<Upper>().adjoint();
229 if(svd.m_computeFullV) m_qr.householderQ().evalTo(svd.m_matrixV, m_workspace);
230 else if(svd.m_computeThinV)
232 svd.m_matrixV.setIdentity(matrix.cols(), matrix.rows());
233 m_qr.householderQ().applyThisOnTheLeft(svd.m_matrixV, m_workspace);
235 if(svd.computeU()) svd.m_matrixU = m_qr.colsPermutation();
242 typedef ColPivHouseholderQR<TransposeTypeWithSameStorageOrder> QRType;
244 TransposeTypeWithSameStorageOrder m_adjoint;
245 typename internal::plain_row_type<MatrixType>::type m_workspace;
250 template<
typename MatrixType>
254 void allocate(
const JacobiSVD<MatrixType, HouseholderQRPreconditioner>& svd)
256 if (svd.rows() != m_qr.rows() || svd.cols() != m_qr.cols())
259 ::new (&m_qr) QRType(svd.rows(), svd.cols());
261 if (svd.m_computeFullU) m_workspace.resize(svd.rows());
262 else if (svd.m_computeThinU) m_workspace.resize(svd.cols());
267 if(matrix.rows() > matrix.cols())
269 m_qr.compute(matrix);
270 svd.m_workMatrix = m_qr.matrixQR().block(0,0,matrix.cols(),matrix.cols()).
template triangularView<Upper>();
271 if(svd.m_computeFullU) m_qr.householderQ().evalTo(svd.m_matrixU, m_workspace);
272 else if(svd.m_computeThinU)
274 svd.m_matrixU.setIdentity(matrix.rows(), matrix.cols());
275 m_qr.householderQ().applyThisOnTheLeft(svd.m_matrixU, m_workspace);
277 if(svd.computeV()) svd.m_matrixV.setIdentity(matrix.cols(), matrix.cols());
283 typedef HouseholderQR<MatrixType> QRType;
285 typename internal::plain_col_type<MatrixType>::type m_workspace;
288 template<
typename MatrixType>
292 typedef typename MatrixType::Scalar Scalar;
295 RowsAtCompileTime = MatrixType::RowsAtCompileTime,
296 ColsAtCompileTime = MatrixType::ColsAtCompileTime,
297 MaxRowsAtCompileTime = MatrixType::MaxRowsAtCompileTime,
298 MaxColsAtCompileTime = MatrixType::MaxColsAtCompileTime,
299 Options = MatrixType::Options
302 typedef Matrix<Scalar, ColsAtCompileTime, RowsAtCompileTime, Options, MaxColsAtCompileTime, MaxRowsAtCompileTime>
303 TransposeTypeWithSameStorageOrder;
305 void allocate(
const JacobiSVD<MatrixType, HouseholderQRPreconditioner>& svd)
307 if (svd.cols() != m_qr.rows() || svd.rows() != m_qr.cols())
310 ::new (&m_qr) QRType(svd.cols(), svd.rows());
312 if (svd.m_computeFullV) m_workspace.resize(svd.cols());
313 else if (svd.m_computeThinV) m_workspace.resize(svd.rows());
314 m_adjoint.resize(svd.cols(), svd.rows());
319 if(matrix.cols() > matrix.rows())
321 m_adjoint = matrix.adjoint();
322 m_qr.compute(m_adjoint);
324 svd.m_workMatrix = m_qr.matrixQR().block(0,0,matrix.rows(),matrix.rows()).
template triangularView<Upper>().adjoint();
325 if(svd.m_computeFullV) m_qr.householderQ().evalTo(svd.m_matrixV, m_workspace);
326 else if(svd.m_computeThinV)
328 svd.m_matrixV.setIdentity(matrix.cols(), matrix.rows());
329 m_qr.householderQ().applyThisOnTheLeft(svd.m_matrixV, m_workspace);
331 if(svd.computeU()) svd.m_matrixU.setIdentity(matrix.rows(), matrix.rows());
338 typedef HouseholderQR<TransposeTypeWithSameStorageOrder> QRType;
340 TransposeTypeWithSameStorageOrder m_adjoint;
341 typename internal::plain_row_type<MatrixType>::type m_workspace;
349 template<
typename MatrixType,
int QRPreconditioner>
350 struct svd_precondition_2x2_block_to_be_real<MatrixType, QRPreconditioner, false>
352 typedef JacobiSVD<MatrixType, QRPreconditioner> SVD;
353 typedef typename MatrixType::RealScalar RealScalar;
354 static bool run(
typename SVD::WorkMatrixType&, SVD&,
Index,
Index, RealScalar&) {
return true; }
357 template<
typename MatrixType,
int QRPreconditioner>
358 struct svd_precondition_2x2_block_to_be_real<MatrixType, QRPreconditioner, true>
360 typedef JacobiSVD<MatrixType, QRPreconditioner> SVD;
361 typedef typename MatrixType::Scalar Scalar;
362 typedef typename MatrixType::RealScalar RealScalar;
363 static bool run(
typename SVD::WorkMatrixType& work_matrix, SVD& svd,
Index p,
Index q, RealScalar& maxDiagEntry)
368 JacobiRotation<Scalar> rot;
369 RealScalar n =
sqrt(numext::abs2(work_matrix.coeff(p,p)) + numext::abs2(work_matrix.coeff(q,p)));
371 const RealScalar considerAsZero = (std::numeric_limits<RealScalar>::min)();
372 const RealScalar precision = NumTraits<Scalar>::epsilon();
377 work_matrix.coeffRef(p,p) = work_matrix.coeffRef(q,p) = Scalar(0);
379 if(
abs(numext::imag(work_matrix.coeff(p,q)))>considerAsZero)
382 z =
abs(work_matrix.coeff(p,q)) / work_matrix.coeff(p,q);
383 work_matrix.row(p) *= z;
384 if(svd.computeU()) svd.m_matrixU.col(p) *=
conj(z);
386 if(
abs(numext::imag(work_matrix.coeff(q,q)))>considerAsZero)
388 z =
abs(work_matrix.coeff(q,q)) / work_matrix.coeff(q,q);
389 work_matrix.row(q) *= z;
390 if(svd.computeU()) svd.m_matrixU.col(q) *=
conj(z);
396 rot.c() =
conj(work_matrix.coeff(p,p)) / n;
397 rot.s() = work_matrix.coeff(q,p) / n;
398 work_matrix.applyOnTheLeft(p,q,rot);
399 if(svd.computeU()) svd.m_matrixU.applyOnTheRight(p,q,rot.adjoint());
400 if(
abs(numext::imag(work_matrix.coeff(p,q)))>considerAsZero)
402 z =
abs(work_matrix.coeff(p,q)) / work_matrix.coeff(p,q);
403 work_matrix.col(q) *= z;
404 if(svd.computeV()) svd.m_matrixV.col(q) *= z;
406 if(
abs(numext::imag(work_matrix.coeff(q,q)))>considerAsZero)
408 z =
abs(work_matrix.coeff(q,q)) / work_matrix.coeff(q,q);
409 work_matrix.row(q) *= z;
410 if(svd.computeU()) svd.m_matrixU.col(q) *=
conj(z);
415 maxDiagEntry = numext::maxi(maxDiagEntry,numext::maxi(
abs(work_matrix.coeff(p,p)),
abs(work_matrix.coeff(q,q))));
417 RealScalar threshold = numext::maxi<RealScalar>(considerAsZero, precision * maxDiagEntry);
418 return abs(work_matrix.coeff(p,q))>threshold ||
abs(work_matrix.coeff(q,p)) > threshold;
422 template<
typename _MatrixType,
int QRPreconditioner>
423 struct traits<JacobiSVD<_MatrixType,QRPreconditioner> >
425 typedef _MatrixType MatrixType;
483 template<
typename _MatrixType,
int QRPreconditioner>
class JacobiSVD
484 :
public SVDBase<JacobiSVD<_MatrixType,QRPreconditioner> >
486 typedef SVDBase<JacobiSVD> Base;
489 typedef _MatrixType MatrixType;
490 typedef typename MatrixType::Scalar Scalar;
491 typedef typename NumTraits<typename MatrixType::Scalar>::Real RealScalar;
493 RowsAtCompileTime = MatrixType::RowsAtCompileTime,
494 ColsAtCompileTime = MatrixType::ColsAtCompileTime,
495 DiagSizeAtCompileTime = EIGEN_SIZE_MIN_PREFER_DYNAMIC(RowsAtCompileTime,ColsAtCompileTime),
496 MaxRowsAtCompileTime = MatrixType::MaxRowsAtCompileTime,
497 MaxColsAtCompileTime = MatrixType::MaxColsAtCompileTime,
498 MaxDiagSizeAtCompileTime = EIGEN_SIZE_MIN_PREFER_FIXED(MaxRowsAtCompileTime,MaxColsAtCompileTime),
499 MatrixOptions = MatrixType::Options
502 typedef typename Base::MatrixUType MatrixUType;
503 typedef typename Base::MatrixVType MatrixVType;
504 typedef typename Base::SingularValuesType SingularValuesType;
506 typedef typename internal::plain_row_type<MatrixType>::type RowType;
507 typedef typename internal::plain_col_type<MatrixType>::type ColType;
508 typedef Matrix<Scalar, DiagSizeAtCompileTime, DiagSizeAtCompileTime,
509 MatrixOptions, MaxDiagSizeAtCompileTime, MaxDiagSizeAtCompileTime>
529 allocate(rows, cols, computationOptions);
542 explicit JacobiSVD(
const MatrixType& matrix,
unsigned int computationOptions = 0)
544 compute(matrix, computationOptions);
557 JacobiSVD& compute(
const MatrixType& matrix,
unsigned int computationOptions);
567 return compute(matrix, m_computationOptions);
570 using Base::computeU;
571 using Base::computeV;
577 void allocate(
Index rows,
Index cols,
unsigned int computationOptions);
580 using Base::m_matrixU;
581 using Base::m_matrixV;
582 using Base::m_singularValues;
583 using Base::m_isInitialized;
584 using Base::m_isAllocated;
585 using Base::m_usePrescribedThreshold;
586 using Base::m_computeFullU;
587 using Base::m_computeThinU;
588 using Base::m_computeFullV;
589 using Base::m_computeThinV;
590 using Base::m_computationOptions;
591 using Base::m_nonzeroSingularValues;
594 using Base::m_diagSize;
595 using Base::m_prescribedThreshold;
596 WorkMatrixType m_workMatrix;
598 template<
typename __MatrixType,
int _QRPreconditioner,
bool _IsComplex>
599 friend struct internal::svd_precondition_2x2_block_to_be_real;
600 template<
typename __MatrixType,
int _QRPreconditioner,
int _Case,
bool _DoAnything>
601 friend struct internal::qr_preconditioner_impl;
603 internal::qr_preconditioner_impl<MatrixType, QRPreconditioner, internal::PreconditionIfMoreColsThanRows> m_qr_precond_morecols;
604 internal::qr_preconditioner_impl<MatrixType, QRPreconditioner, internal::PreconditionIfMoreRowsThanCols> m_qr_precond_morerows;
605 MatrixType m_scaledMatrix;
608 template<
typename MatrixType,
int QRPreconditioner>
611 eigen_assert(rows >= 0 && cols >= 0);
616 computationOptions == m_computationOptions)
623 m_isInitialized =
false;
624 m_isAllocated =
true;
625 m_computationOptions = computationOptions;
626 m_computeFullU = (computationOptions &
ComputeFullU) != 0;
627 m_computeThinU = (computationOptions &
ComputeThinU) != 0;
628 m_computeFullV = (computationOptions &
ComputeFullV) != 0;
629 m_computeThinV = (computationOptions &
ComputeThinV) != 0;
630 eigen_assert(!(m_computeFullU && m_computeThinU) &&
"JacobiSVD: you can't ask for both full and thin U");
631 eigen_assert(!(m_computeFullV && m_computeThinV) &&
"JacobiSVD: you can't ask for both full and thin V");
632 eigen_assert(EIGEN_IMPLIES(m_computeThinU || m_computeThinV, MatrixType::ColsAtCompileTime==
Dynamic) &&
633 "JacobiSVD: thin U and V are only available when your matrix has a dynamic number of columns.");
636 eigen_assert(!(m_computeThinU || m_computeThinV) &&
637 "JacobiSVD: can't compute thin U or thin V with the FullPivHouseholderQR preconditioner. " 638 "Use the ColPivHouseholderQR preconditioner instead.");
640 m_diagSize = (std::min)(m_rows, m_cols);
641 m_singularValues.resize(m_diagSize);
643 m_matrixU.resize(m_rows, m_computeFullU ? m_rows
644 : m_computeThinU ? m_diagSize
647 m_matrixV.resize(m_cols, m_computeFullV ? m_cols
648 : m_computeThinV ? m_diagSize
650 m_workMatrix.resize(m_diagSize, m_diagSize);
652 if(m_cols>m_rows) m_qr_precond_morecols.allocate(*
this);
653 if(m_rows>m_cols) m_qr_precond_morerows.allocate(*
this);
654 if(m_rows!=m_cols) m_scaledMatrix.resize(rows,cols);
657 template<
typename MatrixType,
int QRPreconditioner>
662 allocate(matrix.rows(), matrix.cols(), computationOptions);
671 const RealScalar considerAsZero = RealScalar(2) * std::numeric_limits<RealScalar>::denorm_min();
674 RealScalar scale = matrix.cwiseAbs().maxCoeff();
675 if(scale==RealScalar(0)) scale = RealScalar(1);
681 m_scaledMatrix = matrix / scale;
682 m_qr_precond_morecols.run(*
this, m_scaledMatrix);
683 m_qr_precond_morerows.run(*
this, m_scaledMatrix);
687 m_workMatrix = matrix.block(0,0,m_diagSize,m_diagSize) / scale;
688 if(m_computeFullU) m_matrixU.setIdentity(m_rows,m_rows);
689 if(m_computeThinU) m_matrixU.setIdentity(m_rows,m_diagSize);
690 if(m_computeFullV) m_matrixV.setIdentity(m_cols,m_cols);
691 if(m_computeThinV) m_matrixV.setIdentity(m_cols, m_diagSize);
695 RealScalar maxDiagEntry = m_workMatrix.cwiseAbs().diagonal().maxCoeff();
697 bool finished =
false;
704 for(
Index p = 1; p < m_diagSize; ++p)
706 for(
Index q = 0; q < p; ++q)
711 RealScalar threshold = numext::maxi<RealScalar>(considerAsZero, precision * maxDiagEntry);
712 if(
abs(m_workMatrix.coeff(p,q))>threshold ||
abs(m_workMatrix.coeff(q,p)) > threshold)
717 if(internal::svd_precondition_2x2_block_to_be_real<MatrixType, QRPreconditioner>::run(m_workMatrix, *
this, p, q, maxDiagEntry))
720 internal::real_2x2_jacobi_svd(m_workMatrix, p, q, &j_left, &j_right);
723 m_workMatrix.applyOnTheLeft(p,q,j_left);
724 if(computeU()) m_matrixU.applyOnTheRight(p,q,j_left.
transpose());
726 m_workMatrix.applyOnTheRight(p,q,j_right);
727 if(computeV()) m_matrixV.applyOnTheRight(p,q,j_right);
730 maxDiagEntry = numext::maxi<RealScalar>(maxDiagEntry,numext::maxi(
abs(m_workMatrix.coeff(p,p)),
abs(m_workMatrix.coeff(q,q))));
739 for(
Index i = 0; i < m_diagSize; ++i)
746 RealScalar a =
abs(m_workMatrix.coeff(i,i));
747 m_singularValues.coeffRef(i) =
abs(a);
748 if(computeU()) m_matrixU.col(i) *= m_workMatrix.coeff(i,i)/a;
753 RealScalar a = numext::real(m_workMatrix.coeff(i,i));
754 m_singularValues.coeffRef(i) =
abs(a);
755 if(computeU() && (a<RealScalar(0))) m_matrixU.col(i) = -m_matrixU.col(i);
759 m_singularValues *= scale;
763 m_nonzeroSingularValues = m_diagSize;
764 for(
Index i = 0; i < m_diagSize; i++)
767 RealScalar maxRemainingSingularValue = m_singularValues.tail(m_diagSize-i).maxCoeff(&pos);
768 if(maxRemainingSingularValue == RealScalar(0))
770 m_nonzeroSingularValues = i;
776 std::swap(m_singularValues.coeffRef(i), m_singularValues.coeffRef(pos));
777 if(computeU()) m_matrixU.col(pos).swap(m_matrixU.col(i));
778 if(computeV()) m_matrixV.col(pos).swap(m_matrixV.col(i));
782 m_isInitialized =
true;
794 template<
typename Derived>
804 #endif // EIGEN_JACOBISVD_H Definition: Constants.h:383
Definition: Constants.h:415
const Eigen::CwiseUnaryOp< Eigen::internal::scalar_sqrt_op< typename Derived::Scalar >, const Derived > sqrt(const Eigen::ArrayBase< Derived > &x)
Definition: Constants.h:389
const Eigen::CwiseUnaryOp< Eigen::internal::scalar_conjugate_op< typename Derived::Scalar >, const Derived > conj(const Eigen::ArrayBase< Derived > &x)
Eigen::Index Index
Definition: SVDBase.h:56
Namespace containing all symbols from the Eigen library.
Definition: Core:271
Rotation given by a cosine-sine pair.
Definition: ForwardDeclarations.h:263
Holds information about the various numeric (i.e. scalar) types allowed by Eigen. ...
Definition: NumTraits.h:167
Definition: Constants.h:417
JacobiRotation transpose() const
Definition: Jacobi.h:59
Definition: Constants.h:419
JacobiSVD()
Default Constructor.
Definition: JacobiSVD.h:517
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition: XprHelper.h:35
Definition: Constants.h:421
const Eigen::CwiseUnaryOp< Eigen::internal::scalar_abs_op< typename Derived::Scalar >, const Derived > abs(const Eigen::ArrayBase< Derived > &x)
Definition: Eigen_Colamd.h:50
JacobiSVD & compute(const MatrixType &matrix)
Method performing the decomposition of given matrix using current options.
Definition: JacobiSVD.h:565
Two-sided Jacobi SVD decomposition of a rectangular matrix.
Definition: ForwardDeclarations.h:258
JacobiSVD & compute(const MatrixType &matrix, unsigned int computationOptions)
Method performing the decomposition of given matrix using custom options.
Definition: JacobiSVD.h:659
const int Dynamic
Definition: Constants.h:21
Definition: Constants.h:387
Definition: Constants.h:385
JacobiSVD(Index rows, Index cols, unsigned int computationOptions=0)
Default Constructor with memory preallocation.
Definition: JacobiSVD.h:527
JacobiSVD(const MatrixType &matrix, unsigned int computationOptions=0)
Constructor performing the decomposition of given matrix.
Definition: JacobiSVD.h:542
JacobiSVD< PlainObject > jacobiSvd(unsigned int computationOptions=0) const
Definition: JacobiSVD.h:796