[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: [eigen] SuperLU
- From: Trevor Irons <trevorirons@xxxxxxxxx>
- Date: Thu, 3 Sep 2009 09:39:56 -0600
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=ZnSMomJrlrIgSN5gtU1u4x1IT+hVH+rbB6hkMVwBJGI=; b=avo4pLE32tWX17nkvkOPu6AXGhELhSKRpP5dSPHeFg0iqO7XcHuEpMSfNjVyDCt6cc FEy5FoBoN/kCLOLgMOkPEfemp0mR6Fw4FyDGvxsMuAQcGkb3AW/R7nxBQULjAeftnRtX kgjlb0NfMYi76ABH+S4K59Q77vIvnx8XFKYPw=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=C3wkBba/azPt87UAblNw8Rpfsynt+s4npNBSRHOMHyiKZmWpKMpGRz4jWMWGc4ElvZ gnWPN3X6VAEUOAo3QYtM5ZBGM12aBXmzn3l8Ol6xi47IfT4enQSShqzVqZCI9kLN1Z6W Qd7J0lsaLIcBEiJxStVoEKrBja2XUr+Y8IbO8=
Hi.
Some code I had using the Sparse SuperLU solver quit working with the
latest update (mercurial tip). I get an error
"Parameter 13 to routine zgssvx was incorrect"
Based on the SuperLU documentation this is the X vector (SuperMatrix) argument.
Here is an example piece of code:
#include <fstream>
#include <Eigen/Core>
#include <Eigen/Sparse>
#include <Eigen/Array>
using namespace std;
using namespace Eigen;
typedef double Real;
typedef complex<Real> Complex;
int main() {
cout << "Testing Eigen2 SuperLU\n";
int nm = 3*2;
VectorXcd B(nm);
VectorXcd X(nm);
SparseMatrix<Complex, RowMajor> A (nm, nm);
cout << "Building A,B \n";
{
RandomSetter<SparseMatrix<Complex, RowMajor> > setter(A);
for (int i=0; i<nm; ++i) {
B(i) = Complex(1e-7*rand(), 1e-9*rand());
setter(i,i) = Complex(2, .01);
if (i<nm-1)
setter(i,i+1) = Complex(-1, .0);
if (i>0)
setter(i,i-1) = Complex(-1, .0);
}
}
cout << A << endl;
cout << B << endl;
cout << "Solve for X\n";
SparseLU<SparseMatrix<Complex>,SuperLU> slu2(A);
slu2.solve(B, &X);
cout << X << endl;
}
Compiling with gcc
g++ -I/usr/include/atlas -g -I. -I/usr/include/superlu
-I/home/tirons/src/eigen2 -DEIGEN_SUPERLU_SUPPORT -L/usr/lib/
-lsuperlu /usr/lib/libblas.a -o test test.cpp -L/usr/lib/
-lsuperlu /usr/lib/libblas.a
Am I doing something wrong? I get the same error with ColMajor as well.
Thanks,
Trevor