Lines 47-72
namespace internal {
Link Here
|
47 |
*/ |
47 |
*/ |
48 |
template<typename _MatrixType, int _UpLo> class LDLT |
48 |
template<typename _MatrixType, int _UpLo> class LDLT |
49 |
{ |
49 |
{ |
50 |
public: |
50 |
public: |
51 |
typedef _MatrixType MatrixType; |
51 |
typedef _MatrixType MatrixType; |
52 |
enum { |
52 |
enum { |
53 |
RowsAtCompileTime = MatrixType::RowsAtCompileTime, |
53 |
RowsAtCompileTime = MatrixType::RowsAtCompileTime, |
54 |
ColsAtCompileTime = MatrixType::ColsAtCompileTime, |
54 |
ColsAtCompileTime = MatrixType::ColsAtCompileTime, |
55 |
Options = MatrixType::Options & ~RowMajorBit, // these are the options for the TmpMatrixType, we need a ColMajor matrix here! |
|
|
56 |
MaxRowsAtCompileTime = MatrixType::MaxRowsAtCompileTime, |
55 |
MaxRowsAtCompileTime = MatrixType::MaxRowsAtCompileTime, |
57 |
MaxColsAtCompileTime = MatrixType::MaxColsAtCompileTime, |
56 |
MaxColsAtCompileTime = MatrixType::MaxColsAtCompileTime, |
58 |
UpLo = _UpLo |
57 |
UpLo = _UpLo |
59 |
}; |
58 |
}; |
60 |
typedef typename MatrixType::Scalar Scalar; |
59 |
typedef typename MatrixType::Scalar Scalar; |
61 |
typedef typename NumTraits<typename MatrixType::Scalar>::Real RealScalar; |
60 |
typedef typename NumTraits<typename MatrixType::Scalar>::Real RealScalar; |
62 |
typedef Eigen::Index Index; ///< \deprecated since Eigen 3.3 |
61 |
typedef Eigen::Index Index; ///< \deprecated since Eigen 3.3 |
63 |
typedef typename MatrixType::StorageIndex StorageIndex; |
62 |
typedef typename MatrixType::StorageIndex StorageIndex; |
64 |
typedef Matrix<Scalar, RowsAtCompileTime, 1, Options, MaxRowsAtCompileTime, 1> TmpMatrixType; |
63 |
typedef Matrix<Scalar, RowsAtCompileTime, 1, 0, MaxRowsAtCompileTime, 1> TmpMatrixType; |
65 |
|
64 |
|
66 |
typedef Transpositions<RowsAtCompileTime, MaxRowsAtCompileTime> TranspositionType; |
65 |
typedef Transpositions<RowsAtCompileTime, MaxRowsAtCompileTime> TranspositionType; |
67 |
typedef PermutationMatrix<RowsAtCompileTime, MaxRowsAtCompileTime> PermutationType; |
66 |
typedef PermutationMatrix<RowsAtCompileTime, MaxRowsAtCompileTime> PermutationType; |
68 |
|
67 |
|
69 |
typedef internal::LDLT_Traits<MatrixType,UpLo> Traits; |
68 |
typedef internal::LDLT_Traits<MatrixType,UpLo> Traits; |
70 |
|
69 |
|
71 |
/** \brief Default Constructor. |
70 |
/** \brief Default Constructor. |
72 |
* |
71 |
* |
Lines 92-120
template<typename _MatrixType, int _UpLo
Link Here
|
92 |
m_temporary(size), |
91 |
m_temporary(size), |
93 |
m_sign(internal::ZeroSign), |
92 |
m_sign(internal::ZeroSign), |
94 |
m_isInitialized(false) |
93 |
m_isInitialized(false) |
95 |
{} |
94 |
{} |
96 |
|
95 |
|
97 |
/** \brief Constructor with decomposition |
96 |
/** \brief Constructor with decomposition |
98 |
* |
97 |
* |
99 |
* This calculates the decomposition for the input \a matrix. |
98 |
* This calculates the decomposition for the input \a matrix. |
|
|
99 |
* |
100 |
* \sa LDLT(Index size) |
100 |
* \sa LDLT(Index size) |
101 |
*/ |
101 |
*/ |
102 |
template<typename InputType> |
102 |
template<typename InputType> |
103 |
explicit LDLT(const EigenBase<InputType>& matrix) |
103 |
explicit LDLT(const EigenBase<InputType>& matrix) |
104 |
: m_matrix(matrix.rows(), matrix.cols()), |
104 |
: m_matrix(matrix.rows(), matrix.cols()), |
105 |
m_transpositions(matrix.rows()), |
105 |
m_transpositions(matrix.rows()), |
106 |
m_temporary(matrix.rows()), |
106 |
m_temporary(matrix.rows()), |
107 |
m_sign(internal::ZeroSign), |
107 |
m_sign(internal::ZeroSign), |
108 |
m_isInitialized(false) |
108 |
m_isInitialized(false) |
109 |
{ |
109 |
{ |
110 |
compute(matrix.derived()); |
110 |
compute(matrix.derived()); |
111 |
} |
111 |
} |
112 |
|
112 |
|
|
|
113 |
/** \brief Constructs a LDLT factorization from a given matrix |
114 |
* |
115 |
* This overloaded constructor is provided for inplace solving when \c MatrixType is a Eigen::Ref. |
116 |
* |
117 |
* \sa LDLT(const EigenBase&) |
118 |
*/ |
119 |
template<typename InputType> |
120 |
explicit LDLT(EigenBase<InputType>& matrix) |
121 |
: m_matrix(matrix.derived()), |
122 |
m_transpositions(matrix.rows()), |
123 |
m_temporary(matrix.rows()), |
124 |
m_sign(internal::ZeroSign), |
125 |
m_isInitialized(false) |
126 |
{ |
127 |
compute(matrix.derived()); |
128 |
} |
129 |
|
113 |
/** Clear any existing decomposition |
130 |
/** Clear any existing decomposition |
114 |
* \sa rankUpdate(w,sigma) |
131 |
* \sa rankUpdate(w,sigma) |
115 |
*/ |
132 |
*/ |
116 |
void setZero() |
133 |
void setZero() |
117 |
{ |
134 |
{ |
118 |
m_isInitialized = false; |
135 |
m_isInitialized = false; |
119 |
} |
136 |
} |
120 |
|
137 |
|