Lattice Tester Guide  1.0-9
Software Package For Testing The Uniformity Of Integral Lattices In The Real Space
LatticeTester::IntFactor< Int > Class Template Reference

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

#include <latticetester/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 More...
 
Int getFactor () const
 Returns the numeric value of this factor. More...
 
void setFactor (const Int &x)
 Sets the value of this factor to \(x\). More...
 
int getMultiplicity () const
 Returns the multiplicity of this object. More...
 
void setMultiplicity (int m)
 Sets the multiplicity of this object to \(m\). More...
 
PrimeType getStatus () const
 Returns the PrimeType of this object. More...
 
void setStatus (PrimeType s)
 Sets the PrimeType of this object to \(s\). More...
 
LatticeTester::PrimeType isPrime (std::int64_t k)
 Tests whether this factor is prime. More...
 
std::string toString () const
 Returns this object as a string. More...
 

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. More...
 

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.

Constructor & Destructor Documentation

◆ IntFactor()

template<typename Int >
LatticeTester::IntFactor< Int >::IntFactor ( const Int &  x,
int  mult = 1,
PrimeType  stat = UNKNOWN 
)
inline

Constructor for a factor \(x\) of multiplicity mult that has a PrimeType stat

Member Function Documentation

◆ getFactor()

template<typename Int >
Int LatticeTester::IntFactor< Int >::getFactor ( ) const
inline

Returns the numeric value of this factor.

◆ getMultiplicity()

template<typename Int >
int LatticeTester::IntFactor< Int >::getMultiplicity ( ) const
inline

Returns the multiplicity of this object.

◆ getStatus()

template<typename Int >
PrimeType LatticeTester::IntFactor< Int >::getStatus ( ) const
inline

Returns the PrimeType of this object.

◆ 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.

◆ 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.

◆ setFactor()

template<typename Int >
void LatticeTester::IntFactor< Int >::setFactor ( const Int &  x)
inline

Sets the value of this factor to \(x\).

◆ setMultiplicity()

template<typename Int >
void LatticeTester::IntFactor< Int >::setMultiplicity ( int  m)
inline

Sets the multiplicity of this object to \(m\).

◆ setStatus()

template<typename Int >
void LatticeTester::IntFactor< Int >::setStatus ( PrimeType  s)
inline

Sets the PrimeType of this object to \(s\).

◆ toString() [1/2]

template<typename Int >
std::string LatticeTester::IntFactor< Int >::toString ( LatticeTester::PrimeType  stat)
inlinestatic

Transforms status stat in an easily readable string and returns it.

◆ toString() [2/2]

template<typename Int >
std::string LatticeTester::IntFactor< Int >::toString ( ) const

Returns this object as a string.


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