You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
Hello, thank you for the report.
Indeed our "blackbox" method modulo 2 will not work at all, but still I can reproduce this strange "silent" fail. I'll investigate ...
In the meantime, if you want that kind of rank via Wiedemann's iteration, one way is to ask for a certification as follows: Method::Blackbox meth; meth.certifyInconsistency=true; rank(rankResult, M, meth);
This will setup an extension field and produce the rank with much higher probability.
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:
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.
The text was updated successfully, but these errors were encountered: