AlVin
1.0
A C++ implementation of the Vinberg's algorithm for Q, Q( sqrt(d) ) and Q( cos(2 pi / 7) )
|
Quadratic integers with bigint components. More...
#include <quadraticinteger_big.h>
Public Member Functions | |
QuadraticIntegerBig (const int &iVal) | |
QuadraticIntegerBig (const mpz_class &iVal) | |
QuadraticIntegerBig (const QuadraticIntegerBig &qi) | |
QuadraticIntegerBig (const QuadraticInteger &qi) | |
QuadraticIntegerBig (const int &a, const int &b) | |
QuadraticIntegerBig (const mpz_class &a, const mpz_class &b) | |
AlgebraicInteger * | copy () const |
Create a copy of an algebraic integer. More... | |
AlgebraicInteger * | aiCopyToInteger (const int &n) const |
Create an algebraic integer from an integer. More... | |
virtual void | set (const int &n) |
Assign an integer to the algebraic integer. More... | |
virtual void | set (AlgebraicInteger *ai) |
Assign an algebraic integer to the algebraic integer. More... | |
virtual void | removeSquareFactors () |
Remove all the square factors of the algebraic integer. | |
virtual bool | bIsInvertible () const |
Check whether the number is invertible. More... | |
virtual bool | bIsSquareOfIvertible () const |
Check whether the number is the square of an invertible element. More... | |
virtual void | gcd (const AlgebraicInteger *ai) |
*this becomes the gcd of *this and the parameter More... | |
virtual bool | bIsDivisbleBy (const AlgebraicInteger *) const |
Check whether *this is divisible by the parameter. More... | |
virtual void | divideBy (const AlgebraicInteger *ai) |
Performs the division of *this by the parameter Remark: we do not check that the *this is divisible by *ai. If it is not the case, the division will be an approximation! More... | |
virtual bool | divideByIfDivisible (const AlgebraicInteger *ai) |
virtual void | multiplyBy (const int &n) |
Performs the multiplication of *this by the parameter. More... | |
virtual void | multiplyBy (const AlgebraicInteger *ai) |
Performs the multiplication of *this by the parameter. More... | |
virtual void | add (const AlgebraicInteger *ai) |
Performs the addition of *this by the parameter. More... | |
virtual void | substract (const AlgebraicInteger *ai) |
Substracts the parameter from *this. More... | |
virtual void | opp () |
Computes the opp. | |
virtual bool | bIsLessThan (const int &n) const |
Check whether *this < n. | |
virtual bool | bIsLessThan (const long int &n) const |
virtual bool | bIsLessThan (const AlgebraicInteger &ai) const |
Check whether *this < ai. | |
virtual bool | bIsLessOEThan (const AlgebraicInteger &ai) const |
Check whether *this <= ai. | |
virtual bool | bIsGreaterThan (const int &n) const |
Check whether *this > n. | |
virtual bool | bIsGreaterThan (const long int &n) const |
virtual bool | bIsGreaterOEThan (const int &n) const |
Check whether *this >= n. | |
virtual bool | bIsEqualTo (const AlgebraicInteger &ai) const |
Check whether *this == ai. | |
virtual bool | bIsEqualTo (const int &n) const |
Check whether *this == n. | |
ostream & | print (ostream &) const |
Print the number. | |
virtual string | to_string (const string &strFormat="generic", const bool &bProtect=false) const |
Convert to string. More... | |
virtual double | to_double () const |
Convert to double (approximation) | |
virtual string | get_classname () const |
Return the type (string) | |
mpz_class | floor () const |
void | conjugate () |
mpz_class | iNorm () const |
mpz_class | iTrace () const |
int | iValuation (const QuadraticIntegerBig &qi) |
vector< QuadraticIntegerBig > | qiPrimeFactors () const |
map< QuadraticIntegerBig, unsigned int > | qiPrimeDecomposition () const |
bool | bIsAssociateTo (QuadraticIntegerBig qi2) |
QuadraticIntegerBig & | operator= (const QuadraticIntegerBig &) |
QuadraticIntegerBig & | operator/= (QuadraticIntegerBig const &qi) |
QuadraticIntegerBig & | operator*= (QuadraticIntegerBig const &qi) |
QuadraticIntegerBig | operator+ (const QuadraticIntegerBig &) const |
QuadraticIntegerBig | operator* (const QuadraticIntegerBig &) const |
QuadraticIntegerBig | operator- (const QuadraticIntegerBig &) const |
QuadraticIntegerBig | operator- () const |
bool | operator== (const long int &) const |
bool | operator== (const QuadraticIntegerBig &) const |
bool | operator> (const QuadraticIntegerBig &) const |
Public Member Functions inherited from AlgebraicInteger | |
bool | operator== (const AlgebraicInteger &ai) const |
Check whether *this == ai. | |
bool | operator!= (const int &n) const |
Check whether *this != n. | |
bool | operator!= (const AlgebraicInteger &ai) const |
Check whether *this != ai. | |
Static Public Member Functions | |
static bool | bIsDAdmissible (const unsigned int &d) |
static void | set_d (const unsigned int &d) |
static vector< QuadraticIntegerBig > | qiFactorsRationalPrime (const unsigned int &iPrime, bool bWithMultiplicities=false) |
static array< long int, 2 > | iPellEquation (const unsigned int &iPrime) |
static mpz_class | iSQRT_quotient (const QuadraticIntegerBig &qiNum, const QuadraticIntegerBig &qiDen) |
static mpz_class | iSQRTsup_quotient (const QuadraticIntegerBig &qiNum, const QuadraticIntegerBig &qiDen) |
Public Attributes | |
mpz_class | a |
First component of the quadratic integer (in the usual Z-basis) | |
mpz_class | b |
Second component of the quadratic integer (in the usual Z-basis) | |
Static Public Attributes | |
static int | d = 0 |
We work in Q[ sqrt d ]. | |
static mpf_class | sqrtd = 0 |
Square root of d. | |
static bool | bIsOneMod4 = false |
True if d is 1 mod 4, false otherwise. | |
static int | iDiscriminant = 0 |
Discriminant of the quadratic field. | |
static map< unsigned int, vector< unsigned int > > | iPellMinimalSolution |
Solutions for the Pell equations (used to compute the decompositions of rational prime numbers) | |
static map< unsigned int, vector< long int > > | iFundamentalUnits |
Fundamental units. | |
Quadratic integers with bigint components.
|
virtual |
Performs the addition of *this by the parameter.
ai( | const AlgebraicInteger* ) Pointer to the summand |
Implements AlgebraicInteger.
|
virtual |
Create an algebraic integer from an integer.
n( | const int ): Integer |
Implements AlgebraicInteger.
|
virtual |
Check whether *this is divisible by the parameter.
ai( | const AlgebraicInteger* ) Pointer to the divisor |
Implements AlgebraicInteger.
|
virtual |
Check whether the number is invertible.
Implements AlgebraicInteger.
|
virtual |
Check whether the number is the square of an invertible element.
Implements AlgebraicInteger.
|
virtual |
Create a copy of an algebraic integer.
Implements AlgebraicInteger.
|
virtual |
Performs the division of *this by the parameter Remark: we do not check that the *this is divisible by *ai. If it is not the case, the division will be an approximation!
ai( | const AlgebraicInteger* ) Pointer to the divisor |
Implements AlgebraicInteger.
|
virtual |
*this becomes the gcd of *this and the parameter
ai( | const AlgebraicInteger* ) The other algebraic integer |
Implements AlgebraicInteger.
|
virtual |
Performs the multiplication of *this by the parameter.
ai( | const AlgebraicInteger* ) Pointer to the multiplicand |
Implements AlgebraicInteger.
|
virtual |
Performs the multiplication of *this by the parameter.
ai( | const AlgebraicInteger* ) Pointer to the multiplicand |
Implements AlgebraicInteger.
|
virtual |
Assign an integer to the algebraic integer.
n( | const int& ) Integer |
Implements AlgebraicInteger.
|
virtual |
Assign an algebraic integer to the algebraic integer.
ai( | AlgebraicInteger* ) Pointer to the algebraic integer |
Implements AlgebraicInteger.
|
virtual |
Substracts the parameter from *this.
ai( | const AlgebraicInteger* ) Pointer to the subtrahend |
Implements AlgebraicInteger.
|
virtual |
Convert to string.
strFormat( | const string& ): Format for the output; can be: generic, mathematica, pari, latex |
bProtect( | const bool& ): If true, avoid certain characters (for example if the string is used in for a file name) |
Implements AlgebraicInteger.