template<typename _MatrixType>
Eigen::BDCSVD class

class Bidiagonal Divide and Conquer SVD

Template parameters
_MatrixType the type of the matrix of which we are computing the SVD decomposition

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

BDCSVD()
Default Constructor.
BDCSVD(Index rows, Index cols, unsigned int computationOptions = 0)
Default Constructor with memory preallocation.
BDCSVD(const MatrixType& matrix, unsigned int computationOptions = 0)
Constructor performing the decomposition of given matrix.
~BDCSVD()

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

Typedef documentation

template<typename _MatrixType>
typedef Ref<ArrayXr> Eigen::BDCSVD<_MatrixType>::ArrayRef

template<typename _MatrixType>
typedef Array<Index, 1, Dynamic> Eigen::BDCSVD<_MatrixType>::ArrayXi

template<typename _MatrixType>
typedef Array<RealScalar, Dynamic, 1> Eigen::BDCSVD<_MatrixType>::ArrayXr

template<typename _MatrixType>
typedef Ref<ArrayXi> Eigen::BDCSVD<_MatrixType>::IndicesRef

template<typename _MatrixType>
typedef NumTraits<RealScalar>::Literal Eigen::BDCSVD<_MatrixType>::Literal

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 Matrix<Scalar, Dynamic, Dynamic, ColMajor> Eigen::BDCSVD<_MatrixType>::MatrixX

template<typename _MatrixType>
typedef Matrix<RealScalar, Dynamic, Dynamic, ColMajor> Eigen::BDCSVD<_MatrixType>::MatrixXr

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::compute(const MatrixType&).

template<typename _MatrixType>
Eigen::BDCSVD<_MatrixType>::BDCSVD(Index rows, Index cols, unsigned int computationOptions = 0)

Default Constructor with memory preallocation.

Like the default constructor but with preallocation of the internal data according to the specified problem size.

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>
Index Eigen::BDCSVD<_MatrixType>::cols() const

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

template<typename _MatrixType>
Index Eigen::BDCSVD<_MatrixType>::rows() const

template<typename _MatrixType>
void Eigen::BDCSVD<_MatrixType>::setSwitchSize(int s)

Variable documentation

template<typename _MatrixType>
int Eigen::BDCSVD<_MatrixType>::m_numIters

template<typename _MatrixType>
int Eigen::BDCSVD<_MatrixType>::m_algoswap protected

template<typename _MatrixType>
bool Eigen::BDCSVD<_MatrixType>::m_compU protected

template<typename _MatrixType>
MatrixXr Eigen::BDCSVD<_MatrixType>::m_computed protected

template<typename _MatrixType>
bool Eigen::BDCSVD<_MatrixType>::m_computeFullU protected

template<typename _MatrixType>
bool Eigen::BDCSVD<_MatrixType>::m_computeFullV protected

template<typename _MatrixType>
bool Eigen::BDCSVD<_MatrixType>::m_computeThinU protected

template<typename _MatrixType>
bool Eigen::BDCSVD<_MatrixType>::m_computeThinV protected

template<typename _MatrixType>
bool Eigen::BDCSVD<_MatrixType>::m_compV protected

template<typename _MatrixType>
Index Eigen::BDCSVD<_MatrixType>::m_diagSize protected

template<typename _MatrixType>
bool Eigen::BDCSVD<_MatrixType>::m_isInitialized protected

template<typename _MatrixType>
bool Eigen::BDCSVD<_MatrixType>::m_isTranspose protected

template<typename _MatrixType>
MatrixUType Eigen::BDCSVD<_MatrixType>::m_matrixU protected

template<typename _MatrixType>
MatrixVType Eigen::BDCSVD<_MatrixType>::m_matrixV protected

template<typename _MatrixType>
MatrixXr Eigen::BDCSVD<_MatrixType>::m_naiveU protected

template<typename _MatrixType>
MatrixXr Eigen::BDCSVD<_MatrixType>::m_naiveV protected

template<typename _MatrixType>
Index Eigen::BDCSVD<_MatrixType>::m_nonzeroSingularValues protected

template<typename _MatrixType>
Index Eigen::BDCSVD<_MatrixType>::m_nRec protected

template<typename _MatrixType>
SingularValuesType Eigen::BDCSVD<_MatrixType>::m_singularValues protected

template<typename _MatrixType>
ArrayXr Eigen::BDCSVD<_MatrixType>::m_workspace protected

template<typename _MatrixType>
ArrayXi Eigen::BDCSVD<_MatrixType>::m_workspaceI protected