LatMRG Online Documentation unknown
Tools to analyze the lattice structure of linear generators
|
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. |
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.
|
inline |
Constructs a factor \(x\) of multiplicity mult with given PrimeType status.
|
inline |
Returns the numerical value of this factor.
|
inline |
Sets the value of this factor to \(x\).
|
inline |
Returns the multiplicity of this factor.
|
inline |
Sets the multiplicity of this factor to \(m\).
|
inline |
Returns the PrimeType of this factor.
|
inline |
Sets the PrimeType of this factor to \(s\).
|
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.
PrimeType LatMRG::IntFactor< Int >::isPrime | ( | std::int64_t | k | ) |
Same as isPrime (y, k) with the current object in place of y.
|
static |
Applies the Miller-Rabin probability test to \(y\) with \(k\) trials.
|
inlinestatic |
Transforms the status status to a string and returns it.
std::string LatMRG::IntFactor< Int >::toString | ( | ) | const |
Returns a string that represents this object.