|
TRIQS/nda 2.0.0
Multi-dimensional array library for C++
|
Supporting types and helpers used by the tensor operations.
Classes | |
| struct | nda::tensor::tensor_view< T > |
| A type-erased, non-owning view of an nda::MemoryArray or a conjugate lazy expression. More... | |
Typedefs | |
| template<typename T> | |
| using | nda::tensor::const_tensor_view = tensor_view<const T> |
| Alias for a tensor_view with const value type. | |
| template<BlasArrayOrConj A> | |
| using | nda::tensor::data_ptr_t = decltype(get_array(std::declval<A>()).data()) |
| Data pointer type of an nda::blas_lapack::BlasArrayOrConj. | |
Enumerations | |
| enum class | nda::tensor::binary_op : std::uint8_t |
| Binary operations for tensor operations. More... | |
| enum class | nda::tensor::unary_op : std::uint8_t |
| Unary element-wise operations for tensor operations. More... | |
Functions | |
| template<int R> requires (R >= 0 && R <= 26) | |
| std::string_view | nda::tensor::default_index () |
| Generate a default index string ("abc...") of a given length. | |
| void | nda::tensor::require_equal_indices (std::string_view idx_a, std::string_view idx_b, int rank, std::string_view op_name) |
| Check if two index strings are equal and have a specified length. | |
|
strong |
#include <nda/tensor/tools.hpp>
Binary operations for tensor operations.
The binary operations are mapped to TBLIS and cuTENSOR as follows:
|
strong |
#include <nda/tensor/tools.hpp>
Unary element-wise operations for tensor operations.
The unary operations are mapped to cuTENSOR's element-wise operators (cutensorOperator_t) as follows:
| std::string_view nda::tensor::default_index | ( | ) |
#include <nda/tensor/tools.hpp>
Generate a default index string ("abc...") of a given length.
Used by tensor operations that don't require user-specified indices (e.g., scale, set, full reduce). The maximum supported length is 26 (one character per letter).
| R | Length of the index string (must be in [0, 26]). |
|
inline |
#include <nda/tensor/tools.hpp>
Check if two index strings are equal and have a specified length.
Used by nda fallback branches that cannot permute axes and therefore require identical index strings. Also enforces that the strings have length equal to the tensor rank.
| idx_a | First index string. |
| idx_b | Second index string. |
| rank | Expected length of both index strings (the tensor rank). |
| op_name | Name of the calling tensor operation, for the error message (e.g. "add"). |