Go to the documentation of this file.
10 #ifndef EIGEN_SIMPLICIAL_CHOLESKY_H
11 #define EIGEN_SIMPLICIAL_CHOLESKY_H
21 template<
typename CholMatrixType,
typename InputMatrixType>
31 template<
typename MatrixType>
54 template<
typename Derived>
104 Derived&
derived() {
return *
static_cast<Derived*
>(
this); }
105 const Derived&
derived()
const {
return *
static_cast<const Derived*
>(
this); }
147 #ifndef EIGEN_PARSED_BY_DOXYGEN
149 template<
typename Stream>
154 s <<
" diag: " << ((total+=
m_diag.size() *
sizeof(
Scalar)) >> 20) <<
"Mb" <<
"\n";
155 s <<
" tree: " << ((total+=
m_parent.size() *
sizeof(
int)) >> 20) <<
"Mb" <<
"\n";
157 s <<
" perm: " << ((total+=
m_P.
size() *
sizeof(
int)) >> 20) <<
"Mb" <<
"\n";
158 s <<
" perm^-1: " << ((total+=
m_Pinv.
size() *
sizeof(
int)) >> 20) <<
"Mb" <<
"\n";
159 s <<
" TOTAL: " << (total>> 20) <<
"Mb" <<
"\n";
163 template<
typename Rhs,
typename Dest>
166 eigen_assert(
m_factorizationIsOk &&
"The decomposition is not in a valid state for solving, you must first call either compute() or symbolic()/numeric()");
178 derived().matrixL().solveInPlace(dest);
181 dest =
m_diag.asDiagonal().inverse() * dest;
184 derived().matrixU().solveInPlace(dest);
190 template<
typename Rhs,
typename Dest>
196 #endif // EIGEN_PARSED_BY_DOXYGEN
201 template<
bool DoLDLT>
210 factorize_preordered<DoLDLT>(*pmat);
213 template<
bool DoLDLT>
228 tmp.template selfadjointView<Upper>() =
a.template selfadjointView<UpLo>().twistedBy(
m_P);
232 factorize_preordered<DoLDLT>(*pmat);
235 template<
bool DoLDLT>
274 template<
typename _MatrixType,
int _UpLo = Lower,
typename _Ordering = AMDOrdering<
typename _MatrixType::StorageIndex> >
class SimplicialLLT;
275 template<
typename _MatrixType,
int _UpLo = Lower,
typename _Ordering = AMDOrdering<
typename _MatrixType::StorageIndex> >
class SimplicialLDLT;
276 template<
typename _MatrixType,
int _UpLo = Lower,
typename _Ordering = AMDOrdering<
typename _MatrixType::StorageIndex> >
class SimplicialCholesky;
280 template<
typename _MatrixType,
int _UpLo,
typename _Ordering>
struct traits<
SimplicialLLT<_MatrixType,_UpLo,_Ordering> >
284 enum { UpLo = _UpLo };
294 template<
typename _MatrixType,
int _UpLo,
typename _Ordering>
struct traits<
SimplicialLDLT<_MatrixType,_UpLo,_Ordering> >
298 enum { UpLo = _UpLo };
312 enum { UpLo = _UpLo };
337 template<
typename _MatrixType,
int _UpLo,
typename _Ordering>
338 class SimplicialLLT :
public SimplicialCholeskyBase<SimplicialLLT<_MatrixType,_UpLo,_Ordering> >
374 Base::template compute<false>(
matrix);
397 Base::template factorize<false>(
a);
428 template<
typename _MatrixType,
int _UpLo,
typename _Ordering>
429 class SimplicialLDLT :
public SimplicialCholeskyBase<SimplicialLDLT<_MatrixType,_UpLo,_Ordering> >
471 Base::template compute<true>(
matrix);
494 Base::template factorize<true>(
a);
510 template<
typename _MatrixType,
int _UpLo,
typename _Ordering>
511 class SimplicialCholesky :
public SimplicialCholeskyBase<SimplicialCholesky<_MatrixType,_UpLo,_Ordering> >
564 Base::template compute<true>(
matrix);
566 Base::template compute<false>(
matrix);
590 Base::template factorize<true>(
a);
592 Base::template factorize<false>(
a);
596 template<
typename Rhs,
typename Dest>
619 dest =
Base::m_diag.real().asDiagonal().inverse() * dest;
634 template<
typename Rhs,
typename Dest>
657 template<
typename Derived>
668 C =
a.template selfadjointView<UpLo>();
674 if(m_Pinv.size()>0) m_P = m_Pinv.inverse();
678 ap.template selfadjointView<Upper>() =
a.template selfadjointView<UpLo>().twistedBy(m_P);
684 if(
int(UpLo)==
int(
Lower) || MatrixType::IsRowMajor)
688 ap.template selfadjointView<Upper>() =
a.template selfadjointView<UpLo>();
697 #endif // EIGEN_SIMPLICIAL_CHOLESKY_H
void resize(Index rows, Index cols)
bool operator()(const Index &row, const Index &col, const Scalar &) const
const MatrixL matrixL() const
internal::traits< SimplicialLDLT > Traits
void _solve_impl(const SparseMatrixBase< Rhs > &b, SparseMatrixBase< Dest > &dest) const
Namespace containing all symbols from the Eigen library.
void factorize_preordered(const CholMatrixType &a)
Matrix< Scalar, Dynamic, 1 > VectorType
internal::traits< SimplicialLLT > Traits
MatrixType::StorageIndex StorageIndex
TriangularView< const typename CholMatrixType::AdjointReturnType, Eigen::Upper > MatrixU
static MatrixU getU(const CholMatrixType &m)
A base class for direct sparse Cholesky factorizations.
MatrixType::Scalar Scalar
const PermutationMatrix< Dynamic, Dynamic, StorageIndex > & permutationPinv() const
SimplicialLDLT(const MatrixType &matrix)
const MatrixU matrixU() const
Scalar determinant() const
MatrixType::StorageIndex StorageIndex
internal::traits< SimplicialLLT< MatrixType, UpLo > > LLTTraits
SimplicialLDLT & compute(const MatrixType &matrix)
A direct sparse LDLT Cholesky factorizations without square root.
MatrixType::RealScalar RealScalar
void analyzePattern(const MatrixType &a)
SparseMatrix< Scalar, ColMajor, StorageIndex > CholMatrixType
void factorize(const MatrixType &a)
MatrixType::StorageIndex StorageIndex
ComputationInfo info() const
Reports whether previous computation was successful.
Matrix< Scalar, Dynamic, 1 > VectorType
const PermutationMatrix< Dynamic, Dynamic, StorageIndex > & permutationP() const
const VectorType vectorD() const
A direct sparse LLT Cholesky factorizations.
TriangularView< const CholMatrixType, Eigen::UnitLower > MatrixL
PermutationMatrix< Dynamic, Dynamic, StorageIndex > m_Pinv
SparseMatrix< Scalar, ColMajor, Index > CholMatrixType
MatrixType::Scalar Scalar
SparseMatrix< Scalar, ColMajor, StorageIndex > CholMatrixType
SimplicialCholeskyBase< SimplicialCholesky > Base
void _solve_impl(const SparseMatrixBase< Rhs > &b, SparseMatrixBase< Dest > &dest) const
const CholMatrixType * ConstCholMatrixPtr
Derived & setShift(const RealScalar &offset, const RealScalar &scale=1)
void _solve_impl(const MatrixBase< Rhs > &b, MatrixBase< Dest > &dest) const
const MatrixL matrixL() const
MatrixType::RealScalar RealScalar
const ConstDiagonalReturnType diagonal() const
SparseSolverBase< Derived > Base
MatrixType::RealScalar RealScalar
void _solve_impl(const MatrixBase< Rhs > &b, MatrixBase< Dest > &dest) const
Matrix< Scalar, Dynamic, 1 > VectorType
SparseMatrix< Scalar, ColMajor, StorageIndex > CholMatrixType
static MatrixU getU(const CholMatrixType &m)
void factorize(const MatrixType &a)
set noclip points set clip one set noclip two set bar set border lt lw set xdata set ydata set zdata set x2data set y2data set boxwidth set dummy y set format x g set format y g set format x2 g set format y2 g set format z g set angles radians set nogrid set key title set key left top Right noreverse box linetype linewidth samplen spacing width set nolabel set noarrow set nologscale set logscale x set set pointsize set encoding default set nopolar set noparametric set set set set surface set nocontour set clabel set mapping cartesian set nohidden3d set cntrparam order set cntrparam linear set cntrparam levels auto set cntrparam points set size set set xzeroaxis lt lw set x2zeroaxis lt lw set yzeroaxis lt lw set y2zeroaxis lt lw set tics in set ticslevel set tics scale
MatrixType::Scalar Scalar
Matrix< Scalar, Dynamic, 1 > VectorType
static const DiscreteKey mode(modeKey, 2)
SimplicialCholeskyBase(const MatrixType &matrix)
const CholMatrixType rawMatrix() const
Expression of a diagonal/subdiagonal/superdiagonal in a matrix.
void analyzePattern(const MatrixType &a)
SimplicialCholeskyBase< SimplicialLLT > Base
void analyzePattern(const MatrixType &a, bool doLDLT)
SimplicialCholeskyBase< SimplicialLDLT > Base
void ordering(const MatrixType &a, ConstCholMatrixPtr &pmat, CholMatrixType &ap)
SimplicialCholesky & setMode(SimplicialCholeskyMode mode)
MatrixType::Scalar Scalar
SparseMatrix< Scalar, ColMajor, StorageIndex > CholMatrixType
void factorize(const MatrixType &a)
const MatrixU matrixU() const
const VectorType vectorD() const
static enum @1096 ordering
Map< Matrix< T, Dynamic, Dynamic, ColMajor >, 0, OuterStride<> > matrix(T *data, int rows, int cols, int stride)
static MatrixL getL(const CholMatrixType &m)
set noclip points set clip one set noclip two set bar set border lt lw set xdata set ydata set zdata set x2data set y2data set boxwidth set dummy y set format x g set format y g set format x2 g set format y2 g set format z g set angles radians set nogrid set key title set key left top Right noreverse box linetype linewidth samplen spacing width set nolabel set noarrow set nologscale set logscale x set set pointsize set encoding default set nopolar set noparametric set set set set surface set nocontour set clabel set mapping cartesian set nohidden3d set cntrparam order set cntrparam linear set cntrparam levels auto set cntrparam points set size set set xzeroaxis lt lw set x2zeroaxis lt lw set yzeroaxis lt lw set y2zeroaxis lt lw set tics in set ticslevel set tics set mxtics default set mytics default set mx2tics default set my2tics default set xtics border mirror norotate autofreq set ytics border mirror norotate autofreq set ztics border nomirror norotate autofreq set nox2tics set noy2tics set timestamp bottom norotate offset
MatrixType::RealScalar RealScalar
NumTraits< Scalar >::Real RealScalar
MatrixType::Scalar Scalar
EIGEN_DEVICE_FUNC Index size() const
const Derived & derived() const
A base class for sparse solvers.
EIGEN_DEVICE_FUNC bool abs2(bool x)
MatrixType::StorageIndex StorageIndex
Matrix< Scalar, Dynamic, Dynamic > C
void analyzePattern_preordered(const CholMatrixType &a, bool doLDLT)
internal::traits< Derived >::OrderingType OrderingType
internal::traits< Derived >::MatrixType MatrixType
MatrixType::Scalar Scalar
enable_if< Rhs::ColsAtCompileTime!=1 &&Dest::ColsAtCompileTime!=1 >::type solve_sparse_through_dense_panels(const Decomposition &dec, const Rhs &rhs, Dest &dest)
TriangularView< const typename CholMatrixType::AdjointReturnType, Eigen::UnitUpper > MatrixU
Base class of any sparse matrices or sparse expressions.
void analyzePattern(const MatrixType &a)
void dumpMemory(Stream &s)
internal::traits< SimplicialCholesky > Traits
SimplicialCholesky & compute(const MatrixType &matrix)
void compute(const MatrixType &matrix)
SimplicialLLT(const MatrixType &matrix)
Base class for all dense matrices, vectors, and expressions.
static MatrixL getL(const CholMatrixType &m)
PermutationMatrix< Dynamic, Dynamic, StorageIndex > m_P
MatrixType::StorageIndex StorageIndex
internal::traits< SimplicialLDLT< MatrixType, UpLo > > LDLTTraits
Scalar determinant() const
SimplicialCholesky(const MatrixType &matrix)
Expression of a triangular part in a matrix.
TriangularView< const CholMatrixType, Eigen::Lower > MatrixL
SimplicialLLT & compute(const MatrixType &matrix)
Matrix< StorageIndex, Dynamic, 1 > VectorI
void factorize(const MatrixType &a)
MatrixType::StorageIndex StorageIndex
SparseMatrix< Scalar, ColMajor, StorageIndex > CholMatrixType
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Scalar determinant() const
~SimplicialCholeskyBase()
gtsam
Author(s):
autogenerated on Thu Dec 19 2024 04:03:08