Skip to content

Matrix-matrix product with sparse self-adjoint matrix doesn't compile

Submitted by Clemens Hofreither

Assigned to Desire NUENTSA

Link to original bugzilla bug (#553)

Description

I have a self-adjoint sparse matrix and want to multiply it with another sparse matrix. Compiling the following code produces a compiler error on gcc 4.5.4:


#include <Eigen/Core>
#include <Eigen/Sparse>

using namespace Eigen;

int main()
{
SparseMatrix<double> x(10,10);
SparseMatrix<double> y(10,10);
SparseMatrix<double> z(10,10);

z = x * y;                              // works  
z = x.selfadjointView&lt;Lower&gt;() * y;     // compiler error  

}


The error is the following:

testspmatrix.cpp:14:38: error: no match for 'operator*' in 'Eigen::SparseMatrixBase<Derived>::selfadjointView() with unsigned int UpLo = 1u, Derived = Eigen::SparseMatrix<double> * y'
Eigen/src/SparseCore/../plugins/CommonCwiseUnaryOps.h:80:1: note: candidates are: const Eigen::CwiseUnaryOp<Eigen::internal::scalar_multiple2_op<double, std::complex<double> >, const Eigen::SparseMatrix<double> > Eigen::operator*(const std::complex<double>&, const Eigen::SparseMatrixBase<Eigen::SparseMatrix<double> >::StorageBaseType&)
Eigen/src/SparseCore/../plugins/CommonCwiseUnaryOps.h:76:1: note: const Eigen::SparseMatrixBase<Eigen::SparseMatrix<double> >::ScalarMultipleReturnType Eigen::operator*(const Eigen::SparseMatrixBase<Eigen::SparseMatrix<double, 0, int> >::Scalar&, const Eigen::SparseMatrixBase<Eigen::SparseMatrix<double> >::StorageBaseType&)


This seems like very basic functionality to have and is an absolute blocker for me. Am I doing something wrong?

Blocking

#387 (closed)

Edited by Eigen Bugzilla