Registered Member
|
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> >&) |
Moderator
|
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.
|
Registered Member
|
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! |
Moderator
|
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.
|
Registered Member
|
great, thanks! keep up the work this library is awesome!
|
Registered users: Bing [Bot], Google [Bot], Yahoo [Bot]