|
| index_space (bool storage=STORAGE) |
|
template<class S , bool STORAGE2, bool OWNED2, bool SORTED2, class F2 , template< typename, typename... > class ID_STORAGE_TYPE2, template< typename, typename... > class STORAGE_TYPE2> |
| index_space (const index_space< S, STORAGE2, OWNED2, SORTED2, F2, ID_STORAGE_TYPE2, STORAGE_TYPE2 > &is, size_t begin, size_t end) |
|
| index_space (const index_space &is) |
| Constructor to alias an existing index space unless OWNED.
|
|
| index_space (index_space &&is) |
| Move constructor.
|
|
| ~index_space () |
| Destructor.
|
|
storage_t * | storage () |
| Return the storage object.
|
|
const storage_t * | storage () const |
| Return the storage object.
|
|
void | set_storage (storage_t *s) |
| Set the storage object.
|
|
index_space & | operator= (const index_space &is) |
| Assignment operator. Alias an existing index space unless OWNED.
|
|
index_space & | operator= (index_space &&is) |
| Move assignment operator.
|
|
template<class S , bool STORAGE2 = STORAGE, bool OWNED2 = OWNED, bool SORTED2 = SORTED, class F2 = F, template< typename, typename... > class ID_STORAGE_TYPE2 = ID_STORAGE_TYPE, template< typename, typename... > class STORAGE_TYPE2 = STORAGE_TYPE> |
auto & | cast () |
|
template<class S , bool STORAGE2 = STORAGE, bool OWNED2 = OWNED, bool SORTED2 = SORTED, class F2 = F, template< typename, typename... > class ID_STORAGE_TYPE2 = ID_STORAGE_TYPE, template< typename, typename... > class STORAGE_TYPE2 = STORAGE_TYPE> |
auto & | cast () const |
|
auto | begin () |
| Return begin iterator.
|
|
auto | begin () const |
| Return begin iterator.
|
|
auto | end () |
| Return end iterator.
|
|
auto | end () const |
| Return end iterator.
|
|
size_t | begin_offset () const |
| Return begin offset.
|
|
size_t | end_offset () const |
| Return end offset.
|
|
ref_t | get_offset (size_t offset) |
| Get offset.
|
|
const ref_t | get_offset (size_t offset) const |
| Get offset.
|
|
id_range_ | ids () const |
| Get all IDs in range.
|
|
id_range_ | ids (size_t begin, size_t end) const |
| Get all IDs in range.
|
|
id_range_ | ids (const std::pair< size_t, size_t > &p) const |
| Get all IDs in range.
|
|
template<class S = T> |
auto | slice (size_t begin, size_t end) const |
|
template<class S = T> |
auto | slice (const std::pair< size_t, size_t > &range) const |
|
template<class S = T> |
auto | slice () const |
|
ref_t | get_ (size_t offset) |
| Helper method. Get item at offset.
|
|
const ref_t | get_ (size_t offset) const |
| Helper method. Get item at offset.
|
|
ref_t | get_end_ (size_t offset) |
| Helper method. Get item at offset from end.
|
|
const ref_t | get_end_ (size_t offset) const |
| Helper method. Get item at offset from end.
|
|
ref_t | operator[] (size_t offset) |
| Get item at offset.
|
|
const ref_t | operator[] (size_t i) const |
| Get item at offset.
|
|
const id_t & | operator() (size_t i) const |
|
id_t & | operator() (size_t i) |
|
ref_t | front () |
| Get the entity at the front of the index space.
|
|
const ref_t | front () const |
| Get the entity at the front of the index space.
|
|
ref_t | back () |
| Get the entity at the back of the index space.
|
|
const ref_t | back () const |
| Get the entity at the back of the index space.
|
|
size_t | size () const |
| Get the size of the index space.
|
|
bool | empty () const |
| Return if the index space is empty, i.e. has no indices.
|
|
void | clear () |
| Clear all indices and entities.
|
|
template<bool STORAGE2, bool OWNED2, bool SORTED2, class F2 , template< typename, typename... > class INDEX_STORAGE_TYPE2, template< typename, typename... > class STORAGE_TYPE2> |
void | set_master (const index_space< T, STORAGE2, OWNED2, SORTED2, F2, INDEX_STORAGE_TYPE2, STORAGE_TYPE2 > &master) |
|
template<bool STORAGE2, bool OWNED2, bool SORTED2, class F2 , template< typename, typename... > class INDEX_STORAGE_TYPE2, template< typename, typename... > class STORAGE_TYPE2> |
void | set_master (index_space< T, STORAGE2, OWNED2, SORTED2, F2, INDEX_STORAGE_TYPE2, STORAGE_TYPE2 > &master) |
|
std::vector< const T > | to_vec () const |
|
std::vector< T > | to_vec () |
|
template<class S > |
std::vector< S > | to_vec_ () |
|
const id_storage_t & | id_storage () const |
| Return the index storage object.
|
|
id_storage_t & | id_storage () |
| Return the index storage object.
|
|
void | set_id_storage (id_storage_t *v) |
| Set the index storage object.
|
|
const id_t * | id_array () const |
| Return the index space IDs as an array.
|
|
id_t * | id_array () |
|
template<typename Predicate > |
auto | filter (Predicate &&f) const |
|
void | apply (apply_function f) const |
|
template<class S > |
auto | map (map_function< S > f) const |
|
template<typename S > |
S | reduce (T start, reduce_function< T > f) const |
|
template<typename Predicate > |
auto | bin (Predicate &&f) const |
| Bin entities using a predicate function. More...
|
|
template<typename Predicate > |
auto | bin_as_map (Predicate &&f) const |
| Bin entities using a predicate function. More...
|
|
template<typename Predicate > |
auto | bin_as_vector (Predicate &&f) const |
| Bin entities using a predicate function. More...
|
|
void | prepare_ () |
|
index_space & | operator &= (const index_space &r) |
|
index_space | operator & (const index_space &r) const |
| Return r-value of set intersection of passed index spaces.
|
|
index_space & | operator|= (const index_space &r) |
|
index_space | operator| (const index_space &r) const |
| Return r-value of set union of passed index spaces.
|
|
index_space & | operator-= (const index_space &r) |
|
index_space | operator- (const index_space &r) const |
| Return r-value of set difference of passed index spaces.
|
|
void | push_back (const T &item) |
|
void | push_back (id_t index) |
|
void | pushed () |
| Called if an index was added to storage internally.
|
|
void | append (const index_space &is) |
|
index_space & | operator<< (T item) |
| Shortcut for push_back()
|
|
void | append_ (const std::vector< T > &ents, const std::vector< id_t > &ids) |
| Append helper method. Do not call directly.
|
|
id_t | id_ (const item_t &item) |
| Helper method to get ID.
|
|
id_t | id_ (const item_t *item) |
| Helper method to get ID.
|
|
void | set_begin (size_t begin) |
| Set to begin index of contained IDs.
|
|
void | set_end (size_t end) |
| Set the end index of contained IDs.
|
|
template<class T, bool STORAGE = false, bool OWNED = true, bool SORTED = false, class F = void, template< typename, typename... > class ID_STORAGE_TYPE = std::vector, template< typename, typename... > class STORAGE_TYPE = ID_STORAGE_TYPE>
class flecsi::topo::index_space< T, STORAGE, OWNED, SORTED, F, ID_STORAGE_TYPE, STORAGE_TYPE >
index_space provides a compile-time configurable and iterable container of objects, e.g. mesh/tree topology entities and their id's. Index space defines the concept of STORAGE - whether the actual entities referenced are stored within this index space OR contained in a 'master' index space. OWNERSHIP - whether its set of id's are owned by this index space or aliased to another index space and then must be copied before this index space can then modify them. SORTED - refers to if the id's are sorted and can then have set operations directly applied to them, else the index space must first be sorted. To make operations on index spaces faster, the index space is parameterized on a number of these parameters and can be efficiently recast depending on how it is to be used.
- Template Parameters
-
STORAGE | if true then this is a 'master' index space with its own storage. |
OWNED | if true then id ownership is definitely true, else must check owned_ at runtime |
SORTED | if true then id's are definitely sorted and shall be maintained in sorted order. |
F | iterator predicate/filter function |