LatNet Builder Manual  2.0.1-11
Software Package for Constructing Highly Uniform Point Sets
LatticeTester::IntFactor< Int > Class Template Reference

The objects of this class are the "prime" factors in the decomposition of a positive integer. More...

#include <IntFactor.h>

Public Member Functions

 IntFactor (const Int &x, int mult=1, PrimeType stat=UNKNOWN)
 Constructor for a factor \(x\) of multiplicity mult that has a PrimeType stat
 
Int getFactor () const
 Returns the numeric value of this factor.
 
void setFactor (const Int &x)
 Sets the value of this factor to \(x\).
 
int getMultiplicity () const
 Returns the multiplicity of this object.
 
void setMultiplicity (int m)
 Sets the multiplicity of this object to \(m\).
 
PrimeType getStatus () const
 Returns the PrimeType of this object.
 
void setStatus (PrimeType s)
 Sets the PrimeType of this object to \(s\).
 
LatticeTester::PrimeType isPrime (std::int64_t k)
 Tests whether this factor is prime. More...
 
std::string toString () const
 Returns this object as a string.
 

Static Public Member Functions

static PrimeType isPrime (const Int &y, std::int64_t k)
 Tests whether \(y\) is prime. More...
 
static std::string toString (LatticeTester::PrimeType stat)
 Transforms status stat in an easily readable string and returns it.
 

Detailed Description

template<typename Int>
class LatticeTester::IntFactor< Int >

The objects of this class are the "prime" factors in the decomposition of a positive integer.

The class also contains functions to determine whether a number is prime, probably prime or composite. These methods can be used externally to test the primality of an integer, or to test if this factor is prime.

Member Function Documentation

◆ isPrime() [1/2]

template<typename Int >
PrimeType LatticeTester::IntFactor< Int >::isPrime ( const Int &  y,
std::int64_t  k 
)
static

Tests whether \(y\) is prime.

First tests whether \(y\) is divisible by all small primes \(p\) ( \(p < 2^{16}\)) that are kept in file prime.dat. Then applies the Miller-Rabin probability test with \(k\) trials.

References LatticeTester::SqrRoot().

Referenced by LatticeTester::NormaPalpha< Int, RedDbl >::calcBound().

◆ isPrime() [2/2]

template<typename Int >
PrimeType LatticeTester::IntFactor< Int >::isPrime ( std::int64_t  k)

Tests whether this factor is prime.

Similar to isPrime above.


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