AlVin  1.0
A C++ implementation of the Vinberg's algorithm for Q, Q( sqrt(d) ) and Q( cos(2 pi / 7) )
Public Member Functions | Friends | List of all members
AlgebraicInteger Class Referenceabstract

Parent class for rational, quadratic and rc7 integers. More...

#include <algebraicinteger.h>

Inheritance diagram for AlgebraicInteger:
Inheritance graph
[legend]

Public Member Functions

virtual AlgebraicIntegeraiCopyToInteger (const int &n) const =0
 Create an algebraic integer from an integer. More...
 
virtual AlgebraicIntegercopy () 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 &)
 

Detailed Description

Parent class for rational, quadratic and rc7 integers.

Member Function Documentation

AlgebraicInteger::add ( const AlgebraicInteger ai)
pure virtual

Performs the addition of *this by the parameter.

Parameters
ai(const AlgebraicInteger* ) Pointer to the summand

Implemented in QuadraticIntegerBig, RCyclotomic7Integer, QuadraticInteger, and RationalInteger.

AlgebraicInteger::aiCopyToInteger ( const int &  n) const
pure virtual

Create an algebraic integer from an integer.

Parameters
n(const int ): Integer
Returns
Pointer to the algebraic integer created

Implemented in QuadraticIntegerBig, RCyclotomic7Integer, QuadraticInteger, and RationalInteger.

AlgebraicInteger::bIsDivisbleBy ( const AlgebraicInteger ai) const
pure virtual

Check whether *this is divisible by the parameter.

Parameters
ai(const AlgebraicInteger* ) Pointer to the divisor
Returns
True if *this is divisible by the parameter

Implemented in QuadraticIntegerBig, RCyclotomic7Integer, QuadraticInteger, and RationalInteger.

AlgebraicInteger::bIsInvertible ( ) const
pure virtual

Check whether the number is invertible.

Returns
True if invertible or not

Implemented in QuadraticIntegerBig, RCyclotomic7Integer, QuadraticInteger, and RationalInteger.

AlgebraicInteger::bIsSquareOfIvertible ( ) const
pure virtual

Check whether the number is the square of an invertible element.

Returns
True if invertible or not

Implemented in QuadraticIntegerBig, QuadraticInteger, RCyclotomic7Integer, and RationalInteger.

AlgebraicInteger::copy ( ) const
pure virtual

Create a copy of an algebraic integer.

Returns
Pointer to the algebraic integer created

Implemented in QuadraticIntegerBig, RCyclotomic7Integer, QuadraticInteger, and RationalInteger.

AlgebraicInteger::divideBy ( const AlgebraicInteger ai)
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!

Parameters
ai(const AlgebraicInteger* ) Pointer to the divisor

Implemented in QuadraticIntegerBig, RCyclotomic7Integer, QuadraticInteger, and RationalInteger.

AlgebraicInteger::gcd ( const AlgebraicInteger ai)
pure virtual

*this becomes the gcd of *this and the parameter

Parameters
ai(const AlgebraicInteger* ) The other algebraic integer

Implemented in QuadraticIntegerBig, RCyclotomic7Integer, QuadraticInteger, and RationalInteger.

AlgebraicInteger::multiplyBy ( const int &  n)
pure virtual

Performs the multiplication of *this by the parameter.

Parameters
ai(const AlgebraicInteger* ) Pointer to the multiplicand

Implemented in QuadraticIntegerBig, RCyclotomic7Integer, QuadraticInteger, and RationalInteger.

AlgebraicInteger::multiplyBy ( const AlgebraicInteger ai)
pure virtual

Performs the multiplication of *this by the parameter.

Parameters
ai(const AlgebraicInteger* ) Pointer to the multiplicand

Implemented in QuadraticIntegerBig, QuadraticInteger, RCyclotomic7Integer, and RationalInteger.

AlgebraicInteger::set ( const int &  n)
pure virtual

Assign an integer to the algebraic integer.

Parameters
n(const int& ) Integer

Implemented in QuadraticIntegerBig, QuadraticInteger, RCyclotomic7Integer, and RationalInteger.

AlgebraicInteger::set ( AlgebraicInteger ai)
pure virtual

Assign an algebraic integer to the algebraic integer.

Parameters
ai(AlgebraicInteger* ) Pointer to the algebraic integer

Implemented in QuadraticIntegerBig, QuadraticInteger, RCyclotomic7Integer, and RationalInteger.

AlgebraicInteger::substract ( const AlgebraicInteger ai)
pure virtual

Substracts the parameter from *this.

Parameters
ai(const AlgebraicInteger* ) Pointer to the subtrahend

Implemented in QuadraticIntegerBig, RCyclotomic7Integer, QuadraticInteger, and RationalInteger.

string AlgebraicInteger::to_string ( const string &  strFormat = "generic",
const bool &  bProtect = false 
) const
pure virtual

Convert to string.

Parameters
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.


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