mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
Fix jacobi svd for TriangularBase
This commit is contained in:
committed by
Rasmus Munk Larsen
parent
dbe9e6961e
commit
5bc944a3ef
@@ -571,6 +571,11 @@ class JacobiSVD : public SVDBase<JacobiSVD<MatrixType_, Options_> > {
|
||||
compute_impl(matrix, internal::get_computation_options(Options));
|
||||
}
|
||||
|
||||
template <typename Derived>
|
||||
explicit JacobiSVD(const TriangularBase<Derived>& matrix) {
|
||||
compute_impl(matrix, internal::get_computation_options(Options));
|
||||
}
|
||||
|
||||
/** \brief Constructor performing the decomposition of given matrix using specified options
|
||||
* for computing unitaries.
|
||||
*
|
||||
@@ -601,6 +606,11 @@ class JacobiSVD : public SVDBase<JacobiSVD<MatrixType_, Options_> > {
|
||||
return compute_impl(matrix, m_computationOptions);
|
||||
}
|
||||
|
||||
template <typename Derived>
|
||||
JacobiSVD& compute(const TriangularBase<Derived>& matrix) {
|
||||
return compute_impl(matrix, m_computationOptions);
|
||||
}
|
||||
|
||||
/** \brief Method performing the decomposition of given matrix, as specified by
|
||||
* the `computationOptions` parameter.
|
||||
*
|
||||
@@ -638,6 +648,8 @@ class JacobiSVD : public SVDBase<JacobiSVD<MatrixType_, Options_> > {
|
||||
}
|
||||
|
||||
private:
|
||||
template <typename Derived>
|
||||
JacobiSVD& compute_impl(const TriangularBase<Derived>& matrix, unsigned int computationOptions);
|
||||
template <typename Derived>
|
||||
JacobiSVD& compute_impl(const MatrixBase<Derived>& matrix, unsigned int computationOptions);
|
||||
|
||||
@@ -676,6 +688,13 @@ class JacobiSVD : public SVDBase<JacobiSVD<MatrixType_, Options_> > {
|
||||
WorkMatrixType m_workMatrix;
|
||||
};
|
||||
|
||||
template <typename MatrixType, int Options>
|
||||
template <typename Derived>
|
||||
JacobiSVD<MatrixType, Options>& JacobiSVD<MatrixType, Options>::compute_impl(const TriangularBase<Derived>& matrix,
|
||||
unsigned int computationOptions) {
|
||||
return compute_impl(matrix.toDenseMatrix(), computationOptions);
|
||||
}
|
||||
|
||||
template <typename MatrixType, int Options>
|
||||
template <typename Derived>
|
||||
JacobiSVD<MatrixType, Options>& JacobiSVD<MatrixType, Options>::compute_impl(const MatrixBase<Derived>& matrix,
|
||||
|
||||
Reference in New Issue
Block a user