[eigen] SuperLU

[ Thread Index | Date Index | More lists.tuxfamily.org/eigen Archives ]


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



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/