Determinant of sparse matrix over Z or Zp.
#define __LINBOX_HAVE_KAAPI
#include <iostream>
#include <string>
#include <linbox/ring/gmp-integers.h>
#include <linbox/util/matrix-stream.h>
typedef Givaro::ZRing<Integer> Integers;
struct cra_det_task {
void operator()(int argc, char **argv) {
ifstream input (argv[1]);
if (!input) {
cerr << "Error opening matrix file '" << argv[1] << "'" << endl;
return ;
}
Util::logfile() << "creating matrix" << std::endl;
Integers ZZ;
SparseMatrix<Integers> sparseMatrix (ZZ);
sparseMatrix.read(input);
Util::logfile() << "matrix created" << std::endl;
Givaro::ZRing<Integer>::Element det_A;
try {
}
std::cerr << err << std::endl;
}
cout << "Determinant is ";
ZZ.write(cout, det_A) << endl;
}
};
int main (int argc, char **argv)
{
if(argc<2) {
cerr << "not enough args : usage = athadet file" << endl;
return 1;
}
a1::Community com = a1::System::join_community(argc,argv);
Util::logfile() << "starting job" << std::endl;
a1::ForkMain<cra_det_task>()(argc,argv);
com.leave();
a1::System::terminate();
return 0;
}