openCARP
Doxygen code documentation for the open cardiac electrophysiology simulator openCARP
Public Member Functions | List of all members
SF::index_mapping< T > Class Template Reference

Index mapping class. This is a bijective mapping. More...

#include <SF_container.h>

Inheritance diagram for SF::index_mapping< T >:
Collaboration diagram for SF::index_mapping< T >:

Public Member Functions

 index_mapping ()
 empty constructor. More...
 
 index_mapping (const vector< T > &a, const vector< T > &b)
 Constructor that uses assign() to set up the index mapping. More...
 
void assign (const vector< T > &a, const vector< T > &b)
 Set up the index mapping between a and b. More...
 
forward_map (T idx) const
 Map one index from a to b. More...
 
backward_map (T idx) const
 Map one index from b to a. More...
 
void forward_map (vector< T > &idx) const
 Map a whole array of indices in a to indices in b. More...
 
void backward_map (vector< T > &idx) const
 Map a whole array of indices in b to indices in a. More...
 
size_t size () const
 number of entries in bijective map More...
 
bool in_a (const T idx)
 return whether idx is in set A More...
 
bool in_b (const T idx)
 return whether idx is in set B More...
 
const hashmap::unordered_map< T, T > & get_fwd_map () const
 
const hashmap::unordered_map< T, T > & get_bwd_map () const
 
hashmap::unordered_map< T, T > & get_fwd_map ()
 
hashmap::unordered_map< T, T > & get_bwd_map ()
 

Detailed Description

template<class T>
class SF::index_mapping< T >

Index mapping class. This is a bijective mapping.

Usually used to map indices between two different numberings.

Definition at line 207 of file SF_container.h.

Constructor & Destructor Documentation

◆ index_mapping() [1/2]

template<class T>
SF::index_mapping< T >::index_mapping ( )
inline

empty constructor.

Definition at line 215 of file SF_container.h.

◆ index_mapping() [2/2]

template<class T>
SF::index_mapping< T >::index_mapping ( const vector< T > &  a,
const vector< T > &  b 
)
inline

Constructor that uses assign() to set up the index mapping.

Parameters
aIndex set a.
bIndex set b.

Definition at line 224 of file SF_container.h.

Member Function Documentation

◆ assign()

template<class T>
void SF::index_mapping< T >::assign ( const vector< T > &  a,
const vector< T > &  b 
)
inline

Set up the index mapping between a and b.

Parameters
aIndex set a.
bIndex set b.

Definition at line 235 of file SF_container.h.

Here is the caller graph for this function:

◆ backward_map() [1/2]

template<class T>
T SF::index_mapping< T >::backward_map ( idx) const
inline

Map one index from b to a.

Definition at line 262 of file SF_container.h.

Here is the caller graph for this function:

◆ backward_map() [2/2]

template<class T>
void SF::index_mapping< T >::backward_map ( vector< T > &  idx) const
inline

Map a whole array of indices in b to indices in a.

There is a performance advantage compared to mapping individual indices when indices in idx are stored multiple times.

Parameters
idxVector holding indices.

Definition at line 316 of file SF_container.h.

◆ forward_map() [1/2]

template<class T>
T SF::index_mapping< T >::forward_map ( idx) const
inline

Map one index from a to b.

Definition at line 252 of file SF_container.h.

Here is the caller graph for this function:

◆ forward_map() [2/2]

template<class T>
void SF::index_mapping< T >::forward_map ( vector< T > &  idx) const
inline

Map a whole array of indices in a to indices in b.

There is a performance advantage compared to mapping individual indices when indices in idx are stored multiple times.

Parameters
idxVector holding indices.

Definition at line 280 of file SF_container.h.

◆ get_bwd_map() [1/2]

template<class T>
const hashmap::unordered_map<T, T>& SF::index_mapping< T >::get_bwd_map ( ) const
inline

Definition at line 363 of file SF_container.h.

◆ get_bwd_map() [2/2]

template<class T>
hashmap::unordered_map<T, T>& SF::index_mapping< T >::get_bwd_map ( )
inline

Definition at line 373 of file SF_container.h.

◆ get_fwd_map() [1/2]

template<class T>
const hashmap::unordered_map<T, T>& SF::index_mapping< T >::get_fwd_map ( ) const
inline

Definition at line 358 of file SF_container.h.

◆ get_fwd_map() [2/2]

template<class T>
hashmap::unordered_map<T, T>& SF::index_mapping< T >::get_fwd_map ( )
inline

Definition at line 368 of file SF_container.h.

◆ in_a()

template<class T>
bool SF::index_mapping< T >::in_a ( const T  idx)
inline

return whether idx is in set A

Definition at line 350 of file SF_container.h.

◆ in_b()

template<class T>
bool SF::index_mapping< T >::in_b ( const T  idx)
inline

return whether idx is in set B

Definition at line 354 of file SF_container.h.

Here is the caller graph for this function:

◆ size()

template<class T>
size_t SF::index_mapping< T >::size ( ) const
inline

number of entries in bijective map

Definition at line 345 of file SF_container.h.


The documentation for this class was generated from the following file: