Hermes
Loading...
Searching...
No Matches
hermes::Index3Range< T > Class Template Reference

Represents a closed-open range of indices [lower, upper),. More...

#include <index.h>

Public Member Functions

HERMES_DEVICE_CALLABLE Index3Range (T upper_i, T upper_j, T upper_k)
 Construct a new Index3Range object.
 
HERMES_DEVICE_CALLABLE Index3Range (Index3< T > upper)
 Construct a new Index3Range object.
 
HERMES_DEVICE_CALLABLE Index3Range (size3 upper)
 
HERMES_DEVICE_CALLABLE Index3Range (Index3< T > lower, Index3< T > upper)
 
HERMES_DEVICE_CALLABLE size_t flatIndex (const Index3< T > &ijk) const
 Computes a flat index based on size.
 
HERMES_DEVICE_CALLABLE Index3Iterator< Tbegin () const
 
HERMES_DEVICE_CALLABLE Index3Iterator< Tend () const
 
HERMES_DEVICE_CALLABLE size3 size () const
 

Friends

HERMES_DEVICE_CALLABLE friend Index3Range< Tintersect (const Index3Range< T > &a, const Index3Range< T > &b)
 

Detailed Description

template<typename T>
class hermes::Index3Range< T >

Represents a closed-open range of indices [lower, upper),.

Can be used in a for each loop that iterates over all indices in the range:

for(auto ij : hermes::Index3Range<int>(size)) {
*ij; // index coordinates
}
Represents a closed-open range of indices [lower, upper),.
Definition index.h:532
HERMES_DEVICE_CALLABLE size3 size() const
Definition index.h:599
Holds 2-dimensional size.
Definition size.h:142
Holds 2-dimensional integer index coordinates.
Definition index.h:50
Template Parameters
Tmust be an integer type

Constructor & Destructor Documentation

◆ Index3Range() [1/4]

template<typename T >
HERMES_DEVICE_CALLABLE hermes::Index3Range< T >::Index3Range ( T  upper_i,
T  upper_j,
T  upper_k 
)
inline

Construct a new Index3Range object.

Parameters
upper_i- upper bound i
upper_j- upper bound j
upper_k- upper bound k

◆ Index3Range() [2/4]

template<typename T >
HERMES_DEVICE_CALLABLE hermes::Index3Range< T >::Index3Range ( Index3< T upper)
inlineexplicit

Construct a new Index3Range object.

Parameters
upper- upper bound

◆ Index3Range() [3/4]

template<typename T >
HERMES_DEVICE_CALLABLE hermes::Index3Range< T >::Index3Range ( size3  upper)
inlineexplicit
Parameters
upper

◆ Index3Range() [4/4]

template<typename T >
HERMES_DEVICE_CALLABLE hermes::Index3Range< T >::Index3Range ( Index3< T lower,
Index3< T upper 
)
inline
Parameters
lower
upper

Member Function Documentation

◆ begin()

template<typename T >
HERMES_DEVICE_CALLABLE Index3Iterator< T > hermes::Index3Range< T >::begin ( ) const
inline
Returns
Index3Iterator<T>

◆ end()

template<typename T >
HERMES_DEVICE_CALLABLE Index3Iterator< T > hermes::Index3Range< T >::end ( ) const
inline
Returns
Index3Iterator<T>

◆ flatIndex()

template<typename T >
HERMES_DEVICE_CALLABLE size_t hermes::Index3Range< T >::flatIndex ( const Index3< T > &  ijk) const
inline

Computes a flat index based on size.

\(k * (d_i * d_j) + j * d_i + i\)

where \(d = upper - lower\)

Parameters
ijk
Returns

◆ size()

template<typename T >
HERMES_DEVICE_CALLABLE size3 hermes::Index3Range< T >::size ( ) const
inline

\(|upper - lower|_i\)

Returns

Friends And Related Symbol Documentation

◆ intersect

template<typename T >
HERMES_DEVICE_CALLABLE friend Index3Range< T > intersect ( const Index3Range< T > &  a,
const Index3Range< T > &  b 
)
friend
Parameters
a
b
Returns

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