Question

I'm doing some linear algebra with very large symmetric matrices (~800mb), and I'm trying out several different decompositions. Currently, I'm implementing LDLT and I'd like to take advantage of this to halve my memory requirements by overwriting the upper triangle of my matrix with L^T. Although Eigen's documentation doesn't list anyway to do this, there are some hidden methods in the internal namespace which may do what I want.

The methods can be found in these structs: template<> struct ldlt_inplace<Lower> and template<> struct ldlt_inplace<Upper> in http://eigen.tuxfamily.org/dox/LDLT_8h_source.html

Am I right that these methods are what I want? How do I use them? Should I avoid using them because they're internal, and hence subject to change and deprecation?

Was it helpful?

Solution

Internal indeed means the prototype of this function might to change in future versions. the LDLT::compute() method is a good example about how to use it:

Transpositions<Dynamic> T(mat.cols());
VectorXd temp(mat.cols());
int sign;
Eigen::internal::ldlt_inplace<Eigen::Lower>::unblocked(mat, T, temp, &sign);

EDIT

In Eigen 3.3, you can use LDLT<Ref<MatrixXd> >:

MatrixXd A;
LDLT<Ref<MatrixXd> > ldlt(A);

ldlt will then factorize A within A itself. See the doc for details.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top