-
Notifications
You must be signed in to change notification settings - Fork 31
Open
Description
When I try to calculate the rank of a large blackbox sparse matrix over GF2, the code is always outputting zero. Here is an MWE:
#include <iostream>
#include <linbox/linbox-config.h>
#include <sstream>
#include <linbox/ring/modular.h>
#include <linbox/field/gf2.h>
#include <linbox/matrix/sparse-matrix.h>
#include <linbox/solutions/rank.h>
#include "linbox/solutions/solve.h"
#include "square.h"
using namespace LinBox;
int main (int argc, char **argv)
{
typedef Givaro::Modular<double> Field;
Field F2(2);
SparseMatrix<Field> M(F2, 10000, 100000);
for (int i = 0; i < 1000; i++) {
M.setEntry(i, i, 1);
}
size_t rankResult;
rank(rankResult, M, Method::Blackbox());
std::cout << "Rank of M: " << rankResult << std::endl;
return 0;
}
Is this known behavior because the blackbox solvers are randomized and fail if the field size is small? Or is something else going on? I thought maybe I am supposed to use the GF2 field class directly but can't seem to manage to make that work either.
If the matrix is smaller or if I use SparseElimination instead, everything works fine.
Metadata
Metadata
Assignees
Labels
No labels