|
mptensor v0.6.0
Parallel Library for Tensor Network Methods
|
#include <index.hpp>
Public Types | |
| using | value_type = T |
| using | index_t = std::vector< T > |
Public Member Functions | |
| BasicIndex ()=default | |
| BasicIndex (const index_t &index) | |
| template<typename U , typename = std::enable_if_t<internal::is_index_value_v<U> && !std::is_same_v<U, T>>> | |
| BasicIndex (const std::vector< U > &index) | |
| Converting constructor from a vector of another integer type. | |
| BasicIndex (std::initializer_list< T > list) | |
| template<typename... Ints, typename = std::enable_if_t<(sizeof...(Ints) > 0) && (internal::is_index_value_v<Ints> && ...)>> | |
| BasicIndex (Ints... js) | |
Python-like list literal, e.g. Index(0, 1, -1). | |
| const T & | operator[] (size_t i) const |
| T & | operator[] (size_t i) |
| size_t | size () const |
| void | push (T i) |
| void | resize (size_t n) |
| void | assign (size_t n, const T j[]) |
| void | sort () |
| BasicIndex | inverse_permutation () const |
Inverse of a permutation: inv[(*this)[i]] = i. | |
| BasicIndex | inverse () const |
| Same as inverse_permutation(). | |
| bool | operator== (const BasicIndex &rhs) const |
| BasicIndex & | operator+= (const BasicIndex &rhs) |
List of non-negative or signed integers used as an index, axes, or shape.
Index (= Axes = Shape) is the public type. internal::UIndex (= internal::UAxes = internal::UShape) is used inside the library.
|
default |
|
inline |
Converting constructor from a vector of another integer type.
|
inline |
|
inline |
Python-like list literal, e.g. Index(0, 1, -1).
Not explicit: Axes a = 2; creates [2].
|
inline |
Same as inverse_permutation().
|
inline |
Inverse of a permutation: inv[(*this)[i]] = i.
For example, the inverse permutation of (2, 0, 1) is (1, 2, 0).
| std::out_of_range | if an element is outside [0, size()). |
| std::invalid_argument | if an element appears twice. |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |