Solve with Method::BlockLanczos does not compile or segfault
Breush opened this issue · comments
#include <linbox/solutions/solve.h>
using namespace LinBox;
int main(void)
{
using Field = Givaro::Modular<double>;
using Matrix = DenseMatrix<Field>;
using Vector = DenseVector<Field>;
Field F(101);
Matrix A(F, 1, 2);
Vector x(F, A.coldim());
Vector b(F, A.rowdim());
A.setEntry(0, 0, 13);
A.setEntry(0, 1, 27);
F.assign(b[0], 52);
// Calling BlockLanczos
Method::BlockLanczos method;
solve(x, A, b, method);
std::cout << "[ " << A.getEntry(0, 0) << " " << A.getEntry(0, 1) << " ] x = [ " << b[0] << " ]";
std::cout << " => x = [ " << x[0] << " " << x[1] << " ]" << std::endl;
Field::Element Ax0, Ax1, Ax;
F.mul(Ax0, A.getEntry(0, 0), x[0]);
F.mul(Ax1, A.getEntry(0, 1), x[1]);
F.add(Ax, Ax0, Ax1);
if (!F.areEqual(Ax, b[0])) {
std::cerr << "PROBLEM! Ax != b" << std::endl;
}
return 0;
}
- DenseMatrix: does not compile in
apply-domain.h
- SparseMatrix: is segfaulting