Aesi Multiprecision
C++ class library of long integer arithmetic for GPU parallelization
|
Long precision unsigned integer with arithmetic operations. More...
Go to the source code of this file.
Typedefs | |
using | Aeu128 = Aeu< 128 > |
Number with precision 128-bit. | |
using | Aeu256 = Aeu< 256 > |
Number with precision 128-bit. | |
using | Aeu512 = Aeu< 512 > |
Number with precision 512-bit. | |
using | Aeu768 = Aeu< 768 > |
Number with precision 768-bit. | |
using | Aeu1024 = Aeu< 1024 > |
Number with precision 1024-bit. | |
using | Aeu1536 = Aeu< 1536 > |
Number with precision 1536-bit. | |
using | Aeu2048 = Aeu< 2048 > |
Number with precision 2048-bit. | |
using | Aeu3072 = Aeu< 3072 > |
Number with precision 3072-bit. | |
using | Aeu4096 = Aeu< 4096 > |
Number with precision 4096-bit. | |
using | Aeu6144 = Aeu< 6144 > |
Number with precision 6144-bit. | |
using | Aeu8192 = Aeu< 8192 > |
Number with precision 8192-bit. | |
Functions | |
template<std::size_t bitness = 512> | |
requires (bitness % blockBitLength==0) class Aeu final | |
template<std::size_t bitness, typename Integral > | |
requires (std::is_integral_v< Integral >) gpu const expr auto operator+(Integral number | |
Integral conversion addition operator. More... | |
template<std::size_t bitness, typename Integral > | |
requires (std::is_integral_v< Integral >) gpu const expr auto operator&(Integral number | |
Integral conversion bitwise AND operator. More... | |
Variables | |
const Aeu< bitness > &value | noexcept { return Aeu<bitness>(number) + value |
Long precision unsigned integer with arithmetic operations.
|
final |
Block line of the number
Makes line addition
dst | BlockLine |
src | BlockLine |
Makes complement block line for line
line | BlockLine |
Default constructor
Copy constructor
Copy assignment operator
other | Aeu |
Integral constructor
value | Integral |
Accepts both signed and unsigned built-in integral types. When calling this constructor on negative value, final blocks would be inverted.
Pointer-based character constructor
data | Char* |
size | Size_t |
Accepts decimal strings (no prefix), binary (0b/0B), octal (0o/0O) and hexadecimal (0x/0X)
C-style string literal constructor
literal | Char[] |
Accepts decimal literals along with binary (starting with 0b/0B), octal (0o/0O) and hexadecimal (0x/0X)
String or string-view based constructor
stringView | String/String-View |
Constructs object from STD::Basic_String or STD::Basic_String_View. Accepts objects based on char or wchar_t
Unary plus operator
Unary minus operator
Prefix increment
Postfix increment
Prefix decrement
Postfix decrement
Addition operator for built-in integral types
addendum | Unsigned |
Addition operator
addendum | Aeu |
Assignment addition operator for built-in integral types
addendum | Unsigned |
Assignment addition operator
addendum | Aeu |
Subtraction operator
subtrahend | Aeu |
Assignment subtraction operator
subtrahend | Aeu |
Multiplication operator for built-in integral types
factor | Unsigned |
Multiplication operator
factor | Aeu |
Assignment multiplication operator for built-in integral types
factor | Unsigned |
Works with the greatest performance with types smaller than uint64_t
Assignment multiplication operator
factor | Aeu |
Division operator
divisor | Aeu |
Assignment division operator
divisor | Aeu |
Modulo operator
modulo | Aeu |
Assignment modulo operator
modulo | Aeu |
Bitwise complement operator
Bitwise XOR operator
other | Aeu |
Assignment bitwise XOR operator
other | Aeu |
Bitwise AND operator
other | Aeu |
Assignment bitwise AND operator
other | Aeu |
Bitwise OR operator
other | Aeu |
Assignment bitwise OR operator
other | Aeu |
Left shift operator
bitShift | Unsigned |
Left shift assignment operator
bitShift | Unsigned |
Right shift operator
bitShift | Unsigned |
Right shift assignment operator
bitShift | Unsigned |
Equality check operator for built-in types uint8_t, uint16_t, uint32_t
other | Unsigned |
Equality check operator for numbers of the same precision
other | Aeu |
Templated Equality check operator for numbers of different precision
other | Aeu |
Internal comparison operator for built-in integral types uint8_t, uint16_t, uint32_t
other | Unsigned |
Internal comparison operator for type uint64_t
other | uint64_t |
Internal comparison operator
other | Aeu |
Three-way comparison operator
other | Aeu |
Three-way comparison operator for numbers of different precision and built-in integral types
other | Integral |
Set bit in number by index starting from the right
index | Size_t |
bit | Boolean |
Get bit in number by index staring from the right
index | Size_t |
Set byte in number by index starting from the right
index | Size_t |
byte | Byte |
Get byte in number by index starting from the right
index | Size_t |
Set block in number by index starting from the right
index | Size_t |
block | Block |
Get block in number by index starting from the right
index | Size_t |
Get amount of non-empty bytes in number right to left
Get amount of non-empty bits in number right to left
Check whether number is odd
Check whether number is even
Check whether number is zero
Get number of non-empty blocks inside object starting from the right
Get number's precision
Get the number of blocks (length of array of uint32_t integers) inside object
Make swap between two objects
other | Aeu |
Integer division. Returns results by reference
Integer division. Returns results by value
Extended Euclidean algorithm for greatest common divisor
Counts Bézout coefficients along with the greatest common divisor. Returns coefficients by reference
Greatest common divisor
Faster version, ignoring bezout coefficients
Least common multiplier
Exponentiation by modulo
Accepts power of different precision rather than base and modulo
Fast exponentiation for powers of 2
power | Size_t |
Returns zero for power greater than current bitness
Get square root
Character buffer output operator
buffer | Char* |
bufferSize | Size_t |
showBase | Boolean |
hexUppercase | Boolean |
Places the maximum possible amount of number's characters in buffer. Base parameter should be 2, 8, 10, or 16
STD stream output operator
os | Ostream |
number | Aeu |
Writes number in stream. Accepts STD streams based on char or wchar_t. Supports stream manipulators:
is | Istream |
bigEndian | Boolean |
os | Ostream |
bigEndian | Boolean |
Integral type cast operator for built-in types
Takes the lowest part of Aeu for conversion. Accepts signed and unsigned types
Precision cast operator
If required precision greater than current precision, remaining blocks are filled with zeros. Otherwise - number is cropped inside smaller blocks array
requires | ( | std::is_integral_v< Integral > | ) | const |
Integral conversion addition operator.
Integral conversion bitwise OR operator.
Integral conversion bitwise XOR operator.
Integral conversion modulo operator.
Integral conversion division operator.
Integral conversion multiplication operator.
Integral conversion subtraction operator.
number | Integral |
value | Aeu |