Rework JacobiSVD api / template parameters.

There is now an integer QRPreconditioner template parameter, defaulting to full-piv QR.
Since we have to special-case each QR dec anyway, a template template parameter didn't add much value here.
There is an option NoQRPreconditioner if you know your matrices are already square (auto-detected for fixed-size matrices).
This commit is contained in:
Benoit Jacob
2010-10-08 10:42:32 -04:00
parent 58e0cce0f7
commit 6fad2eb97b
4 changed files with 242 additions and 169 deletions

View File

@@ -209,15 +209,6 @@ enum {
OnTheRight = 2
};
// options for SVD decomposition
enum {
SkipU = 0x1,
SkipV = 0x2,
AtLeastAsManyRowsAsCols = 0x4,
AtLeastAsManyColsAsRows = 0x8,
Square = AtLeastAsManyRowsAsCols | AtLeastAsManyColsAsRows
};
/* the following could as well be written:
* enum NoChange_t { NoChange };
* but it feels dangerous to disambiguate overloaded functions on enum/integer types.
@@ -252,7 +243,7 @@ enum DecompositionOptions {
Pivoting = 0x01, // LDLT,
NoPivoting = 0x02, // LDLT,
ComputeU = 0x10, // SVD,
ComputeR = 0x20, // SVD,
ComputeV = 0x20, // SVD,
EigenvaluesOnly = 0x40, // all eigen solvers
ComputeEigenvectors = 0x80, // all eigen solvers
EigVecMask = EigenvaluesOnly | ComputeEigenvectors,
@@ -262,6 +253,13 @@ enum DecompositionOptions {
GenEigMask = Ax_lBx | ABx_lx | BAx_lx
};
enum QRPreconditioners {
NoQRPreconditioner,
HouseholderQRPreconditioner,
ColPivHouseholderQRPreconditioner,
FullPivHouseholderQRPreconditioner
};
/** \brief Enum for reporting the status of a computation.
*/
enum ComputationInfo {

View File

@@ -170,7 +170,7 @@ template<typename MatrixType> class HouseholderQR;
template<typename MatrixType> class ColPivHouseholderQR;
template<typename MatrixType> class FullPivHouseholderQR;
template<typename MatrixType> class SVD;
template<typename MatrixType, unsigned int Options = 0> class JacobiSVD;
template<typename MatrixType, int QRPreconditioner = FullPivHouseholderQRPreconditioner> class JacobiSVD;
template<typename MatrixType, int UpLo = Lower> class LLT;
template<typename MatrixType, int UpLo = Lower> class LDLT;
template<typename VectorsType, typename CoeffsType, int Side=OnTheLeft> class HouseholderSequence;