|
cppqed-multidiagonal 0.4.0
Multidiagonal sparse operator algebra for C++QED
|
Classes | |
| struct | Placeholder |
Sentinel type for rank-2 slice notation: mav(i, _) returns the i-th row as a rank-1 view. More... | |
Typedefs | |
| template<typename T > | |
| using | StorageType = std::vector< T > |
Underlying storage type: std::vector<T>. May eventually be replaced by kokkos::View or std::valarray. | |
Functions | |
| template<size_t RANK> | |
| auto | calculateStrides (Extents< RANK > extents) |
Computes first-index-fastest strides from extents (std::layout_left; column-major for rank 2): strides[0]=1, strides[i]=strides[i-1]*extents[i-1]. | |
| template<size_t RANK> | |
| auto | calculateExtent (Extents< RANK > extents) |
| Returns the total number of elements: the product of all extents. | |
| template<typename T > | |
| auto | copyInit (const std::ranges::sized_range auto &input) |
| Initializer that copies from a sized range, checking that its size matches the requested extent. | |
Variables | |
| constexpr struct cppqedutils::multiarray::Placeholder | _ |
| template<typename T > | |
| constexpr auto | noInit = [] (size_t e) -> std::vector<T> {return std::vector<T>(e);} |
Initializer for storage of size e whose contents the caller overwrites before reading them. | |
| template<typename T > | |
| constexpr auto | zeroInit = [] (size_t e) -> std::vector<T> {return std::vector<T>(e,T(0.));} |
Initializer that allocates storage of size e and zero-initializes all elements via T(0.). | |
Underlying storage type: std::vector<T>. May eventually be replaced by kokkos::View or std::valarray.
Returns the total number of elements: the product of all extents.
Computes first-index-fastest strides from extents (std::layout_left; column-major for rank 2): strides[0]=1, strides[i]=strides[i-1]*extents[i-1].
This is the memory layout of every owning MultiArray. Note that incrementMultiIndex iterates in the opposite order (last index fastest).
Initializer that copies from a sized range, checking that its size matches the requested extent.
| constexpr struct cppqedutils::multiarray::Placeholder cppqedutils::multiarray::_ |
|
inlineconstexpr |
Initializer for storage of size e whose contents the caller overwrites before reading them.
std::vector<T>(e) value-initializes, so the storage is currently zero-filled after all. Don't rely on that: truly uninitialized storage would need a default-initializing allocator.