linbox
Public Member Functions
DiophantineSolver< QSolver > Class Template Reference

DiophantineSolver<QSolver> creates a diophantine solver using a QSolver to generate rational solutions. More...

#include <diophantine-solver.h>

+ Collaboration diagram for DiophantineSolver< QSolver >:

Public Member Functions

 DiophantineSolver (QSolver &rs)
 Constructor from a rationalSolver. More...
 
template<class IMatrix , class Vector1 , class Vector2 >
SolverReturnStatus solve (Vector1 &x, Integer &den, const IMatrix &A, const Vector2 &b, const int maxPrimes=DEFAULT_MAXPRIMES, const SolverLevel level=SL_DEFAULT)
 Solve a linear system Ax=b over quotient field of a ring. More...
 
template<class IMatrix , class Vector1 , class Vector2 >
SolverReturnStatus randomSolve (Vector1 &x, Integer &den, const IMatrix &A, const Vector2 &b, const int maxPrimes=DEFAULT_MAXPRIMES, const SolverLevel level=SL_DEFAULT)
 Find a random solution of the general linear system Ax=b over quotient field of a ring. More...
 
template<class IMatrix , class Vector1 , class Vector2 >
SolverReturnStatus diophantineSolve (Vector1 &x, Integer &den, const IMatrix &A, const Vector2 &b, const int maxPrimes=DEFAULT_MAXPRIMES, const SolverLevel level=SL_DEFAULT)
 Find a solution of the linear system Ax=b whose denominator (when written as an integer vector over a single denom) is minimal. More...
 

Detailed Description

template<class QSolver>
class LinBox::DiophantineSolver< QSolver >

DiophantineSolver<QSolver> creates a diophantine solver using a QSolver to generate rational solutions.

Methods solve, randomSolve just expose functions from underlying rational solver. Method diophantineSolve creates a solution with minimal denominator, and can also create a certificate of minimality (described in 'Certified Dense Linear System Solving' by Mulders+Storjohann) which will be left in the public field lastCertificate.

Constructor & Destructor Documentation

◆ DiophantineSolver()

DiophantineSolver ( QSolver &  rs)
inline

Constructor from a rationalSolver.

Parameters
rsa rationalSolver

Member Function Documentation

◆ solve()

SolverReturnStatus solve ( Vector1 &  x,
Integer &  den,
const IMatrix &  A,
const Vector2 &  b,
const int  maxPrimes = DEFAULT_MAXPRIMES,
const SolverLevel  level = SL_DEFAULT 
)

Solve a linear system Ax=b over quotient field of a ring.

Parameters
AMatrix of linear system
xVector in which to store solution
bRight-hand side of system
maxPrimesmaximum number of moduli to try
levellevel of certification to be used
den
Returns
status of solution. if (return != SS_FAILED), and (level >= SL_LASVEGAS), solution is guaranteed correct. SS_FAILED - all primes used were bad SS_OK - solution found. SS_INCONSISTENT - system appreared inconsistent. certificate is in lastCertificate if (level >= SL_CERTIFIED)

◆ randomSolve()

SolverReturnStatus randomSolve ( Vector1 &  x,
Integer &  den,
const IMatrix &  A,
const Vector2 &  b,
const int  maxPrimes = DEFAULT_MAXPRIMES,
const SolverLevel  level = SL_DEFAULT 
)

Find a random solution of the general linear system Ax=b over quotient field of a ring.

Parameters
AMatrix of linear system
xVector in which to store solution
bRight-hand side of system
maxPrimesmaximum number of moduli to try
levellevel of certification to be used
den
Returns
status of solution. if (return != SS_FAILED), and (level >= SL_LASVEGAS), solution is guaranteed correct. SS_FAILED - all primes used were bad SS_OK - solution found. SS_INCONSISTENT - system appreared inconsistent. certificate is in lastCertificate if (level >= SL_CERTIFIED)

◆ diophantineSolve()

SolverReturnStatus diophantineSolve ( Vector1 &  x,
Integer &  den,
const IMatrix &  A,
const Vector2 &  b,
const int  maxPrimes = DEFAULT_MAXPRIMES,
const SolverLevel  level = SL_DEFAULT 
)

Find a solution of the linear system Ax=b whose denominator (when written as an integer vector over a single denom) is minimal.

Parameters
AMatrix of linear system
xVector in which to store solution
bRight-hand side of system
maxPrimesmaximum number of moduli to try
levellevel of certification to be used
den
Returns
status of solution. if (return != SS_FAILED) and (level >= SL_LASVEGAS), solution is guaranteed correct if (return == SS_OK) and (level >= SL_LASVEGAS), solution is guaranteed minimal. SS_FAILED - all primes used were bad SS_OK - solution found. certificate of minimality is in lastCertificate if (level >= SL_CERTIFIED) SS_INCONSISTENT - system appreared inconsistent. certificate of inconsistency is in lastCertificate if (level >= SL_CERTIFIED)
status of solution - OK, FAILED, SINGULAR, INCONSISTENT, BAD_PRECONDITIONER

The documentation for this class was generated from the following files: