#include <iostream>
#include <linbox/blackbox/transpose.h>
#include <linbox/blackbox/compose.h>
#include <linbox/solutions/valence.h>
#include <linbox/util/matrix-stream.h>
int main (
int argc,
char **argv)
{
commentator().
setMaxDetailLevel (-1);
commentator().
setMaxDepth (-1);
commentator().
setReportStream (std::cerr);
if (argc < 2 || argc > 3) {
std::cerr << "Usage: valence <matrix-file-in-supported-format> [-ata|-aat]" << std::endl;
return -1;
}
std::ifstream input (argv[1]);
if (!input) { std::cerr << "Error opening matrix file " << argv[1] << std::endl; return -1; }
Givaro::ZRing<Integer> ZZ;
typedef SparseMatrix<Givaro::ZRing<Integer> > Blackbox;
Blackbox A (ms);
std::cout << "A is " << A.rowdim() << " by " << A.coldim() << std::endl;
Givaro::ZRing<Integer>::Element val_A;
if (argc == 3) {
if (strcmp(argv[2],"-aat")) {
std::cout <<
"A^T A is " << C.
rowdim() <<
" by " << C.
coldim() << std::endl;
valence(val_A, C);
}
else {
std::cout <<
"A A^T is " << C.
rowdim() <<
" by " << C.
coldim() << std::endl;
valence(val_A, C);
}
}
else {
if (A.rowdim() != A.coldim()) {
std::cerr << "Valence works only on square matrices, try either to change the dimension in the matrix file, or to compute the valence of A A^T or A^T A, via the -aat or -ata options." << std::endl;
exit(0);
}
else
valence (val_A, A);
}
std::cout << "Valence is " << val_A << std::endl;
return 0;
}
Blackbox of a product: , i.e .
Definition: compose.h:67
size_t coldim(void) const
The number of columns.
Definition: compose.h:207
size_t rowdim(void) const
The number of rows.
Definition: compose.h:194
MatrixStream.
Definition: matrix-stream.h:197
transpose matrix without copying.
Definition: transpose.h:56
int main()
no command line args
Definition: ex-fields-archetype.C:70
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
A SparseMatrix<_Field, _Storage> ....