OPALX (Object Oriented Parallel Accelerator Library for Exascale) MINIorX
OPALX
ippl::Index Class Reference

#include <Index.h>

Collaboration diagram for ippl::Index:
Collaboration graph

Classes

class  iterator
 

Public Member Functions

KOKKOS_INLINE_FUNCTION Index ()
 
KOKKOS_INLINE_FUNCTION Index (size_t n)
 
KOKKOS_INLINE_FUNCTION Index (int f, int l)
 
KOKKOS_INLINE_FUNCTION Index (int f, int l, int s)
 
KOKKOS_DEFAULTED_FUNCTION ~Index ()=default
 
KOKKOS_INLINE_FUNCTION int min () const noexcept
 
KOKKOS_INLINE_FUNCTION int max () const noexcept
 
KOKKOS_INLINE_FUNCTION size_t length () const noexcept
 
KOKKOS_INLINE_FUNCTION int stride () const noexcept
 
KOKKOS_INLINE_FUNCTION int first () const noexcept
 
KOKKOS_INLINE_FUNCTION int last () const noexcept
 
KOKKOS_INLINE_FUNCTION bool empty () const noexcept
 
KOKKOS_INLINE_FUNCTION Indexoperator+= (int)
 
KOKKOS_INLINE_FUNCTION Indexoperator-= (int)
 
KOKKOS_INLINE_FUNCTION Index intersect (const Index &) const
 
KOKKOS_INLINE_FUNCTION Index grow (int ncells) const
 
KOKKOS_INLINE_FUNCTION bool touches (const Index &a) const
 
KOKKOS_INLINE_FUNCTION bool contains (const Index &a) const
 
KOKKOS_INLINE_FUNCTION bool split (Index &l, Index &r) const
 
KOKKOS_INLINE_FUNCTION bool split (Index &l, Index &r, int i) const
 
KOKKOS_INLINE_FUNCTION bool split (Index &l, Index &r, double a) const
 
iterator begin ()
 
iterator end ()
 
KOKKOS_INLINE_FUNCTION bool operator< (const Index &r) const
 
KOKKOS_INLINE_FUNCTION bool operator== (const Index &r) const noexcept
 

Private Member Functions

KOKKOS_INLINE_FUNCTION Index reverse () const
 The number of elements. More...
 
KOKKOS_INLINE_FUNCTION Index (int m, int a, const Index &b)
 
KOKKOS_INLINE_FUNCTION Index (int f, int s, const Index *b)
 
KOKKOS_INLINE_FUNCTION Index general_intersect (const Index &) const
 

Private Attributes

int first_m
 
int stride_m
 First index element. More...
 
size_t length_m
 

Friends

KOKKOS_INLINE_FUNCTION friend Index operator+ (const Index &, int)
 
KOKKOS_INLINE_FUNCTION friend Index operator+ (int, const Index &)
 
KOKKOS_INLINE_FUNCTION friend Index operator- (const Index &, int)
 
KOKKOS_INLINE_FUNCTION friend Index operator- (int, const Index &)
 
KOKKOS_INLINE_FUNCTION friend Index operator- (const Index &)
 
KOKKOS_INLINE_FUNCTION friend Index operator* (const Index &, int)
 
KOKKOS_INLINE_FUNCTION friend Index operator* (int, const Index &)
 
KOKKOS_INLINE_FUNCTION friend Index operator/ (const Index &, int)
 

Detailed Description

Definition at line 40 of file Index.h.

Constructor & Destructor Documentation

◆ Index() [1/6]

KOKKOS_INLINE_FUNCTION ippl::Index::Index ( )

Instantiate Index without any range.

Definition at line 36 of file Index.hpp.

Referenced by general_intersect(), and split().

◆ Index() [2/6]

KOKKOS_INLINE_FUNCTION ippl::Index::Index ( size_t  n)

Instantiate Index with range [0, ..., n-1]

Parameters
nnumber of elements

Definition at line 41 of file Index.hpp.

◆ Index() [3/6]

KOKKOS_INLINE_FUNCTION ippl::Index::Index ( int  f,
int  l 
)

Instantiate Index with user-defined lower and upper bound [f, ..., l].

Parameters
ffirst element
llast element

Definition at line 46 of file Index.hpp.

References PAssert_GE.

◆ Index() [4/6]

KOKKOS_INLINE_FUNCTION ippl::Index::Index ( int  f,
int  l,
int  s 
)

First to Last using Step.

Parameters
ffirst element
llast element
sstep

Definition at line 53 of file Index.hpp.

References length_m, and PAssert_NE.

◆ ~Index()

KOKKOS_DEFAULTED_FUNCTION ippl::Index::~Index ( )
default

◆ Index() [5/6]

KOKKOS_INLINE_FUNCTION ippl::Index::Index ( int  m,
int  a,
const Index b 
)
private

Definition at line 66 of file Index.hpp.

◆ Index() [6/6]

KOKKOS_INLINE_FUNCTION ippl::Index::Index ( int  f,
int  s,
const Index b 
)
private

Definition at line 71 of file Index.hpp.

Member Function Documentation

◆ begin()

iterator ippl::Index::begin ( )
inline

Definition at line 219 of file Index.h.

References first_m, and stride_m.

◆ contains()

KOKKOS_INLINE_FUNCTION bool ippl::Index::contains ( const Index a) const

Definition at line 158 of file Index.hpp.

References max(), and min().

Here is the call graph for this function:

◆ empty()

KOKKOS_INLINE_FUNCTION bool ippl::Index::empty ( ) const
noexcept
Returns
true if empty, otherwise false

Definition at line 84 of file Index.hpp.

References length_m.

◆ end()

iterator ippl::Index::end ( )
inline

Definition at line 221 of file Index.h.

References first_m, length_m, and stride_m.

◆ first()

KOKKOS_INLINE_FUNCTION int ippl::Index::first ( ) const
noexcept
Returns
the first element

Definition at line 76 of file Index.hpp.

References first_m.

Referenced by ippl::do_intersect(), intersect(), and ippl::operator<<().

◆ general_intersect()

KOKKOS_INLINE_FUNCTION Index ippl::Index::general_intersect ( const Index that) const
private

Definition at line 308 of file Index.hpp.

References ippl::do_intersect(), first_m, Index(), intersect(), max(), min(), reverse(), and stride_m.

Referenced by intersect().

Here is the call graph for this function:

◆ grow()

KOKKOS_INLINE_FUNCTION Index ippl::Index::grow ( int  ncells) const

Definition at line 261 of file Index.hpp.

References first_m, length_m, and stride_m.

◆ intersect()

KOKKOS_INLINE_FUNCTION Index ippl::Index::intersect ( const Index rhs) const

Definition at line 244 of file Index.hpp.

References first(), first_m, general_intersect(), last(), length_m, stride(), and stride_m.

Referenced by general_intersect().

Here is the call graph for this function:

◆ last()

KOKKOS_INLINE_FUNCTION int ippl::Index::last ( ) const
noexcept
Returns
the last element

Definition at line 92 of file Index.hpp.

References first_m, length_m, and stride_m.

Referenced by intersect(), ippl::operator<<(), and reverse().

◆ length()

KOKKOS_INLINE_FUNCTION size_t ippl::Index::length ( ) const
noexcept
Returns
the number of elements

Definition at line 88 of file Index.hpp.

References length_m.

Referenced by ippl::do_intersect().

◆ max()

KOKKOS_INLINE_FUNCTION int ippl::Index::max ( ) const
noexcept
Returns
the largest element

Definition at line 100 of file Index.hpp.

References first_m, length_m, and stride_m.

Referenced by contains(), ippl::do_intersect(), general_intersect(), and touches().

◆ min()

KOKKOS_INLINE_FUNCTION int ippl::Index::min ( ) const
noexcept
Returns
the smallest element

Definition at line 96 of file Index.hpp.

References first_m, length_m, and stride_m.

Referenced by contains(), general_intersect(), and touches().

◆ operator+=()

KOKKOS_INLINE_FUNCTION Index & ippl::Index::operator+= ( int  off)

Definition at line 104 of file Index.hpp.

References first_m.

◆ operator-=()

KOKKOS_INLINE_FUNCTION Index & ippl::Index::operator-= ( int  off)

Definition at line 109 of file Index.hpp.

References first_m.

◆ operator<()

KOKKOS_INLINE_FUNCTION bool ippl::Index::operator< ( const Index r) const
inline

Definition at line 224 of file Index.h.

References first_m, length_m, and stride_m.

◆ operator==()

KOKKOS_INLINE_FUNCTION bool ippl::Index::operator== ( const Index r) const
inlinenoexcept

Definition at line 232 of file Index.h.

References first_m, length_m, and stride_m.

◆ reverse()

KOKKOS_INLINE_FUNCTION Index ippl::Index::reverse ( ) const
private

The number of elements.

Definition at line 146 of file Index.hpp.

References first_m, last(), length_m, and stride_m.

Referenced by general_intersect().

Here is the call graph for this function:

◆ split() [1/3]

KOKKOS_INLINE_FUNCTION bool ippl::Index::split ( Index l,
Index r 
) const

Definition at line 162 of file Index.hpp.

References first_m, Index(), length_m, PAssert_EQ, PAssert_GT, and stride_m.

Here is the call graph for this function:

◆ split() [2/3]

KOKKOS_INLINE_FUNCTION bool ippl::Index::split ( Index l,
Index r,
double  a 
) const

Definition at line 182 of file Index.hpp.

References first_m, Index(), length_m, PAssert_EQ, PAssert_GT, PAssert_LT, and stride_m.

Here is the call graph for this function:

◆ split() [3/3]

KOKKOS_INLINE_FUNCTION bool ippl::Index::split ( Index l,
Index r,
int  i 
) const

Definition at line 171 of file Index.hpp.

References first_m, Index(), length_m, PAssert_EQ, PAssert_GT, and stride_m.

Here is the call graph for this function:

◆ stride()

KOKKOS_INLINE_FUNCTION int ippl::Index::stride ( ) const
noexcept
Returns
the stride

Definition at line 80 of file Index.hpp.

References stride_m.

Referenced by ippl::do_intersect(), intersect(), and ippl::operator<<().

◆ touches()

KOKKOS_INLINE_FUNCTION bool ippl::Index::touches ( const Index a) const

Definition at line 154 of file Index.hpp.

References max(), and min().

Here is the call graph for this function:

Friends And Related Function Documentation

◆ operator* [1/2]

KOKKOS_INLINE_FUNCTION friend Index operator* ( const Index i,
int  m 
)
friend

Definition at line 134 of file Index.hpp.

◆ operator* [2/2]

KOKKOS_INLINE_FUNCTION friend Index operator* ( int  m,
const Index i 
)
friend

Definition at line 138 of file Index.hpp.

◆ operator+ [1/2]

KOKKOS_INLINE_FUNCTION friend Index operator+ ( const Index i,
int  off 
)
friend

Definition at line 114 of file Index.hpp.

◆ operator+ [2/2]

KOKKOS_INLINE_FUNCTION friend Index operator+ ( int  off,
const Index i 
)
friend

Definition at line 118 of file Index.hpp.

◆ operator- [1/3]

KOKKOS_INLINE_FUNCTION friend Index operator- ( const Index i)
friend

Definition at line 130 of file Index.hpp.

◆ operator- [2/3]

KOKKOS_INLINE_FUNCTION friend Index operator- ( const Index i,
int  off 
)
friend

Definition at line 122 of file Index.hpp.

◆ operator- [3/3]

KOKKOS_INLINE_FUNCTION friend Index operator- ( int  off,
const Index i 
)
friend

Definition at line 126 of file Index.hpp.

◆ operator/

KOKKOS_INLINE_FUNCTION friend Index operator/ ( const Index i,
int  d 
)
friend

Definition at line 142 of file Index.hpp.

Member Data Documentation

◆ first_m

int ippl::Index::first_m
private

◆ length_m

size_t ippl::Index::length_m
private

Definition at line 239 of file Index.h.

Referenced by empty(), end(), grow(), Index(), intersect(), last(), length(), max(), min(), operator<(), operator==(), reverse(), and split().

◆ stride_m

int ippl::Index::stride_m
private

First index element.

Definition at line 238 of file Index.h.

Referenced by begin(), end(), general_intersect(), grow(), intersect(), last(), max(), min(), operator<(), operator==(), reverse(), split(), and stride().


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