#include <iostream>
#include <sstream>
#include <givaro/givrational.h>
#define SP_STOR SparseMatrixFormat::SparseSeq
int main (
int argc,
char **argv)
{
if (argc < 2 || argc > 3) {
std::cerr << "Usage: rank <matrix-file-in-supported-format> [<p>]" << std::endl;
return -1;
}
std::ifstream input (argv[1]);
if (!input) {
std::cerr << "Error opening matrix file: " << argv[1] << std::endl;
return -1;
}
size_t r;
Givaro::QField<Givaro::Rational> QQ;
tim.stop();
std::clog << "matrix is " << A.rowdim() << " by " << A.coldim() << " (" << tim << ")" << std::endl;
tim.clear() ; tim.start();
if (argc == 2) {
}
if (argc == 3) {
uint32_t q = atoi(argv[2]);
if (q == 0) {
std::cerr << "second argument should be a non-zero integer or missing\n";
return -1;
}
typedef Givaro::Modular<double>
Field;
if (q > F.maxCardinality()) {
std::cerr << "your number is too big for this field" << std::endl;
return -1 ;
}
tim.stop();
std::clog << "matrix is " << B.rowdim() << " by " << B.coldim()
<<" (time for map: "<< tim << ")" << std::endl;
tim.clear();tim.start();
}
tim.stop();
std::clog << "Rank is " << std::flush;
std::cout << r << std::flush;
std::clog << " (" << tim << " )" << std::endl;
return 0;
}
MatrixStream.
Definition matrix-stream.h:200
Definition sparse-matrix.h:47
Givaro::Modular< uint32_t > Field
Definition dot-product.C:49
size_t & rank(size_t &r, const Blackbox &A, const DomainCategory &tag, const Method &M)
Compute the rank of a linear transform A over a field by selected method.
linbox base configuration file
A Givaro::Modular ring is a representations of Z/mZ.
void map(FMatrix &Ap, const IMatrix &A)
Definition matrix-hom.h:195
Namespace in which all linbox code resides.
Definition alt-blackbox-block-container.h:4
Givaro::Timer Timer
Definition timer.h:55
#define SP_STOR
Definition rank.C:43
A SparseMatrix<_Field, _Storage> ....
Commentator & commentator()
Definition commentator.h:998
int main()
Definition test-tutorial.C:54