#include <rational-solver.h>
Public Member Functions | |
RationalSolver (const Ring &r=Ring(), const RandomPrime &rp=RandomPrime(DEFAULT_PRIMESIZE)) | |
RationalSolver (const Prime &p, const Ring &r=Ring(), const RandomPrime &rp=RandomPrime(DEFAULT_PRIMESIZE)) | |
template<class IMatrix , class Vector1 , class Vector2 > | |
SolverReturnStatus | solve (Vector1 &num, Integer &den, const IMatrix &A, const Vector2 &b, const bool=false, const int maxPrimes=DEFAULT_MAXPRIMES, const SolverLevel level=SL_DEFAULT) const |
template<class IMatrix , class Vector1 , class Vector2 > | |
SolverReturnStatus | solve (Vector1 &num, Integer &den, const IMatrix &A, const Vector2 &b, const int maxPrimes, const SolverLevel level=SL_DEFAULT) const |
template<class IMatrix , class Vector1 , class Vector2 > | |
SolverReturnStatus | solveNonsingular (Vector1 &num, Integer &den, const IMatrix &A, const Vector2 &b, bool=false, int maxPrimes=DEFAULT_MAXPRIMES) const |
template<class IMatrix , class Vector1 , class Vector2 > | |
SolverReturnStatus | solveSingular (Vector1 &num, Integer &den, const IMatrix &A, const Vector2 &b, int maxPrimes=DEFAULT_MAXPRIMES, const SolverLevel level=SL_DEFAULT) const |
template<class IMatrix , class Vector1 , class Vector2 > | |
SolverReturnStatus | findRandomSolution (Vector1 &num, Integer &den, const IMatrix &A, const Vector2 &b, int maxPrimes=DEFAULT_MAXPRIMES, const SolverLevel level=SL_DEFAULT) const |
template<class IMatrix , class Vector1 , class Vector2 > | |
SolverReturnStatus | monolithicSolve (Vector1 &num, Integer &den, const IMatrix &A, const Vector2 &b, bool makeMinDenomCert, bool randomSolution, int maxPrimes=DEFAULT_MAXPRIMES, const SolverLevel level=SL_DEFAULT) const |
See the following reference for details on this algorithm:
RationalSolver | ( | const Ring & | r = Ring() , |
|
const RandomPrime & | rp = RandomPrime(DEFAULT_PRIMESIZE) | |||
) | [inline] |
Constructor
r,a | Ring, set by default | |
rp,a | RandomPrime generator, set by default |
RationalSolver | ( | const Prime & | p, | |
const Ring & | r = Ring() , |
|||
const RandomPrime & | rp = RandomPrime(DEFAULT_PRIMESIZE) | |||
) | [inline] |
Constructor, trying the prime p first
p,a | Prime | |
r,a | Ring, set by default | |
rp,a | RandomPrime generator, set by default |
SolverReturnStatus solve | ( | Vector1 & | num, | |
Integer & | den, | |||
const IMatrix & | A, | |||
const Vector2 & | b, | |||
const | bool = false , |
|||
const int | maxPrimes = DEFAULT_MAXPRIMES , |
|||
const SolverLevel | level = SL_DEFAULT | |||
) | const [inline] |
Solve a linear system Ax=b over quotient field of a ring
num,Vector | of numerators of the solution | |
den,The | common denominator. 1/den * num is the rational solution of Ax = b. | |
A,Matrix | of linear system | |
b,Right-hand | side of system | |
maxPrimes,maximum | number of moduli to try | |
level,level | of certification to be used |
SolverReturnStatus solve | ( | Vector1 & | num, | |
Integer & | den, | |||
const IMatrix & | A, | |||
const Vector2 & | b, | |||
const int | maxPrimes, | |||
const SolverLevel | level = SL_DEFAULT | |||
) | const [inline] |
overload so that the bool 'oldMatrix' argument is not accidentally set to true
SolverReturnStatus solveNonsingular | ( | Vector1 & | num, | |
Integer & | den, | |||
const IMatrix & | A, | |||
const Vector2 & | b, | |||
bool | = false , |
|||
int | maxPrimes = DEFAULT_MAXPRIMES | |||
) | const [inline] |
Solve a nonsingular, square linear system Ax=b over quotient field of a ring
num,Vector | of numerators of the solution | |
den,The | common denominator. 1/den * num is the rational solution of Ax = b. | |
A,Matrix | of linear system (it must be square) | |
b,Right-hand | side of system | |
maxPrimes,maximum | number of moduli to try |
SolverReturnStatus solveSingular | ( | Vector1 & | num, | |
Integer & | den, | |||
const IMatrix & | A, | |||
const Vector2 & | b, | |||
int | maxPrimes = DEFAULT_MAXPRIMES , |
|||
const SolverLevel | level = SL_DEFAULT | |||
) | const [inline] |
Solve a general rectangular linear system Ax=b over quotient field of a ring. If A is known to be square and nonsingular, calling solveNonsingular is more efficient.
num,Vector | of numerators of the solution | |
den,The | common denominator. 1/den * num is the rational solution of Ax = b. | |
A,Matrix | of linear system | |
b,Right-hand | side of system | |
maxPrimes,maximum | number of moduli to try | |
level,level | of certification to be used |
SolverReturnStatus findRandomSolution | ( | Vector1 & | num, | |
Integer & | den, | |||
const IMatrix & | A, | |||
const Vector2 & | b, | |||
int | maxPrimes = DEFAULT_MAXPRIMES , |
|||
const SolverLevel | level = SL_DEFAULT | |||
) | const [inline] |
Find a random solution of the general linear system Ax=b over quotient field of a ring.
num,Vector | of numerators of the solution | |
den,The | common denominator. 1/den * num is the rational solution of Ax = b. | |
A,Matrix | of linear system | |
b,Right-hand | side of system | |
maxPrimes,maximum | number of moduli to try | |
level,level | of certification to be used |
SolverReturnStatus monolithicSolve | ( | Vector1 & | num, | |
Integer & | den, | |||
const IMatrix & | A, | |||
const Vector2 & | b, | |||
bool | makeMinDenomCert, | |||
bool | randomSolution, | |||
int | maxPrimes = DEFAULT_MAXPRIMES , |
|||
const SolverLevel | level = SL_DEFAULT | |||
) | const [inline] |
Big solving routine to perform random solving and certificate generation. Same arguments and return as findRandomSolution, except
num,Vector | of numerators of the solution | |
den,The | common denominator. 1/den * num is the rational solution of Ax = b. | |
randomSolution,parameter | to determine whether to randomize or not (since solveSingular calls this function as well) | |
makeMinDenomCert,determines | whether a partial certificate for the minimal denominator of a rational solution is made |