AlVin
1.0
A C++ implementation of the Vinberg's algorithm for Q, Q( sqrt(d) ) and Q( cos(2 pi / 7) )
|
Parent class for rational, quadratic and rc7 integers. More...
#include <algebraicinteger.h>
Public Member Functions | |
virtual AlgebraicInteger * | aiCopyToInteger (const int &n) const =0 |
Create an algebraic integer from an integer. More... | |
virtual AlgebraicInteger * | copy () const =0 |
Create a copy of an algebraic integer. More... | |
virtual void | set (const int &n)=0 |
Assign an integer to the algebraic integer. More... | |
virtual void | set (AlgebraicInteger *ai)=0 |
Assign an algebraic integer to the algebraic integer. More... | |
virtual void | removeSquareFactors ()=0 |
Remove all the square factors of the algebraic integer. | |
virtual bool | bIsInvertible () const =0 |
Check whether the number is invertible. More... | |
virtual bool | bIsSquareOfIvertible () const =0 |
Check whether the number is the square of an invertible element. More... | |
virtual void | gcd (const AlgebraicInteger *ai)=0 |
*this becomes the gcd of *this and the parameter More... | |
virtual bool | bIsDivisbleBy (const AlgebraicInteger *ai) const =0 |
Check whether *this is divisible by the parameter. More... | |
virtual void | divideBy (const AlgebraicInteger *ai)=0 |
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 void | multiplyBy (const int &n)=0 |
Performs the multiplication of *this by the parameter. More... | |
virtual void | multiplyBy (const AlgebraicInteger *ai)=0 |
Performs the multiplication of *this by the parameter. More... | |
virtual void | add (const AlgebraicInteger *ai)=0 |
Performs the addition of *this by the parameter. More... | |
virtual void | substract (const AlgebraicInteger *ai)=0 |
Substracts the parameter from *this. More... | |
virtual void | opp ()=0 |
Computes the opp. | |
virtual bool | bIsLessThan (const int &n) const =0 |
Check whether *this < n. | |
virtual bool | bIsLessThan (const AlgebraicInteger &ai) const =0 |
Check whether *this < ai. | |
virtual bool | bIsLessOEThan (const AlgebraicInteger &ai) const =0 |
Check whether *this <= ai. | |
virtual bool | bIsGreaterThan (const int &n) const =0 |
Check whether *this > n. | |
virtual bool | bIsGreaterOEThan (const int &n) const =0 |
Check whether *this >= n. | |
virtual bool | bIsEqualTo (const AlgebraicInteger &ai) const =0 |
Check whether *this == ai. | |
virtual bool | bIsEqualTo (const int &n) const =0 |
Check whether *this == n. | |
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. | |
virtual ostream & | print (ostream &) const |
Print the number. | |
virtual string | to_string (const string &strFormat="generic", const bool &bProtect=false) const =0 |
Convert to string. More... | |
virtual double | to_double () const =0 |
Convert to double (approximation) | |
virtual string | get_classname () const =0 |
Return the type (string) | |
Friends | |
ostream & | operator<< (ostream &, AlgebraicInteger const &) |
Parent class for rational, quadratic and rc7 integers.
|
pure virtual |
Performs the addition of *this by the parameter.
ai( | const AlgebraicInteger* ) Pointer to the summand |
Implemented in QuadraticIntegerBig, RCyclotomic7Integer, QuadraticInteger, and RationalInteger.
|
pure virtual |
Create an algebraic integer from an integer.
n( | const int ): Integer |
Implemented in QuadraticIntegerBig, RCyclotomic7Integer, QuadraticInteger, and RationalInteger.
|
pure virtual |
Check whether *this is divisible by the parameter.
ai( | const AlgebraicInteger* ) Pointer to the divisor |
Implemented in QuadraticIntegerBig, RCyclotomic7Integer, QuadraticInteger, and RationalInteger.
|
pure virtual |
Check whether the number is invertible.
Implemented in QuadraticIntegerBig, RCyclotomic7Integer, QuadraticInteger, and RationalInteger.
|
pure virtual |
Check whether the number is the square of an invertible element.
Implemented in QuadraticIntegerBig, QuadraticInteger, RCyclotomic7Integer, and RationalInteger.
|
pure virtual |
Create a copy of an algebraic integer.
Implemented in QuadraticIntegerBig, RCyclotomic7Integer, QuadraticInteger, and RationalInteger.
|
pure 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 |
Implemented in QuadraticIntegerBig, RCyclotomic7Integer, QuadraticInteger, and RationalInteger.
|
pure virtual |
*this becomes the gcd of *this and the parameter
ai( | const AlgebraicInteger* ) The other algebraic integer |
Implemented in QuadraticIntegerBig, RCyclotomic7Integer, QuadraticInteger, and RationalInteger.
|
pure virtual |
Performs the multiplication of *this by the parameter.
ai( | const AlgebraicInteger* ) Pointer to the multiplicand |
Implemented in QuadraticIntegerBig, RCyclotomic7Integer, QuadraticInteger, and RationalInteger.
|
pure virtual |
Performs the multiplication of *this by the parameter.
ai( | const AlgebraicInteger* ) Pointer to the multiplicand |
Implemented in QuadraticIntegerBig, QuadraticInteger, RCyclotomic7Integer, and RationalInteger.
|
pure virtual |
Assign an integer to the algebraic integer.
n( | const int& ) Integer |
Implemented in QuadraticIntegerBig, QuadraticInteger, RCyclotomic7Integer, and RationalInteger.
|
pure virtual |
Assign an algebraic integer to the algebraic integer.
ai( | AlgebraicInteger* ) Pointer to the algebraic integer |
Implemented in QuadraticIntegerBig, QuadraticInteger, RCyclotomic7Integer, and RationalInteger.
|
pure virtual |
Substracts the parameter from *this.
ai( | const AlgebraicInteger* ) Pointer to the subtrahend |
Implemented in QuadraticIntegerBig, RCyclotomic7Integer, QuadraticInteger, and RationalInteger.
|
pure 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) |
Implemented in QuadraticIntegerBig, RCyclotomic7Integer, QuadraticInteger, and RationalInteger.