Aesi Multiprecision
C++ class library of long integer arithmetic for GPU parallelization
Loading...
Searching...
No Matches
Aesi.h File Reference

Long precision signed integer with arithmetic operations. More...

Go to the source code of this file.

Classes

class  Aesi< bitness >
 Long precision signed integer. More...
 

Typedefs

using Aesi128 = Aesi<128>
 Number with precision 128-bit.
 
using Aesi256 = Aesi<256>
 Number with precision 128-bit.
 
using Aesi512 = Aesi<512>
 Number with precision 512-bit.
 
using Aesi768 = Aesi<768>
 Number with precision 768-bit.
 
using Aesi1024 = Aesi<1024>
 Number with precision 1024-bit.
 
using Aesi1536 = Aesi<1536>
 Number with precision 1536-bit.
 
using Aesi2048 = Aesi<2048>
 Number with precision 2048-bit.
 
using Aesi3072 = Aesi<3072>
 Number with precision 3072-bit.
 
using Aesi4096 = Aesi<4096>
 Number with precision 4096-bit.
 
using Aesi6144 = Aesi<6144>
 Number with precision 6144-bit.
 
using Aesi8192 = Aesi<8192>
 Number with precision 8192-bit.
 

Functions

template<std::size_t bitness, typename Integral >
requires (std::is_integral_v<Integral>)
gpu constexpr auto operator+ (Integral number, const Aesi< bitness > &value) noexcept
 Integral conversion addition operator.
 
template<std::size_t bitness, typename Integral >
requires (std::is_integral_v<Integral>)
gpu constexpr auto operator- (Integral number, const Aesi< bitness > &value) noexcept
 Integral conversion subtraction operator.
 
template<std::size_t bitness, typename Integral >
requires (std::is_integral_v<Integral>)
gpu constexpr auto operator* (Integral number, const Aesi< bitness > &value) noexcept
 Integral conversion multiplication operator.
 
template<std::size_t bitness, typename Integral >
requires (std::is_integral_v<Integral>)
gpu constexpr auto operator/ (Integral number, const Aesi< bitness > &value) noexcept
 Integral conversion division operator.
 
template<std::size_t bitness, typename Integral >
requires (std::is_integral_v<Integral>)
gpu constexpr auto operator% (Integral number, const Aesi< bitness > &value) noexcept
 Integral conversion modulo operator.
 
template<std::size_t bitness, typename Integral >
requires (std::is_integral_v<Integral>)
gpu constexpr auto operator^ (Integral number, const Aesi< bitness > &value) noexcept
 Integral conversion bitwise XOR operator.
 
template<std::size_t bitness, typename Integral >
requires (std::is_integral_v<Integral>)
gpu constexpr auto operator& (Integral number, const Aesi< bitness > &value) noexcept
 Integral conversion bitwise AND operator.
 
template<std::size_t bitness, typename Integral >
requires (std::is_integral_v<Integral>)
gpu constexpr auto operator| (Integral number, const Aesi< bitness > &value) noexcept
 Integral conversion bitwise OR operator.
 

Detailed Description

Long precision signed integer with arithmetic operations.

Copyright 2021-2023, Alexander V. Lvov All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Function Documentation

◆ operator+()

template<std::size_t bitness, typename Integral >
requires (std::is_integral_v<Integral>)
gpu constexpr auto operator+ ( Integral number,
const Aesi< bitness > & value )
constexprnoexcept

Integral conversion addition operator.

Parameters
numberIntegral
valueAesi
Returns
Aesi

◆ operator-()

template<std::size_t bitness, typename Integral >
requires (std::is_integral_v<Integral>)
gpu constexpr auto operator- ( Integral number,
const Aesi< bitness > & value )
constexprnoexcept

Integral conversion subtraction operator.

Parameters
numberIntegral
valueAesi
Returns
Aesi

◆ operator*()

template<std::size_t bitness, typename Integral >
requires (std::is_integral_v<Integral>)
gpu constexpr auto operator* ( Integral number,
const Aesi< bitness > & value )
constexprnoexcept

Integral conversion multiplication operator.

Parameters
numberIntegral
valueAesi
Returns
Aesi

◆ operator/()

template<std::size_t bitness, typename Integral >
requires (std::is_integral_v<Integral>)
gpu constexpr auto operator/ ( Integral number,
const Aesi< bitness > & value )
constexprnoexcept

Integral conversion division operator.

Parameters
numberIntegral
valueAesi
Returns
Aesi

◆ operator%()

template<std::size_t bitness, typename Integral >
requires (std::is_integral_v<Integral>)
gpu constexpr auto operator% ( Integral number,
const Aesi< bitness > & value )
constexprnoexcept

Integral conversion modulo operator.

Parameters
numberIntegral
valueAesi
Returns
Aesi

◆ operator^()

template<std::size_t bitness, typename Integral >
requires (std::is_integral_v<Integral>)
gpu constexpr auto operator^ ( Integral number,
const Aesi< bitness > & value )
constexprnoexcept

Integral conversion bitwise XOR operator.

Parameters
numberIntegral
valueAesi
Returns
Aesi

◆ operator&()

template<std::size_t bitness, typename Integral >
requires (std::is_integral_v<Integral>)
gpu constexpr auto operator& ( Integral number,
const Aesi< bitness > & value )
constexprnoexcept

Integral conversion bitwise AND operator.

Parameters
numberIntegral
valueAesi
Returns
Aesi

◆ operator|()

template<std::size_t bitness, typename Integral >
requires (std::is_integral_v<Integral>)
gpu constexpr auto operator| ( Integral number,
const Aesi< bitness > & value )
constexprnoexcept

Integral conversion bitwise OR operator.

Parameters
numberIntegral
valueAesi
Returns
Aesi