Documentation
¶
Index ¶
Constants ¶
View Source
const ( UNSMOOTH = iota TRIVIAL INSERTED SOLVED )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FactorBase ¶
type FactorBase interface {
// Prepare factor base.<p>
// @param m BigInteger - number to be factorized
Init(m *math.Int) bool
// Get number of primes in the factor base.<P>
// @return int - number of primes in factor base
GetNumPrimes() int
// Get the i.th primes in the factor base.<p>
// @param i int - prime index
// @return BigInteger - prime value
GetPrime(i int) *math.Int
// Solve the equation x^2 = m (mod p)
// @param i
// @return
GetSqrt(i int) *math.Int
}
Factor base: contains a given number of suitable primes.<p> An integer x is smooth if all the prime factors of x are contained in the factor base.<p>
type FactorBaseImpl ¶
type FactorBaseImpl struct {
// contains filtered or unexported fields
}
func NewFactorBaseImpl ¶
func NewFactorBaseImpl(m *math.Int) *FactorBaseImpl
func (*FactorBaseImpl) GetNumPrimes ¶
func (fb *FactorBaseImpl) GetNumPrimes() int
type FunctionImpl ¶
type FunctionImpl struct {
// contains filtered or unexported fields
}
func NewFunctionImpl ¶
func NewFunctionImpl(n *math.Int) *FunctionImpl
Instanciate function (and compute/initialize helpers).<p> @param n BigInteger - number to be decomposed
type Siever ¶
type Siever interface {
Init(f Function, fb FactorBase, size int) bool
SieveInterval(x0 *math.Int, solver Solver) *math.Int
}
Interface for (quadratic) sieve implementations.<p>
type SieverImpl ¶
type SieverImpl struct {
// contains filtered or unexported fields
}
func NewSieverImpl ¶
func NewSieverImpl(f Function, fb FactorBase, size int) *SieverImpl
func (*SieverImpl) Init ¶
func (si *SieverImpl) Init(f Function, fb FactorBase, size int) bool
func (*SieverImpl) SieveInterval ¶
type SolverImpl ¶
type SolverImpl struct {
Relation
// contains filtered or unexported fields
}
func NewSolverImpl ¶
func NewSolverImpl(m *math.Int, f Function, fb FactorBase) *SolverImpl
func (*SolverImpl) Done ¶
func (si *SolverImpl) Done() bool
func (*SolverImpl) GetSolution ¶
func (si *SolverImpl) GetSolution() *math.Int
func (*SolverImpl) Init ¶
func (si *SolverImpl) Init(m *math.Int, f Function, fb FactorBase) bool
func (*SolverImpl) Optimize ¶
func (si *SolverImpl) Optimize()
Click to show internal directories.
Click to hide internal directories.