![]() |
Blaze 3.9
|
Efficient implementation of a fixed-sized vector. More...
#include <StaticVector.h>
Inherits blaze::DenseVector< StaticVector< Type, N, TF, AF, PF, Tag >, TF >.
Classes | |
struct | Rebind |
Rebind mechanism to obtain a StaticVector with different data/element type. More... | |
struct | Resize |
Resize mechanism to obtain a StaticVector with a different fixed number of elements. More... | |
Public Types | |
using | This = StaticVector< Type, N, TF, AF, PF, Tag > |
Type of this StaticVector instance. | |
using | BaseType = DenseVector< This, TF > |
Base type of this StaticVector instance. | |
using | ResultType = This |
Result type for expression template evaluations. | |
using | TransposeType = StaticVector< Type, N,!TF, AF, PF, Tag > |
Transpose type for expression template evaluations. | |
using | ElementType = Type |
Type of the vector elements. | |
using | SIMDType = SIMDTrait_t< ElementType > |
SIMD type of the vector elements. | |
using | TagType = Tag |
Tag type of this StaticVector instance. | |
using | ReturnType = const Type & |
Return type for expression template evaluations. | |
using | CompositeType = const StaticVector & |
Data type for composite expression templates. | |
using | Reference = Type & |
Reference to a non-constant vector value. | |
using | ConstReference = const Type & |
Reference to a constant vector value. | |
using | Pointer = Type * |
Pointer to a non-constant vector value. | |
using | ConstPointer = const Type * |
Pointer to a constant vector value. | |
using | Iterator = DenseIterator< Type, AF > |
Iterator over non-constant elements. | |
using | ConstIterator = DenseIterator< const Type, AF > |
Iterator over constant elements. | |
using | VectorType = StaticVector< Type, N, TF, AF, PF, Tag > |
Type of the vector. | |
Public Member Functions | |
template<typename Other , size_t Dim> | |
constexpr StaticVector< Type, N, TF, AF, PF, Tag > & | operator= (const Other(&array)[Dim]) & |
Array assignment to all vector elements. More... | |
template<typename Other , size_t Dim> | |
constexpr StaticVector< Type, N, TF, AF, PF, Tag > & | operator= (const std::array< Other, Dim > &array) & |
Array assignment to all vector elements. More... | |
template<typename Other , AlignmentFlag AF2, PaddingFlag PF2> | |
StaticVector< Type, N, TF, AF, PF, Tag > & | operator= (const StaticVector< Other, N, TF, AF2, PF2, Tag > &rhs) & |
Assignment operator for different StaticVector instances. More... | |
template<typename VT > | |
StaticVector< Type, N, TF, AF, PF, Tag > & | operator= (const Vector< VT, TF > &rhs) & |
Assignment operator for different vectors. More... | |
template<typename VT > | |
StaticVector< Type, N, TF, AF, PF, Tag > & | operator+= (const Vector< VT, TF > &rhs) & |
Addition assignment operator for the addition of a vector ( ![]() | |
template<typename VT > | |
StaticVector< Type, N, TF, AF, PF, Tag > & | operator-= (const Vector< VT, TF > &rhs) & |
Subtraction assignment operator for the subtraction of a vector ( ![]() | |
template<typename VT > | |
StaticVector< Type, N, TF, AF, PF, Tag > & | operator*= (const Vector< VT, TF > &rhs) & |
Multiplication assignment operator for the multiplication of a vector ( ![]() | |
template<typename VT > | |
StaticVector< Type, N, TF, AF, PF, Tag > & | operator/= (const DenseVector< VT, TF > &rhs) & |
Division assignment operator for the division of a dense vector ( ![]() | |
template<typename VT > | |
StaticVector< Type, N, TF, AF, PF, Tag > & | operator%= (const Vector< VT, TF > &rhs) & |
Cross product assignment operator for the multiplication of a vector ( ![]() | |
template<typename Other > | |
StaticVector< Type, N, TF, AF, PF, Tag > & | scale (const Other &scalar) |
Scaling of the vector by the scalar value scalar ( ![]() | |
Constructors | |
StaticVector () | |
The default constructor for StaticVector. More... | |
StaticVector (const Type &init) | |
Constructor for a homogenous initialization of all elements. More... | |
constexpr | StaticVector (initializer_list< Type > list) |
List initialization of all vector elements. More... | |
template<typename Other > | |
StaticVector (size_t n, const Other *array) | |
Array initialization of all vector elements. More... | |
template<typename Other , size_t Dim> | |
constexpr | StaticVector (const Other(&array)[Dim]) |
Array initialization of all vector elements. More... | |
template<typename Other , size_t Dim> | |
constexpr | StaticVector (const std::array< Other, Dim > &array) |
Initialization of all vector elements from the given std::array. More... | |
constexpr | StaticVector (const StaticVector &v) |
The copy constructor for StaticVector. More... | |
template<typename Other , AlignmentFlag AF2, PaddingFlag PF2> | |
StaticVector (const StaticVector< Other, N, TF, AF2, PF2, Tag > &v) | |
Conversion constructor from different StaticVector instances. More... | |
template<typename VT > | |
StaticVector (const Vector< VT, TF > &v) | |
Conversion constructor from different vectors. More... | |
Destructor | |
~StaticVector ()=default | |
Data access functions | |
constexpr Reference | operator[] (size_t index) noexcept |
Subscript operator for the direct access to the vector elements. More... | |
constexpr ConstReference | operator[] (size_t index) const noexcept |
Subscript operator for the direct access to the vector elements. More... | |
Reference | at (size_t index) |
Checked access to the vector elements. More... | |
ConstReference | at (size_t index) const |
Checked access to the vector elements. More... | |
constexpr Pointer | data () noexcept |
Low-level data access to the vector elements. More... | |
constexpr ConstPointer | data () const noexcept |
Low-level data access to the vector elements. More... | |
constexpr Iterator | begin () noexcept |
Returns an iterator to the first element of the static vector. More... | |
constexpr ConstIterator | begin () const noexcept |
Returns an iterator to the first element of the static vector. More... | |
constexpr ConstIterator | cbegin () const noexcept |
Returns an iterator to the first element of the static vector. More... | |
constexpr Iterator | end () noexcept |
Returns an iterator just past the last element of the static vector. More... | |
constexpr ConstIterator | end () const noexcept |
Returns an iterator just past the last element of the static vector. More... | |
constexpr ConstIterator | cend () const noexcept |
Returns an iterator just past the last element of the static vector. More... | |
Assignment operators | |
constexpr StaticVector & | operator= (const Type &rhs) & |
Homogenous assignment to all vector elements. More... | |
constexpr StaticVector & | operator= (initializer_list< Type > list) & |
List assignment to all vector elements. More... | |
template<typename Other , size_t Dim> | |
constexpr StaticVector & | operator= (const Other(&array)[Dim]) & |
template<typename Other , size_t Dim> | |
constexpr StaticVector & | operator= (const std::array< Other, Dim > &array) & |
constexpr StaticVector & | operator= (const StaticVector &rhs) & |
Copy assignment operator for StaticVector. More... | |
template<typename Other , AlignmentFlag AF2, PaddingFlag PF2> | |
StaticVector & | operator= (const StaticVector< Other, N, TF, AF2, PF2, Tag > &rhs) & |
template<typename VT > | |
StaticVector & | operator= (const Vector< VT, TF > &rhs) & |
template<typename VT > | |
StaticVector & | operator+= (const Vector< VT, TF > &rhs) & |
template<typename VT > | |
StaticVector & | operator-= (const Vector< VT, TF > &rhs) & |
template<typename VT > | |
StaticVector & | operator*= (const Vector< VT, TF > &rhs) & |
template<typename VT > | |
StaticVector & | operator/= (const DenseVector< VT, TF > &rhs) & |
template<typename VT > | |
StaticVector & | operator%= (const Vector< VT, TF > &rhs) & |
Numeric functions | |
template<typename Other > | |
StaticVector & | scale (const Other &scalar) |
Debugging functions | |
constexpr bool | isIntact () const noexcept |
Returns whether the invariants of the static vector are intact. More... | |
Conversion operators | |
BLAZE_ALWAYS_INLINE constexpr StaticVector< Type, N, TF, AF, PF, Tag > & | operator~ () noexcept |
CRTP-based conversion operation for non-constant vectors. More... | |
BLAZE_ALWAYS_INLINE constexpr const StaticVector< Type, N, TF, AF, PF, Tag > & | operator~ () const noexcept |
CRTP-based conversion operation for constant vectors. More... | |
constexpr StaticVector< Type, N, TF, AF, PF, Tag > & | operator* () noexcept |
CRTP-based conversion operation for non-constant vectors. More... | |
constexpr const StaticVector< Type, N, TF, AF, PF, Tag > & | operator* () const noexcept |
CRTP-based conversion operation for constant vectors. More... | |
Static Public Attributes | |
static constexpr bool | simdEnabled = IsVectorizable_v<Type> |
Compilation flag for SIMD optimization. More... | |
static constexpr bool | smpAssignable = false |
Compilation flag for SMP assignments. More... | |
static constexpr bool | transposeFlag |
Transpose flag of the vector. | |
Private Attributes | |
Member variables | |
AlignedStorage | v_ |
The statically allocated vector elements. More... | |
Expression template evaluation functions | |
using | AlignedStorage = AlignedArray< Type, NN, Alignment > |
Type of the aligned storage. | |
static constexpr size_t | Alignment |
Alignment of the data elements. More... | |
template<typename Other > | |
bool | canAlias (const Other *alias) const noexcept |
Returns whether the vector can alias with the given address alias. More... | |
template<typename Other > | |
bool | isAliased (const Other *alias) const noexcept |
Returns whether the vector is aliased with the given address alias. More... | |
BLAZE_ALWAYS_INLINE SIMDType | load (size_t index) const noexcept |
Load of a SIMD element of the vector. More... | |
BLAZE_ALWAYS_INLINE SIMDType | loada (size_t index) const noexcept |
Aligned load of a SIMD element of the vector. More... | |
BLAZE_ALWAYS_INLINE SIMDType | loadu (size_t index) const noexcept |
Unaligned load of a SIMD element of the vector. More... | |
BLAZE_ALWAYS_INLINE void | store (size_t index, const SIMDType &value) noexcept |
Store of a SIMD element of the vector. More... | |
BLAZE_ALWAYS_INLINE void | storea (size_t index, const SIMDType &value) noexcept |
Aligned store of a SIMD element of the vector. More... | |
BLAZE_ALWAYS_INLINE void | storeu (size_t index, const SIMDType &value) noexcept |
Unaligned store of a SIMD element of the vector. More... | |
BLAZE_ALWAYS_INLINE void | stream (size_t index, const SIMDType &value) noexcept |
Aligned, non-temporal store of a SIMD element of the vector. More... | |
template<typename VT > | |
auto | assign (const DenseVector< VT, TF > &rhs) -> DisableIf_t< VectorizedAssign_v< VT > > |
Default implementation of the assignment of a dense vector. More... | |
template<typename VT > | |
auto | assign (const DenseVector< VT, TF > &rhs) -> EnableIf_t< VectorizedAssign_v< VT > > |
template<typename VT > | |
void | assign (const SparseVector< VT, TF > &rhs) |
Default implementation of the assignment of a sparse vector. More... | |
template<typename VT > | |
auto | addAssign (const DenseVector< VT, TF > &rhs) -> DisableIf_t< VectorizedAddAssign_v< VT > > |
Default implementation of the addition assignment of a dense vector. More... | |
template<typename VT > | |
auto | addAssign (const DenseVector< VT, TF > &rhs) -> EnableIf_t< VectorizedAddAssign_v< VT > > |
template<typename VT > | |
void | addAssign (const SparseVector< VT, TF > &rhs) |
Default implementation of the addition assignment of a sparse vector. More... | |
template<typename VT > | |
auto | subAssign (const DenseVector< VT, TF > &rhs) -> DisableIf_t< VectorizedSubAssign_v< VT > > |
Default implementation of the subtraction assignment of a dense vector. More... | |
template<typename VT > | |
auto | subAssign (const DenseVector< VT, TF > &rhs) -> EnableIf_t< VectorizedSubAssign_v< VT > > |
template<typename VT > | |
void | subAssign (const SparseVector< VT, TF > &rhs) |
Default implementation of the subtraction assignment of a sparse vector. More... | |
template<typename VT > | |
auto | multAssign (const DenseVector< VT, TF > &rhs) -> DisableIf_t< VectorizedMultAssign_v< VT > > |
Default implementation of the multiplication assignment of a dense vector. More... | |
template<typename VT > | |
auto | multAssign (const DenseVector< VT, TF > &rhs) -> EnableIf_t< VectorizedMultAssign_v< VT > > |
template<typename VT > | |
void | multAssign (const SparseVector< VT, TF > &rhs) |
Default implementation of the multiplication assignment of a sparse vector. More... | |
template<typename VT > | |
auto | divAssign (const DenseVector< VT, TF > &rhs) -> DisableIf_t< VectorizedDivAssign_v< VT > > |
Default implementation of the division assignment of a dense vector. More... | |
template<typename VT > | |
auto | divAssign (const DenseVector< VT, TF > &rhs) -> EnableIf_t< VectorizedDivAssign_v< VT > > |
static constexpr bool | isAligned () noexcept |
Returns whether the vector is properly aligned in memory. More... | |
Memory functions | |
static constexpr size_t | SIMDSIZE = SIMDTrait<Type>::size |
The number of elements packed within a single SIMD vector. | |
static constexpr size_t | NN = ( PF == padded ? nextMultiple( N, SIMDSIZE ) : N ) |
Alignment adjustment. | |
static void * | operator new (std::size_t size) |
Class specific implementation of operator new. More... | |
static void * | operator new[] (std::size_t size) |
Class specific implementation of operator new[]. More... | |
static void * | operator new (std::size_t size, const std::nothrow_t &) |
Class specific implementation of the no-throw operator new. More... | |
static void * | operator new[] (std::size_t size, const std::nothrow_t &) |
Class specific implementation of the no-throw operator new[]. More... | |
static void | operator delete (void *ptr) |
Class specific implementation of operator delete. More... | |
static void | operator delete[] (void *ptr) |
Class specific implementation of operator delete[]. More... | |
static void | operator delete (void *ptr, const std::nothrow_t &) |
Class specific implementation of no-throw operator delete. More... | |
static void | operator delete[] (void *ptr, const std::nothrow_t &) |
Class specific implementation of no-throw operator delete[]. More... | |
Utility functions | |
size_t | nonZeros () const |
Returns the number of non-zero elements in the vector. More... | |
constexpr void | reset () |
Reset to the default initial values. More... | |
void | swap (StaticVector &v) noexcept |
Swapping the contents of two static vectors. More... | |
static constexpr size_t | size () noexcept |
Returns the current size/dimension of the vector. More... | |
static constexpr size_t | spacing () noexcept |
Returns the minimum capacity of the vector. More... | |
static constexpr size_t | capacity () noexcept |
Returns the maximum capacity of the vector. More... | |
Efficient implementation of a fixed-sized vector.
The StaticVector class template is the representation of a fixed-size vector with statically allocated elements of arbitrary type. The type of the elements, the number of elements, the transpose flag, the alignment, the padding, and the group tag of the vector can be specified via the six template parameters:
blaze::rowVector
) or a column vector (blaze::columnVector
). The default value is blaze::defaultTransposeFlag
.blaze::aligned
and blaze::unaligned
. The default value is blaze::defaultAlignmentFlag
.blaze::padded
and blaze::unpadded
. The default value is blaze::defaultPaddingFlag
.blaze::Group0
. See Grouping/Tagging for details.These contiguously stored elements can be directly accessed with the subscript operator. The numbering of the vector elements is
\f[\left(\begin{array}{*{4}{c}} 0 & 1 & \cdots & N-1 \\ \end{array}\right)\f]
The use of StaticVector is very natural and intuitive. All operations (addition, subtraction, multiplication, scaling, ...) can be performed on all possible combinations of dense and sparse vectors with fitting element types. The following example gives an impression of the use of a 2-dimensional StaticVector:
|
inline |
The default constructor for StaticVector.
All vector elements are initialized to the default value (i.e. 0 for integral data types).
Note that it is possible to skip the default initialization by means of the BLAZE_USE_DEFAULT_INITIALIZATION configuration switch. In case the switch is set to 1 all elements are initialized to their respective default. In case the switch is set to 0 the default initialization is skipped and the elements are not initialized. Please note that this switch is only effective in case the elements are of fundamental type (i.e. integral or floating point). In case the elements are of class type, this switch has no effect. See the <blaze/config/Optimizations.h>
configuration file for more details.
|
inlineexplicit |
Constructor for a homogenous initialization of all elements.
init | Initial value for all vector elements. |
|
constexpr |
List initialization of all vector elements.
list | The initializer list. |
std::invalid_argument | Invalid setup of static vector. |
This constructor provides the option to explicitly initialize the elements of the vector by means of an initializer list:
The vector elements are (copy) assigned the values of the given initializer list. Missing values are initialized as default. Note that in case the size of the initializer list exceeds the size of the vector, a std::invalid_argument exception is thrown.
|
inline |
Array initialization of all vector elements.
n | The size of the vector. |
array | Dynamic array for the initialization. |
This constructor offers the option to directly initialize the elements of the vector with a dynamic array:
The vector is initialized with the values from the given array. Missing values are initialized with default values. In case the size of the given vector exceeds the maximum size of the static vector (i.e. is larger than N), a std::invalid_argument exception is thrown.
Note that it is expected that the given array has at least n elements. Providing an array with less elements results in undefined behavior!
|
constexpr |
Array initialization of all vector elements.
array | Static array for the initialization. |
This constructor operator offers the option to directly initialize the elements of the vector with a static array:
The vector is initialized with the values from the given static array. Whereas the dimensions of the vector and the static array must match, it is allowed to provide fewer initializers for the static array. Missing values are initialized with default values (as e.g. the third value in the example).
|
constexpr |
Initialization of all vector elements from the given std::array.
array | The given std::array for the initialization. |
This constructor operator offers the option to directly initialize the elements of the vector with a std::array:
The vector is initialized with the values from the given std::array. Whereas the dimensions of the vector and the std::array must match, it is allowed to provide fewer initializers for the std::array. Missing values are initialized with default values (as e.g. the third value in the example).
|
constexpr |
The copy constructor for StaticVector.
v | Vector to be copied. |
The copy constructor is explicitly defined in order to enable/facilitate NRV optimization.
|
inline |
Conversion constructor from different StaticVector instances.
v | Vector to be copied. |
|
inline |
Conversion constructor from different vectors.
v | Vector to be copied. |
std::invalid_argument | Invalid setup of static vector. |
This constructor initializes the static vector from the given vector. In case the size of the given vector does not match the size of the static vector (i.e. is not N), a std::invalid_argument exception is thrown.
|
inline |
Default implementation of the addition assignment of a dense vector.
SIMD optimized implementation of the addition assignment of a dense vector.
rhs | The right-hand side dense vector to be added. |
This function must NOT be called explicitly! It is used internally for the performance optimized evaluation of expression templates. Calling this function explicitly might result in erroneous results and/or in compilation errors. Instead of using this function use the assignment operator.
|
inline |
Default implementation of the addition assignment of a sparse vector.
rhs | The right-hand side sparse vector to be added. |
This function must NOT be called explicitly! It is used internally for the performance optimized evaluation of expression templates. Calling this function explicitly might result in erroneous results and/or in compilation errors. Instead of using this function use the assignment operator.
|
inline |
Default implementation of the assignment of a dense vector.
SIMD optimized implementation of the assignment of a dense vector.
rhs | The right-hand side dense vector to be assigned. |
This function must NOT be called explicitly! It is used internally for the performance optimized evaluation of expression templates. Calling this function explicitly might result in erroneous results and/or in compilation errors. Instead of using this function use the assignment operator.
|
inline |
Default implementation of the assignment of a sparse vector.
rhs | The right-hand side sparse vector to be assigned. |
This function must NOT be called explicitly! It is used internally for the performance optimized evaluation of expression templates. Calling this function explicitly might result in erroneous results and/or in compilation errors. Instead of using this function use the assignment operator.
|
inline |
Checked access to the vector elements.
index | Access index. The index has to be in the range ![]() |
std::out_of_range | Invalid vector access index. |
In contrast to the subscript operator this function always performs a check of the given access index.
|
inline |
Checked access to the vector elements.
index | Access index. The index has to be in the range ![]() |
std::out_of_range | Invalid vector access index. |
In contrast to the subscript operator this function always performs a check of the given access index.
|
constexprnoexcept |
Returns an iterator to the first element of the static vector.
|
constexprnoexcept |
Returns an iterator to the first element of the static vector.
|
inlinenoexcept |
Returns whether the vector can alias with the given address alias.
alias | The alias to be checked. |
This function returns whether the given address can alias with the vector. In contrast to the isAliased() function this function is allowed to use compile time expressions to optimize the evaluation.
|
staticconstexprnoexcept |
Returns the maximum capacity of the vector.
|
constexprnoexcept |
Returns an iterator to the first element of the static vector.
|
constexprnoexcept |
Returns an iterator just past the last element of the static vector.
|
constexprnoexcept |
Low-level data access to the vector elements.
This function returns a pointer to the internal storage of the static vector.
|
constexprnoexcept |
Low-level data access to the vector elements.
This function returns a pointer to the internal storage of the static vector.
|
inline |
Default implementation of the division assignment of a dense vector.
SIMD optimized implementation of the division assignment of a dense vector.
rhs | The right-hand side dense vector divisor. |
This function must NOT be called explicitly! It is used internally for the performance optimized evaluation of expression templates. Calling this function explicitly might result in erroneous results and/or in compilation errors. Instead of using this function use the assignment operator.
|
constexprnoexcept |
Returns an iterator just past the last element of the static vector.
|
constexprnoexcept |
Returns an iterator just past the last element of the static vector.
|
inlinenoexcept |
Returns whether the vector is aliased with the given address alias.
alias | The alias to be checked. |
This function returns whether the given address is aliased with the vector. In contrast to the canAlias() function this function is not allowed to use compile time expressions to optimize the evaluation.
|
staticconstexprnoexcept |
Returns whether the vector is properly aligned in memory.
This function returns whether the vector is guaranteed to be properly aligned in memory, i.e. whether the beginning and the end of the vector are guaranteed to conform to the alignment restrictions of the element type Type.
|
constexprnoexcept |
Returns whether the invariants of the static vector are intact.
This function checks whether the invariants of the static vector are intact, i.e. if its state is valid. In case the invariants are intact, the function returns true, else it will return false.
|
noexcept |
Load of a SIMD element of the vector.
index | Access index. The index must be smaller than the number of vector elements. |
This function performs a load of a specific SIMD element of the dense vector. The index must be smaller than the number of vector elements and it must be a multiple of the number of values inside the SIMD element. This function must NOT be called explicitly! It is used internally for the performance optimized evaluation of expression templates. Calling this function explicitly might result in erroneous results and/or in compilation errors.
|
noexcept |
Aligned load of a SIMD element of the vector.
index | Access index. The index must be smaller than the number of vector elements. |
This function performs an aligned load of a specific SIMD element of the dense vector. The index must be smaller than the number of vector elements and it must be a multiple of the number of values inside the SIMD element. This function must NOT be called explicitly! It is used internally for the performance optimized evaluation of expression templates. Calling this function explicitly might result in erroneous results and/or in compilation errors.
|
noexcept |
Unaligned load of a SIMD element of the vector.
index | Access index. The index must be smaller than the number of vector elements. |
This function performs an unaligned load of a specific SIMD element of the dense vector. The index must be smaller than the number of vector elements and it must be a multiple of the number of values inside the SIMD element. This function must NOT be called explicitly! It is used internally for the performance optimized evaluation of expression templates. Calling this function explicitly might result in erroneous results and/or in compilation errors.
|
inline |
Default implementation of the multiplication assignment of a dense vector.
SIMD optimized implementation of the multiplication assignment of a dense vector.
rhs | The right-hand side dense vector to be multiplied. |
This function must NOT be called explicitly! It is used internally for the performance optimized evaluation of expression templates. Calling this function explicitly might result in erroneous results and/or in compilation errors. Instead of using this function use the assignment operator.
|
inline |
Default implementation of the multiplication assignment of a sparse vector.
rhs | The right-hand side sparse vector to be multiplied. |
This function must NOT be called explicitly! It is used internally for the performance optimized evaluation of expression templates. Calling this function explicitly might result in erroneous results and/or in compilation errors. Instead of using this function use the assignment operator.
|
inline |
Returns the number of non-zero elements in the vector.
This function returns the number of non-zero elements in the vector (i.e. the elements that compare unequal to their default value). Note that the number of non-zero elements is always less than or equal to the current size of the vector.
|
inlinestatic |
Class specific implementation of operator delete.
ptr | The memory to be deallocated. |
|
inlinestatic |
Class specific implementation of no-throw operator delete.
ptr | The memory to be deallocated. |
|
inlinestatic |
Class specific implementation of operator delete[].
ptr | The memory to be deallocated. |
|
inlinestatic |
Class specific implementation of no-throw operator delete[].
ptr | The memory to be deallocated. |
|
inlinestatic |
Class specific implementation of operator new.
size | The total number of bytes to be allocated. |
std::bad_alloc | Allocation failed. |
This class-specific implementation of operator new provides the functionality to allocate dynamic memory based on the alignment restrictions of the StaticVector class template.
|
inlinestatic |
Class specific implementation of the no-throw operator new.
size | The total number of bytes to be allocated. |
std::bad_alloc | Allocation failed. |
This class-specific implementation of operator new provides the functionality to allocate dynamic memory based on the alignment restrictions of the StaticVector class template.
|
inlinestatic |
Class specific implementation of operator new[].
size | The total number of bytes to be allocated. |
std::bad_alloc | Allocation failed. |
This class-specific implementation of operator new provides the functionality to allocate dynamic memory based on the alignment restrictions of the StaticVector class template.
|
inlinestatic |
Class specific implementation of the no-throw operator new[].
size | The total number of bytes to be allocated. |
std::bad_alloc | Allocation failed. |
This class-specific implementation of operator new provides the functionality to allocate dynamic memory based on the alignment restrictions of the StaticVector class template.
|
inline |
Cross product assignment operator for the multiplication of a vector ( ).
rhs | The right-hand side vector for the cross product. |
std::invalid_argument | Invalid vector size for cross product. |
In case the current size of any of the two vectors is not equal to 3, a std::invalid_argument exception is thrown.
|
constexprnoexceptinherited |
CRTP-based conversion operation for constant vectors.
This operator performs the CRTP-based type-safe downcast to the actual type VT of the vector. It will return a constant reference to the actual type VT.
|
constexprnoexceptinherited |
CRTP-based conversion operation for non-constant vectors.
This operator performs the CRTP-based type-safe downcast to the actual type VT of the vector. It will return a mutable reference to the actual type VT.
|
inline |
Multiplication assignment operator for the multiplication of a vector ( ).
rhs | The right-hand side vector to be multiplied with the vector. |
std::invalid_argument | Vector sizes do not match. |
In case the current sizes of the two vectors don't match, a std::invalid_argument exception is thrown.
|
inline |
Addition assignment operator for the addition of a vector ( ).
rhs | The right-hand side vector to be added to the vector. |
std::invalid_argument | Vector sizes do not match. |
In case the current sizes of the two vectors don't match, a std::invalid_argument exception is thrown.
|
inline |
Subtraction assignment operator for the subtraction of a vector ( ).
rhs | The right-hand side vector to be subtracted from the vector. |
std::invalid_argument | Vector sizes do not match. |
In case the current sizes of the two vectors don't match, a std::invalid_argument exception is thrown.
|
inline |
Division assignment operator for the division of a dense vector ( ).
rhs | The right-hand side dense vector divisor. |
std::invalid_argument | Vector sizes do not match. |
In case the current sizes of the two vectors don't match, a std::invalid_argument exception is thrown.
|
constexpr |
Array assignment to all vector elements.
array | Static array for the assignment. |
This assignment operator offers the option to directly set all elements of the vector:
The vector is assigned the values from the given static array. Whereas the dimensions of the vector and the static array must match, it is allowed to provide fewer initializers for the static array. Missing values are initialized with default values (as e.g. the third value in the example).
|
constexpr |
Copy assignment operator for StaticVector.
rhs | Vector to be copied. |
Explicit definition of a copy assignment operator for performance reasons.
|
inline |
Assignment operator for different StaticVector instances.
rhs | Vector to be copied. |
|
constexpr |
Array assignment to all vector elements.
array | The given std::array for the assignment. |
This assignment operator offers the option to directly set all elements of the vector:
The vector is assigned the values from the given std::array. Whereas the dimensions of the vector and the std::array must match, it is allowed to provide fewer initializers for the std::array. Missing values are initialized with default values (as e.g. the third value in the example).
|
constexpr |
Homogenous assignment to all vector elements.
rhs | Scalar value to be assigned to all vector elements. |
|
inline |
Assignment operator for different vectors.
rhs | Vector to be copied. |
std::invalid_argument | Invalid assignment to static vector. |
This constructor initializes the vector as a copy of the given vector. In case the size of the given vector is not N, a std::invalid_argument exception is thrown.
|
constexpr |
List assignment to all vector elements.
list | The initializer list. |
std::invalid_argument | Invalid assignment to static vector. |
This assignment operator offers the option to directly assign to all elements of the vector by means of an initializer list:
The vector elements are (copy) assigned the values from the given initializer list. Missing values are reset to their default state. Note that in case the size of the initializer list exceeds the size of the vector, a std::invalid_argument exception is thrown.
|
constexprnoexcept |
Subscript operator for the direct access to the vector elements.
index | Access index. The index has to be in the range ![]() |
This function only performs an index check in case BLAZE_USER_ASSERT() is active. In contrast, the at() function is guaranteed to perform a check of the given access index.
|
constexprnoexcept |
Subscript operator for the direct access to the vector elements.
index | Access index. The index has to be in the range ![]() |
This function only performs an index check in case BLAZE_USER_ASSERT() is active. In contrast, the at() function is guaranteed to perform a check of the given access index.
|
constexprnoexceptinherited |
CRTP-based conversion operation for constant vectors.
This operator performs the CRTP-based type-safe downcast to the actual type VT of the vector. It will return a constant reference to the actual type VT.
|
constexprnoexceptinherited |
CRTP-based conversion operation for non-constant vectors.
This operator performs the CRTP-based type-safe downcast to the actual type VT of the vector. It will return a mutable reference to the actual type VT.
|
constexpr |
Reset to the default initial values.
|
inline |
Scaling of the vector by the scalar value scalar ( ).
scalar | The scalar value for the vector scaling. |
This function scales the vector by applying the given scalar value scalar to each element of the vector. For built-in and complex
data types it has the same effect as using the multiplication assignment operator:
|
staticconstexprnoexcept |
Returns the current size/dimension of the vector.
|
staticconstexprnoexcept |
Returns the minimum capacity of the vector.
This function returns the minimum capacity of the vector, which corresponds to the current size plus padding.
|
noexcept |
Store of a SIMD element of the vector.
index | Access index. The index must be smaller than the number of vector elements. |
value | The SIMD element to be stored. |
This function performs a store of a specific SIMD element of the dense vector. The index must be smaller than the number of vector elements and it must be a multiple of the number of values inside the SIMD element. This function must NOT be called explicitly! It is used internally for the performance optimized evaluation of expression templates. Calling this function explicitly might result in erroneous results and/or in compilation errors.
|
noexcept |
Aligned store of a SIMD element of the vector.
index | Access index. The index must be smaller than the number of vector elements. |
value | The SIMD element to be stored. |
This function performs an aligned store of a specific SIMD element of the dense vector. The index must be smaller than the number of vector elements and it must be a multiple of the number of values inside the SIMD element. This function must NOT be called explicitly! It is used internally for the performance optimized evaluation of expression templates. Calling this function explicitly might result in erroneous results and/or in compilation errors.
|
noexcept |
Unaligned store of a SIMD element of the vector.
index | Access index. The index must be smaller than the number of vector elements. |
value | The SIMD element to be stored. |
This function performs an unaligned store of a specific SIMD element of the dense vector. The index must be smaller than the number of vector elements and it must be a multiple of the number of values inside the SIMD element. This function must NOT be called explicitly! It is used internally for the performance optimized evaluation of expression templates. Calling this function explicitly might result in erroneous results and/or in compilation errors.
|
noexcept |
Aligned, non-temporal store of a SIMD element of the vector.
index | Access index. The index must be smaller than the number of vector elements. |
value | The SIMD element to be stored. |
This function performs an aligned, non-temporal store of a specific SIMD element of the dense vector. The index must be smaller than the number of vector elements and it must be a multiple of the number of values inside the SIMD element. This function must NOT be called explicitly! It is used internally for the performance optimized evaluation of expression templates. Calling this function explicitly might result in erroneous results and/or in compilation errors.
|
inline |
Default implementation of the subtraction assignment of a dense vector.
SIMD optimized implementation of the subtraction assignment of a dense vector.
rhs | The right-hand side dense vector to be subtracted. |
This function must NOT be called explicitly! It is used internally for the performance optimized evaluation of expression templates. Calling this function explicitly might result in erroneous results and/or in compilation errors. Instead of using this function use the assignment operator.
|
inline |
Default implementation of the subtraction assignment of a sparse vector.
rhs | The right-hand side sparse vector to be subtracted. |
This function must NOT be called explicitly! It is used internally for the performance optimized evaluation of expression templates. Calling this function explicitly might result in erroneous results and/or in compilation errors. Instead of using this function use the assignment operator.
|
inlinenoexcept |
Swapping the contents of two static vectors.
v | The vector to be swapped. |
|
staticconstexprprivate |
Alignment of the data elements.
|
staticconstexpr |
Compilation flag for SIMD optimization.
The simdEnabled compilation flag indicates whether expressions the vector is involved in can be optimized via SIMD operations. In case the element type of the vector is a vectorizable data type, the simdEnabled compilation flag is set to true, otherwise it is set to false.
|
staticconstexpr |
Compilation flag for SMP assignments.
The smpAssignable compilation flag indicates whether the vector can be used in SMP (shared memory parallel) assignments (both on the left-hand and right-hand side of the assignment).
|
private |
The statically allocated vector elements.
Access to the vector values is gained via the subscript operator. The order of the elements is