|
|
| Array () |
| | Default constructor. Value-initializes all elements to zero/default.
|
| |
| | Array (const DataType &val) |
| | Constructs from a std::array lvalue reference.
|
| |
| | Array (const DataType &&val) |
| | Constructs from a std::array rvalue reference.
|
| |
| template<typename... Args> |
| | Array (Args... args) |
| | Constructs from a variadic argument list.
|
| |
|
| ~Array () |
| | Destructor.
|
| |
| size_t | size () const |
| | Returns the number of elements in the array.
|
| |
| template<typename U , size_t OtherNumValues> |
| | Array (const Array< U, OtherNumValues > &other) |
| | Constructs from another Array of a potentially different size.
|
| |
| template<typename U > |
| Array< T, NumValues > & | operator= (const Array< U, NumValues > &other) |
| | Assigns from another Array of the same size but potentially different type.
|
| |
| template<typename U , size_t OtherNumValues> |
| Array< T, NumValues > & | operator= (const Array< U, OtherNumValues > &other) |
| | Assigns from another Array of a different type and size.
|
| |
| template<typename U > |
| Array< T, NumValues > & | operator= (U value) |
| | Assigns a scalar value to all elements.
|
| |
| T & | operator[] (size_t index) |
| | Returns a mutable reference to the element at index.
|
| |
| const T & | operator[] (size_t index) const |
| | Returns a const reference to the element at index.
|
| |
| Array< T, NumValues > & | operator+= (const Array< T, NumValues > &other) |
| | Adds another array element-wise to this one.
|
| |
| Array< T, NumValues > & | operator-= (const Array< T, NumValues > &other) |
| | Subtracts another array element-wise from this one.
|
| |
| Array< T, NumValues > & | operator*= (const Array< T, NumValues > &other) |
| | Multiplies this array element-wise by another.
|
| |
| Array< T, NumValues > & | operator/= (const Array< T, NumValues > &other) |
| | Divides this array element-wise by another.
|
| |
| Array< T, NumValues > & | operator+= (const T &scalar) |
| | Adds a scalar value to all elements.
|
| |
| Array< T, NumValues > & | operator-= (const T &scalar) |
| | Subtracts a scalar value from all elements.
|
| |
| Array< T, NumValues > & | operator*= (const T &scalar) |
| | Multiplies all elements by a scalar value.
|
| |
| Array< T, NumValues > & | operator/= (const T &scalar) |
| | Divides all elements by a scalar value.
|
| |
| T | sum () const |
| | Returns the sum of all elements.
|
| |
| double | mean () const |
| | Returns the arithmetic mean of all elements.
|
| |
| T * | data () |
| | Returns a mutable pointer to the underlying contiguous storage.
|
| |
| const T * | data () const |
| | Returns a const pointer to the underlying contiguous storage.
|
| |
| bool | isZero () const |
| | Returns true if all elements are zero.
|
| |
| Array< T, NumValues > | lerp (const Array< T, NumValues > &other, double v) const |
| | Returns a linearly interpolated array between this one and another.
|
| |
| Array< T, NumValues > | clamp (const Array< T, NumValues > &min, const Array< T, NumValues > &max) const |
| | Returns a new array with each element clamped to the given range.
|
| |
| bool | isBetween (const Array< T, NumValues > &min, const Array< T, NumValues > &max) const |
| | Returns true if all elements fall within the given range.
|
| |
|
|
Array< T, NumValues > | operator+ (Array< T, NumValues > lhs, const Array< T, NumValues > &rhs) |
| | Returns the element-wise sum of two arrays.
|
| |
|
Array< T, NumValues > | operator- (Array< T, NumValues > lhs, const Array< T, NumValues > &rhs) |
| | Returns the element-wise difference of two arrays.
|
| |
|
Array< T, NumValues > | operator* (Array< T, NumValues > lhs, const Array< T, NumValues > &rhs) |
| | Returns the element-wise product of two arrays.
|
| |
|
Array< T, NumValues > | operator/ (Array< T, NumValues > lhs, const Array< T, NumValues > &rhs) |
| | Returns the element-wise quotient of two arrays.
|
| |
|
Array< T, NumValues > | operator+ (Array< T, NumValues > lhs, const T &scalar) |
| | Returns a new array with a scalar added to each element.
|
| |
|
Array< T, NumValues > | operator- (Array< T, NumValues > lhs, const T &scalar) |
| | Returns a new array with a scalar subtracted from each element.
|
| |
|
Array< T, NumValues > | operator* (Array< T, NumValues > lhs, const T &scalar) |
| | Returns a new array with each element multiplied by a scalar.
|
| |
|
Array< T, NumValues > | operator/ (Array< T, NumValues > lhs, const T &scalar) |
| | Returns a new array with each element divided by a scalar.
|
| |
|
bool | operator== (const Array< T, NumValues > &lhs, const Array< T, NumValues > &rhs) |
| | Returns true if all elements of both arrays are equal.
|
| |
|
bool | operator!= (const Array< T, NumValues > &lhs, const Array< T, NumValues > &rhs) |
| | Returns true if any element differs between the two arrays.
|
| |
Fixed-size array container wrapping std::array.
- Example
Dynamic array container wrapping std::vector.
Definition list.h:40
size_t size() const noexcept
Returns the number of elements in the list.
Definition list.h:301
Extends std::array with element-wise arithmetic, interpolation, clamping, and range-checking utilities.
- Template Parameters
-
| T | Element type. |
| NumValues | Number of elements (fixed at compile time). |