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

A sparse times dense problem

Tags: None
(comma "," separated)
User avatar
ccjn
Registered Member
Posts
4
Karma
0
OS

A sparse times dense problem

Fri Nov 21, 2014 1:17 pm
Hi all!

I'v encountered a Link error when I tried to multipy a sparse matrix with a dense one, the Error List is as follow:
Code: Select all
error LNK2001: unresolved external symbol "public: class Eigen::SparseTimeDenseProduct<class Eigen::SparseMatrix<double,0,int>,class Eigen::Matrix<double,-1,-1,0,-1,-1> > const __cdecl Eigen::SparseMatrixBase<class Eigen::SparseMatrix<double,0,int> >::operator*<class Eigen::Matrix<double,-1,-1,0,-1,-1> >(class Eigen::MatrixBase<class Eigen::Matrix<double,-1,-1,0,-1,-1> > const &)const "(??$?DV?$Matrix@N$0?0$0?0$0A@$0?0$0?0@Eigen@@@?$SparseMatrixBase@V?$SparseMatrix@N$0A@H@Eigen@@@Eigen@@QEBA?BV?$SparseTimeDenseProduct@V?$SparseMatrix@N$0A@H@Eigen@@V?$Matrix@N$0?0$0?0$0A@$0?0$0?0@2@@1@AEBV?$MatrixBase@V?$Matrix@N$0?0$0?0$0A@$0?0$0?0@Eigen@@@1@@Z)

I saw that Eigen provide Sparse mutiply dense matrix, so I think it should work
and my code is like this:
Code: Select all
SpMat A(vlarge.size() + 1, vlarge.size());
A.setFromTriplets(cc.begin(),cc.end());

SpMat At = A.transpose();
SpMat AAt = At * A;

Eigen::ConjugateGradient<SpMat> solver;
solver.compute(AAt);

Eigen::MatrixXd B = At * b;
Eigen::MatrixXd S = solver.solve(B);

Is there any wrong in my code or how to solve the link error?

Best
ccjn
User avatar
ccjn
Registered Member
Posts
4
Karma
0
OS

Re: A sparse times dense problem

Sat Nov 22, 2014 1:39 am
I've changed Eigen to previous version 3.1.4 and didn't get that error anymore .
It seems Eigen 3.2.2 has some bugs around sparse times dense matrix or maybe the Documentation needs update.
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS

Re: A sparse times dense problem

Sat Nov 22, 2014 1:07 pm
Yes, please use the latest 3.2: https://bitbucket.org/eigen/eigen/get/3.2.zip


Bookmarks



Who is online

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