template<typename _MatrixType>
BDCSVD class
class Bidiagonal Divide and Conquer SVD
Template parameters | |
---|---|
_MatrixType | the type of the matrix of which we are computing the SVD decomposition |
Contents
This class first reduces the input matrix to bi-diagonal form using class UpperBidiagonalization, and then performs a divide-and-conquer diagonalization. Small blocks are diagonalized using class JacobiSVD. You can control the switching size with the setSwitchSize() method, default is 16. For small matrice (<16), it is thus preferable to directly use JacobiSVD. For larger ones, BDCSVD is highly recommended and can several order of magnitude faster.
Base classes
-
template<typename Derived>class SVDBase
- Base class of SVD algorithms.
Public types
- enum (anonymous) { RowsAtCompileTime = MatrixType::RowsAtCompileTime, ColsAtCompileTime = MatrixType::ColsAtCompileTime, DiagSizeAtCompileTime = EIGEN_SIZE_MIN_PREFER_DYNAMIC(RowsAtCompileTime, ColsAtCompileTime), MaxRowsAtCompileTime = MatrixType::MaxRowsAtCompileTime, MaxColsAtCompileTime = MatrixType::MaxColsAtCompileTime, MaxDiagSizeAtCompileTime = EIGEN_SIZE_MIN_PREFER_FIXED(MaxRowsAtCompileTime, MaxColsAtCompileTime), MatrixOptions = MatrixType::Options }
- using ArrayRef = Ref<ArrayXr>
- using ArrayXi = Array<Index, 1, Dynamic>
- using ArrayXr = Array<RealScalar, Dynamic, 1>
- using IndicesRef = Ref<ArrayXi>
- using Literal = NumTraits<RealScalar>::Literal
- using MatrixType = _MatrixType
-
using MatrixUType = Base::
MatrixUType -
using MatrixVType = Base::
MatrixVType - using MatrixX = Matrix<Scalar, Dynamic, Dynamic, ColMajor>
- using MatrixXr = Matrix<RealScalar, Dynamic, Dynamic, ColMajor>
- using RealScalar = NumTraits<typename MatrixType::Scalar>::Real
- using Scalar = MatrixType::Scalar
- using SingularValuesType = Base::SingularValuesType
- using VectorType = Matrix<RealScalar, Dynamic, 1>
Constructors, destructors, conversion operators
Public functions
- auto cols() const -> Index
- auto compute(const MatrixType& matrix, unsigned int computationOptions) -> BDCSVD&
- Method performing the decomposition of given matrix using custom options.
- auto compute(const MatrixType& matrix) -> BDCSVD&
- Method performing the decomposition of given matrix using current options.
- auto computeU() const -> bool
- auto computeV() const -> bool
- auto rows() const -> Index
- void setSwitchSize(int s)
Public variables
- int m_numIters
Protected variables
- int m_algoswap
- bool m_compU
- MatrixXr m_computed
- bool m_computeFullU
- bool m_computeFullV
- bool m_computeThinU
- bool m_computeThinV
- bool m_compV
- Index m_diagSize
- bool m_isInitialized
- bool m_isTranspose
- MatrixUType m_matrixU
- MatrixVType m_matrixV
- MatrixXr m_naiveU
- MatrixXr m_naiveV
- Index m_nonzeroSingularValues
- Index m_nRec
- SingularValuesType m_singularValues
- ArrayXr m_workspace
- ArrayXi m_workspaceI
Enum documentation
template<typename _MatrixType>
enum Eigen:: BDCSVD<_MatrixType>:: (anonymous)
Enumerators | |
---|---|
RowsAtCompileTime | |
ColsAtCompileTime | |
DiagSizeAtCompileTime | |
MaxRowsAtCompileTime | |
MaxColsAtCompileTime | |
MaxDiagSizeAtCompileTime | |
MatrixOptions |
Typedef documentation
template<typename _MatrixType>
typedef Ref<ArrayXi> Eigen:: BDCSVD<_MatrixType>:: IndicesRef
template<typename _MatrixType>
typedef _MatrixType Eigen:: BDCSVD<_MatrixType>:: MatrixType
template<typename _MatrixType>
typedef Base:: MatrixUType Eigen:: BDCSVD<_MatrixType>:: MatrixUType
template<typename _MatrixType>
typedef Base:: MatrixVType Eigen:: BDCSVD<_MatrixType>:: MatrixVType
template<typename _MatrixType>
typedef NumTraits<typename MatrixType::Scalar>::Real Eigen:: BDCSVD<_MatrixType>:: RealScalar
template<typename _MatrixType>
typedef MatrixType::Scalar Eigen:: BDCSVD<_MatrixType>:: Scalar
template<typename _MatrixType>
typedef Base::SingularValuesType Eigen:: BDCSVD<_MatrixType>:: SingularValuesType
template<typename _MatrixType>
typedef Matrix<RealScalar, Dynamic, 1> Eigen:: BDCSVD<_MatrixType>:: VectorType
Function documentation
template<typename _MatrixType>
Eigen:: BDCSVD<_MatrixType>:: BDCSVD()
Default Constructor.
The default constructor is useful in cases in which the user intends to perform decompositions via BDCSVD::
template<typename _MatrixType>
Eigen:: BDCSVD<_MatrixType>:: BDCSVD(const MatrixType& matrix,
unsigned int computationOptions = 0)
Constructor performing the decomposition of given matrix.
Parameters | |
---|---|
matrix | the matrix to decompose |
computationOptions | optional parameter allowing to specify if you want full or thin U or V unitaries to be computed. By default, none is computed. This is a bit - field, the possible bits are ComputeFullU, ComputeThinU, ComputeFullV, ComputeThinV. |
Thin unitaries are only available if your matrix type has a Dynamic number of columns (for example MatrixXf). They also are not available with the (non - default) FullPivHouseholderQR preconditioner.
template<typename _MatrixType>
Eigen:: BDCSVD<_MatrixType>:: ~BDCSVD()
template<typename _MatrixType>
BDCSVD& Eigen:: BDCSVD<_MatrixType>:: compute(const MatrixType& matrix,
unsigned int computationOptions)
Method performing the decomposition of given matrix using custom options.
Parameters | |
---|---|
matrix | the matrix to decompose |
computationOptions | optional parameter allowing to specify if you want full or thin U or V unitaries to be computed. By default, none is computed. This is a bit - field, the possible bits are ComputeFullU, ComputeThinU, ComputeFullV, ComputeThinV. |
Thin unitaries are only available if your matrix type has a Dynamic number of columns (for example MatrixXf). They also are not available with the (non - default) FullPivHouseholderQR preconditioner.
template<typename _MatrixType>
BDCSVD& Eigen:: BDCSVD<_MatrixType>:: compute(const MatrixType& matrix)
Method performing the decomposition of given matrix using current options.
Parameters | |
---|---|
matrix | the matrix to decompose |
This method uses the current computationOptions, as already passed to the constructor or to compute(const MatrixType&, unsigned int).
template<typename _MatrixType>
bool Eigen:: BDCSVD<_MatrixType>:: computeU() const
Returns | true if U (full or thin) is asked for in this SVD decomposition |
---|
template<typename _MatrixType>
bool Eigen:: BDCSVD<_MatrixType>:: computeV() const
Returns | true if V (full or thin) is asked for in this SVD decomposition |
---|