This forum has been archived. All content is frozen. Please use KDE Discuss instead.

sparse * selfadjoint

Tags: None
(comma "," separated)
yannick1303
Registered Member
Posts
5
Karma
0
OS

sparse * selfadjoint

Fri Sep 30, 2011 1:52 pm
Hi

Similar to a previous thread, I am trying to compute
transpose(L)*C*L
where C is a selfadjointView<Upper> of another matrix A
and L is a sparse matrix.

When I try

Eigen::MatrixXd B(A.selfadjointView<Eigen::Upper>()*L);

I get:

test.cpp: In function 'int main()':
test.cpp:25: error: no match for 'operator*' in '((Eigen::MatrixBase<Eigen::Matrix<double, -0x00000000000000001, -0x00000000000000001, 0, -0x00000000000000001, -0x00000000000000001> >*)(& A))->Eigen::MatrixBase<Derived>::selfadjointView [with unsigned int UpLo = 2u, Derived = Eigen::Matrix<double, -0x00000000000000001, -0x00000000000000001, 0, -0x00000000000000001, -0x00000000000000001>]() * L'
/opt/local/include/eigen3/Eigen/src/Sparse/../plugins/CommonCwiseUnaryOps.h:95: note: candidates are: const Eigen::CwiseUnaryOp<Eigen::internal::scalar_multiple2_op<double, std::complex<double> >, const Eigen::SparseMatrix<double, 0, int> > Eigen::operator*(const std::complex<double>&, const Eigen::SparseMatrixBase<Eigen::SparseMatrix<double, 0, int> >&)
/opt/local/include/eigen3/Eigen/src/Sparse/../plugins/CommonCwiseUnaryOps.h:91: note: const Eigen::CwiseUnaryOp<Eigen::internal::scalar_multiple_op<double>, const Eigen::SparseMatrix<double, 0, int> > Eigen::operator*(const double&, const Eigen::SparseMatrixBase<Eigen::SparseMatrix<double, 0, int> >&)
/opt/local/include/eigen3/Eigen/src/Core/../plugins/CommonCwiseUnaryOps.h:95: note: const Eigen::CwiseUnaryOp<Eigen::internal::scalar_multiple2_op<double, std::complex<double> >, const Eigen::Matrix<double, -0x00000000000000001, -0x00000000000000001, 0, -0x00000000000000001, -0x00000000000000001> > Eigen::operator*(const std::complex<double>&, const Eigen::MatrixBase<Eigen::Matrix<double, -0x00000000000000001, -0x00000000000000001, 0, -0x00000000000000001, -0x00000000000000001> >&)
/opt/local/include/eigen3/Eigen/src/Core/../plugins/CommonCwiseUnaryOps.h:91: note: const Eigen::CwiseUnaryOp<Eigen::internal::scalar_multiple_op<double>, const Eigen::Matrix<double, -0x00000000000000001, -0x00000000000000001, 0, -0x00000000000000001, -0x00000000000000001> > Eigen::operator*(const double&, const Eigen::MatrixBase<Eigen::Matrix<double, -0x00000000000000001, -0x00000000000000001, 0, -0x00000000000000001, -0x00000000000000001> >&)
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS

Re: sparse * selfadjoint

Fri Sep 30, 2011 6:51 pm
as reported by the compiler (no such operator *), this combination is not implemented yet. Just use a full copy for C, or dense matrices for L. In general A sparse storage make sense only for very sparse matrices with more than 80% of zeros.
yannick1303
Registered Member
Posts
5
Karma
0
OS

Re: sparse * selfadjoint

Sat Oct 01, 2011 12:58 pm
alright, thank you.

I am considering of using calls to cholmod directly using viewAsCholmod. However, I don't really understand which header files will be deprecated soon.

I'm using CholmodSupport. Now there's SparseLLT which makes calls to cholmod libraries with the correct flag, and there's SparseLDLT, which seems to be legacy now. And then, there's SimplicialCholesky. Can you give me some insights into what is going to be abandoned and what is not?

Also, when using CholmodDecomposition, is there a way to get the different factors? I see that m_cholmodFactor is protected. I'd like to get L and D from the LDLT decomposition to be able to calculate a determinant quickly.

thanks!
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS

Re: sparse * selfadjoint

Sun Oct 02, 2011 7:29 am
the SparseLLT<> class and the like are deprecated. CholmodDecomposition and SimplicialCholesky are the new ones. Adding access to the factors and a determinant function is planed.
yannick1303
Registered Member
Posts
5
Karma
0
OS

Re: sparse * selfadjoint

Sun Oct 02, 2011 8:43 am
great, thanks! keep up the work this library is awesome!


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], Yahoo [Bot]