plll  1.0
arithmetic-gmp-rops.hpp File Reference

Operator definitions for floating point numbers. More...

Go to the source code of this file.

Namespaces

 plll
 Contains the plll library.
 
 plll::arithmetic
 Contains the arithmetic backend of plll.
 
 plll::arithmetic::expressions
 Expression templates.
 

Functions

Operators.
expressions::Expression
< RealContext,
expressions::Wrapper
< RealContext >
, expressions::NegOp > 
plll::arithmetic::operator- (const Real &a)
 Negates the floating point number. More...
 
expressions::Expression
< RealContext, std::pair
< expressions::Wrapper
< RealContext >
, expressions::Wrapper
< RealContext >
>, expressions::AddOp > 
plll::arithmetic::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 > 
plll::arithmetic::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 > 
plll::arithmetic::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 > 
plll::arithmetic::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 > 
plll::arithmetic::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 > 
plll::arithmetic::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 > 
plll::arithmetic::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 > 
plll::arithmetic::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 > 
plll::arithmetic::operator>> (const Real &a, signed long b)
 Divides a by 2 to the power of b and returns the result. More...
 
Real plll::arithmetic::operator++ (Real &cur, int)
 Increments cur by one and returns the previous value. More...
 
Real plll::arithmetic::operator-- (Real &cur, int)
 Decrements cur by one and returns the previous value. More...
 
Real & plll::arithmetic::operator++ (Real &cur)
 Increments cur by one and returns the new value. More...
 
Real & plll::arithmetic::operator-- (Real &cur)
 Decrements cur by one and returns the new value. More...
 
expressions::Expression
< RealContext,
expressions::Wrapper
< RealContext >
, expressions::AbsOp > 
plll::arithmetic::abs (const Real &i)
 Returns the absolute value of the given floating point number. More...
 
expressions::Expression
< RealContext,
expressions::Wrapper
< RealContext >
, expressions::SquareOp > 
plll::arithmetic::square (const Real &i)
 Returns the square of the given floating point number. More...
 
expressions::Expression
< RealContext,
expressions::Wrapper
< RealContext >
, expressions::AbsOp_Context > 
plll::arithmetic::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 > 
plll::arithmetic::square (const Real &i, const RealContext &rc)
 Returns the square of the given floating point number. More...
 
Assignment-operation operators.
Real & plll::arithmetic::operator-= (Real &cur, const Real &r)
 Subtracts the floating point number r from cur. More...
 
template<class D >
Real & plll::arithmetic::operator-= (Real &cur, const expressions::Expression< RealContext, D, expressions::MulOp > &E)
 Subtracts the multiplication expression E from cur. More...
 
Real & plll::arithmetic::operator+= (Real &cur, const Real &r)
 Adds the floating point number r to cur. More...
 
template<class D >
Real & plll::arithmetic::operator+= (Real &cur, const expressions::Expression< RealContext, D, expressions::MulOp > &E)
 Adds the given multiplication expression to cur. More...
 
Real & plll::arithmetic::operator*= (Real &cur, const Real &r)
 Multiplies the given floating point number r with cur. More...
 
Real & plll::arithmetic::operator/= (Real &cur, const Real &r)
 Divides cur by the given floating point number r. More...
 
Real & plll::arithmetic::operator%= (Real &cur, const Real &r)
 Divides cur by the given floating point number r and stores the remainder in cur. More...
 
Real & plll::arithmetic::operator<<= (Real &cur, const Real &r)
 Multiplies cur by 2 to the power of r. More...
 
Real & plll::arithmetic::operator>>= (Real &cur, const Real &r)
 Divides cur by 2 to the power of r. More...
 
Real & plll::arithmetic::operator<<= (Real &cur, long r)
 Multiplies cur by 2 to the power of r. More...
 
Real & plll::arithmetic::operator>>= (Real &cur, long r)
 Divides cur by 2 to the power of r. More...
 
Comparisons.
bool plll::arithmetic::operator== (const Real &a, const Real &b)
 Compares the two floating point numbers a and b for equality. More...
 
bool plll::arithmetic::operator!= (const Real &a, const Real &b)
 Compares the two floating point numbers a and b for inequality. More...
 
bool plll::arithmetic::operator<= (const Real &a, const Real &b)
 Compares the two floating point numbers a and b. More...
 
bool plll::arithmetic::operator>= (const Real &a, const Real &b)
 Compares the two floating point numbers a and b. More...
 
bool plll::arithmetic::operator< (const Real &a, const Real &b)
 Compares the two floating point numbers a and b. More...
 
bool plll::arithmetic::operator> (const Real &a, const Real &b)
 Compares the two floating point numbers a and b. More...
 
Trigonometric functions.
expressions::Expression
< RealContext,
expressions::Wrapper
< RealContext >
, expressions::SinOp > 
plll::arithmetic::sin (const Real &i)
 Returns the sine of the given floating point number. More...
 
expressions::Expression
< RealContext,
expressions::Wrapper
< RealContext >
, expressions::CosOp > 
plll::arithmetic::cos (const Real &i)
 Returns the cosine of the given floating point number. More...
 
expressions::Expression
< RealContext,
expressions::Wrapper
< RealContext >
, expressions::TanOp > 
plll::arithmetic::tan (const Real &i)
 Returns the tangent of the given floating point number. More...
 
expressions::Expression
< RealContext,
expressions::Wrapper
< RealContext >
, expressions::ASinOp > 
plll::arithmetic::asin (const Real &i)
 Returns the arcsine of the given floating point number. More...
 
expressions::Expression
< RealContext,
expressions::Wrapper
< RealContext >
, expressions::ACosOp > 
plll::arithmetic::acos (const Real &i)
 Returns the arccosine of the given floating point number. More...
 
expressions::Expression
< RealContext,
expressions::Wrapper
< RealContext >
, expressions::ATanOp > 
plll::arithmetic::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 > 
plll::arithmetic::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 > 
plll::arithmetic::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 > 
plll::arithmetic::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 > 
plll::arithmetic::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 > 
plll::arithmetic::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 > 
plll::arithmetic::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 > 
plll::arithmetic::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 > 
plll::arithmetic::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...
 
Exponential and logarithmic functions.
expressions::Expression
< RealContext,
expressions::Wrapper
< RealContext >
, expressions::ExpOp > 
plll::arithmetic::exp (const Real &i)
 Returns the exponential function evaluated at the given floating point number. More...
 
expressions::Expression
< RealContext,
expressions::Wrapper
< RealContext >
, expressions::LogOp > 
plll::arithmetic::log (const Real &i)
 Returns the natural logarithm evaluated at the given floating point number. More...
 
expressions::Expression
< RealContext,
expressions::Wrapper
< RealContext >
, expressions::Log2Op > 
plll::arithmetic::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 > 
plll::arithmetic::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 > 
plll::arithmetic::sqrt (const Real &i)
 Returns the square root of the given floating point number. More...
 
expressions::Expression
< RealContext,
expressions::Wrapper
< RealContext >
, expressions::ExpOp_Context > 
plll::arithmetic::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 > 
plll::arithmetic::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 > 
plll::arithmetic::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 > 
plll::arithmetic::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 > 
plll::arithmetic::sqrt (const Real &i, const RealContext &rc)
 Returns the square root of the given floating point number. More...
 
Special functions.
expressions::Expression
< RealContext,
expressions::Wrapper
< RealContext >
, expressions::GammaOp > 
plll::arithmetic::gamma (const Real &i)
 Returns the Gamma function evaluated at the given floating point number. More...
 
expressions::Expression
< RealContext,
expressions::Wrapper
< RealContext >
, expressions::LGammaOp > 
plll::arithmetic::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 > 
plll::arithmetic::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 > 
plll::arithmetic::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 > 
plll::arithmetic::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 > 
plll::arithmetic::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...
 
Exponentiation.
expressions::Expression
< RealContext,
expressions::Wrapper
< RealContext >
, expressions::PowerCOp
< signed long >::impl > 
plll::arithmetic::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 > 
plll::arithmetic::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 > 
plll::arithmetic::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 > 
plll::arithmetic::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 > 
plll::arithmetic::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 > 
plll::arithmetic::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 > 
plll::arithmetic::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 > 
plll::arithmetic::power (const Real &a, const Real &b, const RealContext &rc)
 Returns a raised to the power of b. More...
 

Detailed Description

Operator definitions for floating point numbers.

This header contains templates and instantiations to implement all operations on floating point numbers.

Definition in file arithmetic-gmp-rops.hpp.