6 #include "../../types.hpp" 12 namespace wavepackets {
14 namespace shape_enum {
21 for (
dim_t i = D; i > 0; i--) {
22 if (lhs[i-1] != rhs[i-1])
42 template<dim_t D,
class MultiIndex,
int N>
48 auto superset_it = superset_slice.
begin();
49 auto subset_it = subset_slice.
begin();
51 while (superset_it != superset_slice.
end() && subset_it != subset_slice.
end()) {
52 if (*superset_it == *subset_it) {
53 std::size_t sub = offset2 + (subset_it - subset_slice.
begin());
54 std::size_t super = offset1 + (superset_it - superset_slice.
begin());
56 subset_data.row(sub) = superset_data.row(super);
63 template<dim_t D,
class MultiIndex,
int N>
69 copy_subset(superset_data, 0, subset_data, 0, superset_slice, subset_slice);
73 template<dim_t D,
class MultiIndex,
int N>
80 std::size_t i_off = 0;
81 std::size_t o_off = 0;
82 for (
int islice = 0; islice < subset_enum->
n_slices(); islice++) {
83 copy_subset(superset_data, i_off, subset_data, o_off, superset_enum->
slice(islice), subset_enum->
slice(islice));
84 i_off += superset_enum->
slice(islice).size();
85 o_off += subset_enum->
slice(islice).size();
Definition: coefficients_file_parser.cpp:10
std::size_t size() const
Definition: shape_enum.hpp:93
int n_slices() const
Retrieves the number of slices.
Definition: shape_enum.hpp:457
A shape enumeration is a complete, ordered list of all lattice nodes that are part of the basis shape...
Definition: shape_enum.hpp:353
std::size_t n_entries() const
Retrieves the number of nodes.
Definition: shape_enum.hpp:449
bool _copy_subset__fast_equals(const std::array< int, D > &lhs, const std::array< int, D > &rhs)
Definition: shape_enum_subset.hpp:16
CArray< Eigen::Dynamic, N > HaWpBasisVector
Definition: types.hpp:31
const_iterator begin() const
Returns a const-iterator pointing to the first node.
Definition: shape_enum.hpp:101
const_iterator end() const
Returns a const-iterator referring to the past-the-end node.
Definition: shape_enum.hpp:109
void copy_subset(const HaWpBasisVector< N > &superset_data, std::size_t offset1, HaWpBasisVector< N > &subset_data, std::size_t offset2, const ShapeSlice< D, MultiIndex > &superset_slice, const ShapeSlice< D, MultiIndex > &subset_slice)
Definition: shape_enum_subset.hpp:43
The -th slice of a shape enumeration contains all multi-indices that satisfy .
Definition: shape_enum.hpp:18
int dim_t
Definition: types.hpp:16
const ShapeSlice< D, MultiIndex > & slice(int islice) const
Returns a reference to a slice.
Definition: shape_enum.hpp:409