plll  1.0
plll::arithmetic Namespace Reference

Contains the arithmetic backend of plll. More...

Namespaces

 expressions
 Expression templates.
 

Classes

struct  binary_operation
 Provides information on the result of a binary arithmetic operation. More...
 
class  HexStringContext
 An "arithmetic" context for hexadecimal (base 16) conversions to std::strings. More...
 
class  Integer
 Represents an arbitrary precision integer. More...
 
class  IntegerContext
 Represents an arithmetic context for arbitrary precision integer. More...
 
class  NInt
 Represents a native integer. More...
 
class  NIntContext
 Represents an arithmetic context for native integers. More...
 
class  OctalStringContext
 An "arithmetic" context for octal (base 8) conversions to std::strings. More...
 
class  RandomNumberGenerator
 Represents a random number generator. More...
 
class  Rational
 Represents a rational number as a quotient of two arbitrary precision integers. More...
 
class  RationalContext
 Represents an arithmetic context for rational numbers. More...
 
class  Real
 Represents an arbitrary precision floating point value. More...
 
class  RealContext
 Represents an arithmetic context for arbitrary precision floating point values. More...
 
class  StringContext
 An "arithmetic" context for conversions to std::strings. More...
 
struct  unary_operation
 Provides information on the result of an unary arithmetic operation. More...
 

Functions

RealContextgetThreadRealContext ()
 Retrieves a context for the current thread. The context is thread local and cannot be accessed by this method from other threads.
 
void initArithmeticThreadAllocators ()
 Initializes the local thread allocator for the current thread, and sets the GMP and MPFR allocators to the local thread allocator. More...
 
Operators.
expressions::Expression
< IntegerContext,
expressions::Wrapper
< IntegerContext >
, expressions::NegOp
operator- (const Integer &a)
 Negates the integer. More...
 
expressions::Expression
< IntegerContext,
expressions::Wrapper
< IntegerContext >
, expressions::BitInvOp
operator~ (const Integer &a)
 Bitwise negates the integer. More...
 
expressions::Expression
< IntegerContext, std::pair
< expressions::Wrapper
< IntegerContext >
, expressions::Wrapper
< IntegerContext >
>, expressions::AddOp
operator+ (const Integer &a, const Integer &b)
 Adds the two integers and returns the result. More...
 
expressions::Expression
< IntegerContext, std::pair
< expressions::Wrapper
< IntegerContext >
, expressions::Wrapper
< IntegerContext >
>, expressions::SubOp
operator- (const Integer &a, const Integer &b)
 Subtracts the second from the first integer and returns the result. More...
 
expressions::Expression
< IntegerContext, std::pair
< expressions::Wrapper
< IntegerContext >
, expressions::Wrapper
< IntegerContext >
>, expressions::MulOp
operator* (const Integer &a, const Integer &b)
 Multiplies the two integers and returns the result. More...
 
expressions::Expression
< IntegerContext, std::pair
< expressions::Wrapper
< IntegerContext >
, expressions::Wrapper
< IntegerContext >
>, expressions::DivOp
operator/ (const Integer &a, const Integer &b)
 Divides the first by the second integer and returns the result. More...
 
expressions::Expression
< IntegerContext, std::pair
< expressions::Wrapper
< IntegerContext >
, expressions::Wrapper
< IntegerContext >
>, expressions::ModOp
operator% (const Integer &a, const Integer &b)
 Divides the first by the second integer and returns the remainder. More...
 
expressions::Expression
< IntegerContext, std::pair
< expressions::Wrapper
< IntegerContext >
, expressions::Wrapper
< IntegerContext >
>, expressions::AndOp
operator& (const Integer &a, const Integer &b)
 Computes the bitwise and of the two integers and returns the result. More...
 
expressions::Expression
< IntegerContext, std::pair
< expressions::Wrapper
< IntegerContext >
, expressions::Wrapper
< IntegerContext >
>, expressions::OrOp
operator| (const Integer &a, const Integer &b)
 Computes the bitwise or of the two integers and returns the result. More...
 
expressions::Expression
< IntegerContext, std::pair
< expressions::Wrapper
< IntegerContext >
, expressions::Wrapper
< IntegerContext >
>, expressions::XOROp
operator^ (const Integer &a, const Integer &b)
 Computes the bitwise exclusive or of the two integers and returns the result. More...
 
expressions::Expression
< IntegerContext, std::pair
< expressions::Wrapper
< IntegerContext >
, expressions::Wrapper
< IntegerContext >
>, expressions::ShLOp
operator<< (const Integer &a, const Integer &b)
 Computes the bitwise left shift of the first integer by the number of bits given by the second integer, and returns the result. More...
 
expressions::Expression
< IntegerContext, std::pair
< expressions::Wrapper
< IntegerContext >
, expressions::Wrapper
< IntegerContext >
>, expressions::ShROp
operator>> (const Integer &a, const Integer &b)
 Computes the bitwise right shift of the first integer by the number of bits given by the second integer, and returns the result. More...
 
expressions::Expression
< IntegerContext,
expressions::Wrapper
< IntegerContext >
, expressions::ShiftCOp
operator<< (const Integer &a, signed long b)
 Computes the bitwise left shift of the first integer by the number of bits given by the second integer, and returns the result. More...
 
expressions::Expression
< IntegerContext,
expressions::Wrapper
< IntegerContext >
, expressions::ShiftCOp
operator>> (const Integer &a, signed long b)
 Computes the bitwise right shift of the first integer by the number of bits given by the second integer, and returns the result. More...
 
Integer operator++ (Integer &cur, int)
 Increments the integer by one and returns the previous value. More...
 
Integer operator-- (Integer &cur, int)
 Decrements the integer by one and returns the previous value. More...
 
Integeroperator++ (Integer &cur)
 Increments the integer by one and returns the new value. More...
 
Integeroperator-- (Integer &cur)
 Decreases the integer by one and returns the new value. More...
 
expressions::Expression
< IntegerContext,
expressions::Wrapper
< IntegerContext >
, expressions::AbsOp
abs (const Integer &i)
 Computes and returns the absolute value of i. More...
 
expressions::Expression
< IntegerContext,
expressions::Wrapper
< IntegerContext >
, expressions::SquareOp
square (const Integer &i)
 Computes and returns the square of i. More...
 
expressions::Expression
< RealContext,
expressions::Wrapper
< RealContext >
, expressions::NegOp
operator- (const Real &a)
 Negates the floating point number. More...
 
expressions::Expression
< RealContext, std::pair
< expressions::Wrapper
< RealContext >
, expressions::Wrapper
< RealContext >
>, expressions::AddOp
operator+ (const Real &a, const Real &b)
 Adds the two floating point numbers and returns the result. More...
 
expressions::Expression
< RealContext, std::pair
< expressions::Wrapper
< RealContext >
, expressions::Wrapper
< RealContext >
>, expressions::SubOp
operator- (const Real &a, const Real &b)
 Subtracts the second from the first floating point number and returns the result. More...
 
expressions::Expression
< RealContext, std::pair
< expressions::Wrapper
< RealContext >
, expressions::Wrapper
< RealContext >
>, expressions::MulOp
operator* (const Real &a, const Real &b)
 Multiplies the two floating point numbers and returns the result. More...
 
expressions::Expression
< RealContext, std::pair
< expressions::Wrapper
< RealContext >
, expressions::Wrapper
< RealContext >
>, expressions::DivOp
operator/ (const Real &a, const Real &b)
 Divides the first by the second floating point number and returns the result. More...
 
expressions::Expression
< RealContext, std::pair
< expressions::Wrapper
< RealContext >
, expressions::Wrapper
< RealContext >
>, expressions::ModOp
operator% (const Real &a, const Real &b)
 Divides the first by the second floating point number and returns the remainder. More...
 
expressions::Expression
< RealContext, std::pair
< expressions::Wrapper
< RealContext >
, expressions::Wrapper
< RealContext >
>, expressions::ShLOp
operator<< (const Real &a, const Real &b)
 Multiplies a with 2 to the power of b and returns the result. More...
 
expressions::Expression
< RealContext, std::pair
< expressions::Wrapper
< RealContext >
, expressions::Wrapper
< RealContext >
>, expressions::ShROp
operator>> (const Real &a, const Real &b)
 Divides a by 2 to the power of b and returns the result. More...
 
expressions::Expression
< RealContext,
expressions::Wrapper
< RealContext >
, expressions::ShiftCOp
operator<< (const Real &a, signed long b)
 Multiplies a with 2 to the power of b and returns the result. More...
 
expressions::Expression
< RealContext,
expressions::Wrapper
< RealContext >
, expressions::ShiftCOp
operator>> (const Real &a, signed long b)
 Divides a by 2 to the power of b and returns the result. More...
 
Real operator++ (Real &cur, int)
 Increments cur by one and returns the previous value. More...
 
Real operator-- (Real &cur, int)
 Decrements cur by one and returns the previous value. More...
 
Realoperator++ (Real &cur)
 Increments cur by one and returns the new value. More...
 
Realoperator-- (Real &cur)
 Decrements cur by one and returns the new value. More...
 
expressions::Expression
< RealContext,
expressions::Wrapper
< RealContext >
, expressions::AbsOp
abs (const Real &i)
 Returns the absolute value of the given floating point number. More...
 
expressions::Expression
< RealContext,
expressions::Wrapper
< RealContext >
, expressions::SquareOp
square (const Real &i)
 Returns the square of the given floating point number. More...
 
expressions::Expression
< RealContext,
expressions::Wrapper
< RealContext >
, expressions::AbsOp_Context
abs (const Real &i, const RealContext &rc)
 Returns the absolute value of the given floating point number. More...
 
expressions::Expression
< RealContext,
expressions::Wrapper
< RealContext >
, expressions::SquareOp_Context
square (const Real &i, const RealContext &rc)
 Returns the square of the given floating point number. More...
 
template<typename Type >
NInt< Type > operator- (const NInt< Type > &a) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Negates the integer. More...
 
template<typename Type >
NInt< Type > operator+ (const NInt< Type > &a, const NInt< Type > &b) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Adds the two integers and returns the result. More...
 
template<typename Type >
NInt< Type > operator- (const NInt< Type > &a, const NInt< Type > &b) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Subtracts the second from the first integer and returns the result. More...
 
template<typename Type >
NInt< Type > operator* (const NInt< Type > &a, const NInt< Type > &b) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Multiplies the two integers and returns the result. More...
 
template<typename Type >
NInt< Type > operator/ (const NInt< Type > &a, const NInt< Type > &b) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Divides the first by the second integer and returns the result. More...
 
template<typename Type >
NInt< Type > operator% (const NInt< Type > &a, const NInt< Type > &b) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Divides the first by the second integer and returns the remainder. More...
 
template<typename Type >
NInt< Type > operator<< (const NInt< Type > &a, long b) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Computes the bitwise left shift of the first integer by the number of bits given by the second integer, and returns the result. More...
 
template<typename Type >
NInt< Type > operator>> (const NInt< Type > &a, long b) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Computes the bitwise right shift of the first integer by the number of bits given by the second integer, and returns the result. More...
 
template<typename Type >
NInt< Type > operator<< (const NInt< Type > &a, const NInt< Type > &b) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Computes the bitwise left shift of the first integer by the number of bits given by the second integer, and returns the result. More...
 
template<typename Type >
NInt< Type > operator>> (const NInt< Type > &a, const NInt< Type > &b) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Computes the bitwise right shift of the first integer by the number of bits given by the second integer, and returns the result. More...
 
template<typename Type >
NInt< Type > operator++ (NInt< Type > &cur, int) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Increments the integer by one and returns the previous value. More...
 
template<typename Type >
NInt< Type > operator-- (NInt< Type > &cur, int) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Decrements the integer by one and returns the previous value. More...
 
template<typename Type >
NInt< Type > & operator++ (NInt< Type > &cur) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Increments the integer by one and returns the new value. More...
 
template<typename Type >
NInt< Type > & operator-- (NInt< Type > &cur) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Decreases the integer by one and returns the new value. More...
 
template<typename Type >
NInt< Type > abs (const NInt< Type > &i) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Computes and returns the absolute value of i. More...
 
template<typename Type >
NInt< Type > square (const NInt< Type > &i) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Computes and returns the square of i. More...
 
Rational operator++ (Rational &cur, int)
 Increments this rational number by one and returns the previous value. More...
 
Rational operator-- (Rational &cur, int)
 Decrements this rational number by one and returns the previous value. More...
 
Rationaloperator++ (Rational &cur)
 Increments this rational number by one and returns the new value. More...
 
Rationaloperator-- (Rational &cur)
 Decrements this rational number by one and returns the new value. More...
 
expressions::Expression
< RationalContext,
expressions::Wrapper
< RationalContext >
, expressions::NegOp
operator- (const Rational &a)
 Negates this rational number. More...
 
expressions::Expression
< RationalContext, std::pair
< expressions::Wrapper
< RationalContext >
, expressions::Wrapper
< RationalContext >
>, expressions::AddOp
operator+ (const Rational &a, const Rational &b)
 Adds the argument to this rational number and returns the result. More...
 
expressions::Expression
< RationalContext, std::pair
< expressions::Wrapper
< RationalContext >
, expressions::Wrapper
< RationalContext >
>, expressions::SubOp
operator- (const Rational &a, const Rational &b)
 Subtracts the argument from this rational number and returns the result. More...
 
expressions::Expression
< RationalContext, std::pair
< expressions::Wrapper
< RationalContext >
, expressions::Wrapper
< RationalContext >
>, expressions::MulOp
operator* (const Rational &a, const Rational &b)
 Multiplies the argument with this rational number and returns the result. More...
 
expressions::Expression
< RationalContext, std::pair
< expressions::Wrapper
< RationalContext >
, expressions::Wrapper
< RationalContext >
>, expressions::DivOp
operator/ (const Rational &a, const Rational &b)
 Divides this rational number by the argument and returns the result. More...
 
expressions::Expression
< RationalContext, std::pair
< expressions::Wrapper
< RationalContext >
, expressions::Wrapper
< RationalContext >
>, expressions::ModOp
operator% (const Rational &a, const Rational &b)
 Returns the remainder of this rational number divided by the by the argument. More...
 
expressions::Expression
< RationalContext,
expressions::Wrapper
< RationalContext >
, expressions::ShiftCOp
operator<< (const Rational &a, signed long b)
 Multiplies this rational number with 2 to the power of b and returns the result. More...
 
expressions::Expression
< RationalContext,
expressions::Wrapper
< RationalContext >
, expressions::ShiftCOp
operator>> (const Rational &a, signed long b)
 Divides this rational number by 2 to the power of b and returns the result. More...
 
expressions::Expression
< RationalContext,
expressions::Wrapper
< RationalContext >
, expressions::AbsOp
abs (const Rational &i)
 Returns the absolute value of the given rational number. More...
 
expressions::Expression
< RationalContext,
expressions::Wrapper
< RationalContext >
, expressions::SquareOp
square (const Rational &i)
 Returns the square of the given rational number. More...
 
expressions::Expression
< RationalContext,
expressions::Wrapper
< RationalContext >
, expressions::AbsOp
abs (const Rational &i, const RationalContext &rc)
 Returns the absolute value of the given rational number. More...
 
expressions::Expression
< RationalContext,
expressions::Wrapper
< RationalContext >
, expressions::SquareOp
square (const Rational &i, const RationalContext &rc)
 Returns the square of the given rational number. More...
 
Assignment-operation operators.
template<class D >
Integeroperator-= (Integer &cur, const expressions::Expression< IntegerContext, D, expressions::MulOp > &E)
 Subtracts the multiplication expression E from cur. More...
 
Integeroperator-= (Integer &cur, const Integer &i)
 Subtracts the integer i from cur. More...
 
template<class D >
Integeroperator+= (Integer &cur, const expressions::Expression< IntegerContext, D, expressions::MulOp > &E)
 Adds the given multiplication expression to cur. More...
 
Integeroperator+= (Integer &cur, const Integer &i)
 Adds the integer i to cur. More...
 
Integeroperator*= (Integer &cur, const Integer &i)
 Multiplies the given integer i with cur. More...
 
Integeroperator/= (Integer &cur, const Integer &i)
 Divides cur by the given integer i. More...
 
Integeroperator%= (Integer &cur, const Integer &i)
 Divides cur by the given integer i and stores the remainder in cur. More...
 
Integeroperator|= (Integer &cur, const Integer &i)
 Computes the bitwise or of cur with i and stores the result in cur. More...
 
Integeroperator&= (Integer &cur, const Integer &i)
 Computes the bitwise and of cur with i and stores the result in cur. More...
 
Integeroperator^= (Integer &cur, const Integer &i)
 Computes the bitwise exclusive or of cur with i and stores the result in cur. More...
 
Integeroperator<<= (Integer &cur, const Integer &i)
 Computes the bitwise left shift of cur by i bits, and stores the result in cur. More...
 
Integeroperator>>= (Integer &cur, const Integer &i)
 Computes the bitwise right shift of cur by i bits, and stores the result in cur. More...
 
Integeroperator<<= (Integer &cur, long i)
 Computes the bitwise left shift of cur by i bits, and stores the result in cur. More...
 
Integeroperator>>= (Integer &cur, long i)
 Computes the bitwise right shift of cur by i bits, and stores the result in cur. More...
 
Realoperator-= (Real &cur, const Real &r)
 Subtracts the floating point number r from cur. More...
 
template<class D >
Realoperator-= (Real &cur, const expressions::Expression< RealContext, D, expressions::MulOp > &E)
 Subtracts the multiplication expression E from cur. More...
 
Realoperator+= (Real &cur, const Real &r)
 Adds the floating point number r to cur. More...
 
template<class D >
Realoperator+= (Real &cur, const expressions::Expression< RealContext, D, expressions::MulOp > &E)
 Adds the given multiplication expression to cur. More...
 
Realoperator*= (Real &cur, const Real &r)
 Multiplies the given floating point number r with cur. More...
 
Realoperator/= (Real &cur, const Real &r)
 Divides cur by the given floating point number r. More...
 
Realoperator%= (Real &cur, const Real &r)
 Divides cur by the given floating point number r and stores the remainder in cur. More...
 
Realoperator<<= (Real &cur, const Real &r)
 Multiplies cur by 2 to the power of r. More...
 
Realoperator>>= (Real &cur, const Real &r)
 Divides cur by 2 to the power of r. More...
 
Realoperator<<= (Real &cur, long r)
 Multiplies cur by 2 to the power of r. More...
 
Realoperator>>= (Real &cur, long r)
 Divides cur by 2 to the power of r. More...
 
template<typename Type >
NInt< Type > & operator-= (NInt< Type > &cur, const NInt< Type > &i) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Subtracts the integer i from cur. More...
 
template<typename Type >
NInt< Type > & operator+= (NInt< Type > &cur, const NInt< Type > &i) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Adds the integer i to cur. More...
 
template<typename Type >
NInt< Type > & operator*= (NInt< Type > &cur, const NInt< Type > &i) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Multiplies the given integer i with cur. More...
 
template<typename Type >
NInt< Type > & operator/= (NInt< Type > &cur, const NInt< Type > &i) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Divides cur by the given integer i. More...
 
template<typename Type >
NInt< Type > & operator%= (NInt< Type > &cur, const NInt< Type > &i) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Divides cur by the given integer i and stores the remainder in cur. More...
 
template<typename Type >
NInt< Type > & operator<<= (NInt< Type > &cur, long i) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Computes the bitwise left shift of cur by i bits, and stores the result in cur. More...
 
template<typename Type >
NInt< Type > & operator>>= (NInt< Type > &cur, long i) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Computes the bitwise right shift of cur by i bits, and stores the result in cur. More...
 
template<typename Type >
NInt< Type > & operator<<= (NInt< Type > &cur, const NInt< Type > &i) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Computes the bitwise left shift of cur by i bits, and stores the result in cur. More...
 
template<typename Type >
NInt< Type > & operator>>= (NInt< Type > &cur, const NInt< Type > &i) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Computes the bitwise right shift of cur by i bits, and stores the result in cur. More...
 
Rationaloperator-= (Rational &cur, const Rational &r)
 Subtracts the given rational number r from this rational number. More...
 
template<class D >
Rationaloperator-= (Rational &cur, const expressions::Expression< RationalContext, D, expressions::MulOp > &E)
 Subtracts the given multiplication expression from this rational number. More...
 
Rationaloperator+= (Rational &cur, const Rational &r)
 Adds the given rational number r to this rational number. More...
 
template<class D >
Rationaloperator+= (Rational &cur, const expressions::Expression< RationalContext, D, expressions::MulOp > &E)
 Adds the given multiplication expression to this rational number. More...
 
Rationaloperator*= (Rational &cur, const Rational &r)
 Multiplies the given rational number r with this rational number. More...
 
Rationaloperator/= (Rational &cur, const Rational &r)
 Divides this rational number by the given rational number r. More...
 
Rationaloperator%= (Rational &cur, const Rational &r)
 Divides this rational number by the given rational number r and stores the remainder in this rational number. More...
 
Rationaloperator<<= (Rational &cur, long r)
 Multiplies this rational number by 2 to the power of r. More...
 
Rationaloperator>>= (Rational &cur, long r)
 Divides this rational number by 2 to the power of r. More...
 
Comparisons.
bool operator== (const Integer &a, const Integer &b)
 Compares the current integer with the given one for equality. More...
 
bool operator!= (const Integer &a, const Integer &b)
 Compares the current integer with the given one for inequality. More...
 
bool operator<= (const Integer &a, const Integer &b)
 Compares the current integer with the given one. More...
 
bool operator>= (const Integer &a, const Integer &b)
 Compares the current integer with the given one. More...
 
bool operator< (const Integer &a, const Integer &b)
 Compares the current integer with the given one. More...
 
bool operator> (const Integer &a, const Integer &b)
 Compares the current integer with the given one. More...
 
bool operator== (const Real &a, const Real &b)
 Compares the two floating point numbers a and b for equality. More...
 
bool operator!= (const Real &a, const Real &b)
 Compares the two floating point numbers a and b for inequality. More...
 
bool operator<= (const Real &a, const Real &b)
 Compares the two floating point numbers a and b. More...
 
bool operator>= (const Real &a, const Real &b)
 Compares the two floating point numbers a and b. More...
 
bool operator< (const Real &a, const Real &b)
 Compares the two floating point numbers a and b. More...
 
bool operator> (const Real &a, const Real &b)
 Compares the two floating point numbers a and b. More...
 
int compare (const Integer &a, const Integer &b)
 Compares the two integers. More...
 
int compare (const Real &a, const Real &b)
 Compares the two floating point numbers. More...
 
int compareAbsValues (const Integer &a, const Integer &b)
 Compares the two integers in absolute value. More...
 
int compareAbsValues (const Real &a, const Real &b)
 Compares the two floating point numbers in absolute value. More...
 
template<typename Type >
bool operator== (const NInt< Type > &a, const NInt< Type > &b) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Compares the current integer with the given one for equality. More...
 
template<typename Type >
bool operator!= (const NInt< Type > &a, const NInt< Type > &b) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Compares the current integer with the given one for inequality. More...
 
template<typename Type >
bool operator<= (const NInt< Type > &a, const NInt< Type > &b) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Compares the current integer with the given one. More...
 
template<typename Type >
bool operator>= (const NInt< Type > &a, const NInt< Type > &b) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Compares the current integer with the given one. More...
 
template<typename Type >
bool operator< (const NInt< Type > &a, const NInt< Type > &b) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Compares the current integer with the given one. More...
 
template<typename Type >
bool operator> (const NInt< Type > &a, const NInt< Type > &b) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Compares the current integer with the given one. More...
 
template<typename Type >
int compare (const NInt< Type > &, const NInt< Type > &) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Compares the two integers. More...
 
template<typename Type >
int compareAbsValues (const NInt< Type > &, const NInt< Type > &) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Compares the two integers in absolute value. More...
 
bool operator== (const Rational &a, const Rational &b)
 Compares the two rational numbers a and b for equality. More...
 
bool operator!= (const Rational &a, const Rational &b)
 Compares the two rational numbers a and b for inequality. More...
 
bool operator<= (const Rational &a, const Rational &b)
 Compares the two rational numbers a and b. More...
 
bool operator>= (const Rational &a, const Rational &b)
 Compares the two rational numbers a and b. More...
 
bool operator< (const Rational &a, const Rational &b)
 Compares the two rational numbers a and b. More...
 
bool operator> (const Rational &a, const Rational &b)
 Compares the two rational numbers a and b. More...
 
int compare (const Rational &a, const Rational &b)
 Compares the two rational numbers. More...
 
int compareAbsValues (const Rational &a, const Rational &b)
 Compares the two rational numbers in absolute value. More...
 
Integer approximation.
expressions::Expression
< IntegerContext,
expressions::Wrapper
< IntegerContext >
, expressions::SqrtCeilOp
sqrtCeil (const Integer &i)
 Computes and returns the ceil of the square root of i. More...
 
expressions::Expression
< IntegerContext,
expressions::Wrapper
< IntegerContext >
, expressions::SqrtFloorOp
sqrtFloor (const Integer &i)
 Computes and returns the floor of the square root of i. More...
 
expressions::Expression
< IntegerContext, std::pair
< expressions::Wrapper
< IntegerContext >
, expressions::Wrapper
< IntegerContext >
>, expressions::FloorDivOp
floorDiv (const Integer &a, const Integer &b)
 Computes and returns $\lfloor \tfrac{a}{b} \rfloor$. More...
 
expressions::Expression
< IntegerContext, std::pair
< expressions::Wrapper
< IntegerContext >
, expressions::Wrapper
< IntegerContext >
>, expressions::CeilDivOp
ceilDiv (const Integer &a, const Integer &b)
 Computes and returns $\lceil \tfrac{a}{b} \rceil$. More...
 
expressions::Expression
< IntegerContext, std::pair
< expressions::Wrapper
< IntegerContext >
, expressions::Wrapper
< IntegerContext >
>, expressions::RoundDivOp
roundDiv (const Integer &a, const Integer &b)
 Computes and returns $\lfloor \tfrac{a}{b} \rceil$. More...
 
void sqrtCeil (Integer &r, const Integer &a)
 Computes $\lceil\sqrt{a}\rceil$ and stores the result in r. More...
 
void sqrtFloor (Integer &r, const Integer &a)
 Computes $\lfloor\sqrt{a}\rfloor$ and stores the result in r. More...
 
long approxLog2 (const Integer &x) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Quickly approximates $\log_2 |x|$ and returns the approximation. More...
 
long ceilOfLog2 (const Integer &x) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Computes and returns $\lceil \log_2 |x| \rceil$. More...
 
long floorOfLog2 (const Integer &x) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Computes and returns $\lfloor \log_2 |x| \rfloor$. More...
 
long bitLength (const Integer &x) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Computes and returns n such that $2^{n-1} \le |x| < 2^n$. More...
 
void floorDiv (Integer &r, const Integer &a, const Integer &b)
 Computes $\lfloor \tfrac{a}{b} \rfloor$ and stores the result in r. More...
 
void ceilDiv (Integer &r, const Integer &a, const Integer &b)
 Computes $\lceil \tfrac{a}{b} \rceil$ and stores the result in r. More...
 
void roundDiv (Integer &r, const Integer &a, const Integer &b)
 Computes $\lfloor \tfrac{a}{b} \rceil$ (rounding to the next integer) and stores the result in r. More...
 
template<typename Type >
void sqrtCeil (NInt< Type > &r, const NInt< Type > &a) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Computes $\lceil\sqrt{a}\rceil$ and stores the result in r. More...
 
template<typename Type >
NInt< Type > sqrtCeil (const NInt< Type > &a) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Computes and returns $\lceil\sqrt{a}\rceil$. More...
 
template<typename Type >
void sqrtFloor (NInt< Type > &r, const NInt< Type > &a) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Computes $\lfloor\sqrt{a}\rfloor$ and stores the result in r. More...
 
template<typename Type >
NInt< Type > sqrtFloor (const NInt< Type > &a) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Computes and returns $\lfloor\sqrt{a}\rfloor$. More...
 
template<typename Type >
long ceilOfLog2 (const NInt< Type > &x) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Computes and returns $\lceil \log_2 |x| \rceil$. More...
 
template<typename Type >
long floorOfLog2 (const NInt< Type > &x) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Computes and returns $\lfloor \log_2 |x| \rfloor$. More...
 
template<typename Type >
long approxLog2 (const NInt< Type > &x) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Quickly approximates $\log_2 |x|$ and returns the approximation. More...
 
template<typename Type >
long bitLength (const NInt< Type > &x) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Computes and returns n such that $2^{n-1} \le |x| < 2^n$. More...
 
template<typename Type >
void floorDiv (NInt< Type > &r, const NInt< Type > &a, const NInt< Type > &b) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Computes $\lfloor \tfrac{a}{b} \rfloor$ and stores the result in r. More...
 
template<typename Type >
NInt< Type > floorDiv (const NInt< Type > &a, const NInt< Type > &b) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Computes and returns $\lfloor \tfrac{a}{b} \rfloor$. More...
 
template<typename Type >
void ceilDiv (NInt< Type > &r, const NInt< Type > &a, const NInt< Type > &b) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Computes $\lceil \tfrac{a}{b} \rceil$ and stores the result in r. More...
 
template<typename Type >
NInt< Type > ceilDiv (const NInt< Type > &a, const NInt< Type > &b) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Computes and returns $\lceil \tfrac{a}{b} \rceil$. More...
 
template<typename Type >
void roundDiv (NInt< Type > &r, const NInt< Type > &a, const NInt< Type > &b) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Computes $\lfloor \tfrac{a}{b} \rceil$ (rounding to the next integer) and stores the result in r. More...
 
template<typename Type >
NInt< Type > roundDiv (const NInt< Type > &a, const NInt< Type > &b) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Computes and returns $\lfloor \tfrac{a}{b} \rceil$ (rounding to the next integer). More...
 
Euclidean ring functions.
expressions::Expression
< IntegerContext, std::pair
< expressions::Wrapper
< IntegerContext >
, expressions::Wrapper
< IntegerContext >
>, expressions::GCDOp
GCD (const Integer &a, const Integer &b)
 Computes and returns the non-negative Greatest Common Divisor of a and b. More...
 
expressions::Expression
< IntegerContext, std::pair
< expressions::Wrapper
< IntegerContext >
, expressions::Wrapper
< IntegerContext >
>, expressions::LCMOp
LCM (const Integer &a, const Integer &b)
 Computes and returns the non-negative Least Common Multiple of a and b. More...
 
void euclideanDivision (Integer &q, Integer &r, const Integer &a, const Integer &b)
 Computes an Euclidean Division of a by b. More...
 
void euclideanDivisionPos (Integer &q, Integer &r, const Integer &a, const Integer &b)
 Computes an Euclidean Division of a by b. More...
 
void GCD (Integer &r, const Integer &x, const Integer &y)
 Computes the non-negative Greatest Common Divisior r of x and y. More...
 
void XGCD (Integer &r, Integer &a, Integer &b, const Integer &x, const Integer &y)
 Computes the non-negative extended Greatest Common Divisior r of x and y. More...
 
void LCM (Integer &r, const Integer &x, const Integer &y)
 Computes the non-negative Least Common Multiple r of x and y. More...
 
template<typename Type >
void euclideanDivision (NInt< Type > &q, NInt< Type > &r, const NInt< Type > &a, const NInt< Type > &b) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Computes an Euclidean Division of a by b. More...
 
template<typename Type >
void euclideanDivisionPos (NInt< Type > &q, NInt< Type > &r, const NInt< Type > &a, const NInt< Type > &b) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Computes an Euclidean Division of a by b. More...
 
template<typename Type >
void GCD (NInt< Type > &r, const NInt< Type > &x, const NInt< Type > &y) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Computes the non-negative Greatest Common Divisior r of x and y. More...
 
template<typename Type >
NInt< Type > GCD (const NInt< Type > &x, const NInt< Type > &y) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Computes and returns the non-negative Greatest Common Divisior of x and y. More...
 
template<typename Type >
void XGCD (NInt< Type > &r, NInt< Type > &a, NInt< Type > &b, const NInt< Type > &x, const NInt< Type > &y) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Computes the non-negative extended Greatest Common Divisior r of x and y. More...
 
template<typename Type >
void LCM (NInt< Type > &r, const NInt< Type > &x, const NInt< Type > &y) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Computes the non-negative Least Common Multiple r of x and y. More...
 
template<typename Type >
NInt< Type > LCM (const NInt< Type > &x, const NInt< Type > &y) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Computes and returns the non-negative Least Common Multiple of x and y. More...
 
Exponentiation.
expressions::Expression
< IntegerContext, std::pair
< expressions::Wrapper
< IntegerContext >
, expressions::Wrapper
< IntegerContext >
>, expressions::PowerOp
power (const Integer &a, const Integer &b)
 Computes and returns a raised to the power of b. More...
 
expressions::Expression
< IntegerContext,
expressions::Wrapper
< IntegerContext >
, expressions::PowerCOp
< signed long >::impl > 
power (const Integer &a, signed long b)
 Computes and returns a raised to the power of b. More...
 
expressions::Expression
< RealContext,
expressions::Wrapper
< RealContext >
, expressions::PowerCOp
< signed long >::impl > 
power (const Real &a, signed long b)
 Returns a raised to the power of b. More...
 
expressions::Expression
< RealContext,
expressions::Wrapper
< RealContext >
, expressions::PowerCOp
< unsigned long >::impl > 
power (const Real &a, unsigned long b)
 Returns a raised to the power of b. More...
 
expressions::Expression
< RealContext, std::pair
< expressions::Wrapper
< RealContext >
, expressions::Wrapper
< IntegerContext >
>, expressions::PowerOp
power (const Real &a, const Integer &b)
 Returns a raised to the power of b. More...
 
expressions::Expression
< RealContext, std::pair
< expressions::Wrapper
< RealContext >
, expressions::Wrapper
< RealContext >
>, expressions::PowerOp
power (const Real &a, const Real &b)
 Returns a raised to the power of b. More...
 
expressions::Expression
< RealContext,
expressions::Wrapper
< RealContext >
, expressions::PowerCOp_Context
< signed long >::impl > 
power (const Real &a, signed long b, const RealContext &rc)
 Returns a raised to the power of b. More...
 
expressions::Expression
< RealContext,
expressions::Wrapper
< RealContext >
, expressions::PowerCOp_Context
< unsigned long >::impl > 
power (const Real &a, unsigned long b, const RealContext &rc)
 Returns a raised to the power of b. More...
 
expressions::Expression
< RealContext, std::pair
< expressions::Wrapper
< RealContext >
, expressions::Wrapper
< IntegerContext >
>, expressions::PowerOp_Context
power (const Real &a, const Integer &b, const RealContext &rc)
 Returns a raised to the power of b. More...
 
expressions::Expression
< RealContext, std::pair
< expressions::Wrapper
< RealContext >
, expressions::Wrapper
< RealContext >
>, expressions::PowerOp_Context
power (const Real &a, const Real &b, const RealContext &rc)
 Returns a raised to the power of b. More...
 
void power (Integer &r, const Integer &a, long b)
 Raises a to the power b and stores the result in r. More...
 
void power (Integer &r, const Integer &a, const Integer &b)
 Raises a to the power b and stores the result in r. More...
 
void power (Real &res, const Real &a, long b)
 
void power (Real &res, const Real &a, const Integer &b)
 Raises a to the power b and stores the result in res. More...
 
void power (Real &res, const Real &a, const Real &b)
 Raises a to the power b and stores the result in res. More...
 
template<typename Type >
NInt< Type > power (const NInt< Type > &a, long b) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Computes and returns a raised to the power of b. More...
 
template<typename Type >
void power (NInt< Type > &r, const NInt< Type > &a, long b) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Raises a to the power b and stores the result in r. More...
 
template<typename Type >
NInt< Type > power (const NInt< Type > &a, const NInt< Type > &b) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Computes and returns a raised to the power of b. More...
 
template<typename Type >
void power (NInt< Type > &r, const NInt< Type > &a, const NInt< Type > &b) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Raises a to the power b and stores the result in r. More...
 
expressions::Expression
< RationalContext,
expressions::Wrapper
< RationalContext >
, expressions::PowerCOp
< signed long >::impl > 
power (const Rational &a, signed long b)
 Returns a raised to the power of b. More...
 
expressions::Expression
< RationalContext,
expressions::Wrapper
< RationalContext >
, expressions::PowerCOp
< unsigned long >::impl > 
power (const Rational &a, unsigned long b)
 Returns a raised to the power of b. More...
 
expressions::Expression
< RationalContext, std::pair
< expressions::Wrapper
< RationalContext >
, expressions::Wrapper
< IntegerContext >
>, expressions::PowerOp
power (const Rational &a, const Integer &b)
 Returns a raised to the power of b. More...
 
expressions::Expression
< RationalContext,
expressions::Wrapper
< RationalContext >
, expressions::PowerCOp
< signed long >::impl > 
power (const Rational &a, signed long b, const RationalContext &rc)
 Returns a raised to the power of b. More...
 
expressions::Expression
< RationalContext,
expressions::Wrapper
< RationalContext >
, expressions::PowerCOp
< unsigned long >::impl > 
power (const Rational &a, unsigned long b, const RationalContext &rc)
 Returns a raised to the power of b. More...
 
expressions::Expression
< RationalContext, std::pair
< expressions::Wrapper
< RationalContext >
, expressions::Wrapper
< IntegerContext >
>, expressions::PowerOp
power (const Rational &a, const Integer &b, const RationalContext &rc)
 Returns a raised to the power of b. More...
 
void power (Rational &r, const Rational &a, signed long e)
 Raises a to the power e and stores the result in r. More...
 
void power (Rational &r, const Rational &a, unsigned long e)
 Raises a to the power e and stores the result in r. More...
 
void power (Rational &r, const Rational &a, const Integer &e)
 Raises a to the power e and stores the result in r. More...
 
Trigonometric functions.
expressions::Expression
< RealContext,
expressions::Wrapper
< RealContext >
, expressions::SinOp
sin (const Real &i)
 Returns the sine of the given floating point number. More...
 
expressions::Expression
< RealContext,
expressions::Wrapper
< RealContext >
, expressions::CosOp
cos (const Real &i)
 Returns the cosine of the given floating point number. More...
 
expressions::Expression
< RealContext,
expressions::Wrapper
< RealContext >
, expressions::TanOp
tan (const Real &i)
 Returns the tangent of the given floating point number. More...
 
expressions::Expression
< RealContext,
expressions::Wrapper
< RealContext >
, expressions::ASinOp
asin (const Real &i)
 Returns the arcsine of the given floating point number. More...
 
expressions::Expression
< RealContext,
expressions::Wrapper
< RealContext >
, expressions::ACosOp
acos (const Real &i)
 Returns the arccosine of the given floating point number. More...
 
expressions::Expression
< RealContext,
expressions::Wrapper
< RealContext >
, expressions::ATanOp
atan (const Real &i)
 Returns the arctangent of the given floating point number. More...
 
expressions::Expression
< RealContext, std::pair
< expressions::Wrapper
< RealContext >
, expressions::Wrapper
< RealContext >
>, expressions::ATan2Op
atan2 (const Real &y, const Real &x)
 Returns the arctangent of $\tfrac{y}{x}$, using the signs of x and y to determine the quadrant. More...
 
expressions::Expression
< RealContext,
expressions::Wrapper
< RealContext >
, expressions::SinOp_Context
sin (const Real &i, const RealContext &rc)
 Returns the sine of the given floating point number. More...
 
expressions::Expression
< RealContext,
expressions::Wrapper
< RealContext >
, expressions::CosOp_Context
cos (const Real &i, const RealContext &rc)
 Returns the cosine of the given floating point number. More...
 
expressions::Expression
< RealContext,
expressions::Wrapper
< RealContext >
, expressions::TanOp_Context
tan (const Real &i, const RealContext &rc)
 Returns the tangent of the given floating point number. More...
 
expressions::Expression
< RealContext,
expressions::Wrapper
< RealContext >
, expressions::ASinOp_Context
asin (const Real &i, const RealContext &rc)
 Returns the arcsine of the given floating point number. More...
 
expressions::Expression
< RealContext,
expressions::Wrapper
< RealContext >
, expressions::ACosOp_Context
acos (const Real &i, const RealContext &rc)
 Returns the arccosine of the given floating point number. More...
 
expressions::Expression
< RealContext,
expressions::Wrapper
< RealContext >
, expressions::ATanOp_Context
atan (const Real &i, const RealContext &rc)
 Returns the arctangent of the given floating point number. More...
 
expressions::Expression
< RealContext, std::pair
< expressions::Wrapper
< RealContext >
, expressions::Wrapper
< RealContext >
>, expressions::ATan2Op_Context
atan2 (const Real &y, const Real &x, const RealContext &rc)
 Returns the arctangent of $\tfrac{y}{x}$, using the signs of x and y to determine the quadrant. More...
 
void sin (Real &res, const Real &a)
 Computes the sine of a and stores the result in res. More...
 
void cos (Real &res, const Real &a)
 Computes the cosine of a and stores the result in res. More...
 
void tan (Real &res, const Real &a)
 Computes the tangent of a and stores the result in res. More...
 
void asin (Real &res, const Real &a)
 Computes the arcsine of a and stores the result in res. More...
 
void acos (Real &res, const Real &a)
 Computes the arccosine of a and stores the result in res. More...
 
void atan (Real &res, const Real &a)
 Computes the arctangent of a and stores the result in res. More...
 
void atan2 (Real &res, const Real &y, const Real &x)
 Computes the arctangent of $\tfrac{y}{x}$and stores the result inres. The signs ofxandy` are used to determine the quadrant and yield a result in $[-\pi, \pi]$. More...
 
Exponential and logarithmic functions.
expressions::Expression
< RealContext,
expressions::Wrapper
< RealContext >
, expressions::ExpOp
exp (const Real &i)
 Returns the exponential function evaluated at the given floating point number. More...
 
expressions::Expression
< RealContext,
expressions::Wrapper
< RealContext >
, expressions::LogOp
log (const Real &i)
 Returns the natural logarithm evaluated at the given floating point number. More...
 
expressions::Expression
< RealContext,
expressions::Wrapper
< RealContext >
, expressions::Log2Op
log2 (const Real &i)
 Returns the base-2 logarithm evaluated at the given floating point number. More...
 
expressions::Expression
< RealContext,
expressions::Wrapper
< RealContext >
, expressions::Log10Op
log10 (const Real &i)
 Returns the base-10 logarithm evaluated at the given floating point number. More...
 
expressions::Expression
< RealContext,
expressions::Wrapper
< RealContext >
, expressions::SqrtOp
sqrt (const Real &i)
 Returns the square root of the given floating point number. More...
 
expressions::Expression
< RealContext,
expressions::Wrapper
< RealContext >
, expressions::ExpOp_Context
exp (const Real &i, const RealContext &rc)
 Returns the exponential function evaluated at the given floating point number. More...
 
expressions::Expression
< RealContext,
expressions::Wrapper
< RealContext >
, expressions::LogOp_Context
log (const Real &i, const RealContext &rc)
 Returns the natural logarithm evaluated at the given floating point number. More...
 
expressions::Expression
< RealContext,
expressions::Wrapper
< RealContext >
, expressions::Log2Op_Context
log2 (const Real &i, const RealContext &rc)
 Returns the base-2 logarithm evaluated at the given floating point number. More...
 
expressions::Expression
< RealContext,
expressions::Wrapper
< RealContext >
, expressions::Log10Op_Context
log10 (const Real &i, const RealContext &rc)
 Returns the base-10 logarithm evaluated at the given floating point number. More...
 
expressions::Expression
< RealContext,
expressions::Wrapper
< RealContext >
, expressions::SqrtOp_Context
sqrt (const Real &i, const RealContext &rc)
 Returns the square root of the given floating point number. More...
 
void exp (Real &res, const Real &a)
 Computes the exponential function at a and stores the result in res. More...
 
void log (Real &res, const Real &a)
 Computes the natural logarithm of a and stores the result in res. More...
 
void log2 (Real &res, const Real &a)
 Computes the logarithm of a to base 2 and stores the result in res. More...
 
void log10 (Real &res, const Real &a)
 Computes the logarithm of a to base 10 and stores the result in res. More...
 
void sqrt (Real &res, const Real &a)
 Computes the square root of a and stores the result in res. More...
 
Special functions.
expressions::Expression
< RealContext,
expressions::Wrapper
< RealContext >
, expressions::GammaOp
gamma (const Real &i)
 Returns the Gamma function evaluated at the given floating point number. More...
 
expressions::Expression
< RealContext,
expressions::Wrapper
< RealContext >
, expressions::LGammaOp
lgamma (const Real &i)
 Returns the natural logarithm of the absolute value of the Gamma function evaluated at the given floating point number. More...
 
expressions::Expression
< RealContext,
expressions::Wrapper
< RealContext >
, expressions::LGamma2Op
lgamma (int &sign, const Real &i)
 Returns the natural logarithm of the absolute value of the Gamma function evaluated at the given floating point number, as well as the sign of the Gamma function. More...
 
expressions::Expression
< RealContext,
expressions::Wrapper
< RealContext >
, expressions::GammaOp_Context
gamma (const Real &i, const RealContext &rc)
 Returns the Gamma function evaluated at the given floating point number. More...
 
expressions::Expression
< RealContext,
expressions::Wrapper
< RealContext >
, expressions::LGammaOp_Context
lgamma (const Real &i, const RealContext &rc)
 Returns the natural logarithm of the absolute value of the Gamma function evaluated at the given floating point number. More...
 
expressions::Expression
< RealContext,
expressions::Wrapper
< RealContext >
, expressions::LGamma2Op_Context
lgamma (int &sign, const Real &i, const RealContext &rc)
 Returns the natural logarithm of the absolute value of the Gamma function evaluated at the given floating point number, as well as the sign of the Gamma function. More...
 
void gamma (Real &res, const Real &a)
 Computes the Gamma function at a and stores the result in res. More...
 
void lgamma (Real &res, const Real &a)
 Computes the logarithm of the absolute value of the Gamma function at a and stores the result in res. More...
 
void lgamma (Real &res, int &sign, const Real &a)
 Computes the logarithm of the absolute value of the Gamma function at a and stores the result in res. The sign of the Gamma function at a is stored in sign. More...
 
Swap functions.
void swap (plll::arithmetic::Integer &, plll::arithmetic::Integer &) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Swaps two plll::arithmetic::Integer objects.
 
void swap (plll::arithmetic::Real &, plll::arithmetic::Real &) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Swaps two plll::arithmetic::Real objects.
 
template<typename Type >
void swap (NInt< Type > &, NInt< Type > &) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Swaps two plll::arithmetic::NInt<> objects.
 
void swap (Rational &, Rational &) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Swaps two plll::arithmetic::Rational objects.
 
Predicates.
bool isZero (const Integer &) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Tests the given plll::arithmetic::Integer object for being zero. More...
 
bool isZero (const Real &) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Tests the given plll::arithmetic::Real object for being zero. More...
 
bool isOne (const Integer &) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Tests the given plll::arithmetic::Integer object for being one. More...
 
bool isPMOne (const Integer &) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Tests the given plll::arithmetic::Integer object for being one or minus one. More...
 
bool isPMTwo (const Integer &) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Tests the given plll::arithmetic::Integer object for being two or minus two. More...
 
bool isOne (const Real &) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Tests the given plll::arithmetic::Real object for being one. More...
 
bool isPositive (const Integer &) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Tests the given plll::arithmetic::Integer object for being strictly positive. More...
 
bool isPositive (const Real &) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Tests the given plll::arithmetic::Real object for being strictly positive. More...
 
bool isNonNegative (const Integer &) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Tests the given plll::arithmetic::Integer object for being positive or zero. More...
 
bool isNonNegative (const Real &) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Tests the given plll::arithmetic::Real object for being positive or zero. More...
 
bool isNegative (const Integer &) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Tests the given plll::arithmetic::Integer object for being strictly negative. More...
 
bool isNegative (const Real &) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Tests the given plll::arithmetic::Real object for being strictly negative. More...
 
bool isNonPositive (const Integer &) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Tests the given plll::arithmetic::Integer object for being negative or zero. More...
 
bool isNonPositive (const Real &) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Tests the given plll::arithmetic::Real object for being negative or zero. More...
 
template<typename Type >
bool isZero (const NInt< Type > &) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Tests the given plll::arithmetic::Integer object for being zero. More...
 
template<typename Type >
bool isOne (const NInt< Type > &) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Tests the given plll::arithmetic::Integer object for being one. More...
 
template<typename Type >
bool isPMOne (const NInt< Type > &) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Tests the given plll::arithmetic::Integer object for being one or minus one. More...
 
template<typename Type >
bool isPMTwo (const NInt< Type > &) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Tests the given plll::arithmetic::Integer object for being two or minus two. More...
 
template<typename Type >
bool isPositive (const NInt< Type > &) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Tests the given plll::arithmetic::Integer object for being strictly positive. More...
 
template<typename Type >
bool isNonNegative (const NInt< Type > &) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Tests the given plll::arithmetic::Integer object for being positive or zero. More...
 
template<typename Type >
bool isNegative (const NInt< Type > &) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Tests the given plll::arithmetic::Integer object for being strictly negative. More...
 
template<typename Type >
bool isNonPositive (const NInt< Type > &) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Tests the given plll::arithmetic::Integer object for being negative or zero. More...
 
bool isZero (const Rational &r) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Tests the given rational number for being zero. More...
 
bool isOne (const Rational &r) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Tests the given plll::arithmetic::Real object for being zero. More...
 
bool isPositive (const Rational &r) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Tests the given rational number for being strictly positive. More...
 
bool isNonNegative (const Rational &r) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Tests the given rational number for being positive or zero. More...
 
bool isNegative (const Rational &r) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Tests the given rational number for being strictly negative. More...
 
bool isNonPositive (const Rational &r) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Tests the given rational number for being negative or zero. More...
 
Stream input/output.
std::ostream & operator<< (std::ostream &, const Integer &)
 Outputs the integer on the given output stream.
 
std::istream & operator>> (std::istream &, Integer &)
 Reads the integer from the given input stream.
 
std::ostream & operator<< (std::ostream &, const Real &)
 Outputs the floating point number on the given output stream.
 
std::istream & operator>> (std::istream &, Real &)
 Reads the floating point number from the given input stream.
 
template<typename Type >
std::ostream & operator<< (std::ostream &, const NInt< Type > &)
 Outputs the integer on the given output stream.
 
template<typename Type >
std::istream & operator>> (std::istream &, NInt< Type > &)
 Reads the integer from the given input stream.
 
std::ostream & operator<< (std::ostream &s, const Rational &r)
 Outputs the rational number on the given output stream.
 
std::istream & operator>> (std::istream &s, Rational &r)
 Reads the rational number from the given input stream.
 
Setting to specific constants.
void setNaN (Real &)
 Sets the given floating point number to Not a Number.
 
void setInfinity (Real &r, bool sign=true)
 Sets the given floating point number to $\pm \infty$. More...
 
void setZero (Integer &)
 Sets the given integer to zero.
 
void setZero (Real &r, bool sign=true)
 Sets the given floating point number to $\pm 0$. More...
 
void setOne (Integer &)
 Sets the given integer to one.
 
void setOne (Real &)
 Sets the given floating point number to one.
 
template<typename Type >
void setZero (NInt< Type > &) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Sets the given integer to zero.
 
template<typename Type >
void setOne (NInt< Type > &) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Sets the given integer to one.
 
void setZero (Rational &r, bool sign=true)
 Sets the given rational number to $\pm 0$. More...
 
void setOne (Rational &r)
 Sets the given rational number to one. More...
 
Sign querying/modification.
int sign (const Integer &) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Returns the sign of the given integer. More...
 
int sign (const Real &) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Returns the sign of the given floating point number. More...
 
void makeAbs (Integer &a) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Makes the operand non-negative. More...
 
void makeAbs (Real &a) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Makes the operand non-negative. More...
 
template<typename Type >
int sign (const NInt< Type > &) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Returns the sign of the given integer. More...
 
template<typename Type >
void makeAbs (NInt< Type > &a) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Makes the operand non-negative. More...
 
void makeAbs (Rational &a) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Makes the operand non-negative. More...
 
int sign (const Rational &r) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Returns the sign of the given rational number. More...
 
Bit manipulation.
int bit (const Integer &x, long n) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Returns the n bit of $|x|$ in the usual binary representation. More...
 
void setbit (Integer &x, long n, bool value=true)
 Sets the n-th bit of $|x|$ to value. More...
 
template<typename Type >
int bit (const NInt< Type > &x, long n) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Returns the n bit of $|x|$ in the usual binary representation. More...
 
template<typename Type >
void setbit (NInt< Type > &x, long n, bool value=true) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Sets the n-th bit of $|x|$ to value. More...
 
Functional versions of operators.
void increment (Integer &r, const Integer &a)
 Increments a by one and stores the result in r. More...
 
void decrement (Integer &r, const Integer &a)
 Decrements a by one and stores the result in r. More...
 
void add (Integer &r, const Integer &a, const Integer &b)
 Adds a and b and stores the result in r. More...
 
void sub (Integer &r, const Integer &a, const Integer &b)
 Subtracts b from a and stores the result in r. More...
 
void mul (Integer &r, const Integer &a, const Integer &b)
 Multiplies a with b and stores the result in r. More...
 
void neg (Integer &r, const Integer &a)
 Negates a and stores the result in r. More...
 
void div (Integer &r, const Integer &a, const Integer &b)
 Divides a by b and stores the result in r. More...
 
void mod (Integer &r, const Integer &a, const Integer &b)
 Takes the remainder of the division of a by b and stores it in r. More...
 
void divmod (Integer &q, Integer &r, const Integer &a, const Integer &b)
 Stores quotient and remainder of the division of a by b in q respectively r. More...
 
void abs (Integer &r, const Integer &a)
 Takes the absolute value of a and stores the result in r. More...
 
void addmul (Integer &r, const Integer &a, const Integer &b)
 Multiplies a and b and adds the result to r. More...
 
void submul (Integer &r, const Integer &a, const Integer &b)
 Multiplies a and b and subtracts the result from r. More...
 
void band (Integer &r, const Integer &a, const Integer &b)
 Computes the bitwise and of a and b and stores the result in r. More...
 
void bor (Integer &r, const Integer &a, const Integer &b)
 Computes the bitwise or of a and b and stores the result in r. More...
 
void bxor (Integer &r, const Integer &a, const Integer &b)
 Computes the bitwise exclusive or of a and b and stores the result in r. More...
 
void bneg (Integer &r, const Integer &a)
 Takes the bitwise complement of a and stores the result in r. More...
 
void shl (Integer &r, const Integer &a, long b)
 Shifts a by b bits to the left and stores the result in r. More...
 
void shl (Integer &r, const Integer &a, const Integer &b)
 Shifts a by b bits to the right and stores the result in r. More...
 
void shr (Integer &r, const Integer &a, long b)
 Shifts a by b bits to the left and stores the result in r. More...
 
void shr (Integer &r, const Integer &a, const Integer &b)
 Shifts a by b bits to the right and stores the result in r. More...
 
void square (Integer &r, const Integer &a)
 Computes the square of a and stores the result in r. More...
 
void add (Real &r, const Real &a, const Real &b)
 Adds a and b and stores the result in r. More...
 
void sub (Real &r, const Real &a, const Real &b)
 Subtracts b from a and stores the result in r. More...
 
void mul (Real &r, const Real &a, const Real &b)
 Multiplies a with b and stores the result in r. More...
 
void div (Real &r, const Real &a, const Real &b)
 Divides a by b and stores the result in r. More...
 
void mod (Real &r, const Real &a, const Real &b)
 Takes the remainder of the division of a by b and stores it in r. More...
 
void divmod (Real &q, Real &r, const Real &a, const Real &b)
 Stores quotient and remainder of the division of a by b in q respectively r. More...
 
void shl (Real &r, const Real &a, const Real &b)
 Multiplies a by $2^b$ and stores the result in r. More...
 
void shr (Real &r, const Real &a, const Real &b)
 Multiplies a by $2^{-b}$ and stores the result in r. More...
 
void shl (Real &r, const Real &a, long b)
 Multiplies a by $2^b$ and stores the result in r. More...
 
void shr (Real &r, const Real &a, long b)
 Multiplies a by $2^{-b}$ and stores the result in r. More...
 
void increment (Real &r, const Real &a)
 Increments a by one and stores the result in r. More...
 
void decrement (Real &r, const Real &a)
 Decrements a by one and stores the result in r. More...
 
void neg (Real &r, const Real &a)
 Negates a and stores the result in r. More...
 
void abs (Real &r, const Real &a)
 Takes the absolute value of a and stores the result in r. More...
 
void addmul (Real &r, const Real &a, const Real &b)
 Multiplies a and b and adds the result to r. More...
 
void submul (Real &r, const Real &a, const Real &b)
 Multiplies a and b and subtracts the result from r. More...
 
void square (Real &r, const Real &a)
 Computes the square of a and stores the result in r. More...
 
template<typename Type >
void add (NInt< Type > &r, const NInt< Type > &a, const NInt< Type > &b) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Adds a and b and stores the result in r. More...
 
template<typename Type >
void sub (NInt< Type > &r, const NInt< Type > &a, const NInt< Type > &b) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Subtracts b from a and stores the result in r. More...
 
template<typename Type >
void addmul (NInt< Type > &r, const NInt< Type > &a, const NInt< Type > &b) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Multiplies a and b and adds the result to r. More...
 
template<typename Type >
void submul (NInt< Type > &r, const NInt< Type > &a, const NInt< Type > &b) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Multiplies a and b and subtracts the result from r. More...
 
template<typename Type >
void mul (NInt< Type > &r, const NInt< Type > &a, const NInt< Type > &b) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Multiplies a with b and stores the result in r. More...
 
template<typename Type >
void div (NInt< Type > &r, const NInt< Type > &a, const NInt< Type > &b) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Divides a by b and stores the result in r. More...
 
template<typename Type >
void divmod (NInt< Type > &q, NInt< Type > &r, const NInt< Type > &a, const NInt< Type > &b) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Stores quotient and remainder of the division of a by b in q respectively r. More...
 
template<typename Type >
void mod (NInt< Type > &r, const NInt< Type > &a, const NInt< Type > &b) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Takes the remainder of the division of a by b and stores it in r. More...
 
template<typename Type >
void shl (NInt< Type > &r, const NInt< Type > &a, long b) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Shifts a by b bits to the left and stores the result in r. More...
 
template<typename Type >
void shr (NInt< Type > &r, const NInt< Type > &a, long b) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Shifts a by b bits to the left and stores the result in r. More...
 
template<typename Type >
void shl (NInt< Type > &r, const NInt< Type > &a, const NInt< Type > &b) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Shifts a by b bits to the left and stores the result in r. More...
 
template<typename Type >
void shr (NInt< Type > &r, const NInt< Type > &a, const NInt< Type > &b) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Shifts a by b bits to the left and stores the result in r. More...
 
template<typename Type >
void increment (NInt< Type > &r, const NInt< Type > &a) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Increments a by one and stores the result in r. More...
 
template<typename Type >
void decrement (NInt< Type > &r, const NInt< Type > &a) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Decrements a by one and stores the result in r. More...
 
template<typename Type >
void neg (NInt< Type > &r, const NInt< Type > &a) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Negates a and stores the result in r. More...
 
template<typename Type >
void abs (NInt< Type > &r, const NInt< Type > &a) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Takes the absolute value of a and stores the result in r. More...
 
template<typename Type >
void square (NInt< Type > &r, const NInt< Type > &a) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE
 Computes the square of a and stores the result in r. More...
 
void addmul (Rational &r, const Rational &a, const Rational &b)
 Multiplies a and b and adds the result to r. More...
 
void submul (Rational &r, const Rational &a, const Rational &b)
 Multiplies a and b and subtracts the result from r. More...
 
void add (Rational &r, const Rational &a, const Rational &b)
 Adds a and b and stores the result in r. More...
 
void sub (Rational &r, const Rational &a, const Rational &b)
 Subtracts b from a and stores the result in r. More...
 
void mul (Rational &r, const Rational &a, const Rational &b)
 Multiplies a with b and stores the result in r. More...
 
void div (Rational &r, const Rational &a, const Rational &b)
 Divides a by b and stores the result in r. More...
 
void mod (Rational &r, const Rational &a, const Rational &b)
 Takes the remainder of the division of a by b and stores it in r. More...
 
void shl (Rational &r, const Rational &a, long b)
 Multiplies a by $2^b$ and stores the result in r. More...
 
void shr (Rational &r, const Rational &a, long b)
 Multiplies a by $2^b$ and stores the result in r. More...
 
void increment (Rational &r, const Rational &a)
 Increments a by one and stores the result in r. More...
 
void decrement (Rational &r, const Rational &a)
 Negates a and stores the result in r. More...
 
void neg (Rational &r, const Rational &a)
 Negates a and stores the result in r. More...
 
void abs (Rational &r, const Rational &a)
 Takes the absolute value of a and stores the result in r. More...
 
void square (Rational &r, const Rational &a)
 Computes the square of a and stores the result in r. More...
 
Conversion functions.
template<class SourceType , class DestContext >
void convert (typename DestContext::Type &dst, const SourceType &src, const DestContext &context)
 Converts the value in src to the type described by context and stores the result in dst. More...
 
template<class SourceType , class DestContext >
implementation::conversion_impl
< SourceType, DestContext >
::RetVal 
convert (const SourceType &src, const DestContext &context)
 Converts the value in src to the type described by context and returns the result. More...
 
template<class SourceType , class DestContext >
void convert_fraction (typename DestContext::Type &dst, const SourceType &src1, const SourceType &src2, const DestContext &context)
 Converts the values in src1 and scr2 to the type described by context and stores their quotient in dst. More...
 
template<class SourceType , class DestContext >
implementation::conversion_impl
< SourceType, DestContext >
::RetVal_Frac 
convert_fraction (const SourceType &src1, const SourceType &src2, const DestContext &context)
 Converts the values in src1 and scr2 to the type described by context and returns their quotient. More...
 
template<class SourceType , class DestContext >
void convert_floor (typename DestContext::Type &dst, const SourceType &src, const DestContext &context)
 Converts the floor of the value in src to the type described by context and stores the result in dst. More...
 
template<class SourceType , class DestContext >
implementation::conversion_impl
< SourceType, DestContext >
::RetVal_Floor 
convert_floor (const SourceType &src, const DestContext &context)
 Converts the floor of the value in src to the type described by context and returns the result. More...
 
template<class SourceType , class DestContext >
void convert_round (typename DestContext::Type &dst, const SourceType &src, const DestContext &context)
 Converts the rounded value in src to the type described by context and stores the result in dst. More...
 
template<class SourceType , class DestContext >
implementation::conversion_impl
< SourceType, DestContext >
::RetVal_Round 
convert_round (const SourceType &src, const DestContext &context)
 Converts the rounded value in src to the type described by context and returns the result. More...
 
template<class SourceType , class DestContext >
void convert_round (typename DestContext::Type &dst, const SourceType &src, bool &up, const DestContext &context)
 Converts the rounded value in src to the type described by context and stores the result in dst. Stores in up whether the value was rounded up or down. More...
 
template<class SourceType , class DestContext >
implementation::conversion_impl
< SourceType, DestContext >
::RetVal_Round2 
convert_round (const SourceType &src, bool &up, const DestContext &context)
 Converts the rounded value in src to the type described by context and returns the result. Stores in up whether the value was rounded up or down. More...
 
template<class SourceType , class DestContext >
void convert_ceil (typename DestContext::Type &dst, const SourceType &src, const DestContext &context)
 Converts the ceil of the value in src to the type described by context and stores the result in dst. More...
 
template<class SourceType , class DestContext >
implementation::conversion_impl
< SourceType, DestContext >
::RetVal_Ceil 
convert_ceil (const SourceType &src, const DestContext &context)
 Converts the ceil of the value in src to the type described by context and returns the result in dst. More...
 
template<class Native , class SourceType >
implementation::nativeconversion_impl2
< Native, SourceType,
traits::type_traits< Native >
::is_inttype||!traits::type_traits
< Native >::is_number,
traits::type_traits
< SourceType >::is_inttype||!traits::type_traits
< SourceType >::is_number >
::RetVal 
convert (const SourceType &src)
 Converts the value in src to the native type Native and returns the result. More...
 
template<class Native , class SourceType >
implementation::nativeconversion_impl2
< Native, SourceType,
traits::type_traits< Native >
::is_inttype||!traits::type_traits
< Native >::is_number,
traits::type_traits
< SourceType >::is_inttype||!traits::type_traits
< SourceType >::is_number >
::RetVal_Floor 
convert_floor (const SourceType &src)
 Converts the floor of the value in src to the native type Native and returns the result. More...
 
template<class Native , class SourceType >
implementation::nativeconversion_impl2
< Native, SourceType,
traits::type_traits< Native >
::is_inttype||!traits::type_traits
< Native >::is_number,
traits::type_traits
< SourceType >::is_inttype||!traits::type_traits
< SourceType >::is_number >
::RetVal_Round 
convert_round (const SourceType &src)
 Converts the rounded value of src to the native type Native and returns the result. More...
 
template<class Native , class SourceType >
implementation::nativeconversion_impl2
< Native, SourceType,
traits::type_traits< Native >
::is_inttype||!traits::type_traits
< Native >::is_number,
traits::type_traits
< SourceType >::is_inttype||!traits::type_traits
< SourceType >::is_number >
::RetVal_Round2 
convert_round (const SourceType &src, bool &up)
 Converts the rounded value of src to the native type Native and returns the result. Returns whether the value was rounded up or not in up. More...
 
template<class Native , class SourceType >
implementation::nativeconversion_impl2
< Native, SourceType,
traits::type_traits< Native >
::is_inttype||!traits::type_traits
< Native >::is_number,
traits::type_traits
< SourceType >::is_inttype||!traits::type_traits
< SourceType >::is_number >
::RetVal_Ceil 
convert_ceil (const SourceType &src)
 Converts the ceil of the value in src to the native type Native and returns the result. More...
 

Detailed Description

Contains the arithmetic backend of plll.

The plll::arithmetic namespace contains all arithmetic code of plll, such as contexts, expression templates, conversion facilities and traits.

Function Documentation

void plll::arithmetic::abs ( Rational &  r,
const Rational &  a 
)
inline

Takes the absolute value of a and stores the result in r.

Parameters
rThe result.
aThe operand.

Definition at line 1285 of file rational.hpp.

void plll::arithmetic::abs ( Integer &  r,
const Integer &  a 
)
inline

Takes the absolute value of a and stores the result in r.

Parameters
rThe result.
aThe operand.

Definition at line 1458 of file arithmetic-gmp.hpp.

template<typename Type >
void plll::arithmetic::abs ( NInt< Type > &  r,
const NInt< Type > &  a 
)
inline

Takes the absolute value of a and stores the result in r.

Parameters
rThe result.
aThe operand.

Definition at line 1752 of file arithmetic-nint.hpp.

void plll::arithmetic::abs ( Real &  r,
const Real &  a 
)
inline

Takes the absolute value of a and stores the result in r.

Parameters
rThe result.
aThe operand.

Definition at line 2902 of file arithmetic-gmp.hpp.

template<typename Type >
NInt< Type > plll::arithmetic::abs ( const NInt< Type > &  i)
inline

Computes and returns the absolute value of i.

Parameters
iThe operand.
Returns
The result.

Definition at line 1758 of file arithmetic-nint.hpp.

expressions::Expression<RationalContext, expressions::Wrapper<RationalContext>, expressions::AbsOp> plll::arithmetic::abs ( const Rational &  i)
inline

Returns the absolute value of the given rational number.

Parameters
iThe operand.
Returns
The result.

Definition at line 995 of file rational-ops.hpp.

expressions::Expression<RationalContext, expressions::Wrapper<RationalContext>, expressions::AbsOp> plll::arithmetic::abs ( const Rational &  i,
const RationalContext &  rc 
)
inline

Returns the absolute value of the given rational number.

Parameters
iThe operand.
rcThe context whose precision to use for the result.
Returns
The result.

Definition at line 1060 of file rational-ops.hpp.

expressions::Expression<RealContext, expressions::Wrapper<RealContext>, expressions::AbsOp> plll::arithmetic::abs ( const Real &  i)
inline

Returns the absolute value of the given floating point number.

Parameters
iThe operand.
Returns
The result.

Definition at line 1437 of file arithmetic-gmp-rops.hpp.

expressions::Expression<IntegerContext, expressions::Wrapper<IntegerContext>, expressions::AbsOp> plll::arithmetic::abs ( const Integer &  i)
inline

Computes and returns the absolute value of i.

Parameters
iThe operand.
Returns
The result.

Definition at line 1490 of file arithmetic-gmp-iops.hpp.

expressions::Expression<RealContext, expressions::Wrapper<RealContext>, expressions::AbsOp_Context> plll::arithmetic::abs ( const Real &  i,
const RealContext &  rc 
)
inline

Returns the absolute value of the given floating point number.

Parameters
iThe operand.
rcThe context whose precision to use for the result.
Returns
The result.

Definition at line 1851 of file arithmetic-gmp-rops.hpp.

void plll::arithmetic::acos ( Real &  res,
const Real &  a 
)
inline

Computes the arccosine of a and stores the result in res.

Parameters
resThe result.
aThe value the function is evaluated at.
See also
Trigonometric Functions

Definition at line 3064 of file arithmetic-gmp.hpp.

expressions::Expression<RealContext, expressions::Wrapper<RealContext>, expressions::ACosOp> plll::arithmetic::acos ( const Real &  i)
inline

Returns the arccosine of the given floating point number.

Parameters
iThe operand.
Returns
The result.
See also
Trigonometric Functions

Definition at line 1506 of file arithmetic-gmp-rops.hpp.

expressions::Expression<RealContext, expressions::Wrapper<RealContext>, expressions::ACosOp_Context> plll::arithmetic::acos ( const Real &  i,
const RealContext &  rc 
)
inline

Returns the arccosine of the given floating point number.

Parameters
iThe operand.
rcThe context whose precision to use for the result.
Returns
The result.
See also
Trigonometric Functions

Definition at line 1926 of file arithmetic-gmp-rops.hpp.

void plll::arithmetic::add ( Rational &  r,
const Rational &  a,
const Rational &  b 
)
inline

Adds a and b and stores the result in r.

Parameters
rThe result.
aThe first operand.
bThe second operand.

Definition at line 887 of file rational.hpp.

void plll::arithmetic::add ( Integer &  r,
const Integer &  a,
const Integer &  b 
)
inline

Adds a and b and stores the result in r.

Parameters
rThe result.
aThe first operand.
bThe second operand.

Definition at line 1319 of file arithmetic-gmp.hpp.

template<typename Type >
void plll::arithmetic::add ( NInt< Type > &  r,
const NInt< Type > &  a,
const NInt< Type > &  b 
)
inline

Adds a and b and stores the result in r.

Parameters
rThe result.
aThe first operand.
bThe second operand.

Definition at line 1631 of file arithmetic-nint.hpp.

void plll::arithmetic::add ( Real &  r,
const Real &  a,
const Real &  b 
)
inline

Adds a and b and stores the result in r.

Parameters
rThe result.
aThe first operand.
bThe second operand.

Definition at line 2444 of file arithmetic-gmp.hpp.

void plll::arithmetic::addmul ( Integer &  r,
const Integer &  a,
const Integer &  b 
)
inline

Multiplies a and b and adds the result to r.

Parameters
rThe accumulator.
aThe first operand.
bThe second operand.

Definition at line 1463 of file arithmetic-gmp.hpp.

template<typename Type >
void plll::arithmetic::addmul ( NInt< Type > &  r,
const NInt< Type > &  a,
const NInt< Type > &  b 
)
inline

Multiplies a and b and adds the result to r.

Parameters
rThe accumulator.
aThe first operand.
bThe second operand.

Definition at line 1643 of file arithmetic-nint.hpp.

void plll::arithmetic::addmul ( Real &  r,
const Real &  a,
const Real &  b 
)
inline

Multiplies a and b and adds the result to r.

Parameters
rThe accumulator.
aThe first operand.
bThe second operand.

Definition at line 2588 of file arithmetic-gmp.hpp.

void plll::arithmetic::addmul ( Rational &  r,
const Rational &  a,
const Rational &  b 
)
inline

Multiplies a and b and adds the result to r.

Parameters
rThe accumulator.
aThe first operand.
bThe second operand.

Definition at line 1256 of file rational-ops.hpp.

long plll::arithmetic::approxLog2 ( const Integer &  x)

Quickly approximates $\log_2 |x|$ and returns the approximation.

Parameters
xA non-zero integer.
Returns
$\approx \log_2 |x|$.

Definition at line 1793 of file arithmetic-gmp.hpp.

template<typename Type >
long plll::arithmetic::approxLog2 ( const NInt< Type > &  x)
inline

Quickly approximates $\log_2 |x|$ and returns the approximation.

Parameters
xA non-zero integer.
Returns
$\approx \log_2 |x|$.

Definition at line 2161 of file arithmetic-nint.hpp.

void plll::arithmetic::asin ( Real &  res,
const Real &  a 
)
inline

Computes the arcsine of a and stores the result in res.

Parameters
resThe result.
aThe value the function is evaluated at.
See also
Trigonometric Functions

Definition at line 3055 of file arithmetic-gmp.hpp.

expressions::Expression<RealContext, expressions::Wrapper<RealContext>, expressions::ASinOp> plll::arithmetic::asin ( const Real &  i)
inline

Returns the arcsine of the given floating point number.

Parameters
iThe operand.
Returns
The result.
See also
Trigonometric Functions

Definition at line 1495 of file arithmetic-gmp-rops.hpp.

expressions::Expression<RealContext, expressions::Wrapper<RealContext>, expressions::ASinOp_Context> plll::arithmetic::asin ( const Real &  i,
const RealContext &  rc 
)
inline

Returns the arcsine of the given floating point number.

Parameters
iThe operand.
rcThe context whose precision to use for the result.
Returns
The result.
See also
Trigonometric Functions

Definition at line 1914 of file arithmetic-gmp-rops.hpp.

void plll::arithmetic::atan ( Real &  res,
const Real &  a 
)
inline

Computes the arctangent of a and stores the result in res.

Parameters
resThe result.
aThe value the function is evaluated at.
See also
Trigonometric Functions

Definition at line 3073 of file arithmetic-gmp.hpp.

expressions::Expression<RealContext, expressions::Wrapper<RealContext>, expressions::ATanOp> plll::arithmetic::atan ( const Real &  i)
inline

Returns the arctangent of the given floating point number.

Parameters
iThe operand.
Returns
The result.
See also
Trigonometric Functions

Definition at line 1517 of file arithmetic-gmp-rops.hpp.

expressions::Expression<RealContext, expressions::Wrapper<RealContext>, expressions::ATanOp_Context> plll::arithmetic::atan ( const Real &  i,
const RealContext &  rc 
)
inline

Returns the arctangent of the given floating point number.

Parameters
iThe operand.
rcThe context whose precision to use for the result.
Returns
The result.
See also
Trigonometric Functions

Definition at line 1938 of file arithmetic-gmp-rops.hpp.

void plll::arithmetic::atan2 ( Real &  res,
const Real &  y,
const Real &  x 
)
inline

Computes the arctangent of $\tfrac{y}{x}$and stores the result inres. The signs ofxandy` are used to determine the quadrant and yield a result in $[-\pi, \pi]$.

Parameters
resThe result.
yThe numerator of the fraction the function is evaluated at.
xThe denominator of the fraction the function is evaluated at.
See also
Trigonometric Functions

Definition at line 3082 of file arithmetic-gmp.hpp.

expressions::Expression<RealContext, std::pair<expressions::Wrapper<RealContext>, expressions::Wrapper<RealContext> >, expressions::ATan2Op> plll::arithmetic::atan2 ( const Real &  y,
const Real &  x 
)
inline

Returns the arctangent of $\tfrac{y}{x}$, using the signs of x and y to determine the quadrant.

Parameters
yThe numerator.
xThe denominator.
Returns
The result.
See also
Trigonometric Functions

Definition at line 1531 of file arithmetic-gmp-rops.hpp.

expressions::Expression<RealContext, std::pair<expressions::Wrapper<RealContext>, expressions::Wrapper<RealContext> >, expressions::ATan2Op_Context> plll::arithmetic::atan2 ( const Real &  y,
const Real &  x,
const RealContext &  rc 
)
inline

Returns the arctangent of $\tfrac{y}{x}$, using the signs of x and y to determine the quadrant.

Parameters
yThe numerator.
xThe denominator.
rcThe context whose precision to use for the result.
Returns
The result.
See also
Trigonometric Functions

Definition at line 1953 of file arithmetic-gmp-rops.hpp.

void plll::arithmetic::band ( Integer &  r,
const Integer &  a,
const Integer &  b 
)
inline

Computes the bitwise and of a and b and stores the result in r.

Parameters
rThe result.
aThe first operand.
bThe second operand.

Definition at line 1555 of file arithmetic-gmp.hpp.

int plll::arithmetic::bit ( const Integer &  x,
long  n 
)
inline

Returns the n bit of $|x|$ in the usual binary representation.

Parameters
xThe integer whose bit to query.
nThe index of the bit to query.

Definition at line 1773 of file arithmetic-gmp.hpp.

template<typename Type >
int plll::arithmetic::bit ( const NInt< Type > &  x,
long  n 
)
inline

Returns the n bit of $|x|$ in the usual binary representation.

Parameters
xThe integer whose bit to query.
nThe index of the bit to query.

Definition at line 1846 of file arithmetic-nint.hpp.

long plll::arithmetic::bitLength ( const Integer &  x)
inline

Computes and returns n such that $2^{n-1} \le |x| < 2^n$.

Parameters
xA non-zero integer.
Returns
$n \in \mathbb{N}$ such that ` $2^{n-1} \le |x| < 2^n$.
See also
Integer Functions

Definition at line 1810 of file arithmetic-gmp.hpp.

template<typename Type >
long plll::arithmetic::bitLength ( const NInt< Type > &  x)
inline

Computes and returns n such that $2^{n-1} \le |x| < 2^n$.

Parameters
xA non-zero integer.
Returns
$n \in \mathbb{N}$ such that ` $2^{n-1} \le |x| < 2^n$.
See also
Integer Functions

Definition at line 2168 of file arithmetic-nint.hpp.

void plll::arithmetic::bneg ( Integer &  r,
const Integer &  a 
)
inline

Takes the bitwise complement of a and stores the result in r.

Parameters
rThe result.
aThe operand.

Definition at line 1570 of file arithmetic-gmp.hpp.

void plll::arithmetic::bor ( Integer &  r,
const Integer &  a,
const Integer &  b 
)
inline

Computes the bitwise or of a and b and stores the result in r.

Parameters
rThe result.
aThe first operand.
bThe second operand.

Definition at line 1560 of file arithmetic-gmp.hpp.

void plll::arithmetic::bxor ( Integer &  r,
const Integer &  a,
const Integer &  b 
)
inline

Computes the bitwise exclusive or of a and b and stores the result in r.

Parameters
rThe result.
aThe first operand.
bThe second operand.

Definition at line 1565 of file arithmetic-gmp.hpp.

void plll::arithmetic::ceilDiv ( Integer &  r,
const Integer &  a,
const Integer &  b 
)

Computes $\lceil \tfrac{a}{b} \rceil$ and stores the result in r.

Parameters
rThe result.
aThe divident.
bThe divisor.
See also
Integer Functions

Definition at line 1524 of file arithmetic-gmp.hpp.

template<typename Type >
void plll::arithmetic::ceilDiv ( NInt< Type > &  r,
const NInt< Type > &  a,
const NInt< Type > &  b 
)

Computes $\lceil \tfrac{a}{b} \rceil$ and stores the result in r.

Parameters
rThe result.
aThe divident.
bThe divisor.
See also
Integer Functions

Definition at line 2196 of file arithmetic-nint.hpp.

template<typename Type >
NInt< Type > plll::arithmetic::ceilDiv ( const NInt< Type > &  a,
const NInt< Type > &  b 
)

Computes and returns $\lceil \tfrac{a}{b} \rceil$.

Returns
The result.
Parameters
aThe divident.
bThe divisor.
See also
Integer Functions

Definition at line 2209 of file arithmetic-nint.hpp.

expressions::Expression<IntegerContext, std::pair<expressions::Wrapper<IntegerContext>, expressions::Wrapper<IntegerContext> >, expressions::CeilDivOp> plll::arithmetic::ceilDiv ( const Integer &  a,
const Integer &  b 
)
inline

Computes and returns $\lceil \tfrac{a}{b} \rceil$.

Parameters
aThe first operand.
bThe second operand.
Returns
The result.

Definition at line 1596 of file arithmetic-gmp-iops.hpp.

long plll::arithmetic::ceilOfLog2 ( const Integer &  x)

Computes and returns $\lceil \log_2 |x| \rceil$.

Parameters
xA non-zero integer.
Returns
$n \in \mathbb{N}$ such that ` $2^{n-1} < |x| \le 2^n$.
See also
Integer Functions

Definition at line 1798 of file arithmetic-gmp.hpp.

template<typename Type >
long plll::arithmetic::ceilOfLog2 ( const NInt< Type > &  x)

Computes and returns $\lceil \log_2 |x| \rceil$.

Parameters
xA non-zero integer.
Returns
$n \in \mathbb{N}$ such that ` $2^{n-1} < |x| \le 2^n$.
See also
Integer Functions

Definition at line 1965 of file arithmetic-nint.hpp.

int plll::arithmetic::compare ( const Rational &  a,
const Rational &  b 
)
inline

Compares the two rational numbers.

Parameters
aThe first operand.
bThe second operand.
Returns
Returns a negative number if $a < b$, zero if $a = b$ and a positive number if $a > b$.

Definition at line 1320 of file rational.hpp.

int plll::arithmetic::compare ( const Integer &  a,
const Integer &  b 
)
inline

Compares the two integers.

Parameters
aThe first operand.
bThe second operand.
Returns
Returns a negative number if $a < b$, zero if $a = b$ and a positive number if $a > b$.

Definition at line 1718 of file arithmetic-gmp.hpp.

int plll::arithmetic::compare ( const Real &  a,
const Real &  b 
)
inline

Compares the two floating point numbers.

Parameters
aThe first operand.
bThe second operand.
Returns
Returns a negative number if $a < b$, zero if $a = b$ and a positive number if $a > b$.

Definition at line 2950 of file arithmetic-gmp.hpp.

template<typename Type >
int plll::arithmetic::compare ( const NInt< Type > &  a,
const NInt< Type > &  b 
)
inline

Compares the two integers.

Parameters
aThe first operand.
bThe second operand.
Returns
Returns a negative number if $a < b$, zero if $a = b$ and a positive number if $a > b$.

Definition at line 1799 of file arithmetic-nint.hpp.

int plll::arithmetic::compareAbsValues ( const Rational &  a,
const Rational &  b 
)
inline

Compares the two rational numbers in absolute value.

Parameters
aThe first operand.
bThe second operand.
Returns
Returns a negative number if $|a| < |b|$, zero if $|a| = |b|$ and a positive number if $|a| > |b|$.

Definition at line 1331 of file rational.hpp.

int plll::arithmetic::compareAbsValues ( const Integer &  a,
const Integer &  b 
)
inline

Compares the two integers in absolute value.

Parameters
aThe first operand.
bThe second operand.
Returns
Returns a negative number if $|a| < |b|$, zero if $|a| = |b|$ and a positive number if $|a| > |b|$.

Definition at line 1742 of file arithmetic-gmp.hpp.

int plll::arithmetic::compareAbsValues ( const Real &  a,
const Real &  b 
)
inline

Compares the two floating point numbers in absolute value.

Parameters
aThe first operand.
bThe second operand.
Returns
Returns a negative number if $|a| < |b|$, zero if $|a| = |b|$ and a positive number if $|a| > |b|$.

Definition at line 3002 of file arithmetic-gmp.hpp.

template<typename Type >
int plll::arithmetic::compareAbsValues ( const NInt< Type > &  a,
const NInt< Type > &  b 
)
inline

Compares the two integers in absolute value.

Parameters
aThe first operand.
bThe second operand.
Returns
Returns a negative number if $|a| < |b|$, zero if $|a| = |b|$ and a positive number if $|a| > |b|$.

Definition at line 1806 of file arithmetic-nint.hpp.

template<class SourceType , class DestContext >
void plll::arithmetic::convert ( typename DestContext::Type &  dst,
const SourceType &  src,
const DestContext &  context 
)

Converts the value in src to the type described by context and stores the result in dst.

Template Parameters
SourceTypeThe source type.
DestContextThe type of the arithmetic context for the destination.
Parameters
dstThe destination variable.
srcThe source variable. Can also be a C or C++ string.
contextThe arithmetic context for the destination.
See also
Conversions with Contexts
Conversions to and from Strings

Definition at line 734 of file arithmetic.hpp.

template<class SourceType , class DestContext >
implementation::conversion_impl<SourceType, DestContext>::RetVal plll::arithmetic::convert ( const SourceType &  src,
const DestContext &  context 
)

Converts the value in src to the type described by context and returns the result.

Template Parameters
SourceTypeThe source type.
DestContextThe type of the arithmetic context for the destination.
Returns
The result of the conversion.
Parameters
srcThe source variable. Can also be a C or C++ string.
contextThe arithmetic context for the destination.
See also
Conversions with Contexts
Conversions to and from Strings

Definition at line 753 of file arithmetic.hpp.

template<class Native , class SourceType >
implementation::nativeconversion_impl2<Native, SourceType, traits::type_traits<Native>::is_inttype || !traits::type_traits<Native>::is_number, traits::type_traits<SourceType>::is_inttype || !traits::type_traits<SourceType>::is_number>::RetVal plll::arithmetic::convert ( const SourceType &  src)

Converts the value in src to the native type Native and returns the result.

Template Parameters
NativeThe native type to convert to. Can also be std::string.
SourceTypeThe source type.
Parameters
srcThe source variable.
Returns
The converted result of type Native.
See also
Conversions to Native Types
Conversions to and from Strings

Definition at line 1032 of file arithmetic.hpp.

template<class SourceType , class DestContext >
void plll::arithmetic::convert_ceil ( typename DestContext::Type &  dst,
const SourceType &  src,
const DestContext &  context 
)

Converts the ceil of the value in src to the type described by context and stores the result in dst.

This method is only allowed in case src is a real type and dst an integer type.

Template Parameters
SourceTypeThe source type.
DestContextThe type of the arithmetic context for the destination.
Parameters
dstThe destination variable.
srcThe source variable.
contextThe arithmetic context for the destination.
See also
Conversions with Contexts

Definition at line 955 of file arithmetic.hpp.

template<class SourceType , class DestContext >
implementation::conversion_impl<SourceType, DestContext>::RetVal_Ceil plll::arithmetic::convert_ceil ( const SourceType &  src,
const DestContext &  context 
)

Converts the ceil of the value in src to the type described by context and returns the result in dst.

This method is only allowed in case src is a real type and context an integer context.

Template Parameters
SourceTypeThe source type.
DestContextThe type of the arithmetic context for the destination.
Returns
The result of the conversion.
Parameters
srcThe source variable.
contextThe arithmetic context for the destination.
See also
Conversions with Contexts

Definition at line 977 of file arithmetic.hpp.

template<class Native , class SourceType >
implementation::nativeconversion_impl2<Native, SourceType, traits::type_traits<Native>::is_inttype || !traits::type_traits<Native>::is_number, traits::type_traits<SourceType>::is_inttype || !traits::type_traits<SourceType>::is_number>::RetVal_Ceil plll::arithmetic::convert_ceil ( const SourceType &  src)

Converts the ceil of the value in src to the native type Native and returns the result.

Template Parameters
NativeThe native type to convert to.
SourceTypeThe source type.
Parameters
srcThe source variable.
Returns
The converted result.
See also
Conversions to Native Types

Definition at line 1120 of file arithmetic.hpp.

template<class SourceType , class DestContext >
void plll::arithmetic::convert_floor ( typename DestContext::Type &  dst,
const SourceType &  src,
const DestContext &  context 
)

Converts the floor of the value in src to the type described by context and stores the result in dst.

This method is only allowed in case src is a real type and dst an integer type.

Template Parameters
SourceTypeThe source type.
DestContextThe type of the arithmetic context for the destination.
Parameters
dstThe destination variable.
srcThe source variable.
contextThe arithmetic context for the destination.
See also
Conversions with Contexts

Definition at line 819 of file arithmetic.hpp.

template<class SourceType , class DestContext >
implementation::conversion_impl<SourceType, DestContext>::RetVal_Floor plll::arithmetic::convert_floor ( const SourceType &  src,
const DestContext &  context 
)

Converts the floor of the value in src to the type described by context and returns the result.

This method is only allowed in case src is a real type and context an integer context.

Template Parameters
SourceTypeThe source type.
DestContextThe type of the arithmetic context for the destination.
Returns
The result of the conversion.
Parameters
srcThe source variable.
contextThe arithmetic context for the destination.
See also
Conversions with Contexts

Definition at line 841 of file arithmetic.hpp.

template<class Native , class SourceType >
implementation::nativeconversion_impl2<Native, SourceType, traits::type_traits<Native>::is_inttype || !traits::type_traits<Native>::is_number, traits::type_traits<SourceType>::is_inttype || !traits::type_traits<SourceType>::is_number>::RetVal_Floor plll::arithmetic::convert_floor ( const SourceType &  src)

Converts the floor of the value in src to the native type Native and returns the result.

Template Parameters
NativeThe native type to convert to.
SourceTypeThe source type.
Parameters
srcThe source variable.
Returns
The converted result.
See also
Conversions to Native Types

Definition at line 1052 of file arithmetic.hpp.

template<class SourceType , class DestContext >
void plll::arithmetic::convert_fraction ( typename DestContext::Type &  dst,
const SourceType &  src1,
const SourceType &  src2,
const DestContext &  context 
)

Converts the values in src1 and scr2 to the type described by context and stores their quotient in dst.

This method is only allowed in case context a real context.

Template Parameters
SourceTypeThe source type.
DestContextThe type of the arithmetic context for the destination.
Parameters
dstThe destination variable.
src1The source variable for the numerator.
src2The source variable for the denominator.
contextThe arithmetic context for the destination.
See also
Conversions with Contexts

Definition at line 774 of file arithmetic.hpp.

template<class SourceType , class DestContext >
implementation::conversion_impl<SourceType, DestContext>::RetVal_Frac plll::arithmetic::convert_fraction ( const SourceType &  src1,
const SourceType &  src2,
const DestContext &  context 
)

Converts the values in src1 and scr2 to the type described by context and returns their quotient.

This method is only allowed in case context a real context.

Template Parameters
SourceTypeThe source type.
DestContextThe type of the arithmetic context for the destination.
Returns
The result of the conversion.
Parameters
src1The source variable for the numerator.
src2The source variable for the denominator.
contextThe arithmetic context for the destination.
See also
Conversions with Contexts

Definition at line 797 of file arithmetic.hpp.

template<class SourceType , class DestContext >
void plll::arithmetic::convert_round ( typename DestContext::Type &  dst,
const SourceType &  src,
const DestContext &  context 
)

Converts the rounded value in src to the type described by context and stores the result in dst.

This method is only allowed in case src is a real type and dst an integer type.

Template Parameters
SourceTypeThe source type.
DestContextThe type of the arithmetic context for the destination.
Parameters
dstThe destination variable.
srcThe source variable.
contextThe arithmetic context for the destination.
See also
Conversions with Contexts

Definition at line 863 of file arithmetic.hpp.

template<class SourceType , class DestContext >
implementation::conversion_impl<SourceType, DestContext>::RetVal_Round plll::arithmetic::convert_round ( const SourceType &  src,
const DestContext &  context 
)

Converts the rounded value in src to the type described by context and returns the result.

This method is only allowed in case src is a real type and context an integer context.

Template Parameters
SourceTypeThe source type.
DestContextThe type of the arithmetic context for the destination.
Returns
The result of the conversion.
Parameters
srcThe source variable.
contextThe arithmetic context for the destination.
See also
Conversions with Contexts

Definition at line 885 of file arithmetic.hpp.

template<class SourceType , class DestContext >
void plll::arithmetic::convert_round ( typename DestContext::Type &  dst,
const SourceType &  src,
bool &  up,
const DestContext &  context 
)

Converts the rounded value in src to the type described by context and stores the result in dst. Stores in up whether the value was rounded up or down.

This method is only allowed in case src is a real type and dst an integer type.

Template Parameters
SourceTypeThe source type.
DestContextThe type of the arithmetic context for the destination.
Parameters
dstThe destination variable.
srcThe source variable.
upWill be set to true if src was rounded up, or false if it was rounded down.
contextThe arithmetic context for the destination.
See also
Conversions with Contexts

Definition at line 909 of file arithmetic.hpp.

template<class SourceType , class DestContext >
implementation::conversion_impl<SourceType, DestContext>::RetVal_Round2 plll::arithmetic::convert_round ( const SourceType &  src,
bool &  up,
const DestContext &  context 
)

Converts the rounded value in src to the type described by context and returns the result. Stores in up whether the value was rounded up or down.

This method is only allowed in case src is a real type and context an integer context.

Template Parameters
SourceTypeThe source type.
DestContextThe type of the arithmetic context for the destination.
Returns
The result of the conversion.
Parameters
srcThe source variable.
upWill be set to true if src was rounded up, or false if it was rounded down.
contextThe arithmetic context for the destination.
See also
Conversions with Contexts

Definition at line 933 of file arithmetic.hpp.

template<class Native , class SourceType >
implementation::nativeconversion_impl2<Native, SourceType, traits::type_traits<Native>::is_inttype || !traits::type_traits<Native>::is_number, traits::type_traits<SourceType>::is_inttype || !traits::type_traits<SourceType>::is_number>::RetVal_Round plll::arithmetic::convert_round ( const SourceType &  src)

Converts the rounded value of src to the native type Native and returns the result.

Template Parameters
NativeThe native type to convert to.
SourceTypeThe source type.
Parameters
srcThe source variable.
Returns
The converted result.
See also
Conversions to Native Types

Definition at line 1074 of file arithmetic.hpp.

template<class Native , class SourceType >
implementation::nativeconversion_impl2<Native, SourceType, traits::type_traits<Native>::is_inttype || !traits::type_traits<Native>::is_number, traits::type_traits<SourceType>::is_inttype || !traits::type_traits<SourceType>::is_number>::RetVal_Round2 plll::arithmetic::convert_round ( const SourceType &  src,
bool &  up 
)

Converts the rounded value of src to the native type Native and returns the result. Returns whether the value was rounded up or not in up.

Template Parameters
NativeThe native type to convert to.
SourceTypeThe source type.
Parameters
srcThe source variable.
upWill be set to true if src was rounded up, or false if it was rounded down.
Returns
The converted result.
See also
Conversions to Native Types

Definition at line 1098 of file arithmetic.hpp.

void plll::arithmetic::cos ( Real &  res,
const Real &  a 
)
inline

Computes the cosine of a and stores the result in res.

Parameters
resThe result.
aThe value the function is evaluated at.
See also
Trigonometric Functions

Definition at line 3037 of file arithmetic-gmp.hpp.

expressions::Expression<RealContext, expressions::Wrapper<RealContext>, expressions::CosOp> plll::arithmetic::cos ( const Real &  i)
inline

Returns the cosine of the given floating point number.

Parameters
iThe operand.
Returns
The result.
See also
Trigonometric Functions

Definition at line 1473 of file arithmetic-gmp-rops.hpp.

expressions::Expression<RealContext, expressions::Wrapper<RealContext>, expressions::CosOp_Context> plll::arithmetic::cos ( const Real &  i,
const RealContext &  rc 
)
inline

Returns the cosine of the given floating point number.

Parameters
iThe operand.
rcThe context whose precision to use for the result.
Returns
The result.
See also
Trigonometric Functions

Definition at line 1890 of file arithmetic-gmp-rops.hpp.

void plll::arithmetic::decrement ( Rational &  r,
const Rational &  a 
)
inline

Negates a and stores the result in r.

Parameters
rThe result.
aThe operand.

Definition at line 1265 of file rational.hpp.

void plll::arithmetic::decrement ( Integer &  r,
const Integer &  a 
)
inline

Decrements a by one and stores the result in r.

Parameters
rThe result.
aThe operand.

Definition at line 1314 of file arithmetic-gmp.hpp.

template<typename Type >
void plll::arithmetic::decrement ( NInt< Type > &  r,
const NInt< Type > &  a 
)
inline

Decrements a by one and stores the result in r.

Parameters
rThe result.
aThe operand.

Definition at line 1740 of file arithmetic-nint.hpp.

void plll::arithmetic::decrement ( Real &  r,
const Real &  a 
)
inline

Decrements a by one and stores the result in r.

Parameters
rThe result.
aThe operand.

Definition at line 2884 of file arithmetic-gmp.hpp.

void plll::arithmetic::div ( Rational &  r,
const Rational &  a,
const Rational &  b 
)
inline

Divides a by b and stores the result in r.

Parameters
rThe result.
aThe first operand.
bThe second operand.

Definition at line 1081 of file rational.hpp.

void plll::arithmetic::div ( Integer &  r,
const Integer &  a,
const Integer &  b 
)
inline

Divides a by b and stores the result in r.

Parameters
rThe result.
aThe first operand.
bThe second operand.

Definition at line 1399 of file arithmetic-gmp.hpp.

template<typename Type >
void plll::arithmetic::div ( NInt< Type > &  r,
const NInt< Type > &  a,
const NInt< Type > &  b 
)
inline

Divides a by b and stores the result in r.

Parameters
rThe result.
aThe first operand.
bThe second operand.

Definition at line 1661 of file arithmetic-nint.hpp.

void plll::arithmetic::div ( Real &  r,
const Real &  a,
const Real &  b 
)
inline

Divides a by b and stores the result in r.

Parameters
rThe result.
aThe first operand.
bThe second operand.

Definition at line 2693 of file arithmetic-gmp.hpp.

void plll::arithmetic::divmod ( Integer &  q,
Integer &  r,
const Integer &  a,
const Integer &  b 
)
inline

Stores quotient and remainder of the division of a by b in q respectively r.

Parameters
qThe quotient.
rThe remainder.
aThe first operand.
bThe second operand.

Definition at line 1439 of file arithmetic-gmp.hpp.

template<typename Type >
void plll::arithmetic::divmod ( NInt< Type > &  q,
NInt< Type > &  r,
const NInt< Type > &  a,
const NInt< Type > &  b 
)
inline

Stores quotient and remainder of the division of a by b in q respectively r.

Parameters
qThe quotient.
rThe remainder.
aThe first operand.
bThe second operand.

Definition at line 1673 of file arithmetic-nint.hpp.

void plll::arithmetic::divmod ( Real &  q,
Real &  r,
const Real &  a,
const Real &  b 
)
inline

Stores quotient and remainder of the division of a by b in q respectively r.

Parameters
qThe quotient.
rThe remainder.
aThe first operand.
bThe second operand.

Definition at line 2787 of file arithmetic-gmp.hpp.

void plll::arithmetic::euclideanDivision ( Integer &  q,
Integer &  r,
const Integer &  a,
const Integer &  b 
)
inline

Computes an Euclidean Division of a by b.

Parameters
qThe quotient of a divided by b.
rThe remainder of a divided by b, i.e. a modulo b.
aThe first operand.
bThe second operand. Must be non-zero.

Computes q and r such that a == q * b + r and that $0 \le |r| \le |b|$ and $b \cdot r \ge 0$.

Definition at line 1646 of file arithmetic-gmp.hpp.

template<typename Type >
void plll::arithmetic::euclideanDivision ( NInt< Type > &  q,
NInt< Type > &  r,
const NInt< Type > &  a,
const NInt< Type > &  b 
)
inline

Computes an Euclidean Division of a by b.

Parameters
qThe quotient of a divided by b.
rThe remainder of a divided by b, i.e. a modulo b.
aThe first operand.
bThe second operand. Must be non-zero.

Computes q and r such that a == q * b + r and that $0 \le |r| \le |b|$ and $b \cdot r \ge 0$.

Definition at line 2238 of file arithmetic-nint.hpp.

void plll::arithmetic::euclideanDivisionPos ( Integer &  q,
Integer &  r,
const Integer &  a,
const Integer &  b 
)
inline

Computes an Euclidean Division of a by b.

Parameters
qThe quotient of a divided by b.
rThe remainder of a divided by b, i.e. a modulo b.
aThe first operand.
bThe second operand. Must be non-zero.

Computes q and r such that a == q * b + r and that $0 \le r \le |b|$.

Definition at line 1652 of file arithmetic-gmp.hpp.

template<typename Type >
void plll::arithmetic::euclideanDivisionPos ( NInt< Type > &  q,
NInt< Type > &  r,
const NInt< Type > &  a,
const NInt< Type > &  b 
)
inline

Computes an Euclidean Division of a by b.

Parameters
qThe quotient of a divided by b.
rThe remainder of a divided by b, i.e. a modulo b.
aThe first operand.
bThe second operand. Must be non-zero.

Computes q and r such that a == q * b + r and that $0 \le r \le |b|$.

Definition at line 2246 of file arithmetic-nint.hpp.

void plll::arithmetic::exp ( Real &  res,
const Real &  a 
)
inline

Computes the exponential function at a and stores the result in res.

Parameters
resThe result.
aThe value the function is evaluated at.
See also
Trigonometric Functions

Definition at line 3094 of file arithmetic-gmp.hpp.

expressions::Expression<RealContext, expressions::Wrapper<RealContext>, expressions::ExpOp> plll::arithmetic::exp ( const Real &  i)
inline

Returns the exponential function evaluated at the given floating point number.

Parameters
iThe operand.
Returns
The result.
See also
Special Functions

Definition at line 1548 of file arithmetic-gmp-rops.hpp.

expressions::Expression<RealContext, expressions::Wrapper<RealContext>, expressions::ExpOp_Context> plll::arithmetic::exp ( const Real &  i,
const RealContext &  rc 
)
inline

Returns the exponential function evaluated at the given floating point number.

Parameters
iThe operand.
rcThe context whose precision to use for the result.
rcThe context whose precision to use for the result.
Returns
The result.
See also
Special Functions

Definition at line 1972 of file arithmetic-gmp-rops.hpp.

void plll::arithmetic::floorDiv ( Integer &  r,
const Integer &  a,
const Integer &  b 
)

Computes $\lfloor \tfrac{a}{b} \rfloor$ and stores the result in r.

Parameters
rThe result.
aThe divident.
bThe divisor.
See also
Integer Functions

Definition at line 1519 of file arithmetic-gmp.hpp.

template<typename Type >
void plll::arithmetic::floorDiv ( NInt< Type > &  r,
const NInt< Type > &  a,
const NInt< Type > &  b 
)

Computes $\lfloor \tfrac{a}{b} \rfloor$ and stores the result in r.

Parameters
rThe result.
aThe divident.
bThe divisor.
See also
Integer Functions

Definition at line 2175 of file arithmetic-nint.hpp.

template<typename Type >
NInt< Type > plll::arithmetic::floorDiv ( const NInt< Type > &  a,
const NInt< Type > &  b 
)

Computes and returns $\lfloor \tfrac{a}{b} \rfloor$.

Returns
The result.
Parameters
aThe divident.
bThe divisor.
See also
Integer Functions

Definition at line 2188 of file arithmetic-nint.hpp.

expressions::Expression<IntegerContext, std::pair<expressions::Wrapper<IntegerContext>, expressions::Wrapper<IntegerContext> >, expressions::FloorDivOp> plll::arithmetic::floorDiv ( const Integer &  a,
const Integer &  b 
)
inline

Computes and returns $\lfloor \tfrac{a}{b} \rfloor$.

Parameters
aThe base.
bThe exponent.
Returns
The result.

Definition at line 1583 of file arithmetic-gmp-iops.hpp.

long plll::arithmetic::floorOfLog2 ( const Integer &  x)

Computes and returns $\lfloor \log_2 |x| \rfloor$.

Parameters
xA non-zero integer.
Returns
$n \in \mathbb{N}$ such that ` $2^n \le |x| < 2^{n+1}$.
See also
Integer Functions

Definition at line 1805 of file arithmetic-gmp.hpp.

template<typename Type >
long plll::arithmetic::floorOfLog2 ( const NInt< Type > &  x)

Computes and returns $\lfloor \log_2 |x| \rfloor$.

Parameters
xA non-zero integer.
Returns
$n \in \mathbb{N}$ such that ` $2^n \le |x| < 2^{n+1}$.
See also
Integer Functions

Definition at line 1982 of file arithmetic-nint.hpp.

void plll::arithmetic::gamma ( Real &  res,
const Real &  a 
)
inline

Computes the Gamma function at a and stores the result in res.

Parameters
resThe result.
aThe value the function is evaluated at.
See also
Square Roots and Full Powers

Definition at line 3139 of file arithmetic-gmp.hpp.

expressions::Expression<RealContext, expressions::Wrapper<RealContext>, expressions::GammaOp> plll::arithmetic::gamma ( const Real &  i)
inline

Returns the Gamma function evaluated at the given floating point number.

Parameters
iThe operand.
Returns
The result.
See also
Special Functions

Definition at line 1607 of file arithmetic-gmp-rops.hpp.

expressions::Expression<RealContext, expressions::Wrapper<RealContext>, expressions::GammaOp_Context> plll::arithmetic::gamma ( const Real &  i,
const RealContext &  rc 
)
inline

Returns the Gamma function evaluated at the given floating point number.

Parameters
iThe operand.
rcThe context whose precision to use for the result.
Returns
The result.
See also
Special Functions

Definition at line 2036 of file arithmetic-gmp-rops.hpp.

void plll::arithmetic::GCD ( Integer &  r,
const Integer &  x,
const Integer &  y 
)
inline

Computes the non-negative Greatest Common Divisior r of x and y.

Parameters
rThe result is stored in here.
xThe first operand.
yThe first operand.
See also
Integer Functions

Definition at line 1658 of file arithmetic-gmp.hpp.

template<typename Type >
void plll::arithmetic::GCD ( NInt< Type > &  r,
const NInt< Type > &  x,
const NInt< Type > &  y 
)
inline

Computes the non-negative Greatest Common Divisior r of x and y.

Parameters
rThe result is stored in here.
xThe first operand.
yThe first operand.
See also
Integer Functions

Definition at line 2260 of file arithmetic-nint.hpp.

template<typename Type >
NInt< Type > plll::arithmetic::GCD ( const NInt< Type > &  x,
const NInt< Type > &  y 
)
inline

Computes and returns the non-negative Greatest Common Divisior of x and y.

Returns
The GCD of x and y.
Parameters
xThe first operand.
yThe first operand.
See also
Integer Functions

Definition at line 2278 of file arithmetic-nint.hpp.

expressions::Expression<IntegerContext, std::pair<expressions::Wrapper<IntegerContext>, expressions::Wrapper<IntegerContext> >, expressions::GCDOp> plll::arithmetic::GCD ( const Integer &  a,
const Integer &  b 
)
inline

Computes and returns the non-negative Greatest Common Divisor of a and b.

Parameters
aThe first operand.
bThe second operand.
Returns
The result.

Definition at line 1536 of file arithmetic-gmp-iops.hpp.

void plll::arithmetic::increment ( Rational &  r,
const Rational &  a 
)
inline

Increments a by one and stores the result in r.

Parameters
rThe result.
aThe operand.

Definition at line 1258 of file rational.hpp.

void plll::arithmetic::increment ( Integer &  r,
const Integer &  a 
)
inline

Increments a by one and stores the result in r.

Parameters
rThe result.
aThe operand.
See also
Integer Functions

Definition at line 1309 of file arithmetic-gmp.hpp.

template<typename Type >
void plll::arithmetic::increment ( NInt< Type > &  r,
const NInt< Type > &  a 
)
inline

Increments a by one and stores the result in r.

Parameters
rThe result.
aThe operand.
See also
Integer Functions

Definition at line 1734 of file arithmetic-nint.hpp.

void plll::arithmetic::increment ( Real &  r,
const Real &  a 
)
inline

Increments a by one and stores the result in r.

Parameters
rThe result.
aThe operand.

Definition at line 2875 of file arithmetic-gmp.hpp.

void plll::arithmetic::initArithmeticThreadAllocators ( )

Initializes the local thread allocator for the current thread, and sets the GMP and MPFR allocators to the local thread allocator.

This function must be called at the beginning of each thread (and, most importantly, of the process itself!) before any plll::arithmetic::Integer or pll::arithmetic::Real variable was initialized.

Warning
In case the program uses GMP and/or MPFR directly, this function must also be called before any GMP respectively MPFR method is used directly.

Violation of this will quite surely lead to crashes and/or segmentation faults.

bool plll::arithmetic::isNegative ( const Rational &  r)
inline

Tests the given rational number for being strictly negative.

Returns
Returns true if and only if the argument is strictly negative.
See also
Predicates

Definition at line 829 of file rational.hpp.

bool plll::arithmetic::isNegative ( const Integer &  )
inline

Tests the given plll::arithmetic::Integer object for being strictly negative.

Returns
Returns true if and only if the argument is strictly negative.
See also
Predicates

Definition at line 1631 of file arithmetic-gmp.hpp.

bool plll::arithmetic::isNegative ( const Real &  )
inline

Tests the given plll::arithmetic::Real object for being strictly negative.

Returns
Returns true if and only if the argument is strictly negative.
See also
Predicates

Definition at line 2432 of file arithmetic-gmp.hpp.

template<typename Type >
bool plll::arithmetic::isNegative ( const NInt< Type > &  r)
inline

Tests the given plll::arithmetic::Integer object for being strictly negative.

Returns
Returns true if and only if the argument is strictly negative.
See also
Predicates

Definition at line 1617 of file arithmetic-nint.hpp.

bool plll::arithmetic::isNonNegative ( const Rational &  r)
inline

Tests the given rational number for being positive or zero.

Returns
Returns true if and only if the argument is positive or zero.
See also
Predicates

Definition at line 824 of file rational.hpp.

bool plll::arithmetic::isNonNegative ( const Integer &  )
inline

Tests the given plll::arithmetic::Integer object for being positive or zero.

Returns
Returns true if and only if the argument is positive or zero.
See also
Predicates

Definition at line 1626 of file arithmetic-gmp.hpp.

bool plll::arithmetic::isNonNegative ( const Real &  )
inline

Tests the given plll::arithmetic::Real object for being positive or zero.

Returns
Returns true if and only if the argument is positive or zero.
See also
Predicates

Definition at line 2426 of file arithmetic-gmp.hpp.

template<typename Type >
bool plll::arithmetic::isNonNegative ( const NInt< Type > &  r)
inline

Tests the given plll::arithmetic::Integer object for being positive or zero.

Returns
Returns true if and only if the argument is positive or zero.
See also
Predicates

Definition at line 1610 of file arithmetic-nint.hpp.

bool plll::arithmetic::isNonPositive ( const Rational &  r)
inline

Tests the given rational number for being negative or zero.

Returns
Returns true if and only if the argument is negative or zero.
See also
Predicates

Definition at line 834 of file rational.hpp.

bool plll::arithmetic::isNonPositive ( const Integer &  )
inline

Tests the given plll::arithmetic::Integer object for being negative or zero.

Returns
Returns true if and only if the argument is negative or zero.
See also
Predicates

Definition at line 1636 of file arithmetic-gmp.hpp.

bool plll::arithmetic::isNonPositive ( const Real &  )
inline

Tests the given plll::arithmetic::Real object for being negative or zero.

Returns
Returns true if and only if the argument is negative or zero.
See also
Predicates

Definition at line 2438 of file arithmetic-gmp.hpp.

template<typename Type >
bool plll::arithmetic::isNonPositive ( const NInt< Type > &  r)
inline

Tests the given plll::arithmetic::Integer object for being negative or zero.

Returns
Returns true if and only if the argument is negative or zero.
See also
Predicates

Definition at line 1624 of file arithmetic-nint.hpp.

bool plll::arithmetic::isOne ( const Rational &  r)
inline

Tests the given plll::arithmetic::Real object for being zero.

Returns
Returns true if and only if the argument is zero.
See also
Predicates

Definition at line 814 of file rational.hpp.

bool plll::arithmetic::isOne ( const Integer &  )
inline

Tests the given plll::arithmetic::Integer object for being one.

Returns
Returns true if and only if the argument is one.
See also
Predicates

Definition at line 1606 of file arithmetic-gmp.hpp.

bool plll::arithmetic::isOne ( const Real &  )
inline

Tests the given plll::arithmetic::Real object for being one.

Returns
Returns true if and only if the argument is one.
See also
Predicates

Definition at line 2414 of file arithmetic-gmp.hpp.

template<typename Type >
bool plll::arithmetic::isOne ( const NInt< Type > &  r)
inline

Tests the given plll::arithmetic::Integer object for being one.

Returns
Returns true if and only if the argument is one.
See also
Predicates

Definition at line 1582 of file arithmetic-nint.hpp.

bool plll::arithmetic::isPMOne ( const Integer &  )
inline

Tests the given plll::arithmetic::Integer object for being one or minus one.

Returns
Returns true if and only if the argument is $\pm 1$.
See also
Predicates

Definition at line 1611 of file arithmetic-gmp.hpp.

template<typename Type >
bool plll::arithmetic::isPMOne ( const NInt< Type > &  r)
inline

Tests the given plll::arithmetic::Integer object for being one or minus one.

Returns
Returns true if and only if the argument is $\pm 1$.
See also
Predicates

Definition at line 1589 of file arithmetic-nint.hpp.

bool plll::arithmetic::isPMTwo ( const Integer &  )
inline

Tests the given plll::arithmetic::Integer object for being two or minus two.

Returns
Returns true if and only if the argument is $\pm 2$.
See also
Predicates

Definition at line 1616 of file arithmetic-gmp.hpp.

template<typename Type >
bool plll::arithmetic::isPMTwo ( const NInt< Type > &  r)
inline

Tests the given plll::arithmetic::Integer object for being two or minus two.

Returns
Returns true if and only if the argument is $\pm 2$.
See also
Predicates

Definition at line 1596 of file arithmetic-nint.hpp.

bool plll::arithmetic::isPositive ( const Rational &  r)
inline

Tests the given rational number for being strictly positive.

Returns
Returns true if and only if the argument is strictly positive.
See also
Predicates

Definition at line 819 of file rational.hpp.

bool plll::arithmetic::isPositive ( const Integer &  )
inline

Tests the given plll::arithmetic::Integer object for being strictly positive.

Returns
Returns true if and only if the argument is strictly positive.
See also
Predicates

Definition at line 1621 of file arithmetic-gmp.hpp.

bool plll::arithmetic::isPositive ( const Real &  )
inline

Tests the given plll::arithmetic::Real object for being strictly positive.

Returns
Returns true if and only if the argument is strictly positive.
See also
Predicates

Definition at line 2420 of file arithmetic-gmp.hpp.

template<typename Type >
bool plll::arithmetic::isPositive ( const NInt< Type > &  r)
inline

Tests the given plll::arithmetic::Integer object for being strictly positive.

Returns
Returns true if and only if the argument is strictly positive.
See also
Predicates

Definition at line 1603 of file arithmetic-nint.hpp.

bool plll::arithmetic::isZero ( const Rational &  r)
inline

Tests the given rational number for being zero.

Returns
Returns true if and only if the argument is zero.
See also
Predicates

Definition at line 809 of file rational.hpp.

bool plll::arithmetic::isZero ( const Integer &  )
inline

Tests the given plll::arithmetic::Integer object for being zero.

Returns
Returns true if and only if the argument is zero.
See also
Predicates

Definition at line 1601 of file arithmetic-gmp.hpp.

bool plll::arithmetic::isZero ( const Real &  )
inline

Tests the given plll::arithmetic::Real object for being zero.

Returns
Returns true if and only if the argument is zero.
See also
Predicates

Definition at line 2408 of file arithmetic-gmp.hpp.

template<typename Type >
bool plll::arithmetic::isZero ( const NInt< Type > &  r)
inline

Tests the given plll::arithmetic::Integer object for being zero.

Returns
Returns true if and only if the argument is zero.
See also
Predicates

Definition at line 1575 of file arithmetic-nint.hpp.

void plll::arithmetic::LCM ( Integer &  r,
const Integer &  x,
const Integer &  y 
)
inline

Computes the non-negative Least Common Multiple r of x and y.

Parameters
rThe result is stored in here.
xThe first operand.
yThe first operand.
See also
Integer Functions

Definition at line 1682 of file arithmetic-gmp.hpp.

template<typename Type >
void plll::arithmetic::LCM ( NInt< Type > &  r,
const NInt< Type > &  x,
const NInt< Type > &  y 
)
inline

Computes the non-negative Least Common Multiple r of x and y.

Parameters
rThe result is stored in here.
xThe first operand.
yThe first operand.
See also
Integer Functions

Definition at line 2330 of file arithmetic-nint.hpp.

template<typename Type >
NInt< Type > plll::arithmetic::LCM ( const NInt< Type > &  x,
const NInt< Type > &  y 
)
inline

Computes and returns the non-negative Least Common Multiple of x and y.

Returns
The LCM of x and y.
Parameters
xThe first operand.
yThe first operand.
See also
Integer Functions

Definition at line 2337 of file arithmetic-nint.hpp.

expressions::Expression<IntegerContext, std::pair<expressions::Wrapper<IntegerContext>, expressions::Wrapper<IntegerContext> >, expressions::LCMOp> plll::arithmetic::LCM ( const Integer &  a,
const Integer &  b 
)
inline

Computes and returns the non-negative Least Common Multiple of a and b.

Parameters
aThe first operand.
bThe second operand.
Returns
The result.

Definition at line 1549 of file arithmetic-gmp-iops.hpp.

void plll::arithmetic::lgamma ( Real &  res,
const Real &  a 
)
inline

Computes the logarithm of the absolute value of the Gamma function at a and stores the result in res.

Parameters
resThe result.
aThe value the function is evaluated at.
See also
Special Functions

Definition at line 3148 of file arithmetic-gmp.hpp.

void plll::arithmetic::lgamma ( Real &  res,
int &  sign,
const Real &  a 
)
inline

Computes the logarithm of the absolute value of the Gamma function at a and stores the result in res. The sign of the Gamma function at a is stored in sign.

Parameters
resThe result.
signWill be set to 1 if $\Gamma(a) \ge 0$ and -1 otherwise.
See also
Special Functions
Parameters
aThe value the function is evaluated at.

Definition at line 3158 of file arithmetic-gmp.hpp.

expressions::Expression<RealContext, expressions::Wrapper<RealContext>, expressions::LGammaOp> plll::arithmetic::lgamma ( const Real &  i)
inline

Returns the natural logarithm of the absolute value of the Gamma function evaluated at the given floating point number.

Parameters
iThe operand.
Returns
The result.
See also
Special Functions

Definition at line 1619 of file arithmetic-gmp-rops.hpp.

expressions::Expression<RealContext, expressions::Wrapper<RealContext>, expressions::LGamma2Op> plll::arithmetic::lgamma ( int &  sign,
const Real &  i 
)
inline

Returns the natural logarithm of the absolute value of the Gamma function evaluated at the given floating point number, as well as the sign of the Gamma function.

Parameters
signThe integer variable to store the sign of $\Gamma(i)$ in.
iThe operand.
Returns
The result.
See also
Special Functions

Definition at line 1633 of file arithmetic-gmp-rops.hpp.

expressions::Expression<RealContext, expressions::Wrapper<RealContext>, expressions::LGammaOp_Context> plll::arithmetic::lgamma ( const Real &  i,
const RealContext &  rc 
)
inline

Returns the natural logarithm of the absolute value of the Gamma function evaluated at the given floating point number.

Parameters
iThe operand.
rcThe context whose precision to use for the result.
Returns
The result.
See also
Special Functions

Definition at line 2049 of file arithmetic-gmp-rops.hpp.

expressions::Expression<RealContext, expressions::Wrapper<RealContext>, expressions::LGamma2Op_Context> plll::arithmetic::lgamma ( int &  sign,
const Real &  i,
const RealContext &  rc 
)
inline

Returns the natural logarithm of the absolute value of the Gamma function evaluated at the given floating point number, as well as the sign of the Gamma function.

Parameters
signThe integer variable to store the sign of $\Gamma(i)$ in.
iThe operand.
rcThe context whose precision to use for the result.
Returns
The result.
See also
Special Functions

Definition at line 2064 of file arithmetic-gmp-rops.hpp.

void plll::arithmetic::log ( Real &  res,
const Real &  a 
)
inline

Computes the natural logarithm of a and stores the result in res.

Parameters
resThe result.
aThe value the function is evaluated at.

Definition at line 3103 of file arithmetic-gmp.hpp.

expressions::Expression<RealContext, expressions::Wrapper<RealContext>, expressions::LogOp> plll::arithmetic::log ( const Real &  i)
inline

Returns the natural logarithm evaluated at the given floating point number.

Parameters
iThe operand.
Returns
The result.
See also
Special Functions

Definition at line 1559 of file arithmetic-gmp-rops.hpp.

expressions::Expression<RealContext, expressions::Wrapper<RealContext>, expressions::LogOp_Context> plll::arithmetic::log ( const Real &  i,
const RealContext &  rc 
)
inline

Returns the natural logarithm evaluated at the given floating point number.

Parameters
iThe operand.
rcThe context whose precision to use for the result.
Returns
The result.
See also
Special Functions

Definition at line 1984 of file arithmetic-gmp-rops.hpp.

void plll::arithmetic::log10 ( Real &  res,
const Real &  a 
)
inline

Computes the logarithm of a to base 10 and stores the result in res.

Parameters
resThe result.
aThe value the function is evaluated at.

Definition at line 3121 of file arithmetic-gmp.hpp.

expressions::Expression<RealContext, expressions::Wrapper<RealContext>, expressions::Log10Op> plll::arithmetic::log10 ( const Real &  i)
inline

Returns the base-10 logarithm evaluated at the given floating point number.

Parameters
iThe operand.
Returns
The result.
See also
Special Functions

Definition at line 1581 of file arithmetic-gmp-rops.hpp.

expressions::Expression<RealContext, expressions::Wrapper<RealContext>, expressions::Log10Op_Context> plll::arithmetic::log10 ( const Real &  i,
const RealContext &  rc 
)
inline

Returns the base-10 logarithm evaluated at the given floating point number.

Parameters
iThe operand.
rcThe context whose precision to use for the result.
Returns
The result.
See also
Special Functions

Definition at line 2008 of file arithmetic-gmp-rops.hpp.

void plll::arithmetic::log2 ( Real &  res,
const Real &  a 
)
inline

Computes the logarithm of a to base 2 and stores the result in res.

Parameters
resThe result.
aThe value the function is evaluated at.

Definition at line 3112 of file arithmetic-gmp.hpp.

expressions::Expression<RealContext, expressions::Wrapper<RealContext>, expressions::Log2Op> plll::arithmetic::log2 ( const Real &  i)
inline

Returns the base-2 logarithm evaluated at the given floating point number.

Parameters
iThe operand.
Returns
The result.
See also
Special Functions

Definition at line 1570 of file arithmetic-gmp-rops.hpp.

expressions::Expression<RealContext, expressions::Wrapper<RealContext>, expressions::Log2Op_Context> plll::arithmetic::log2 ( const Real &  i,
const RealContext &  rc 
)
inline

Returns the base-2 logarithm evaluated at the given floating point number.

Parameters
iThe operand.
rcThe context whose precision to use for the result.
Returns
The result.
See also
Special Functions

Definition at line 1996 of file arithmetic-gmp-rops.hpp.

void plll::arithmetic::makeAbs ( Rational &  a)
inline

Makes the operand non-negative.

Parameters
aThe operand.

Definition at line 1298 of file rational.hpp.

void plll::arithmetic::makeAbs ( Integer &  a)
inline

Makes the operand non-negative.

Parameters
aThe operand.

Definition at line 1641 of file arithmetic-gmp.hpp.

void plll::arithmetic::makeAbs ( Real &  a)
inline

Makes the operand non-negative.

Parameters
aThe operand.

Definition at line 2911 of file arithmetic-gmp.hpp.

template<typename Type >
void plll::arithmetic::makeAbs ( NInt< Type > &  a)
inline

Makes the operand non-negative.

Parameters
aThe operand.

Definition at line 1764 of file arithmetic-nint.hpp.

void plll::arithmetic::mod ( Rational &  r,
const Rational &  a,
const Rational &  b 
)
inline

Takes the remainder of the division of a by b and stores it in r.

Parameters
rThe result.
aThe first operand.
bThe second operand.

Definition at line 1171 of file rational.hpp.

void plll::arithmetic::mod ( Integer &  r,
const Integer &  a,
const Integer &  b 
)
inline

Takes the remainder of the division of a by b and stores it in r.

Parameters
rThe result.
aThe first operand.
bThe second operand.

Definition at line 1422 of file arithmetic-gmp.hpp.

void plll::arithmetic::mod ( Real &  r,
const Real &  a,
const Real &  b 
)
inline

Takes the remainder of the division of a by b and stores it in r.

Parameters
rThe result.
aThe first operand.
bThe second operand.

Definition at line 2775 of file arithmetic-gmp.hpp.

template<typename Type >
void plll::arithmetic::mod ( NInt< Type > &  r,
const NInt< Type > &  a,
const NInt< Type > &  b 
)
inline

Takes the remainder of the division of a by b and stores it in r.

Parameters
rThe result.
aThe first operand.
bThe second operand.

Definition at line 1667 of file arithmetic-nint.hpp.

void plll::arithmetic::mul ( Rational &  r,
const Rational &  a,
const Rational &  b 
)
inline

Multiplies a with b and stores the result in r.

Parameters
rThe result.
aThe first operand.
bThe second operand.

Definition at line 1008 of file rational.hpp.

void plll::arithmetic::mul ( Integer &  r,
const Integer &  a,
const Integer &  b 
)
inline

Multiplies a with b and stores the result in r.

Parameters
rThe result.
aThe first operand.
bThe second operand.

Definition at line 1377 of file arithmetic-gmp.hpp.

template<typename Type >
void plll::arithmetic::mul ( NInt< Type > &  r,
const NInt< Type > &  a,
const NInt< Type > &  b 
)
inline

Multiplies a with b and stores the result in r.

Parameters
rThe result.
aThe first operand.
bThe second operand.

Definition at line 1655 of file arithmetic-nint.hpp.

void plll::arithmetic::mul ( Real &  r,
const Real &  a,
const Real &  b 
)
inline

Multiplies a with b and stores the result in r.

Parameters
rThe result.
aThe first operand.
bThe second operand.

Definition at line 2641 of file arithmetic-gmp.hpp.

void plll::arithmetic::neg ( Rational &  r,
const Rational &  a 
)
inline

Negates a and stores the result in r.

Parameters
rThe result.
aThe operand.

Definition at line 1272 of file rational.hpp.

void plll::arithmetic::neg ( Integer &  r,
const Integer &  a 
)
inline

Negates a and stores the result in r.

Parameters
rThe result.
aThe operand.

Definition at line 1394 of file arithmetic-gmp.hpp.

template<typename Type >
void plll::arithmetic::neg ( NInt< Type > &  r,
const NInt< Type > &  a 
)
inline

Negates a and stores the result in r.

Parameters
rThe result.
aThe operand.

Definition at line 1746 of file arithmetic-nint.hpp.

void plll::arithmetic::neg ( Real &  r,
const Real &  a 
)
inline

Negates a and stores the result in r.

Parameters
rThe result.
aThe operand.

Definition at line 2893 of file arithmetic-gmp.hpp.

template<typename Type >
bool plll::arithmetic::operator!= ( const NInt< Type > &  a,
const NInt< Type > &  b 
)
inline

Compares the current integer with the given one for inequality.

Parameters
aThe first operand.
bThe second operand.
Returns
true if a does not equal b.

Definition at line 1545 of file arithmetic-nint.hpp.

bool plll::arithmetic::operator!= ( const Rational &  a,
const Rational &  b 
)
inline

Compares the two rational numbers a and b for inequality.

Parameters
aThe first operand.
bThe second operand.
Returns
true if and only if a does not equal b.

Definition at line 457 of file rational-ops.hpp.

bool plll::arithmetic::operator!= ( const Real &  a,
const Real &  b 
)
inline

Compares the two floating point numbers a and b for inequality.

Parameters
aThe first operand.
bThe second operand.
Returns
true if and only if a does not equal b.

Definition at line 944 of file arithmetic-gmp-rops.hpp.

bool plll::arithmetic::operator!= ( const Integer &  a,
const Integer &  b 
)
inline

Compares the current integer with the given one for inequality.

Parameters
aThe first operand.
bThe second operand.
Returns
true if a does not equal b.

Definition at line 1155 of file arithmetic-gmp-iops.hpp.

template<typename Type >
NInt< Type > plll::arithmetic::operator% ( const NInt< Type > &  a,
const NInt< Type > &  b 
)
inline

Divides the first by the second integer and returns the remainder.

Parameters
aThe first operand.
bThe second operand.
Returns
The result.

Definition at line 1412 of file arithmetic-nint.hpp.

expressions::Expression<IntegerContext, std::pair<expressions::Wrapper<IntegerContext>, expressions::Wrapper<IntegerContext> >, expressions::ModOp> plll::arithmetic::operator% ( const Integer &  a,
const Integer &  b 
)
inline

Divides the first by the second integer and returns the remainder.

Parameters
aThe first operand.
bThe second operand.
Returns
The result.

Definition at line 327 of file arithmetic-gmp-iops.hpp.

expressions::Expression<RealContext, std::pair<expressions::Wrapper<RealContext>, expressions::Wrapper<RealContext> >, expressions::ModOp> plll::arithmetic::operator% ( const Real &  a,
const Real &  b 
)
inline

Divides the first by the second floating point number and returns the remainder.

Parameters
aThe first operand.
bThe second operand.
Returns
The result.

Definition at line 410 of file arithmetic-gmp-rops.hpp.

expressions::Expression<RationalContext, std::pair<expressions::Wrapper<RationalContext>, expressions::Wrapper<RationalContext> >, expressions::ModOp> plll::arithmetic::operator% ( const Rational &  a,
const Rational &  b 
)
inline

Returns the remainder of this rational number divided by the by the argument.

Parameters
aThe first operand.
bThe second operand.
Returns
The result.

Definition at line 812 of file rational-ops.hpp.

Rational& plll::arithmetic::operator%= ( Rational &  cur,
const Rational &  r 
)
inline

Divides this rational number by the given rational number r and stores the remainder in this rational number.

Parameters
curThe rational number to work on.
rThe rational number to divide by.
Returns
A reference to this rational number containing the result.

Definition at line 297 of file rational-ops.hpp.

template<typename Type >
NInt< Type > & plll::arithmetic::operator%= ( NInt< Type > &  cur,
const NInt< Type > &  i 
)
inline

Divides cur by the given integer i and stores the remainder in cur.

Parameters
curThe integer to operate on.
iThe integer to divide by.
Returns
A reference to cur containing the result.

Definition at line 1446 of file arithmetic-nint.hpp.

Real& plll::arithmetic::operator%= ( Real &  cur,
const Real &  r 
)
inline

Divides cur by the given floating point number r and stores the remainder in cur.

Parameters
curThe floating point number to operate on.
rThe floating point number to divide by.
Returns
A reference to cur containing the result.

Definition at line 801 of file arithmetic-gmp-rops.hpp.

Integer& plll::arithmetic::operator%= ( Integer &  cur,
const Integer &  i 
)
inline

Divides cur by the given integer i and stores the remainder in cur.

Parameters
curThe integer to operate on.
iThe integer to divide by.
Returns
A reference to cur containing the result.

Definition at line 897 of file arithmetic-gmp-iops.hpp.

expressions::Expression<IntegerContext, std::pair<expressions::Wrapper<IntegerContext>, expressions::Wrapper<IntegerContext> >, expressions::AndOp> plll::arithmetic::operator& ( const Integer &  a,
const Integer &  b 
)
inline

Computes the bitwise and of the two integers and returns the result.

Parameters
aThe first operand.
bThe second operand.
Returns
The result.

Definition at line 341 of file arithmetic-gmp-iops.hpp.

Integer& plll::arithmetic::operator&= ( Integer &  cur,
const Integer &  i 
)
inline

Computes the bitwise and of cur with i and stores the result in cur.

Parameters
curThe integer to operate on.
iThe second operand.
Returns
A reference to cur containing the result.

Definition at line 923 of file arithmetic-gmp-iops.hpp.

template<typename Type >
NInt< Type > plll::arithmetic::operator* ( const NInt< Type > &  a,
const NInt< Type > &  b 
)
inline

Multiplies the two integers and returns the result.

Parameters
aThe first operand.
bThe second operand.
Returns
The result.

Definition at line 1400 of file arithmetic-nint.hpp.

expressions::Expression<IntegerContext, std::pair<expressions::Wrapper<IntegerContext>, expressions::Wrapper<IntegerContext> >, expressions::MulOp> plll::arithmetic::operator* ( const Integer &  a,
const Integer &  b 
)
inline

Multiplies the two integers and returns the result.

Parameters
aThe first operand.
bThe second operand.
Returns
The result.

Definition at line 299 of file arithmetic-gmp-iops.hpp.

expressions::Expression<RealContext, std::pair<expressions::Wrapper<RealContext>, expressions::Wrapper<RealContext> >, expressions::MulOp> plll::arithmetic::operator* ( const Real &  a,
const Real &  b 
)
inline

Multiplies the two floating point numbers and returns the result.

Parameters
aThe first operand.
bThe second operand.
Returns
The result.

Definition at line 382 of file arithmetic-gmp-rops.hpp.

expressions::Expression<RationalContext, std::pair<expressions::Wrapper<RationalContext>, expressions::Wrapper<RationalContext> >, expressions::MulOp> plll::arithmetic::operator* ( const Rational &  a,
const Rational &  b 
)
inline

Multiplies the argument with this rational number and returns the result.

Parameters
aThe first operand.
bThe second operand.
Returns
The result.

Definition at line 784 of file rational-ops.hpp.

Rational& plll::arithmetic::operator*= ( Rational &  cur,
const Rational &  r 
)
inline

Multiplies the given rational number r with this rational number.

Parameters
curThe rational number to work on.
rThe rational number to multiply to this rational number.
Returns
A reference to this rational number containing the result.

Definition at line 270 of file rational-ops.hpp.

template<typename Type >
NInt< Type > & plll::arithmetic::operator*= ( NInt< Type > &  cur,
const NInt< Type > &  i 
)
inline

Multiplies the given integer i with cur.

Parameters
curThe integer to operate on.
iThe integer to multiply to cur.
Returns
A reference to cur containing the result.

Definition at line 1432 of file arithmetic-nint.hpp.

Real& plll::arithmetic::operator*= ( Real &  cur,
const Real &  r 
)
inline

Multiplies the given floating point number r with cur.

Parameters
curThe floating point number to operate on.
rThe floating point number to multiply to cur.
Returns
A reference to cur containing the result.

Definition at line 774 of file arithmetic-gmp-rops.hpp.

Integer& plll::arithmetic::operator*= ( Integer &  cur,
const Integer &  i 
)
inline

Multiplies the given integer i with cur.

Parameters
curThe integer to operate on.
iThe integer to multiply to cur.
Returns
A reference to cur containing the result.

Definition at line 870 of file arithmetic-gmp-iops.hpp.

expressions::Expression<IntegerContext, std::pair<expressions::Wrapper<IntegerContext>, expressions::Wrapper<IntegerContext> >, expressions::AddOp> plll::arithmetic::operator+ ( const Integer &  a,
const Integer &  b 
)
inline

Adds the two integers and returns the result.

Parameters
aThe first operand.
bThe second operand.
Returns
The result.

Definition at line 271 of file arithmetic-gmp-iops.hpp.

template<typename Type >
NInt< Type > plll::arithmetic::operator+ ( const NInt< Type > &  a,
const NInt< Type > &  b 
)
inline

Adds the two integers and returns the result.

Parameters
aThe first operand.
bThe second operand.
Returns
The result.

Definition at line 1388 of file arithmetic-nint.hpp.

expressions::Expression<RealContext, std::pair<expressions::Wrapper<RealContext>, expressions::Wrapper<RealContext> >, expressions::AddOp> plll::arithmetic::operator+ ( const Real &  a,
const Real &  b 
)
inline

Adds the two floating point numbers and returns the result.

Parameters
aThe first operand.
bThe second operand.
Returns
The result.

Definition at line 354 of file arithmetic-gmp-rops.hpp.

expressions::Expression<RationalContext, std::pair<expressions::Wrapper<RationalContext>, expressions::Wrapper<RationalContext> >, expressions::AddOp> plll::arithmetic::operator+ ( const Rational &  a,
const Rational &  b 
)
inline

Adds the argument to this rational number and returns the result.

Parameters
aThe first operand.
bThe second operand.
Returns
The result.

Definition at line 757 of file rational-ops.hpp.

template<typename Type >
NInt< Type > plll::arithmetic::operator++ ( NInt< Type > &  cur,
int   
)
inline

Increments the integer by one and returns the previous value.

Parameters
curThe integer to work on.
Returns
The previous value.

Definition at line 1481 of file arithmetic-nint.hpp.

template<typename Type >
NInt< Type > & plll::arithmetic::operator++ ( NInt< Type > &  cur)
inline

Increments the integer by one and returns the new value.

Parameters
curThe integer to work on.
Returns
The new value (a reference to cur).

Definition at line 1493 of file arithmetic-nint.hpp.

Rational plll::arithmetic::operator++ ( Rational &  cur,
int   
)
inline

Increments this rational number by one and returns the previous value.

Parameters
curThe rational number to work on.
Returns
The previous value before incrementing.

Definition at line 388 of file rational-ops.hpp.

Rational& plll::arithmetic::operator++ ( Rational &  cur)
inline

Increments this rational number by one and returns the new value.

Parameters
curThe rational number to work on.
Returns
The new value.

Definition at line 414 of file rational-ops.hpp.

Integer plll::arithmetic::operator++ ( Integer &  cur,
int   
)
inline

Increments the integer by one and returns the previous value.

Parameters
curThe integer to work on.
Returns
The previous value.

Definition at line 753 of file arithmetic-gmp-iops.hpp.

Integer& plll::arithmetic::operator++ ( Integer &  cur)
inline

Increments the integer by one and returns the new value.

Parameters
curThe integer to work on.
Returns
The new value (a reference to cur).

Definition at line 779 of file arithmetic-gmp-iops.hpp.

Real plll::arithmetic::operator++ ( Real &  cur,
int   
)
inline

Increments cur by one and returns the previous value.

Parameters
curThe floating point number to operate on.
Returns
The previous value before incrementing.

Definition at line 875 of file arithmetic-gmp-rops.hpp.

Real& plll::arithmetic::operator++ ( Real &  cur)
inline

Increments cur by one and returns the new value.

Parameters
curThe floating point number to operate on.
Returns
The new value.

Definition at line 901 of file arithmetic-gmp-rops.hpp.

Rational& plll::arithmetic::operator+= ( Rational &  cur,
const Rational &  r 
)
inline

Adds the given rational number r to this rational number.

Parameters
curThe rational number to work on.
rThe rational number to add to this rational number.
Returns
A reference to this rational number containing the result.

Definition at line 240 of file rational-ops.hpp.

template<class D >
Rational& plll::arithmetic::operator+= ( Rational &  cur,
const expressions::Expression< RationalContext, D, expressions::MulOp > &  E 
)
inline

Adds the given multiplication expression to this rational number.

Note that the faster addmul() command is used for this special case where the product of two rational numbers is added to a third one.

Parameters
curThe rational number to work on.
EThe multiplication expression to add to this rational number.
Returns
A reference to this rational number containing the result.

Definition at line 257 of file rational-ops.hpp.

template<typename Type >
NInt< Type > & plll::arithmetic::operator+= ( NInt< Type > &  cur,
const NInt< Type > &  i 
)
inline

Adds the integer i to cur.

Parameters
curThe integer to operate on.
iThe integer to add to cur.
Returns
A reference to cur containing the result.

Definition at line 1425 of file arithmetic-nint.hpp.

Real& plll::arithmetic::operator+= ( Real &  cur,
const Real &  r 
)
inline

Adds the floating point number r to cur.

Parameters
curThe floating point number to operate on.
rThe floating point number to add to cur.
Returns
A reference to cur containing the result.

Definition at line 744 of file arithmetic-gmp-rops.hpp.

template<class D >
Real& plll::arithmetic::operator+= ( Real &  cur,
const expressions::Expression< RealContext, D, expressions::MulOp > &  E 
)
inline

Adds the given multiplication expression to cur.

Note that the faster addmul() command is used for this special case where the product of two floating point numbers is added to a third one.

Parameters
curThe floating point number to operate on.
EThe multiplication expression to add to cur.
Returns
A reference to cur containing the result.

Definition at line 761 of file arithmetic-gmp-rops.hpp.

template<class D >
Integer& plll::arithmetic::operator+= ( Integer &  cur,
const expressions::Expression< IntegerContext, D, expressions::MulOp > &  E 
)
inline

Adds the given multiplication expression to cur.

Note that the faster addmul() command is used for this special case where the product of two integers is added to a third one.

Parameters
curThe integer to operate on.
EThe multiplication expression to add to cur.
Returns
A reference to cur containing the result.

Definition at line 844 of file arithmetic-gmp-iops.hpp.

Integer& plll::arithmetic::operator+= ( Integer &  cur,
const Integer &  i 
)
inline

Adds the integer i to cur.

Parameters
curThe integer to operate on.
iThe integer to add to cur.
Returns
A reference to cur containing the result.

Definition at line 857 of file arithmetic-gmp-iops.hpp.

expressions::Expression<IntegerContext, expressions::Wrapper<IntegerContext>, expressions::NegOp> plll::arithmetic::operator- ( const Integer &  a)
inline

Negates the integer.

Parameters
aThe integer.
Returns
The result.

Definition at line 249 of file arithmetic-gmp-iops.hpp.

template<typename Type >
NInt< Type > plll::arithmetic::operator- ( const NInt< Type > &  a)
inline

Negates the integer.

Parameters
aThe integer.
Returns
The result.

Definition at line 1382 of file arithmetic-nint.hpp.

expressions::Expression<IntegerContext, std::pair<expressions::Wrapper<IntegerContext>, expressions::Wrapper<IntegerContext> >, expressions::SubOp> plll::arithmetic::operator- ( const Integer &  a,
const Integer &  b 
)
inline

Subtracts the second from the first integer and returns the result.

Parameters
aThe first operand.
bThe second operand.
Returns
The result.

Definition at line 285 of file arithmetic-gmp-iops.hpp.

template<typename Type >
NInt< Type > plll::arithmetic::operator- ( const NInt< Type > &  a,
const NInt< Type > &  b 
)
inline

Subtracts the second from the first integer and returns the result.

Parameters
aThe first operand.
bThe second operand.
Returns
The result.

Definition at line 1394 of file arithmetic-nint.hpp.

expressions::Expression<RealContext, expressions::Wrapper<RealContext>, expressions::NegOp> plll::arithmetic::operator- ( const Real &  a)
inline

Negates the floating point number.

Parameters
aThe floating point number.
Returns
The result.

Definition at line 342 of file arithmetic-gmp-rops.hpp.

expressions::Expression<RealContext, std::pair<expressions::Wrapper<RealContext>, expressions::Wrapper<RealContext> >, expressions::SubOp> plll::arithmetic::operator- ( const Real &  a,
const Real &  b 
)
inline

Subtracts the second from the first floating point number and returns the result.

Parameters
aThe first operand.
bThe second operand.
Returns
The result.

Definition at line 368 of file arithmetic-gmp-rops.hpp.

expressions::Expression<RationalContext, expressions::Wrapper<RationalContext>, expressions::NegOp> plll::arithmetic::operator- ( const Rational &  a)
inline

Negates this rational number.

Parameters
aThe operand.
Returns
The result.

Definition at line 745 of file rational-ops.hpp.

expressions::Expression<RationalContext, std::pair<expressions::Wrapper<RationalContext>, expressions::Wrapper<RationalContext> >, expressions::SubOp> plll::arithmetic::operator- ( const Rational &  a,
const Rational &  b 
)
inline

Subtracts the argument from this rational number and returns the result.

Parameters
aThe first operand.
bThe second operand.
Returns
The result.

Definition at line 770 of file rational-ops.hpp.

template<typename Type >
NInt< Type > plll::arithmetic::operator-- ( NInt< Type > &  cur,
int   
)
inline

Decrements the integer by one and returns the previous value.

Parameters
curThe integer to work on.
Returns
The previous value.

Definition at line 1487 of file arithmetic-nint.hpp.

template<typename Type >
NInt< Type > & plll::arithmetic::operator-- ( NInt< Type > &  cur)
inline

Decreases the integer by one and returns the new value.

Parameters
curThe integer to work on.
Returns
The new value (a reference to cur).

Definition at line 1500 of file arithmetic-nint.hpp.

Rational plll::arithmetic::operator-- ( Rational &  cur,
int   
)
inline

Decrements this rational number by one and returns the previous value.

Parameters
curThe rational number to work on.
Returns
The previous value before decrementing.

Definition at line 401 of file rational-ops.hpp.

Rational& plll::arithmetic::operator-- ( Rational &  cur)
inline

Decrements this rational number by one and returns the new value.

Parameters
curThe rational number to work on.
Returns
The new value.

Definition at line 426 of file rational-ops.hpp.

Integer plll::arithmetic::operator-- ( Integer &  cur,
int   
)
inline

Decrements the integer by one and returns the previous value.

Parameters
curThe integer to work on.
Returns
The previous value.

Definition at line 766 of file arithmetic-gmp-iops.hpp.

Integer& plll::arithmetic::operator-- ( Integer &  cur)
inline

Decreases the integer by one and returns the new value.

Parameters
curThe integer to work on.
Returns
The new value (a reference to cur).

Definition at line 791 of file arithmetic-gmp-iops.hpp.

Real plll::arithmetic::operator-- ( Real &  cur,
int   
)
inline

Decrements cur by one and returns the previous value.

Parameters
curThe floating point number to operate on.
Returns
The previous value before decrementing.

Definition at line 888 of file arithmetic-gmp-rops.hpp.

Real& plll::arithmetic::operator-- ( Real &  cur)
inline

Decrements cur by one and returns the new value.

Parameters
curThe floating point number to operate on.
Returns
The new value.

Definition at line 913 of file arithmetic-gmp-rops.hpp.

Rational& plll::arithmetic::operator-= ( Rational &  cur,
const Rational &  r 
)
inline

Subtracts the given rational number r from this rational number.

Parameters
curThe rational number to work on.
rThe rational number to subtract from this rational number.
Returns
A reference to this rational number containing the result.

Definition at line 210 of file rational-ops.hpp.

template<class D >
Rational& plll::arithmetic::operator-= ( Rational &  cur,
const expressions::Expression< RationalContext, D, expressions::MulOp > &  E 
)
inline

Subtracts the given multiplication expression from this rational number.

Note that the faster submul() command is used for this special case where the product of two rational numbers is subtracted from a third one.

Parameters
curThe rational number to work on.
EThe multiplication expression to subtract from this rational number.
Returns
A reference to this rational number containing the result.

Definition at line 227 of file rational-ops.hpp.

template<typename Type >
NInt< Type > & plll::arithmetic::operator-= ( NInt< Type > &  cur,
const NInt< Type > &  i 
)
inline

Subtracts the integer i from cur.

Parameters
curThe integer to operate on.
iThe integer to subtract from cur.
Returns
A reference to cur containing the result.

Definition at line 1418 of file arithmetic-nint.hpp.

Real& plll::arithmetic::operator-= ( Real &  cur,
const Real &  r 
)
inline

Subtracts the floating point number r from cur.

Parameters
curThe floating point number to operate on.
rThe floating point number to subtract from cur.
Returns
A reference to cur containing the result.

Definition at line 714 of file arithmetic-gmp-rops.hpp.

template<class D >
Real& plll::arithmetic::operator-= ( Real &  cur,
const expressions::Expression< RealContext, D, expressions::MulOp > &  E 
)
inline

Subtracts the multiplication expression E from cur.

Note that the faster submul() command is used for this special case where the product of two floating point numbers is subtracted from a third one.

Parameters
curThe floating point number to operate on.
EThe multiplication expression to subtract from cur.
Returns
A reference to cur containing the result.

Definition at line 731 of file arithmetic-gmp-rops.hpp.

template<class D >
Integer& plll::arithmetic::operator-= ( Integer &  cur,
const expressions::Expression< IntegerContext, D, expressions::MulOp > &  E 
)
inline

Subtracts the multiplication expression E from cur.

Note that the faster submul() command is used for this special case where the product of two integers is subtracted from a third one.

Parameters
curThe integer to operate on.
EThe multiplication expression to subtract from cur.
Returns
A reference to cur containing the result.

Definition at line 814 of file arithmetic-gmp-iops.hpp.

Integer& plll::arithmetic::operator-= ( Integer &  cur,
const Integer &  i 
)
inline

Subtracts the integer i from cur.

Parameters
curThe integer to operate on.
iThe integer to subtract from cur.
Returns
A reference to cur containing the result.

Definition at line 827 of file arithmetic-gmp-iops.hpp.

template<typename Type >
NInt< Type > plll::arithmetic::operator/ ( const NInt< Type > &  a,
const NInt< Type > &  b 
)
inline

Divides the first by the second integer and returns the result.

Parameters
aThe first operand.
bThe second operand.
Returns
The result.

Definition at line 1406 of file arithmetic-nint.hpp.

expressions::Expression<IntegerContext, std::pair<expressions::Wrapper<IntegerContext>, expressions::Wrapper<IntegerContext> >, expressions::DivOp> plll::arithmetic::operator/ ( const Integer &  a,
const Integer &  b 
)
inline

Divides the first by the second integer and returns the result.

Parameters
aThe first operand.
bThe second operand.
Returns
The result.

Definition at line 313 of file arithmetic-gmp-iops.hpp.

expressions::Expression<RealContext, std::pair<expressions::Wrapper<RealContext>, expressions::Wrapper<RealContext> >, expressions::DivOp> plll::arithmetic::operator/ ( const Real &  a,
const Real &  b 
)
inline

Divides the first by the second floating point number and returns the result.

Parameters
aThe first operand.
bThe second operand.
Returns
The result.

Definition at line 396 of file arithmetic-gmp-rops.hpp.

expressions::Expression<RationalContext, std::pair<expressions::Wrapper<RationalContext>, expressions::Wrapper<RationalContext> >, expressions::DivOp> plll::arithmetic::operator/ ( const Rational &  a,
const Rational &  b 
)
inline

Divides this rational number by the argument and returns the result.

Parameters
aThe first operand.
bThe second operand.
Returns
The result.

Definition at line 798 of file rational-ops.hpp.

Rational& plll::arithmetic::operator/= ( Rational &  cur,
const Rational &  r 
)
inline

Divides this rational number by the given rational number r.

Parameters
curThe rational number to work on.
rThe rational number to divide by.
Returns
A reference to this rational number containing the result.

Definition at line 283 of file rational-ops.hpp.

template<typename Type >
NInt< Type > & plll::arithmetic::operator/= ( NInt< Type > &  cur,
const NInt< Type > &  i 
)
inline

Divides cur by the given integer i.

Parameters
curThe integer to operate on.
iThe integer to divide by.
Returns
A reference to cur containing the result.

Definition at line 1439 of file arithmetic-nint.hpp.

Real& plll::arithmetic::operator/= ( Real &  cur,
const Real &  r 
)
inline

Divides cur by the given floating point number r.

Parameters
curThe floating point number to operate on.
rThe floating point number to divide by.
Returns
A reference to cur containing the result.

Definition at line 787 of file arithmetic-gmp-rops.hpp.

Integer& plll::arithmetic::operator/= ( Integer &  cur,
const Integer &  i 
)
inline

Divides cur by the given integer i.

Parameters
curThe integer to operate on.
iThe integer to divide by.
Returns
A reference to cur containing the result.

Definition at line 883 of file arithmetic-gmp-iops.hpp.

template<typename Type >
bool plll::arithmetic::operator< ( const NInt< Type > &  a,
const NInt< Type > &  b 
)
inline

Compares the current integer with the given one.

Parameters
aThe first operand.
bThe second operand.
Returns
true if a is less than b.

Definition at line 1563 of file arithmetic-nint.hpp.

bool plll::arithmetic::operator< ( const Rational &  a,
const Rational &  b 
)
inline

Compares the two rational numbers a and b.

Parameters
aThe first operand.
bThe second operand.
Returns
true if and only if a is less than b.

Definition at line 493 of file rational-ops.hpp.

bool plll::arithmetic::operator< ( const Real &  a,
const Real &  b 
)
inline

Compares the two floating point numbers a and b.

Parameters
aThe first operand.
bThe second operand.
Returns
true if and only if a is less than b.

Definition at line 980 of file arithmetic-gmp-rops.hpp.

bool plll::arithmetic::operator< ( const Integer &  a,
const Integer &  b 
)
inline

Compares the current integer with the given one.

Parameters
aThe first operand.
bThe second operand.
Returns
true if a is less than b.

Definition at line 1188 of file arithmetic-gmp-iops.hpp.

template<typename Type >
NInt< Type > plll::arithmetic::operator<< ( const NInt< Type > &  a,
long  b 
)
inline

Computes the bitwise left shift of the first integer by the number of bits given by the second integer, and returns the result.

This effectively multiplies the first integer by 2 to the power of the second integer.

Parameters
aThe first operand.
bThe second operand.
Returns
The result.

Definition at line 1507 of file arithmetic-nint.hpp.

template<typename Type >
NInt< Type > plll::arithmetic::operator<< ( const NInt< Type > &  a,
const NInt< Type > &  b 
)
inline

Computes the bitwise left shift of the first integer by the number of bits given by the second integer, and returns the result.

This effectively multiplies the first integer by 2 to the power of the second integer.

Parameters
aThe first operand.
bThe second operand.
Returns
The result.

Definition at line 1523 of file arithmetic-nint.hpp.

expressions::Expression<IntegerContext, std::pair<expressions::Wrapper<IntegerContext>, expressions::Wrapper<IntegerContext> >, expressions::ShLOp> plll::arithmetic::operator<< ( const Integer &  a,
const Integer &  b 
)
inline

Computes the bitwise left shift of the first integer by the number of bits given by the second integer, and returns the result.

This effectively multiplies the first integer by 2 to the power of the second integer.

Parameters
aThe first operand.
bThe second operand.
Returns
The result.

Definition at line 386 of file arithmetic-gmp-iops.hpp.

expressions::Expression<IntegerContext, expressions::Wrapper<IntegerContext>, expressions::ShiftCOp> plll::arithmetic::operator<< ( const Integer &  a,
signed long  b 
)
inline

Computes the bitwise left shift of the first integer by the number of bits given by the second integer, and returns the result.

This effectively multiplies the first integer by 2 to the power of the second integer.

Parameters
aThe first operand.
bThe second operand.
Returns
The result.

Definition at line 420 of file arithmetic-gmp-iops.hpp.

expressions::Expression<RealContext, std::pair<expressions::Wrapper<RealContext>, expressions::Wrapper<RealContext> >, expressions::ShLOp> plll::arithmetic::operator<< ( const Real &  a,
const Real &  b 
)
inline

Multiplies a with 2 to the power of b and returns the result.

Parameters
aThe first operand.
bThe second operand.
Returns
The result.
See also
Square Roots and Full Powers

Definition at line 426 of file arithmetic-gmp-rops.hpp.

expressions::Expression<RealContext, expressions::Wrapper<RealContext>, expressions::ShiftCOp> plll::arithmetic::operator<< ( const Real &  a,
signed long  b 
)
inline

Multiplies a with 2 to the power of b and returns the result.

Parameters
aThe first operand.
bThe second operand.
Returns
The result.

Definition at line 457 of file arithmetic-gmp-rops.hpp.

expressions::Expression<RationalContext, expressions::Wrapper<RationalContext>, expressions::ShiftCOp> plll::arithmetic::operator<< ( const Rational &  a,
signed long  b 
)
inline

Multiplies this rational number with 2 to the power of b and returns the result.

Parameters
aThe first operand.
bThe second operand.
Returns
The result.

Definition at line 826 of file rational-ops.hpp.

Rational& plll::arithmetic::operator<<= ( Rational &  cur,
long  r 
)
inline

Multiplies this rational number by 2 to the power of r.

Parameters
curThe rational number to work on.
rThe exponent.
Returns
A reference to this rational number containing the result.

Definition at line 310 of file rational-ops.hpp.

template<typename Type >
NInt< Type > & plll::arithmetic::operator<<= ( NInt< Type > &  cur,
long  i 
)
inline

Computes the bitwise left shift of cur by i bits, and stores the result in cur.

This effectively multiplies cur by 2 to the power of i.

Parameters
curThe integer to operate on.
iThe second operand.
Returns
A reference to cur containing the result.

Definition at line 1453 of file arithmetic-nint.hpp.

template<typename Type >
NInt< Type > & plll::arithmetic::operator<<= ( NInt< Type > &  cur,
const NInt< Type > &  i 
)
inline

Computes the bitwise left shift of cur by i bits, and stores the result in cur.

This effectively multiplies cur by 2 to the power of i.

Parameters
curThe integer to operate on.
iThe second operand.
Returns
A reference to cur containing the result.

Definition at line 1467 of file arithmetic-nint.hpp.

Real& plll::arithmetic::operator<<= ( Real &  cur,
const Real &  r 
)
inline

Multiplies cur by 2 to the power of r.

Parameters
curThe floating point number to operate on.
rThe exponent.
Returns
A reference to cur containing the result.
See also
Square Roots and Full Powers

Definition at line 816 of file arithmetic-gmp-rops.hpp.

Real& plll::arithmetic::operator<<= ( Real &  cur,
long  r 
)
inline

Multiplies cur by 2 to the power of r.

Parameters
curThe floating point number to operate on.
rThe exponent.
Returns
A reference to cur containing the result.

Definition at line 844 of file arithmetic-gmp-rops.hpp.

Integer& plll::arithmetic::operator<<= ( Integer &  cur,
const Integer &  i 
)
inline

Computes the bitwise left shift of cur by i bits, and stores the result in cur.

This effectively multiplies cur by 2 to the power of i.

Parameters
curThe integer to operate on.
iThe second operand.
Returns
A reference to cur containing the result.

Definition at line 953 of file arithmetic-gmp-iops.hpp.

Integer& plll::arithmetic::operator<<= ( Integer &  cur,
long  i 
)
inline

Computes the bitwise left shift of cur by i bits, and stores the result in cur.

This effectively multiplies cur by 2 to the power of i.

Parameters
curThe integer to operate on.
iThe second operand.
Returns
A reference to cur containing the result.

Definition at line 985 of file arithmetic-gmp-iops.hpp.

template<typename Type >
bool plll::arithmetic::operator<= ( const NInt< Type > &  a,
const NInt< Type > &  b 
)
inline

Compares the current integer with the given one.

Parameters
aThe first operand.
bThe second operand.
Returns
true if a is less than or equal to b.

Definition at line 1551 of file arithmetic-nint.hpp.

bool plll::arithmetic::operator<= ( const Rational &  a,
const Rational &  b 
)
inline

Compares the two rational numbers a and b.

Parameters
aThe first operand.
bThe second operand.
Returns
true if and only if a is less than or equal to b.

Definition at line 469 of file rational-ops.hpp.

bool plll::arithmetic::operator<= ( const Real &  a,
const Real &  b 
)
inline

Compares the two floating point numbers a and b.

Parameters
aThe first operand.
bThe second operand.
Returns
true if and only if a is less than or equal to b.

Definition at line 956 of file arithmetic-gmp-rops.hpp.

bool plll::arithmetic::operator<= ( const Integer &  a,
const Integer &  b 
)
inline

Compares the current integer with the given one.

Parameters
aThe first operand.
bThe second operand.
Returns
true if a is less than or equal to b.

Definition at line 1166 of file arithmetic-gmp-iops.hpp.

template<typename Type >
bool plll::arithmetic::operator== ( const NInt< Type > &  a,
const NInt< Type > &  b 
)
inline

Compares the current integer with the given one for equality.

Parameters
aThe first operand.
bThe second operand.
Returns
true if a equals b.

Definition at line 1539 of file arithmetic-nint.hpp.

bool plll::arithmetic::operator== ( const Rational &  a,
const Rational &  b 
)
inline

Compares the two rational numbers a and b for equality.

Parameters
aThe first operand.
bThe second operand.
Returns
true if and only if a equals b.

Definition at line 445 of file rational-ops.hpp.

bool plll::arithmetic::operator== ( const Real &  a,
const Real &  b 
)
inline

Compares the two floating point numbers a and b for equality.

Parameters
aThe first operand.
bThe second operand.
Returns
true if and only if a equals b.

Definition at line 932 of file arithmetic-gmp-rops.hpp.

bool plll::arithmetic::operator== ( const Integer &  a,
const Integer &  b 
)
inline

Compares the current integer with the given one for equality.

Parameters
aThe first operand.
bThe second operand.
Returns
true if a equals b.

Definition at line 1144 of file arithmetic-gmp-iops.hpp.

template<typename Type >
bool plll::arithmetic::operator> ( const NInt< Type > &  a,
const NInt< Type > &  b 
)
inline

Compares the current integer with the given one.

Parameters
aThe first operand.
bThe second operand.
Returns
true if a is greater than b.

Definition at line 1569 of file arithmetic-nint.hpp.

bool plll::arithmetic::operator> ( const Rational &  a,
const Rational &  b 
)
inline

Compares the two rational numbers a and b.

Parameters
aThe first operand.
bThe second operand.
Returns
true if and only if a is greater than b.

Definition at line 505 of file rational-ops.hpp.

bool plll::arithmetic::operator> ( const Real &  a,
const Real &  b 
)
inline

Compares the two floating point numbers a and b.

Parameters
aThe first operand.
bThe second operand.
Returns
true if and only if a is greater than b.

Definition at line 992 of file arithmetic-gmp-rops.hpp.

bool plll::arithmetic::operator> ( const Integer &  a,
const Integer &  b 
)
inline

Compares the current integer with the given one.

Parameters
aThe first operand.
bThe second operand.
Returns
true if a is greater than b.

Definition at line 1199 of file arithmetic-gmp-iops.hpp.

template<typename Type >
bool plll::arithmetic::operator>= ( const NInt< Type > &  a,
const NInt< Type > &  b 
)
inline

Compares the current integer with the given one.

Parameters
aThe first operand.
bThe second operand.
Returns
true if a is greater than or equal to b.

Definition at line 1557 of file arithmetic-nint.hpp.

bool plll::arithmetic::operator>= ( const Rational &  a,
const Rational &  b 
)
inline

Compares the two rational numbers a and b.

Parameters
aThe first operand.
bThe second operand.
Returns
true if and only if a is greater than or equal to b.

Definition at line 481 of file rational-ops.hpp.

bool plll::arithmetic::operator>= ( const Real &  a,
const Real &  b 
)
inline

Compares the two floating point numbers a and b.

Parameters
aThe first operand.
bThe second operand.
Returns
true if and only if a is greater than or equal to b.

Definition at line 968 of file arithmetic-gmp-rops.hpp.

bool plll::arithmetic::operator>= ( const Integer &  a,
const Integer &  b 
)
inline

Compares the current integer with the given one.

Parameters
aThe first operand.
bThe second operand.
Returns
true if a is greater than or equal to b.

Definition at line 1177 of file arithmetic-gmp-iops.hpp.

template<typename Type >
NInt< Type > plll::arithmetic::operator>> ( const NInt< Type > &  a,
long  b 
)
inline

Computes the bitwise right shift of the first integer by the number of bits given by the second integer, and returns the result.

This effectively divides the first integer by 2 to the power of the second integer, and rounds towards zero.

Parameters
aThe first operand.
bThe second operand.
Returns
The result.

Definition at line 1515 of file arithmetic-nint.hpp.

template<typename Type >
NInt< Type > plll::arithmetic::operator>> ( const NInt< Type > &  a,
const NInt< Type > &  b 
)
inline

Computes the bitwise right shift of the first integer by the number of bits given by the second integer, and returns the result.

This effectively divides the first integer by 2 to the power of the second integer, and rounds towards zero.

Parameters
aThe first operand.
bThe second operand.
Returns
The result.

Definition at line 1531 of file arithmetic-nint.hpp.

expressions::Expression<IntegerContext, std::pair<expressions::Wrapper<IntegerContext>, expressions::Wrapper<IntegerContext> >, expressions::ShROp> plll::arithmetic::operator>> ( const Integer &  a,
const Integer &  b 
)
inline

Computes the bitwise right shift of the first integer by the number of bits given by the second integer, and returns the result.

This effectively divides the first integer by 2 to the power of the second integer, and rounds towards zero.

Parameters
aThe first operand.
bThe second operand.
Returns
The result.

Definition at line 404 of file arithmetic-gmp-iops.hpp.

expressions::Expression<IntegerContext, expressions::Wrapper<IntegerContext>, expressions::ShiftCOp> plll::arithmetic::operator>> ( const Integer &  a,
signed long  b 
)
inline

Computes the bitwise right shift of the first integer by the number of bits given by the second integer, and returns the result.

This effectively divides the first integer by 2 to the power of the second integer, and rounds towards zero.

Parameters
aThe first operand.
bThe second operand.
Returns
The result.

Definition at line 435 of file arithmetic-gmp-iops.hpp.

expressions::Expression<RealContext, std::pair<expressions::Wrapper<RealContext>, expressions::Wrapper<RealContext> >, expressions::ShROp> plll::arithmetic::operator>> ( const Real &  a,
const Real &  b 
)
inline

Divides a by 2 to the power of b and returns the result.

Parameters
aThe first operand.
bThe second operand.
Returns
The result.
See also
Square Roots and Full Powers

Definition at line 443 of file arithmetic-gmp-rops.hpp.

expressions::Expression<RealContext, expressions::Wrapper<RealContext>, expressions::ShiftCOp> plll::arithmetic::operator>> ( const Real &  a,
signed long  b 
)
inline

Divides a by 2 to the power of b and returns the result.

Parameters
aThe first operand.
bThe second operand.
Returns
The result.

Definition at line 469 of file arithmetic-gmp-rops.hpp.

expressions::Expression<RationalContext, expressions::Wrapper<RationalContext>, expressions::ShiftCOp> plll::arithmetic::operator>> ( const Rational &  a,
signed long  b 
)
inline

Divides this rational number by 2 to the power of b and returns the result.

Parameters
aThe first operand.
bThe second operand.
Returns
The result.

Definition at line 838 of file rational-ops.hpp.

Rational& plll::arithmetic::operator>>= ( Rational &  cur,
long  r 
)
inline

Divides this rational number by 2 to the power of r.

Parameters
curThe rational number to work on.
rThe exponent.
Returns
A reference to this rational number containing the result.

Definition at line 323 of file rational-ops.hpp.

template<typename Type >
NInt< Type > & plll::arithmetic::operator>>= ( NInt< Type > &  cur,
long  i 
)
inline

Computes the bitwise right shift of cur by i bits, and stores the result in cur.

This effectively divides cur by 2 to the power of i, and rounds towards zero.

Parameters
curThe integer to operate on.
iThe second operand.
Returns
A reference to cur containing the result.

Definition at line 1460 of file arithmetic-nint.hpp.

template<typename Type >
NInt< Type > & plll::arithmetic::operator>>= ( NInt< Type > &  cur,
const NInt< Type > &  i 
)
inline

Computes the bitwise right shift of cur by i bits, and stores the result in cur.

This effectively divides cur by 2 to the power of i, and rounds towards zero.

Parameters
curThe integer to operate on.
iThe second operand.
Returns
A reference to cur containing the result.

Definition at line 1474 of file arithmetic-nint.hpp.

Real& plll::arithmetic::operator>>= ( Real &  cur,
const Real &  r 
)
inline

Divides cur by 2 to the power of r.

Parameters
curThe floating point number to operate on.
rThe exponent.
Returns
A reference to cur containing the result.
See also
Square Roots and Full Powers

Definition at line 831 of file arithmetic-gmp-rops.hpp.

Real& plll::arithmetic::operator>>= ( Real &  cur,
long  r 
)
inline

Divides cur by 2 to the power of r.

Parameters
curThe floating point number to operate on.
rThe exponent.
Returns
A reference to cur containing the result.

Definition at line 857 of file arithmetic-gmp-rops.hpp.

Integer& plll::arithmetic::operator>>= ( Integer &  cur,
const Integer &  i 
)
inline

Computes the bitwise right shift of cur by i bits, and stores the result in cur.

This effectively divides cur by 2 to the power of i, and rounds towards zero.

Parameters
curThe integer to operate on.
iThe second operand.
Returns
A reference to cur containing the result.

Definition at line 969 of file arithmetic-gmp-iops.hpp.

Integer& plll::arithmetic::operator>>= ( Integer &  cur,
long  i 
)
inline

Computes the bitwise right shift of cur by i bits, and stores the result in cur.

This effectively divides cur by 2 to the power of i, and rounds towards zero.

Parameters
curThe integer to operate on.
iThe second operand.
Returns
A reference to cur containing the result.

Definition at line 1001 of file arithmetic-gmp-iops.hpp.

expressions::Expression<IntegerContext, std::pair<expressions::Wrapper<IntegerContext>, expressions::Wrapper<IntegerContext> >, expressions::XOROp> plll::arithmetic::operator^ ( const Integer &  a,
const Integer &  b 
)
inline

Computes the bitwise exclusive or of the two integers and returns the result.

Parameters
aThe first operand.
bThe second operand.
Returns
The result.

Definition at line 369 of file arithmetic-gmp-iops.hpp.

Integer& plll::arithmetic::operator^= ( Integer &  cur,
const Integer &  i 
)
inline

Computes the bitwise exclusive or of cur with i and stores the result in cur.

Parameters
curThe integer to operate on.
iThe second operand.
Returns
A reference to cur containing the result.

Definition at line 937 of file arithmetic-gmp-iops.hpp.

expressions::Expression<IntegerContext, std::pair<expressions::Wrapper<IntegerContext>, expressions::Wrapper<IntegerContext> >, expressions::OrOp> plll::arithmetic::operator| ( const Integer &  a,
const Integer &  b 
)
inline

Computes the bitwise or of the two integers and returns the result.

Parameters
aThe first operand.
bThe second operand.
Returns
The result.

Definition at line 355 of file arithmetic-gmp-iops.hpp.

Integer& plll::arithmetic::operator|= ( Integer &  cur,
const Integer &  i 
)
inline

Computes the bitwise or of cur with i and stores the result in cur.

Parameters
curThe integer to operate on.
iThe second operand.
Returns
A reference to cur containing the result.

Definition at line 910 of file arithmetic-gmp-iops.hpp.

expressions::Expression<IntegerContext, expressions::Wrapper<IntegerContext>, expressions::BitInvOp> plll::arithmetic::operator~ ( const Integer &  a)
inline

Bitwise negates the integer.

Parameters
aThe integer.
Returns
The result.

Definition at line 259 of file arithmetic-gmp-iops.hpp.

void plll::arithmetic::power ( Rational &  r,
const Rational &  a,
signed long  e 
)
inline

Raises a to the power e and stores the result in r.

Parameters
rThe result.
aThe base.
eThe exponent.

Definition at line 1361 of file rational.hpp.

void plll::arithmetic::power ( Rational &  r,
const Rational &  a,
unsigned long  e 
)
inline

Raises a to the power e and stores the result in r.

Parameters
rThe result.
aThe base.
eThe exponent.

Definition at line 1381 of file rational.hpp.

void plll::arithmetic::power ( Rational &  r,
const Rational &  a,
const Integer &  e 
)

Raises a to the power e and stores the result in r.

Parameters
rThe result.
aThe base.
eThe exponent.
void plll::arithmetic::power ( Integer &  r,
const Integer &  a,
long  b 
)
inline

Raises a to the power b and stores the result in r.

Parameters
rThe result.
aThe base.
bThe exponent.

Definition at line 1503 of file arithmetic-gmp.hpp.

void plll::arithmetic::power ( Integer &  r,
const Integer &  a,
const Integer &  b 
)
inline

Raises a to the power b and stores the result in r.

Parameters
rThe result.
aThe base.
bThe exponent.

Definition at line 1511 of file arithmetic-gmp.hpp.

template<typename Type >
NInt< Type > plll::arithmetic::power ( const NInt< Type > &  a,
long  b 
)
inline

Computes and returns a raised to the power of b.

Parameters
aThe first operand.
bThe second operand.
Returns
The result.

Definition at line 1899 of file arithmetic-nint.hpp.

template<typename Type >
void plll::arithmetic::power ( NInt< Type > &  r,
const NInt< Type > &  a,
long  b 
)
inline

Raises a to the power b and stores the result in r.

Parameters
rThe result.
aThe base.
bThe exponent.

Definition at line 1893 of file arithmetic-nint.hpp.

template<typename Type >
NInt< Type > plll::arithmetic::power ( const NInt< Type > &  a,
const NInt< Type > &  b 
)
inline

Computes and returns a raised to the power of b.

Parameters
aThe first operand.
bThe second operand.
Returns
The result.

Definition at line 1911 of file arithmetic-nint.hpp.

template<typename Type >
void plll::arithmetic::power ( NInt< Type > &  r,
const NInt< Type > &  a,
const NInt< Type > &  b 
)
inline

Raises a to the power b and stores the result in r.

Parameters
rThe result.
aThe base.
bThe exponent.

Definition at line 1905 of file arithmetic-nint.hpp.

expressions::Expression<RationalContext, expressions::Wrapper<RationalContext>, expressions::PowerCOp<signed long>::impl> plll::arithmetic::power ( const Rational &  a,
signed long  b 
)
inline

Returns a raised to the power of b.

Parameters
aThe base.
bThe exponent.
Returns
The result.

Definition at line 1020 of file rational-ops.hpp.

void plll::arithmetic::power ( Real &  res,
const Real &  a,
const Integer &  b 
)
inline

Raises a to the power b and stores the result in res.

Parameters
resThe result.
aThe base.
bThe exponent.

Definition at line 3185 of file arithmetic-gmp.hpp.

expressions::Expression<RationalContext, expressions::Wrapper<RationalContext>, expressions::PowerCOp<unsigned long>::impl> plll::arithmetic::power ( const Rational &  a,
unsigned long  b 
)
inline

Returns a raised to the power of b.

Parameters
aThe base.
bThe exponent.
Returns
The result.

Definition at line 1031 of file rational-ops.hpp.

void plll::arithmetic::power ( Real &  res,
const Real &  a,
const Real &  b 
)
inline

Raises a to the power b and stores the result in res.

Parameters
resThe result.
aThe base.
bThe exponent.
See also
Square Roots and Full Powers

Definition at line 3194 of file arithmetic-gmp.hpp.

expressions::Expression<RationalContext, std::pair<expressions::Wrapper<RationalContext>, expressions::Wrapper<IntegerContext> >, expressions::PowerOp> plll::arithmetic::power ( const Rational &  a,
const Integer &  b 
)
inline

Returns a raised to the power of b.

Parameters
aThe base.
bThe exponent.
Returns
The result.

Definition at line 1043 of file rational-ops.hpp.

expressions::Expression<RationalContext, expressions::Wrapper<RationalContext>, expressions::PowerCOp<signed long>::impl> plll::arithmetic::power ( const Rational &  a,
signed long  b,
const RationalContext &  rc 
)
inline

Returns a raised to the power of b.

Parameters
aThe base.
bThe exponent.
rcThe context whose precision to use for the result.
Returns
The result.

Definition at line 1087 of file rational-ops.hpp.

expressions::Expression<RationalContext, expressions::Wrapper<RationalContext>, expressions::PowerCOp<unsigned long>::impl> plll::arithmetic::power ( const Rational &  a,
unsigned long  b,
const RationalContext &  rc 
)
inline

Returns a raised to the power of b.

Parameters
aThe base.
bThe exponent.
rcThe context whose precision to use for the result.
Returns
The result.

Definition at line 1099 of file rational-ops.hpp.

expressions::Expression<RationalContext, std::pair<expressions::Wrapper<RationalContext>, expressions::Wrapper<IntegerContext> >, expressions::PowerOp> plll::arithmetic::power ( const Rational &  a,
const Integer &  b,
const RationalContext &  rc 
)
inline

Returns a raised to the power of b.

Parameters
aThe base.
bThe exponent.
rcThe context whose precision to use for the result.
Returns
The result.

Definition at line 1112 of file rational-ops.hpp.

expressions::Expression<IntegerContext, std::pair<expressions::Wrapper<IntegerContext>, expressions::Wrapper<IntegerContext> >, expressions::PowerOp> plll::arithmetic::power ( const Integer &  a,
const Integer &  b 
)
inline

Computes and returns a raised to the power of b.

Parameters
aThe first operand.
bThe second operand.
Returns
The result.

Definition at line 1566 of file arithmetic-gmp-iops.hpp.

expressions::Expression<IntegerContext, expressions::Wrapper<IntegerContext>, expressions::PowerCOp<signed long>::impl> plll::arithmetic::power ( const Integer &  a,
signed long  b 
)
inline

Computes and returns a raised to the power of b.

Parameters
aThe base.
bThe exponent.
Returns
The result.

Definition at line 1625 of file arithmetic-gmp-iops.hpp.

expressions::Expression<RealContext, expressions::Wrapper<RealContext>, expressions::PowerCOp<signed long>::impl> plll::arithmetic::power ( const Real &  a,
signed long  b 
)
inline

Returns a raised to the power of b.

Parameters
aThe base.
bThe exponent.
Returns
The result.

Definition at line 1648 of file arithmetic-gmp-rops.hpp.

expressions::Expression<RealContext, expressions::Wrapper<RealContext>, expressions::PowerCOp<unsigned long>::impl> plll::arithmetic::power ( const Real &  a,
unsigned long  b 
)
inline

Returns a raised to the power of b.

Parameters
aThe base.
bThe exponent.
Returns
The result.

Definition at line 1659 of file arithmetic-gmp-rops.hpp.

expressions::Expression<RealContext, std::pair<expressions::Wrapper<RealContext>, expressions::Wrapper<IntegerContext> >, expressions::PowerOp> plll::arithmetic::power ( const Real &  a,
const Integer &  b 
)
inline

Returns a raised to the power of b.

Parameters
aThe base.
bThe exponent.
Returns
The result.

Definition at line 1671 of file arithmetic-gmp-rops.hpp.

expressions::Expression<RealContext, std::pair<expressions::Wrapper<RealContext>, expressions::Wrapper<RealContext> >, expressions::PowerOp> plll::arithmetic::power ( const Real &  a,
const Real &  b 
)
inline

Returns a raised to the power of b.

Parameters
aThe base.
bThe exponent.
Returns
The result.
See also
Square Roots and Full Powers

Definition at line 1686 of file arithmetic-gmp-rops.hpp.

expressions::Expression<RealContext, expressions::Wrapper<RealContext>, expressions::PowerCOp_Context<signed long>::impl> plll::arithmetic::power ( const Real &  a,
signed long  b,
const RealContext &  rc 
)
inline

Returns a raised to the power of b.

Parameters
aThe base.
bThe exponent.
rcThe context whose precision to use for the result.
Returns
The result.

Definition at line 2081 of file arithmetic-gmp-rops.hpp.

expressions::Expression<RealContext, expressions::Wrapper<RealContext>, expressions::PowerCOp_Context<unsigned long>::impl> plll::arithmetic::power ( const Real &  a,
unsigned long  b,
const RealContext &  rc 
)
inline

Returns a raised to the power of b.

Parameters
aThe base.
bThe exponent.
rcThe context whose precision to use for the result.
Returns
The result.

Definition at line 2094 of file arithmetic-gmp-rops.hpp.

expressions::Expression<RealContext, std::pair<expressions::Wrapper<RealContext>, expressions::Wrapper<IntegerContext> >, expressions::PowerOp_Context> plll::arithmetic::power ( const Real &  a,
const Integer &  b,
const RealContext &  rc 
)
inline

Returns a raised to the power of b.

Parameters
aThe base.
bThe exponent.
rcThe context whose precision to use for the result.
Returns
The result.

Definition at line 2108 of file arithmetic-gmp-rops.hpp.

expressions::Expression<RealContext, std::pair<expressions::Wrapper<RealContext>, expressions::Wrapper<RealContext> >, expressions::PowerOp_Context> plll::arithmetic::power ( const Real &  a,
const Real &  b,
const RealContext &  rc 
)
inline

Returns a raised to the power of b.

Parameters
aThe base.
bThe exponent.
rcThe context whose precision to use for the result.
Returns
The result.
See also
Square Roots and Full Powers

Definition at line 2124 of file arithmetic-gmp-rops.hpp.

void plll::arithmetic::roundDiv ( Integer &  r,
const Integer &  a,
const Integer &  b 
)

Computes $\lfloor \tfrac{a}{b} \rceil$ (rounding to the next integer) and stores the result in r.

Parameters
rThe result.
aThe divident.
bThe divisor.
See also
Integer Functions

Definition at line 1529 of file arithmetic-gmp.hpp.

template<typename Type >
void plll::arithmetic::roundDiv ( NInt< Type > &  r,
const NInt< Type > &  a,
const NInt< Type > &  b 
)

Computes $\lfloor \tfrac{a}{b} \rceil$ (rounding to the next integer) and stores the result in r.

Parameters
rThe result.
aThe divident.
bThe divisor.
See also
Integer Functions

Definition at line 2217 of file arithmetic-nint.hpp.

template<typename Type >
NInt< Type > plll::arithmetic::roundDiv ( const NInt< Type > &  a,
const NInt< Type > &  b 
)

Computes and returns $\lfloor \tfrac{a}{b} \rceil$ (rounding to the next integer).

Returns
The result.
Parameters
aThe divident.
bThe divisor.
See also
Integer Functions

Definition at line 2230 of file arithmetic-nint.hpp.

expressions::Expression<IntegerContext, std::pair<expressions::Wrapper<IntegerContext>, expressions::Wrapper<IntegerContext> >, expressions::RoundDivOp> plll::arithmetic::roundDiv ( const Integer &  a,
const Integer &  b 
)
inline

Computes and returns $\lfloor \tfrac{a}{b} \rceil$.

Parameters
aThe first operand.
bThe second operand.
Returns
The result.

Definition at line 1609 of file arithmetic-gmp-iops.hpp.

void plll::arithmetic::setbit ( Integer &  x,
long  n,
bool  value = true 
)
inline

Sets the n-th bit of $|x|$ to value.

Parameters
xThe integer whose bits to modify.
nThe index of the bit to set or clear.
valueThe new value of the n-th bit. The default value is true.
See also
Integer Functions

Definition at line 1779 of file arithmetic-gmp.hpp.

template<typename Type >
void plll::arithmetic::setbit ( NInt< Type > &  x,
long  n,
bool  value = true 
)
inline

Sets the n-th bit of $|x|$ to value.

Parameters
xThe integer whose bits to modify.
nThe index of the bit to set or clear.
valueThe new value of the n-th bit. The default value is true.
See also
Integer Functions

Definition at line 1855 of file arithmetic-nint.hpp.

void plll::arithmetic::setInfinity ( Real &  r,
bool  sign = true 
)
inline

Sets the given floating point number to $\pm \infty$.

Parameters
rThe floating point variable to set to infinity.
signIf true, the number is set to $+\infty$, and otherwise to $-\infty$. The default value is true.

Definition at line 2927 of file arithmetic-gmp.hpp.

void plll::arithmetic::setOne ( Rational &  r)
inline

Sets the given rational number to one.

Parameters
rThe rational number variable to set to one.

Definition at line 1313 of file rational.hpp.

void plll::arithmetic::setZero ( Rational &  r,
bool  sign = true 
)
inline

Sets the given rational number to $\pm 0$.

Note that the sign is ignored, as there is no distinction between the rational +0 and -0.

Parameters
rThe rational number variable to set to zero.
signThis is ignored. The default value is true.

Definition at line 1306 of file rational.hpp.

void plll::arithmetic::setZero ( Real &  r,
bool  sign = true 
)
inline

Sets the given floating point number to $\pm 0$.

Parameters
rThe floating point variable to set to zero.
signIf true, the number is set to $+0$, and otherwise to $-0$. The default value is true.

Definition at line 2932 of file arithmetic-gmp.hpp.

void plll::arithmetic::shl ( Rational &  r,
const Rational &  a,
long  b 
)
inline

Multiplies a by $2^b$ and stores the result in r.

Parameters
rThe result.
aThe first operand.
bThe second operand.

Definition at line 1194 of file rational.hpp.

void plll::arithmetic::shl ( Integer &  r,
const Integer &  a,
long  b 
)
inline

Shifts a by b bits to the left and stores the result in r.

Parameters
rThe result.
aThe first operand.
bThe second operand.

Definition at line 1575 of file arithmetic-gmp.hpp.

void plll::arithmetic::shl ( Integer &  r,
const Integer &  a,
const Integer &  b 
)
inline

Shifts a by b bits to the right and stores the result in r.

Parameters
rThe result.
aThe first operand.
bThe second operand.

Definition at line 1583 of file arithmetic-gmp.hpp.

template<typename Type >
void plll::arithmetic::shl ( NInt< Type > &  r,
const NInt< Type > &  a,
long  b 
)
inline

Shifts a by b bits to the left and stores the result in r.

Parameters
rThe result.
aThe first operand.
bThe second operand.

Definition at line 1681 of file arithmetic-nint.hpp.

void plll::arithmetic::shl ( Real &  r,
const Real &  a,
const Real &  b 
)
inline

Multiplies a by $2^b$ and stores the result in r.

Parameters
rThe result.
aThe first operand.
bThe second operand.

Definition at line 2825 of file arithmetic-gmp.hpp.

template<typename Type >
void plll::arithmetic::shl ( NInt< Type > &  r,
const NInt< Type > &  a,
const NInt< Type > &  b 
)
inline

Shifts a by b bits to the left and stores the result in r.

Parameters
rThe result.
aThe first operand.
bThe second operand.

Definition at line 1719 of file arithmetic-nint.hpp.

void plll::arithmetic::shl ( Real &  r,
const Real &  a,
long  b 
)
inline

Multiplies a by $2^b$ and stores the result in r.

Parameters
rThe result.
aThe first operand.
bThe second operand.
See also
Square Roots and Full Powers

Definition at line 2857 of file arithmetic-gmp.hpp.

void plll::arithmetic::shr ( Rational &  r,
const Rational &  a,
long  b 
)
inline

Multiplies a by $2^b$ and stores the result in r.

Parameters
rThe result.
aThe first operand.
bThe second operand.

Definition at line 1226 of file rational.hpp.

void plll::arithmetic::shr ( Integer &  r,
const Integer &  a,
long  b 
)
inline

Shifts a by b bits to the left and stores the result in r.

Parameters
rThe result.
aThe first operand.
bThe second operand.

Definition at line 1588 of file arithmetic-gmp.hpp.

void plll::arithmetic::shr ( Integer &  r,
const Integer &  a,
const Integer &  b 
)
inline

Shifts a by b bits to the right and stores the result in r.

Parameters
rThe result.
aThe first operand.
bThe second operand.

Definition at line 1596 of file arithmetic-gmp.hpp.

template<typename Type >
void plll::arithmetic::shr ( NInt< Type > &  r,
const NInt< Type > &  a,
long  b 
)
inline

Shifts a by b bits to the left and stores the result in r.

Parameters
rThe result.
aThe first operand.
bThe second operand.

Definition at line 1700 of file arithmetic-nint.hpp.

void plll::arithmetic::shr ( Real &  r,
const Real &  a,
const Real &  b 
)
inline

Multiplies a by $2^{-b}$ and stores the result in r.

Parameters
rThe result.
aThe first operand.
bThe second operand.
See also
Square Roots and Full Powers

Definition at line 2841 of file arithmetic-gmp.hpp.

template<typename Type >
void plll::arithmetic::shr ( NInt< Type > &  r,
const NInt< Type > &  a,
const NInt< Type > &  b 
)
inline

Shifts a by b bits to the left and stores the result in r.

Parameters
rThe result.
aThe first operand.
bThe second operand.

Definition at line 1725 of file arithmetic-nint.hpp.

void plll::arithmetic::shr ( Real &  r,
const Real &  a,
long  b 
)
inline

Multiplies a by $2^{-b}$ and stores the result in r.

Parameters
rThe result.
aThe first operand.
bThe second operand.

Definition at line 2866 of file arithmetic-gmp.hpp.

int plll::arithmetic::sign ( const Rational &  r)
inline

Returns the sign of the given rational number.

Returns
Returns a negative value if the value is negative, 0 if it is zero, and a positive value if it is positive.
See also
Predicates

Definition at line 1342 of file rational.hpp.

int plll::arithmetic::sign ( const Integer &  )
inline

Returns the sign of the given integer.

Returns
Returns a negative value if the value is negative, 0 if it is zero, and a positive value if it is positive.

Definition at line 1767 of file arithmetic-gmp.hpp.

int plll::arithmetic::sign ( const Real &  )
inline

Returns the sign of the given floating point number.

Returns
Returns a negative value if the value is negative, 0 if it is zero, and a positive value if it is positive.
See also
Predicates

Definition at line 3013 of file arithmetic-gmp.hpp.

template<typename Type >
int plll::arithmetic::sign ( const NInt< Type > &  r)
inline

Returns the sign of the given integer.

Returns
Returns a negative value if the value is negative, 0 if it is zero, and a positive value if it is positive.

Definition at line 1815 of file arithmetic-nint.hpp.

void plll::arithmetic::sin ( Real &  res,
const Real &  a 
)
inline

Computes the sine of a and stores the result in res.

Parameters
resThe result.
aThe value the function is evaluated at.
See also
Trigonometric Functions

Definition at line 3028 of file arithmetic-gmp.hpp.

expressions::Expression<RealContext, expressions::Wrapper<RealContext>, expressions::SinOp> plll::arithmetic::sin ( const Real &  i)
inline

Returns the sine of the given floating point number.

Parameters
iThe operand.
Returns
The result.
See also
Trigonometric Functions

Definition at line 1462 of file arithmetic-gmp-rops.hpp.

expressions::Expression<RealContext, expressions::Wrapper<RealContext>, expressions::SinOp_Context> plll::arithmetic::sin ( const Real &  i,
const RealContext &  rc 
)
inline

Returns the sine of the given floating point number.

Parameters
iThe operand.
rcThe context whose precision to use for the result.
Returns
The result.
See also
Trigonometric Functions

Definition at line 1878 of file arithmetic-gmp-rops.hpp.

void plll::arithmetic::sqrt ( Real &  res,
const Real &  a 
)
inline

Computes the square root of a and stores the result in res.

Parameters
resThe result.
aThe value the function is evaluated at.

Definition at line 3130 of file arithmetic-gmp.hpp.

expressions::Expression<RealContext, expressions::Wrapper<RealContext>, expressions::SqrtOp> plll::arithmetic::sqrt ( const Real &  i)
inline

Returns the square root of the given floating point number.

Parameters
iThe operand.
Returns
The result.
See also
Square Roots and Full Powers

Definition at line 1592 of file arithmetic-gmp-rops.hpp.

expressions::Expression<RealContext, expressions::Wrapper<RealContext>, expressions::SqrtOp_Context> plll::arithmetic::sqrt ( const Real &  i,
const RealContext &  rc 
)
inline

Returns the square root of the given floating point number.

Parameters
iThe operand.
rcThe context whose precision to use for the result.
Returns
The result.
See also
Square Roots and Full Powers

Definition at line 2020 of file arithmetic-gmp-rops.hpp.

void plll::arithmetic::sqrtCeil ( Integer &  r,
const Integer &  a 
)
inline

Computes $\lceil\sqrt{a}\rceil$ and stores the result in r.

Parameters
rThe result.
aThe operand.

Definition at line 1540 of file arithmetic-gmp.hpp.

template<typename Type >
void plll::arithmetic::sqrtCeil ( NInt< Type > &  r,
const NInt< Type > &  a 
)
inline

Computes $\lceil\sqrt{a}\rceil$ and stores the result in r.

Parameters
rThe result.
aThe operand.

Definition at line 1917 of file arithmetic-nint.hpp.

template<typename Type >
NInt<Type> plll::arithmetic::sqrtCeil ( const NInt< Type > &  a)
inline

Computes and returns $\lceil\sqrt{a}\rceil$.

Returns
The result.
Parameters
aThe operand.
expressions::Expression<IntegerContext, expressions::Wrapper<IntegerContext>, expressions::SqrtCeilOp> plll::arithmetic::sqrtCeil ( const Integer &  i)
inline

Computes and returns the ceil of the square root of i.

Parameters
iThe operand.
Returns
The result.

Definition at line 1512 of file arithmetic-gmp-iops.hpp.

void plll::arithmetic::sqrtFloor ( Integer &  r,
const Integer &  a 
)
inline

Computes $\lfloor\sqrt{a}\rfloor$ and stores the result in r.

Parameters
rThe result.
aThe operand.

Definition at line 1550 of file arithmetic-gmp.hpp.

template<typename Type >
void plll::arithmetic::sqrtFloor ( NInt< Type > &  r,
const NInt< Type > &  a 
)
inline

Computes $\lfloor\sqrt{a}\rfloor$ and stores the result in r.

Parameters
rThe result.
aThe operand.

Definition at line 1941 of file arithmetic-nint.hpp.

template<typename Type >
NInt<Type> plll::arithmetic::sqrtFloor ( const NInt< Type > &  a)
inline

Computes and returns $\lfloor\sqrt{a}\rfloor$.

Returns
The result.
Parameters
aThe operand.
expressions::Expression<IntegerContext, expressions::Wrapper<IntegerContext>, expressions::SqrtFloorOp> plll::arithmetic::sqrtFloor ( const Integer &  i)
inline

Computes and returns the floor of the square root of i.

Parameters
iThe operand.
Returns
The result.

Definition at line 1521 of file arithmetic-gmp-iops.hpp.

void plll::arithmetic::square ( Rational &  r,
const Rational &  a 
)
inline

Computes the square of a and stores the result in r.

Parameters
rThe result.
aThe operand.

Definition at line 1348 of file rational.hpp.

void plll::arithmetic::square ( Integer &  r,
const Integer &  a 
)
inline

Computes the square of a and stores the result in r.

Parameters
rThe result.
aThe operand.

Definition at line 1788 of file arithmetic-gmp.hpp.

template<typename Type >
void plll::arithmetic::square ( NInt< Type > &  r,
const NInt< Type > &  a 
)
inline

Computes the square of a and stores the result in r.

Parameters
rThe result.
aThe operand.

Definition at line 1871 of file arithmetic-nint.hpp.

template<typename Type >
NInt< Type > plll::arithmetic::square ( const NInt< Type > &  i)
inline

Computes and returns the square of i.

Parameters
iThe operand.
Returns
The result.

Definition at line 1865 of file arithmetic-nint.hpp.

void plll::arithmetic::square ( Real &  r,
const Real &  a 
)
inline

Computes the square of a and stores the result in r.

Parameters
rThe result.
aThe operand.

Definition at line 3019 of file arithmetic-gmp.hpp.

expressions::Expression<RationalContext, expressions::Wrapper<RationalContext>, expressions::SquareOp> plll::arithmetic::square ( const Rational &  i)
inline

Returns the square of the given rational number.

Parameters
iThe operand.
Returns
The result.

Definition at line 1005 of file rational-ops.hpp.

expressions::Expression<RationalContext, expressions::Wrapper<RationalContext>, expressions::SquareOp> plll::arithmetic::square ( const Rational &  i,
const RationalContext &  rc 
)
inline

Returns the square of the given rational number.

Parameters
iThe operand.
rcThe context whose precision to use for the result.
Returns
The result.

Definition at line 1071 of file rational-ops.hpp.

expressions::Expression<RealContext, expressions::Wrapper<RealContext>, expressions::SquareOp> plll::arithmetic::square ( const Real &  i)
inline

Returns the square of the given floating point number.

Parameters
iThe operand.
Returns
The result.

Definition at line 1447 of file arithmetic-gmp-rops.hpp.

expressions::Expression<IntegerContext, expressions::Wrapper<IntegerContext>, expressions::SquareOp> plll::arithmetic::square ( const Integer &  i)
inline

Computes and returns the square of i.

Parameters
iThe operand.
Returns
The result.

Definition at line 1499 of file arithmetic-gmp-iops.hpp.

expressions::Expression<RealContext, expressions::Wrapper<RealContext>, expressions::SquareOp_Context> plll::arithmetic::square ( const Real &  i,
const RealContext &  rc 
)
inline

Returns the square of the given floating point number.

Parameters
iThe operand.
rcThe context whose precision to use for the result.
Returns
The result.

Definition at line 1862 of file arithmetic-gmp-rops.hpp.

void plll::arithmetic::sub ( Rational &  r,
const Rational &  a,
const Rational &  b 
)
inline

Subtracts b from a and stores the result in r.

Parameters
rThe result.
aThe first operand.
bThe second operand.

Definition at line 918 of file rational.hpp.

void plll::arithmetic::sub ( Integer &  r,
const Integer &  a,
const Integer &  b 
)
inline

Subtracts b from a and stores the result in r.

Parameters
rThe result.
aThe first operand.
bThe second operand.

Definition at line 1339 of file arithmetic-gmp.hpp.

template<typename Type >
void plll::arithmetic::sub ( NInt< Type > &  r,
const NInt< Type > &  a,
const NInt< Type > &  b 
)
inline

Subtracts b from a and stores the result in r.

Parameters
rThe result.
aThe first operand.
bThe second operand.

Definition at line 1637 of file arithmetic-nint.hpp.

void plll::arithmetic::sub ( Real &  r,
const Real &  a,
const Real &  b 
)
inline

Subtracts b from a and stores the result in r.

Parameters
rThe result.
aThe first operand.
bThe second operand.

Definition at line 2496 of file arithmetic-gmp.hpp.

void plll::arithmetic::submul ( Integer &  r,
const Integer &  a,
const Integer &  b 
)
inline

Multiplies a and b and subtracts the result from r.

Parameters
rThe accumulator.
aThe first operand.
bThe second operand.

Definition at line 1483 of file arithmetic-gmp.hpp.

template<typename Type >
void plll::arithmetic::submul ( NInt< Type > &  r,
const NInt< Type > &  a,
const NInt< Type > &  b 
)
inline

Multiplies a and b and subtracts the result from r.

Parameters
rThe accumulator.
aThe first operand.
bThe second operand.

Definition at line 1649 of file arithmetic-nint.hpp.

void plll::arithmetic::submul ( Real &  r,
const Real &  a,
const Real &  b 
)
inline

Multiplies a and b and subtracts the result from r.

Parameters
rThe accumulator.
aThe first operand.
bThe second operand.

Definition at line 2614 of file arithmetic-gmp.hpp.

void plll::arithmetic::submul ( Rational &  r,
const Rational &  a,
const Rational &  b 
)
inline

Multiplies a and b and subtracts the result from r.

Parameters
rThe accumulator.
aThe first operand.
bThe second operand.

Definition at line 1262 of file rational-ops.hpp.

void plll::arithmetic::tan ( Real &  res,
const Real &  a 
)
inline

Computes the tangent of a and stores the result in res.

Parameters
resThe result.
aThe value the function is evaluated at.
See also
Trigonometric Functions

Definition at line 3046 of file arithmetic-gmp.hpp.

expressions::Expression<RealContext, expressions::Wrapper<RealContext>, expressions::TanOp> plll::arithmetic::tan ( const Real &  i)
inline

Returns the tangent of the given floating point number.

Parameters
iThe operand.
Returns
The result.
See also
Trigonometric Functions

Definition at line 1484 of file arithmetic-gmp-rops.hpp.

expressions::Expression<RealContext, expressions::Wrapper<RealContext>, expressions::TanOp_Context> plll::arithmetic::tan ( const Real &  i,
const RealContext &  rc 
)
inline

Returns the tangent of the given floating point number.

Parameters
iThe operand.
rcThe context whose precision to use for the result.
Returns
The result.
See also
Trigonometric Functions

Definition at line 1902 of file arithmetic-gmp-rops.hpp.

void plll::arithmetic::XGCD ( Integer &  r,
Integer &  a,
Integer &  b,
const Integer &  x,
const Integer &  y 
)
inline

Computes the non-negative extended Greatest Common Divisior r of x and y.

Parameters
rThe result is stored in here.
aThe Bezout coefficient of x.
bThe Bezout coefficient of y.
xThe first operand.
yThe first operand.

Afterwards, the variables r, a and b satisfy r == a * x + b * y.

See also
Integer Functions

Definition at line 1676 of file arithmetic-gmp.hpp.

template<typename Type >
void plll::arithmetic::XGCD ( NInt< Type > &  r,
NInt< Type > &  a,
NInt< Type > &  b,
const NInt< Type > &  x,
const NInt< Type > &  y 
)
inline

Computes the non-negative extended Greatest Common Divisior r of x and y.

Parameters
rThe result is stored in here.
aThe Bezout coefficient of x.
bThe Bezout coefficient of y.
xThe first operand.
yThe first operand.

Afterwards, the variables r, a and b satisfy r == a * x + b * y.

See also
Integer Functions

Definition at line 2286 of file arithmetic-nint.hpp.