atlas
0.6
|
Stores a positive integer as product of prime powers, using the first PRIMES_MAX primes. More...
#include <Atlas.h>
Public Member Functions | |
SizeType () | |
SizeType (unsigned long) | |
C | operator[] (size_t j) const |
bool | operator== (const SizeType &c) const |
bool | operator!= (const SizeType &c) const |
unsigned long | piece (size_t) const |
unsigned long | toUlong () const |
C & | operator[] (size_t j) |
SizeType & | operator*= (const SizeType &) |
SizeType & | operator*= (unsigned long n) |
SizeType & | operator/= (const SizeType &) |
void | reset () |
void | twoShift (C n) |
Private Attributes | |
C | d_exp [PRIMES_MAX] |
Stores a positive integer as product of prime powers, using the first PRIMES_MAX primes.
The exponent of the jth prime is |d_exp[j]|. The reason for using this is that the software must occasionally deal with integers too large to be unsigned long; mostly these appear as cardinalities of Weyl groups. The constant |PRIMES_MAX| is chosen so that the cardinality of any Weyl group of rank at most RANK_MAX can be represented as a |SizeType|.
|
inline |
|
explicit |
|
inline |
SizeType< C > & atlas::size::SizeType< C >::operator*= | ( | const SizeType< C > & | a | ) |
NOTE: multiplication becomes addition in our logarithmic representation.
|
inline |
SizeType< C > & atlas::size::SizeType< C >::operator/= | ( | const SizeType< C > & | a | ) |
NOTE: division becomes subtraction in our logarithmic representation.
|
inline |
|
inline |
|
inline |
unsigned long atlas::size::SizeType< C >::piece | ( | size_t | k | ) | const |
Synopsis: return the unsigned long value of $prime(i)^{d_exp[i]}$
The algorithm is the classical algorithm with squarings and multiplications, logarithmic in i.
NOTE: in case of overflow, we simply return the value modulo $2^{longBits}$.
|
inline |
unsigned long atlas::size::SizeType< C >::toUlong | ( | ) | const |
Synopsis: returns the unsigned long value of *this.
NOTE: in case of overflow, we simply return the value modulo $2^{longBits}$.
|
inline |
|
private |