|
akreon-linalg
Fixed-size linear algebra and numerical methods in C++26.
|
Owning, fixed-size vector container. More...
#include <vector.hpp>
Public Member Functions | |
| template<typename... Coords> requires (sizeof...(coords) == N) | |
| constexpr | Vector (Coords... coords) |
Construct from exactly N coordinate values. | |
| constexpr | Vector () |
| Construct a value-initialized vector. | |
| constexpr auto | begin () const |
| Const iterator to the first coordinate. | |
| constexpr auto | end () const |
| Const iterator one past the final coordinate. | |
| constexpr const T & | operator() (std::size_t idx) const |
| Read a coordinate at a zero-based index. | |
| constexpr T & | operator() (std::size_t idx) |
| Read or modify a coordinate at a zero-based index. | |
| constexpr bool | operator== (const Vector &other) const |
| Compare coordinates for exact element-wise equality. | |
| constexpr bool | operator!= (const Vector &other) const |
| Compare coordinates for element-wise inequality. | |
| constexpr auto | view () |
| Obtain a mutable fixed-extent view of contiguous coordinate storage. | |
| constexpr auto | size () const |
Return the compile-time coordinate count N. | |
Owning, fixed-size vector container.
Forward declaration of the owning fixed-size vector container.
Vector stores exactly N values inline in a std::array; its dimension is part of the type and no dynamic allocation occurs. The container is intentionally generic over T. Field-based algorithms opt in separately through FieldVector, while std::array remains available for arbitrary non-mathematical fixed-size data.
Coordinates use zero-based vector(index) access guarded by AK_ASSERT. Default construction value-initializes every coordinate. Iteration is const, while mutable contiguous access is available through view().
| T | Stored coordinate type. |
| N | Compile-time coordinate count. |
Definition at line 36 of file vector.hpp.
|
inlineconstexpr |
Construct from exactly N coordinate values.
| coords | Coordinates in increasing index order. |
Definition at line 43 of file vector.hpp.
References linalg::mat_rows_v.
|
inlineconstexpr |
Construct a value-initialized vector.
Definition at line 48 of file vector.hpp.
|
inlineconstexpr |
Const iterator to the first coordinate.
Definition at line 51 of file vector.hpp.
|
inlineconstexpr |
Const iterator one past the final coordinate.
Definition at line 54 of file vector.hpp.
|
inlineconstexpr |
Compare coordinates for element-wise inequality.
| other | Shape-compatible vector to compare. |
Definition at line 88 of file vector.hpp.
References linalg::mat_rows_v.
|
inlineconstexpr |
Read or modify a coordinate at a zero-based index.
| idx | Coordinate index in [0, N). |
Definition at line 71 of file vector.hpp.
References AK_ASSERT, and linalg::mat_rows_v.
|
inlineconstexpr |
Read a coordinate at a zero-based index.
| idx | Coordinate index in [0, N). |
Definition at line 61 of file vector.hpp.
References AK_ASSERT, and linalg::mat_rows_v.
|
inlineconstexpr |
Compare coordinates for exact element-wise equality.
| other | Shape-compatible vector to compare. |
Definition at line 80 of file vector.hpp.
References linalg::mat_rows_v.
|
inlineconstexpr |
Return the compile-time coordinate count N.
Definition at line 98 of file vector.hpp.
|
inlineconstexpr |
Obtain a mutable fixed-extent view of contiguous coordinate storage.
Definition at line 95 of file vector.hpp.