Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dense dixon with high bitsize fail #197

Open
Breush opened this issue Apr 10, 2019 · 1 comment
Open

Dense dixon with high bitsize fail #197

Breush opened this issue Apr 10, 2019 · 1 comment
Labels

Comments

@Breush
Copy link
Contributor

Breush commented Apr 10, 2019

Might be because of applyM (in apply.h) which handle numbers below 53 bits differently.

#include <linbox/solutions/solve.h>

using namespace LinBox;

int main(void)
{
    using Ring = Givaro::ZRing<Integer>;
    using Matrix = DenseMatrix<Ring>;
    using Vector = DenseVector<Ring>;

    Ring ZZ;

    Matrix A(ZZ, 1, 2);
    Vector x(ZZ, A.coldim());
    Vector b(ZZ, A.rowdim());
    Ring::Element d;

    A.setEntry(0, 0, "-4354606737974399");
    A.setEntry(0, 1, "1444080914074811");
    ZZ.assign(b[0], "-7270283604704528652531814423094");

    // Calling Dixon
    Method::Dixon method;
    method.singularSolutionType = SingularSolutionType::Random;
    solve(x, d, A, b, method);

    std::cout << "[ " << A.getEntry(0, 0) << " " << A.getEntry(0, 1) << " ] x = [ " << b[0] << " ]";
    std::cout << " => xNum/xDen = [ " << x[0] << " " << x[1] << " ] /" << d << std::endl;

    if ((A.getEntry(0, 0) * x[0]) + (A.getEntry(0, 1) * x[1]) != b[0] * d) {
        std::cerr << "PROBLEM! Ax != b" << std::endl;
    }

    return 0;
}
@Breush
Copy link
Contributor Author

Breush commented Jun 13, 2019

test-solve-full -m 1 -n 1 -b 1 -B 30 exhibits the same problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant