avx::ULong256¶
-
class ULong256¶
Class providing vectorized version of
unsigned long long
akauint64_t
. Can hold 4 individualunsigned long long
values. Provides arithmetic and bitwise operators. Provides comparison operators == !=.Public Types
-
using storedType = unsigned long long¶
Type that is stored inside vector.
Public Functions
-
inline ULong256() noexcept¶
-
inline ULong256(__m256i init)¶
-
inline ULong256(const unsigned long long &init)¶
-
inline ULong256(const unsigned long long *init)¶
-
inline ULong256(const std::array<unsigned long long, 4> &init)¶
-
inline ULong256(const std::array<unsigned int, 4> &init) noexcept¶
-
inline ULong256(const std::array<unsigned short, 4> &init) noexcept¶
-
inline ULong256(const std::array<unsigned char, 4> &init) noexcept¶
-
inline ULong256(std::initializer_list<unsigned long long> init) noexcept¶
-
inline __m256i get() const noexcept¶
-
inline void set(__m256i val) noexcept¶
- inline void load (const unsigned long long *pSrc) N_THROW_REL
Loads data from memory into vector (memory should be of size of at least 32 bytes). Memory doesn’t need to be aligned to any specific boundary. If
sP
isnullptr
this method has no effect.- Parameters:
pSrc – Pointer to memory from which to load data.
- Throws:
std::invalid_argument – If in Debug mode and
pSrc
isnullptr
. In Release builds this method never throws (fornullptr
method will have no effect).
-
inline void save(std::array<unsigned long long, 4> &dest) const noexcept¶
Saves data to destination in memory.
- Parameters:
dest – Reference to the list to which vector will be saved. Array doesn’t need to be aligned to any specific boundary.
- inline void save (unsigned long long *pDest) const N_THROW_REL
Saves data to destination in memory. The memory doesn’t have to be aligned to any specific boundary.
See https://en.cppreference.com/w/cpp/memory/c/aligned_alloc for more details.
- Parameters:
pDest – A valid pointer to a memory of at least 32 bytes (4x
unsigned long long
).- Throws:
std::invalid_argument – If in Debug mode and
pDest
isnullptr
. In Release builds this method never throws (fornullptr
method will have no effect).
- inline void saveAligned (unsigned long long *pDest) const N_THROW_REL
Saves data to destination in memory. The memory must be aligned at 32-byte boundary.
See https://en.cppreference.com/w/cpp/memory/c/aligned_alloc for more details.
- Parameters:
pDest – A valid pointer to a memory of at least 32 bytes (4x
unsigned long long
).- Throws:
std::invalid_argument – If in Debug mode and
pDest
isnullptr
. In Release builds this method never throws (fornullptr
method will have no effect).
-
inline unsigned long long operator[](unsigned int index) const¶
-
inline bool operator==(const ULong256 &bV) const noexcept¶
Compares with second vector for equality.
- Parameters:
bV – Object to compare.
- Returns:
true
if all elements are equal orfalse
if not.
-
inline bool operator==(const unsigned long long b) const noexcept¶
Compares with value for equality.
- Parameters:
b – Value to compare.
- Returns:
true
if all elements are equal to passed valuefalse
if not.
-
inline bool operator!=(const ULong256 &bV) const noexcept¶
Compares with second vector for inequality.
- Parameters:
bV – Object to compare.
- Returns:
true
if any alement is not equal to corresponding element inbV
otherwisefalse
.
-
inline bool operator!=(const unsigned long long b) const noexcept¶
Compares with value for inequality.
- Parameters:
b – Value
- Returns:
true
if any alement is not equal to corresponding element inbV
otherwisefalse
.
-
inline ULong256 operator+(const ULong256 &bV) const noexcept¶
Adds values from other vector and returns new vector.
- Returns:
New vector being a sum of this vector and
bv
.
-
inline ULong256 operator+(const unsigned long long &b) const noexcept¶
Adds single value across all vector fields.
- Returns:
New vector being a sum of this vector and
b
.
-
inline std::string str() const noexcept¶
Public Static Attributes
-
static int size = 4¶
Number of individual values stored by object. This value can be used to iterate over elements.
-
using storedType = unsigned long long¶