Echelon form of matrix over Zp.
#include <iostream>
#include <linbox/solutions/echelon.h>
#include <fflas-ffpack/ffpack/ffpack.h>
#define COMPARE_FFPACK
int main (int argc, char **argv)
{
if (argc < 3 || argc > 3) {
cerr << "Usage: echelon <matrix-file-in-SMS-format> <p>" << endl;
return -1;
}
ifstream input (argv[1]);
if (!input) { cerr << "Error opening matrix file " << argv[1] << endl; return -1; }
typedef Givaro::Modular<double> Field;
double q = atof(argv[2]);
Field F(q);
cout <<
"A is " << A.
rowdim() <<
" by " << A.
coldim() << endl;
#ifdef COMPARE_FFPACK
size_t * P =
new size_t[G.
rowdim()];
size_t * Q =
new size_t[G.
coldim()];
FFPACK::getReducedEchelonForm (F, FFLAS::FflasUpper, G.
rowdim(), G.
coldim(), r,
G.
write(cerr<<
"FFPACK::Echelon = "<<endl)<<endl;
delete[] P ;
delete[] Q ;
#endif
if (E.coldim() <20)
E.write(cerr<<"LinBox::Echelon = "<<endl)<<endl;
return 0;
}