101 for (
Index i = 0; i < N_new; ++i) {
112 std::vector<Index> im_perm_array(
size(), 0);
124 const std::vector<Index> &block_dims)
const {
125 assert(block_dims.size() ==
size());
126 std::vector<Index> block_perm;
127 block_perm.reserve(
sum(block_dims) *
size());
128 std::vector<Index> i_start(block_dims.size(), 0);
129 for (
Index i = 0; i + 1 < block_dims.size(); i++) {
130 i_start[i + 1] = i_start[i] + block_dims[i];
Permutation inverse() const
Construct permutation that undoes the permutation performed by 'this'.
Container permute(const Container &_before) const
Generate permuted copy of indexed container.
bool has_fixed_points() const
Checks whether any indices remain unchanged by permutation.
Index character() const
Character of permutation is number of fixed points.
bool is_identity() const
Checks whether permutation is identity (i.e., m_perm_aray[i]==i for all i)
Permutation transformed_by(const Permutation &trans_perm) const
std::vector< Index > m_perm_array
Permutation make_block_permutation(const std::vector< Index > &block_dims) const
void append_fixed_points(Index N_new)
Add new indices that remain unchanged by permutation.
Container operator*(const Container &_before) const
Index find_index(Iterator begin, Iterator end, const T &value)
Equivalent to std::distance(begin, std::find(begin, end, value))
Container::value_type sum(const Container &container, typename Container::value_type init_val=0)
bool valid_index(Index i)
INDEX_TYPE Index
For long integer indexing: