LatMRG Online Documentation unknown
Tools to analyze the lattice structure of linear generators
Loading...
Searching...
No Matches
LatMRG::IntFactor< Int > Class Template Reference

An object of this class represents a factor in the decomposition of a positive integer. More...

Public Member Functions

 IntFactor (const Int &x, int64_t mult=1, PrimeType status=UNKNOWN)
 Constructs a factor \(x\) of multiplicity mult with given PrimeType status.
Int getFactor () const
 Returns the numerical value of this factor.
void setFactor (const Int &x)
 Sets the value of this factor to \(x\).
int64_t getMultiplicity () const
 Returns the multiplicity of this factor.
void setMultiplicity (int64_t m)
 Sets the multiplicity of this factor to \(m\).
PrimeType getStatus () const
 Returns the PrimeType of this factor.
void setStatus (PrimeType s)
 Sets the PrimeType of this factor to \(s\).
PrimeType isPrime (std::int64_t k)
 Same as isPrime (y, k) with the current object in place of y.
std::string toString () const
 Returns a string that represents this object.

Static Public Member Functions

static PrimeType isPrime (const Int &y, std::int64_t k)
 Tests whether \(y\) is prime or not.
static PrimeType isProbPrime (const Int &y, std::int64_t k)
 Applies the Miller-Rabin probability test to \(y\) with \(k\) trials.
static std::string toString (PrimeType status)
 Transforms the status status to a string and returns it.

Detailed Description

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

An object of this class represents a factor in the decomposition of a positive integer.

It is usually a prime factor, but not always. The class also contains very basic functions to test whether an integer is prime, probably prime, or composite.

Constructor & Destructor Documentation

◆ IntFactor()

template<typename Int>
LatMRG::IntFactor< Int >::IntFactor ( const Int & x,
int64_t mult = 1,
PrimeType status = UNKNOWN )
inline

Constructs a factor \(x\) of multiplicity mult with given PrimeType status.

Member Function Documentation

◆ getFactor()

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

Returns the numerical value of this factor.

◆ setFactor()

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

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

◆ getMultiplicity()

template<typename Int>
int64_t LatMRG::IntFactor< Int >::getMultiplicity ( ) const
inline

Returns the multiplicity of this factor.

◆ setMultiplicity()

template<typename Int>
void LatMRG::IntFactor< Int >::setMultiplicity ( int64_t m)
inline

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

◆ getStatus()

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

Returns the PrimeType of this factor.

◆ setStatus()

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

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

◆ isPrime() [1/2]

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

Tests whether \(y\) is prime or not.

First tests whether \(y\) is divisible by all small primes \(p\) ( \(p < 2^{16}\)) that are kept in file prime.dat. If no factor is found, the Miller-Rabin probability test from NTL is applied with \(k\) trials.

◆ isPrime() [2/2]

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

Same as isPrime (y, k) with the current object in place of y.

◆ isProbPrime()

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

Applies the Miller-Rabin probability test to \(y\) with \(k\) trials.

◆ toString() [1/2]

template<typename Int>
std::string LatMRG::IntFactor< Int >::toString ( PrimeType status)
inlinestatic

Transforms the status status to a string and returns it.

◆ toString() [2/2]

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

Returns a string that represents this object.


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