plll  1.0
arithmetic-gmp-iops.hpp File Reference

Operator definitions for integers. 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
< IntegerContext,
expressions::Wrapper
< IntegerContext >
, expressions::NegOp > 
plll::arithmetic::operator- (const Integer &a)
 Negates the integer. More...
 
expressions::Expression
< IntegerContext,
expressions::Wrapper
< IntegerContext >
, expressions::BitInvOp > 
plll::arithmetic::operator~ (const Integer &a)
 Bitwise negates the integer. More...
 
expressions::Expression
< IntegerContext, std::pair
< expressions::Wrapper
< IntegerContext >
, expressions::Wrapper
< IntegerContext >
>, expressions::AddOp > 
plll::arithmetic::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 > 
plll::arithmetic::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 > 
plll::arithmetic::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 > 
plll::arithmetic::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 > 
plll::arithmetic::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 > 
plll::arithmetic::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 > 
plll::arithmetic::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 > 
plll::arithmetic::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 > 
plll::arithmetic::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 > 
plll::arithmetic::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 > 
plll::arithmetic::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 > 
plll::arithmetic::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 plll::arithmetic::operator++ (Integer &cur, int)
 Increments the integer by one and returns the previous value. More...
 
Integer plll::arithmetic::operator-- (Integer &cur, int)
 Decrements the integer by one and returns the previous value. More...
 
Integer & plll::arithmetic::operator++ (Integer &cur)
 Increments the integer by one and returns the new value. More...
 
Integer & plll::arithmetic::operator-- (Integer &cur)
 Decreases the integer by one and returns the new value. More...
 
expressions::Expression
< IntegerContext,
expressions::Wrapper
< IntegerContext >
, expressions::AbsOp > 
plll::arithmetic::abs (const Integer &i)
 Computes and returns the absolute value of i. More...
 
expressions::Expression
< IntegerContext,
expressions::Wrapper
< IntegerContext >
, expressions::SquareOp > 
plll::arithmetic::square (const Integer &i)
 Computes and returns the square of i. More...
 
Assignment-operation operators.
template<class D >
Integer & plll::arithmetic::operator-= (Integer &cur, const expressions::Expression< IntegerContext, D, expressions::MulOp > &E)
 Subtracts the multiplication expression E from cur. More...
 
Integer & plll::arithmetic::operator-= (Integer &cur, const Integer &i)
 Subtracts the integer i from cur. More...
 
template<class D >
Integer & plll::arithmetic::operator+= (Integer &cur, const expressions::Expression< IntegerContext, D, expressions::MulOp > &E)
 Adds the given multiplication expression to cur. More...
 
Integer & plll::arithmetic::operator+= (Integer &cur, const Integer &i)
 Adds the integer i to cur. More...
 
Integer & plll::arithmetic::operator*= (Integer &cur, const Integer &i)
 Multiplies the given integer i with cur. More...
 
Integer & plll::arithmetic::operator/= (Integer &cur, const Integer &i)
 Divides cur by the given integer i. More...
 
Integer & plll::arithmetic::operator%= (Integer &cur, const Integer &i)
 Divides cur by the given integer i and stores the remainder in cur. More...
 
Integer & plll::arithmetic::operator|= (Integer &cur, const Integer &i)
 Computes the bitwise or of cur with i and stores the result in cur. More...
 
Integer & plll::arithmetic::operator&= (Integer &cur, const Integer &i)
 Computes the bitwise and of cur with i and stores the result in cur. More...
 
Integer & plll::arithmetic::operator^= (Integer &cur, const Integer &i)
 Computes the bitwise exclusive or of cur with i and stores the result in cur. More...
 
Integer & plll::arithmetic::operator<<= (Integer &cur, const Integer &i)
 Computes the bitwise left shift of cur by i bits, and stores the result in cur. More...
 
Integer & plll::arithmetic::operator>>= (Integer &cur, const Integer &i)
 Computes the bitwise right shift of cur by i bits, and stores the result in cur. More...
 
Integer & plll::arithmetic::operator<<= (Integer &cur, long i)
 Computes the bitwise left shift of cur by i bits, and stores the result in cur. More...
 
Integer & plll::arithmetic::operator>>= (Integer &cur, long i)
 Computes the bitwise right shift of cur by i bits, and stores the result in cur. More...
 
Comparisons.
bool plll::arithmetic::operator== (const Integer &a, const Integer &b)
 Compares the current integer with the given one for equality. More...
 
bool plll::arithmetic::operator!= (const Integer &a, const Integer &b)
 Compares the current integer with the given one for inequality. More...
 
bool plll::arithmetic::operator<= (const Integer &a, const Integer &b)
 Compares the current integer with the given one. More...
 
bool plll::arithmetic::operator>= (const Integer &a, const Integer &b)
 Compares the current integer with the given one. More...
 
bool plll::arithmetic::operator< (const Integer &a, const Integer &b)
 Compares the current integer with the given one. More...
 
bool plll::arithmetic::operator> (const Integer &a, const Integer &b)
 Compares the current integer with the given one. More...
 
Integer approximation.
expressions::Expression
< IntegerContext,
expressions::Wrapper
< IntegerContext >
, expressions::SqrtCeilOp > 
plll::arithmetic::sqrtCeil (const Integer &i)
 Computes and returns the ceil of the square root of i. More...
 
expressions::Expression
< IntegerContext,
expressions::Wrapper
< IntegerContext >
, expressions::SqrtFloorOp > 
plll::arithmetic::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 > 
plll::arithmetic::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 > 
plll::arithmetic::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 > 
plll::arithmetic::roundDiv (const Integer &a, const Integer &b)
 Computes and returns $\lfloor \tfrac{a}{b} \rceil$. More...
 
Euclidean ring functions.
expressions::Expression
< IntegerContext, std::pair
< expressions::Wrapper
< IntegerContext >
, expressions::Wrapper
< IntegerContext >
>, expressions::GCDOp > 
plll::arithmetic::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 > 
plll::arithmetic::LCM (const Integer &a, const Integer &b)
 Computes and returns the non-negative Least Common Multiple of a and b. More...
 
Exponentiation.
expressions::Expression
< IntegerContext, std::pair
< expressions::Wrapper
< IntegerContext >
, expressions::Wrapper
< IntegerContext >
>, expressions::PowerOp > 
plll::arithmetic::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 > 
plll::arithmetic::power (const Integer &a, signed long b)
 Computes and returns a raised to the power of b. More...
 

Detailed Description

Operator definitions for integers.

This header contains templates and instantiations to implement all operations on integers.

Definition in file arithmetic-gmp-iops.hpp.