plll
1.0
|
Represents a native integer. More...
#include <arithmetic-nint.hpp>
Public Types | |
typedef NIntContext< Type > | Context |
The context type. | |
Public Member Functions | |
NInt () PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE | |
Creates a new integer. Default value is zero. | |
NInt (const NIntContext< Type > &c) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE | |
Creates a new integer. Default value is zero. More... | |
NInt (const NInt &i) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE | |
Creates a copy of the given integer. More... | |
template<typename T > | |
NInt (const NInt< T > &i) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE | |
Creates a copy of the given integer (of another native type). More... | |
NInt (const NInt &i, const NIntContext< Type > &ic) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE | |
Creates a copy of the given integer. More... | |
template<typename T > | |
NInt (const NInt< T > &i, const NIntContext< Type > &ic) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE | |
Creates a copy of the given integer (of another native type). More... | |
NInt (double d) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE | |
Creates a native CPU integer from the given native floating point number. More... | |
NInt (long double d) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE | |
Creates a native CPU integer from the given native floating point number. More... | |
NInt (long i) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE | |
Creates a native CPU integer from the given native integer. More... | |
NInt (unsigned long i) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE | |
Creates a native CPU integer from the given native integer. More... | |
NInt (const Integer &i) | |
Creates a native CPU integer from the given arbitrary precision integer. More... | |
NInt & | operator= (const NInt &r) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE |
Copies the given integer into this one. More... | |
Static Public Member Functions | |
static void | setContext (const NIntContext< Type > &c) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE |
Sets the integer context c . More... | |
Friends | |
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... | |
NInt< Type > | abs (const NInt< Type > &i) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE |
Computes and returns the absolute value of i . More... | |
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... | |
long | approxLog2 (const NInt< Type > &x) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE |
Quickly approximates and returns the approximation. More... | |
int | bit (const NInt< Type > &, long n) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE |
Returns the n bit of in the usual binary representation. More... | |
long | bitLength (const NInt< Type > &x) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE |
Computes and returns n such that . More... | |
void | ceilDiv (NInt< Type > &r, const NInt< Type > &a, const NInt< Type > &b) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE |
Computes and stores the result in r . More... | |
NInt< Type > | ceilDiv (const NInt< Type > &a, const NInt< Type > &b) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE |
Computes and returns . More... | |
long | ceilOfLog2 (const NInt< Type > &x) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE |
Computes and returns . More... | |
int | compare (const NInt< Type > &a, const NInt< Type > &b) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE |
Compares the two integers. More... | |
int | compareAbsValues (const NInt< Type > &a, const NInt< Type > &b) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE |
Compares the two integers in absolute value. More... | |
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... | |
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... | |
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... | |
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... | |
void | floorDiv (NInt< Type > &r, const NInt< Type > &a, const NInt< Type > &b) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE |
Computes and stores the result in r . More... | |
NInt< Type > | floorDiv (const NInt< Type > &a, const NInt< Type > &b) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE |
Computes and returns . More... | |
long | floorOfLog2 (const NInt< Type > &x) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE |
Computes and returns . More... | |
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... | |
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... | |
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... | |
bool | isNegative (const NInt< Type > &r) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE |
Tests the given plll::arithmetic::Integer object for being strictly negative. More... | |
bool | isNonNegative (const NInt< Type > &r) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE |
Tests the given plll::arithmetic::Integer object for being positive or zero. More... | |
bool | isNonPositive (const NInt< Type > &r) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE |
Tests the given plll::arithmetic::Integer object for being negative or zero. More... | |
bool | isOne (const NInt< Type > &r) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE |
Tests the given plll::arithmetic::Integer object for being one. More... | |
bool | isPMOne (const NInt< Type > &r) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE |
Tests the given plll::arithmetic::Integer object for being one or minus one. More... | |
bool | isPMTwo (const NInt< Type > &r) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE |
Tests the given plll::arithmetic::Integer object for being two or minus two. More... | |
bool | isPositive (const NInt< Type > &r) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE |
Tests the given plll::arithmetic::Integer object for being strictly positive. More... | |
bool | isZero (const NInt< Type > &r) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE |
Tests the given plll::arithmetic::Integer object for being zero. More... | |
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... | |
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... | |
void | makeAbs (NInt< Type > &a) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE |
Makes the operand non-negative. More... | |
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... | |
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... | |
void | neg (NInt< Type > &r, const NInt< Type > &a) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE |
Negates a and stores the result in r . More... | |
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... | |
NInt< Type > | operator% (const NInt< Type > &, const NInt< Type > &b) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE |
Divides the first by the second integer and returns the remainder. More... | |
NInt< Type > & | operator%= (NInt< Type > &, const NInt< Type > &i) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE |
Divides cur by the given integer i and stores the remainder in cur . More... | |
NInt< Type > | operator* (const NInt< Type > &, const NInt< Type > &b) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE |
Multiplies the two integers and returns the result. More... | |
NInt< Type > & | operator*= (NInt< Type > &, const NInt< Type > &i) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE |
Multiplies the given integer i with cur . More... | |
NInt< Type > | operator+ (const NInt< Type > &, const NInt< Type > &b) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE |
Adds the two integers and returns the result. More... | |
NInt< Type > | operator++ (NInt< Type > &, int) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE |
Increments the integer by one and returns the previous value. More... | |
NInt< Type > & | operator++ (NInt< Type > &) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE |
Increments the integer by one and returns the new value. More... | |
NInt< Type > & | operator+= (NInt< Type > &, const NInt< Type > &i) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE |
Adds the integer i to cur . More... | |
NInt< Type > | operator- (const NInt< Type > &) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE |
Negates the integer. More... | |
NInt< Type > | operator- (const NInt< Type > &, const NInt< Type > &b) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE |
Subtracts the second from the first integer and returns the result. More... | |
NInt< Type > | operator-- (NInt< Type > &, int) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE |
Decrements the integer by one and returns the previous value. More... | |
NInt< Type > & | operator-- (NInt< Type > &) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE |
Decreases the integer by one and returns the new value. More... | |
NInt< Type > & | operator-= (NInt< Type > &, const NInt< Type > &i) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE |
Subtracts the integer i from cur . More... | |
NInt< Type > | operator/ (const NInt< Type > &, const NInt< Type > &b) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE |
Divides the first by the second integer and returns the result. More... | |
NInt< Type > & | operator/= (NInt< Type > &, const NInt< Type > &i) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE |
Divides cur by the given integer i . More... | |
bool | operator< (const NInt< Type > &a, const NInt< Type > &b) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE |
Compares the current integer with the given one. More... | |
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... | |
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... | |
std::ostream & | operator<< (std::ostream &s, const NInt< Type > &r) |
Outputs the integer on the given output stream. | |
bool | operator<= (const NInt< Type > &a, const NInt< Type > &b) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE |
Compares the current integer with the given one. More... | |
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... | |
bool | operator> (const NInt< Type > &a, const NInt< Type > &b) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE |
Compares the current integer with the given one. More... | |
bool | operator>= (const NInt< Type > &a, const NInt< Type > &b) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE |
Compares the current integer with the given one. More... | |
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... | |
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... | |
std::istream & | operator>> (std::istream &s, NInt< Type > &r) |
Reads the integer from the given input stream. | |
NInt< Type > | power (const NInt< Type > &, long) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE |
Computes and returns a raised to the power of b . More... | |
void | power (NInt< Type > &, const NInt< Type > &, long) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE |
Raises a to the power b and stores the result in r . More... | |
NInt< Type > | power (const NInt< Type > &, const NInt< Type > &) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE |
Computes and returns a raised to the power of b . More... | |
void | power (NInt< Type > &, const NInt< Type > &, const NInt< Type > &) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE |
Raises a to the power b and stores the result in r . More... | |
void | roundDiv (NInt< Type > &r, const NInt< Type > &a, const NInt< Type > &b) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE |
Computes (rounding to the next integer) and stores the result in r . More... | |
NInt< Type > | roundDiv (const NInt< Type > &a, const NInt< Type > &b) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE |
Computes and returns (rounding to the next integer). More... | |
void | setOne (NInt< Type > &r) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE |
Sets the given integer to one. | |
void | setZero (NInt< Type > &r) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE |
Sets the given integer to zero. | |
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... | |
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... | |
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... | |
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... | |
int | sign (const NInt< Type > &r) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE |
Returns the sign of the given integer. More... | |
void | sqrtCeil (NInt< Type > &, const NInt< Type > &) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE |
Computes and stores the result in r . More... | |
void | sqrtFloor (NInt< Type > &, const NInt< Type > &) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE |
Computes and stores the result in r . More... | |
NInt< Type > | square (const NInt< Type > &i) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE |
Computes and returns the square of i . More... | |
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 | 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... | |
void | swap (NInt< Type > &a, NInt< Type > &b) PLLL_INTERNAL_NOTHROW_POSTFIX_INLINE |
Swaps two plll::arithmetic::NInt<> objects. | |
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... | |
Represents a native integer.
Type | A native signed integer type, such as int , long int and long long . |
Definition at line 48 of file arithmetic-nint.hpp.
|
inline |
Creates a new integer. Default value is zero.
c | A native CPU integer context. |
Definition at line 1168 of file arithmetic-nint.hpp.
|
inline |
Creates a copy of the given integer.
i | The integer to be copied. |
Definition at line 1178 of file arithmetic-nint.hpp.
|
inline |
Creates a copy of the given integer (of another native type).
i | The integer to be copied. |
Definition at line 1189 of file arithmetic-nint.hpp.
|
inline |
Creates a copy of the given integer.
i | The integer to be copied. |
ic | An integer context. |
Definition at line 1200 of file arithmetic-nint.hpp.
|
inline |
Creates a copy of the given integer (of another native type).
i | The integer to be copied. |
ic | An integer context. |
Definition at line 1212 of file arithmetic-nint.hpp.
|
inlineexplicit |
Creates a native CPU integer from the given native floating point number.
d | The native floating point number. |
Definition at line 1231 of file arithmetic-nint.hpp.
|
inlineexplicit |
Creates a native CPU integer from the given native floating point number.
d | The native floating point number. |
Definition at line 1241 of file arithmetic-nint.hpp.
|
inlineexplicit |
Creates a native CPU integer from the given native integer.
i | The native integer. |
Definition at line 1251 of file arithmetic-nint.hpp.
|
inlineexplicit |
Creates a native CPU integer from the given native integer.
i | The native integer. |
Definition at line 1261 of file arithmetic-nint.hpp.
|
inlineexplicit |
Creates a native CPU integer from the given arbitrary precision integer.
i | The native integer. |
Definition at line 1271 of file arithmetic-nint.hpp.
|
inline |
Copies the given integer into this one.
r | A integer to be moved into this one. |
Definition at line 1281 of file arithmetic-nint.hpp.
|
inlinestatic |
Sets the integer context c
.
c | The integer context. |
Definition at line 1222 of file arithmetic-nint.hpp.
Takes the absolute value of a
and stores the result in r
.
r | The result. |
a | The operand. |
Definition at line 1752 of file arithmetic-nint.hpp.
Computes and returns the absolute value of i
.
i | The operand. |
Definition at line 1758 of file arithmetic-nint.hpp.
|
friend |
Adds a
and b
and stores the result in r
.
r | The result. |
a | The first operand. |
b | The second operand. |
Definition at line 1631 of file arithmetic-nint.hpp.
|
friend |
Quickly approximates and returns the approximation.
x | A non-zero integer. |
Definition at line 2161 of file arithmetic-nint.hpp.
|
friend |
Returns the n
bit of in the usual binary representation.
x | The integer whose bit to query. |
n | The index of the bit to query. |
Definition at line 1846 of file arithmetic-nint.hpp.
|
friend |
Computes and returns n
such that .
x | A non-zero integer. |
Definition at line 2168 of file arithmetic-nint.hpp.
|
friend |
Computes and stores the result in r
.
r | The result. |
a | The divident. |
b | The divisor. |
Definition at line 2196 of file arithmetic-nint.hpp.
|
friend |
Computes and returns .
a | The divident. |
b | The divisor. |
Definition at line 2209 of file arithmetic-nint.hpp.
|
friend |
Computes and returns .
x | A non-zero integer. |
Definition at line 1965 of file arithmetic-nint.hpp.
Compares the two integers.
a | The first operand. |
b | The second operand. |
Definition at line 1799 of file arithmetic-nint.hpp.
|
friend |
Compares the two integers in absolute value.
a | The first operand. |
b | The second operand. |
Definition at line 1806 of file arithmetic-nint.hpp.
Decrements a
by one and stores the result in r
.
r | The result. |
a | The operand. |
Definition at line 1740 of file arithmetic-nint.hpp.
|
friend |
Divides a
by b
and stores the result in r
.
r | The result. |
a | The first operand. |
b | The second operand. |
Definition at line 1661 of file arithmetic-nint.hpp.
|
friend |
Computes an Euclidean Division of a
by b
.
q | The quotient of a divided by b . |
r | The remainder of a divided by b , i.e. a modulo b . |
a | The first operand. |
b | The second operand. Must be non-zero. |
Computes q
and r
such that a == q * b + r
and that and .
Definition at line 2238 of file arithmetic-nint.hpp.
|
friend |
Computes an Euclidean Division of a
by b
.
q | The quotient of a divided by b . |
r | The remainder of a divided by b , i.e. a modulo b . |
a | The first operand. |
b | The second operand. Must be non-zero. |
Computes q
and r
such that a == q * b + r
and that .
Definition at line 2246 of file arithmetic-nint.hpp.
|
friend |
Computes and stores the result in r
.
r | The result. |
a | The divident. |
b | The divisor. |
Definition at line 2175 of file arithmetic-nint.hpp.
|
friend |
Computes and returns .
a | The divident. |
b | The divisor. |
Definition at line 2188 of file arithmetic-nint.hpp.
|
friend |
Computes and returns .
x | A non-zero integer. |
Definition at line 1982 of file arithmetic-nint.hpp.
|
friend |
Computes the non-negative Greatest Common Divisior r
of x
and y
.
r | The result is stored in here. |
x | The first operand. |
y | The first operand. |
Definition at line 2260 of file arithmetic-nint.hpp.
Computes and returns the non-negative Greatest Common Divisior of x
and y
.
x
and y
. x | The first operand. |
y | The first operand. |
Definition at line 2278 of file arithmetic-nint.hpp.
Increments a
by one and stores the result in r
.
r | The result. |
a | The operand. |
Definition at line 1734 of file arithmetic-nint.hpp.
|
friend |
Tests the given plll::arithmetic::Integer
object for being strictly negative.
true
if and only if the argument is strictly negative. Definition at line 1617 of file arithmetic-nint.hpp.
|
friend |
Tests the given plll::arithmetic::Integer
object for being positive or zero.
true
if and only if the argument is positive or zero. Definition at line 1610 of file arithmetic-nint.hpp.
|
friend |
Tests the given plll::arithmetic::Integer
object for being negative or zero.
true
if and only if the argument is negative or zero. Definition at line 1624 of file arithmetic-nint.hpp.
|
friend |
Tests the given plll::arithmetic::Integer
object for being one.
true
if and only if the argument is one. Definition at line 1582 of file arithmetic-nint.hpp.
|
friend |
Tests the given plll::arithmetic::Integer
object for being one or minus one.
true
if and only if the argument is . Definition at line 1589 of file arithmetic-nint.hpp.
|
friend |
Tests the given plll::arithmetic::Integer
object for being two or minus two.
true
if and only if the argument is . Definition at line 1596 of file arithmetic-nint.hpp.
|
friend |
Tests the given plll::arithmetic::Integer
object for being strictly positive.
true
if and only if the argument is strictly positive. Definition at line 1603 of file arithmetic-nint.hpp.
|
friend |
Tests the given plll::arithmetic::Integer
object for being zero.
true
if and only if the argument is zero. Definition at line 1575 of file arithmetic-nint.hpp.
|
friend |
Computes the non-negative Least Common Multiple r
of x
and y
.
r | The result is stored in here. |
x | The first operand. |
y | The first operand. |
Definition at line 2330 of file arithmetic-nint.hpp.
Computes and returns the non-negative Least Common Multiple of x
and y
.
x
and y
. x | The first operand. |
y | The first operand. |
Definition at line 2337 of file arithmetic-nint.hpp.
|
friend |
Makes the operand non-negative.
a | The operand. |
Definition at line 1764 of file arithmetic-nint.hpp.
|
friend |
Takes the remainder of the division of a
by b
and stores it in r
.
r | The result. |
a | The first operand. |
b | The second operand. |
Definition at line 1667 of file arithmetic-nint.hpp.
|
friend |
Multiplies a
with b
and stores the result in r
.
r | The result. |
a | The first operand. |
b | The second operand. |
Definition at line 1655 of file arithmetic-nint.hpp.
Negates a
and stores the result in r
.
r | The result. |
a | The operand. |
Definition at line 1746 of file arithmetic-nint.hpp.
Compares the current integer with the given one for inequality.
a | The first operand. |
b | The second operand. |
true
if a
does not equal b
. Definition at line 1545 of file arithmetic-nint.hpp.
|
friend |
Divides the first by the second integer and returns the remainder.
a | The first operand. |
b | The second operand. |
Definition at line 1412 of file arithmetic-nint.hpp.
|
friend |
Divides cur
by the given integer i
and stores the remainder in cur
.
cur | The integer to operate on. |
i | The integer to divide by. |
cur
containing the result. Definition at line 1446 of file arithmetic-nint.hpp.
|
friend |
Multiplies the two integers and returns the result.
a | The first operand. |
b | The second operand. |
Definition at line 1400 of file arithmetic-nint.hpp.
|
friend |
Multiplies the given integer i
with cur
.
cur | The integer to operate on. |
i | The integer to multiply to cur . |
cur
containing the result. Definition at line 1432 of file arithmetic-nint.hpp.
|
friend |
Adds the two integers and returns the result.
a | The first operand. |
b | The second operand. |
Definition at line 1388 of file arithmetic-nint.hpp.
Increments the integer by one and returns the previous value.
cur | The integer to work on. |
Definition at line 1481 of file arithmetic-nint.hpp.
Increments the integer by one and returns the new value.
cur | The integer to work on. |
cur
). Definition at line 1493 of file arithmetic-nint.hpp.
|
friend |
Adds the integer i
to cur
.
cur | The integer to operate on. |
i | The integer to add to cur . |
cur
containing the result. Definition at line 1425 of file arithmetic-nint.hpp.
Negates the integer.
a | The integer. |
Definition at line 1382 of file arithmetic-nint.hpp.
|
friend |
Subtracts the second from the first integer and returns the result.
a | The first operand. |
b | The second operand. |
Definition at line 1394 of file arithmetic-nint.hpp.
Decrements the integer by one and returns the previous value.
cur | The integer to work on. |
Definition at line 1487 of file arithmetic-nint.hpp.
Decreases the integer by one and returns the new value.
cur | The integer to work on. |
cur
). Definition at line 1500 of file arithmetic-nint.hpp.
|
friend |
Subtracts the integer i
from cur
.
cur | The integer to operate on. |
i | The integer to subtract from cur . |
cur
containing the result. Definition at line 1418 of file arithmetic-nint.hpp.
|
friend |
Divides the first by the second integer and returns the result.
a | The first operand. |
b | The second operand. |
Definition at line 1406 of file arithmetic-nint.hpp.
|
friend |
Divides cur
by the given integer i
.
cur | The integer to operate on. |
i | The integer to divide by. |
cur
containing the result. Definition at line 1439 of file arithmetic-nint.hpp.
Compares the current integer with the given one.
a | The first operand. |
b | The second operand. |
true
if a
is less than b
. Definition at line 1563 of file arithmetic-nint.hpp.
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.
a | The first operand. |
b | The second operand. |
Definition at line 1507 of file arithmetic-nint.hpp.
|
friend |
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.
a | The first operand. |
b | The second operand. |
Definition at line 1523 of file arithmetic-nint.hpp.
Compares the current integer with the given one.
a | The first operand. |
b | The second operand. |
true
if a
is less than or equal to b
. Definition at line 1551 of file arithmetic-nint.hpp.
Compares the current integer with the given one for equality.
a | The first operand. |
b | The second operand. |
true
if a
equals b
. Definition at line 1539 of file arithmetic-nint.hpp.
Compares the current integer with the given one.
a | The first operand. |
b | The second operand. |
true
if a
is greater than b
. Definition at line 1569 of file arithmetic-nint.hpp.
Compares the current integer with the given one.
a | The first operand. |
b | The second operand. |
true
if a
is greater than or equal to b
. Definition at line 1557 of file arithmetic-nint.hpp.
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.
a | The first operand. |
b | The second operand. |
Definition at line 1515 of file arithmetic-nint.hpp.
|
friend |
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.
a | The first operand. |
b | The second operand. |
Definition at line 1531 of file arithmetic-nint.hpp.
Computes and returns a
raised to the power of b
.
a | The first operand. |
b | The second operand. |
Definition at line 1899 of file arithmetic-nint.hpp.
Raises a
to the power b
and stores the result in r
.
r | The result. |
a | The base. |
b | The exponent. |
Definition at line 1893 of file arithmetic-nint.hpp.
Computes and returns a
raised to the power of b
.
a | The first operand. |
b | The second operand. |
Definition at line 1911 of file arithmetic-nint.hpp.
|
friend |
Raises a
to the power b
and stores the result in r
.
r | The result. |
a | The base. |
b | The exponent. |
Definition at line 1905 of file arithmetic-nint.hpp.
|
friend |
Computes (rounding to the next integer) and stores the result in r
.
r | The result. |
a | The divident. |
b | The divisor. |
Definition at line 2217 of file arithmetic-nint.hpp.
|
friend |
Computes and returns (rounding to the next integer).
a | The divident. |
b | The divisor. |
Definition at line 2230 of file arithmetic-nint.hpp.
Shifts a
by b
bits to the left and stores the result in r
.
r | The result. |
a | The first operand. |
b | The second operand. |
Definition at line 1681 of file arithmetic-nint.hpp.
|
friend |
Shifts a
by b
bits to the left and stores the result in r
.
r | The result. |
a | The first operand. |
b | The second operand. |
Definition at line 1719 of file arithmetic-nint.hpp.
Shifts a
by b
bits to the left and stores the result in r
.
r | The result. |
a | The first operand. |
b | The second operand. |
Definition at line 1700 of file arithmetic-nint.hpp.
|
friend |
Shifts a
by b
bits to the left and stores the result in r
.
r | The result. |
a | The first operand. |
b | The second operand. |
Definition at line 1725 of file arithmetic-nint.hpp.
|
friend |
Returns the sign of the given integer.
Definition at line 1815 of file arithmetic-nint.hpp.
Computes and stores the result in r
.
r | The result. |
a | The operand. |
Definition at line 1917 of file arithmetic-nint.hpp.
Computes and stores the result in r
.
r | The result. |
a | The operand. |
Definition at line 1941 of file arithmetic-nint.hpp.
Computes and returns the square of i
.
i | The operand. |
Definition at line 1865 of file arithmetic-nint.hpp.
Computes the square of a
and stores the result in r
.
r | The result. |
a | The operand. |
Definition at line 1871 of file arithmetic-nint.hpp.
|
friend |
Subtracts b
from a
and stores the result in r
.
r | The result. |
a | The first operand. |
b | The second operand. |
Definition at line 1637 of file arithmetic-nint.hpp.
|
friend |
Computes the non-negative extended Greatest Common Divisior r
of x
and y
.
r | The result is stored in here. |
a | The Bezout coefficient of x . |
b | The Bezout coefficient of y . |
x | The first operand. |
y | The first operand. |
Afterwards, the variables r
, a
and b
satisfy r == a * x + b * y
.
Definition at line 2286 of file arithmetic-nint.hpp.