avx::Double256¶
-
class Double256¶
Class providing vectorized version of
double
. Can hold 4 individualdouble
values. Provides arithmetic operators.Provides comparison operators == != (optimization on the way).
Public Types
-
using storedType = double¶
Type that is stored inside vector.
Public Functions
-
inline Double256() noexcept¶
-
inline Double256(const double val) noexcept¶
-
inline Double256(const __m256d init) noexcept¶
-
inline Double256(const std::array<double, 4> &init) noexcept¶
- inline Double256 (const double *addr) N_THROW_REL
-
inline Double256(std::initializer_list<double> init)¶
- inline void load (const double *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<double, 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 (double *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
double
).- 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 (double *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
double
).- 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 const __m256d get() const noexcept¶
-
inline void set(__m256d val) noexcept¶
-
inline bool operator==(const double b)¶
-
inline bool operator!=(const double b)¶
-
inline double operator[](const unsigned int index) const¶
Indexing operator. Does not support value assignment through this method (e.g. aV[0] = 1 won’t work).
- Parameters:
index – Position of desired element between 0 and 3.
- Throws:
std::out_of_range – If index is not within the correct range and build type is debug will be thrown. Otherwise bitwise AND will prevent index to be out of range.
- Returns:
Value of underlying element.
Public Static Attributes
-
static int size = 4¶
Number of individual values stored by object. This value can be used to iterate over elements.