Echelon form of matrix over Zp.
Echelon form of matrix over Zp.
#include <iostream>
#include <fflas-ffpack/ffpack/ffpack.h>
#define COMPARE_FFPACK
int main (
int argc,
char **argv)
{
if (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]);
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
E.
write(cerr<<
"LinBox::Echelon = "<<endl)<<endl;
return 0;
}
size_t rowdim() const
Get the number of rows in the matrix.
Definition blas-matrix.h:233
ConstElement_ptr getPointer() const
 
Definition blas-matrix.h:246
size_t coldim() const
Get the number of columns in the matrix.
Definition blas-matrix.h:238
std::istream & read(std::istream &file)
Read the matrix from an input stream.
Definition blas-matrix.inl:286
std::ostream & write(std::ostream &os, Tag::FileFormat f=Tag::FileFormat::MatrixMarket) const
Write the matrix to an output stream.
Definition blas-matrix.inl:297
Givaro::Modular< uint32_t > Field
Definition dot-product.C:49
linbox base configuration file
A Givaro::Modular ring is a representations of Z/mZ.
Namespace in which all linbox code resides.
Definition alt-blackbox-block-container.h:4
size_t reducedRowEchelon(Matrix &E, const Matrix &A, const CategoryTag &tag, const EchelonMethod &m)
Compute the reduced row echelon form of a matrix.
Definition echelon.h:208
BlasMatrix< _Field > DenseMatrix
Definition dense-matrix.h:46
int main()
Definition test-tutorial.C:54