IPPL (Independent Parallel Particle Layer)
IPPL
Loading...
Searching...
No Matches
ippl::Index Class Reference

#include <Index.h>

Collaboration diagram for ippl::Index:

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.
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.
size_t length_m

Friends

KOKKOS_INLINE_FUNCTION friend Index operator+ (const Index &i, int off)
KOKKOS_INLINE_FUNCTION friend Index operator+ (int off, const Index &i)
KOKKOS_INLINE_FUNCTION friend Index operator- (const Index &i, int off)
KOKKOS_INLINE_FUNCTION friend Index operator- (int off, const Index &i)
KOKKOS_INLINE_FUNCTION friend Index operator- (const Index &i)
KOKKOS_INLINE_FUNCTION friend Index operator* (const Index &i, int m)
KOKKOS_INLINE_FUNCTION friend Index operator* (int m, const Index &i)
KOKKOS_INLINE_FUNCTION friend Index operator/ (const Index &i, int d)

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.

References first_m, length_m, and stride_m.

Referenced by contains(), general_intersect(), grow(), Index(), Index(), intersect(), operator*, operator*, operator+, operator+, operator+=(), operator-, operator-, operator-, operator-=(), operator/, operator<(), operator==(), reverse(), split(), split(), split(), touches(), and ~Index().

Here is the caller graph for this function:

◆ 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.

References first_m, length_m, and stride_m.

◆ 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 first_m, length_m, PAssert_GE, and stride_m.

◆ 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 first_m, length_m, PAssert_NE, and stride_m.

◆ ~Index()

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

References contains(), empty(), first(), grow(), Index(), intersect(), last(), length(), max(), split(), stride(), and touches().

Here is the call graph for this function:

◆ 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.

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

Here is the call graph for this function:

◆ 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.

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

Here is the call graph for this function:

Member Function Documentation

◆ begin()

iterator ippl::Index::begin ( )
inline

Definition at line 219 of file Index.h.

References begin(), first_m, and stride_m.

Referenced by begin().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ contains()

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

Definition at line 158 of file Index.hpp.

References Index(), max(), and min().

Referenced by ~Index().

Here is the call graph for this function:
Here is the caller 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.

Referenced by ~Index().

Here is the caller graph for this function:

◆ 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(), ippl::operator<<(), and ~Index().

Here is the caller graph for this function:

◆ 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:
Here is the caller 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, Index(), length_m, and stride_m.

Referenced by ~Index().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ 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(), Index(), last(), length_m, stride(), and stride_m.

Referenced by general_intersect(), and ~Index().

Here is the call graph for this function:
Here is the caller 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<<(), reverse(), and ~Index().

Here is the caller graph for this function:

◆ 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(), and ~Index().

Here is the caller graph for this function:

◆ 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(), touches(), and ~Index().

Here is the caller graph for this function:

◆ 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().

Here is the caller graph for this function:

◆ operator+=()

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

Definition at line 104 of file Index.hpp.

References first_m, and Index().

Here is the call graph for this function:

◆ operator-=()

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

Definition at line 109 of file Index.hpp.

References first_m, and Index().

Here is the call graph for this function:

◆ operator<()

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

Definition at line 224 of file Index.h.

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

Here is the call graph for this function:

◆ operator==()

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

Definition at line 232 of file Index.h.

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

Here is the call graph for this function:

◆ 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, Index(), last(), length_m, and stride_m.

Referenced by general_intersect().

Here is the call graph for this function:
Here is the caller 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.

Referenced by ~Index().

Here is the call graph for this function:
Here is the caller 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(), ippl::Index::iterator::iterator(), ippl::operator<<(), and ~Index().

Here is the caller graph for this function:

◆ touches()

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

Definition at line 154 of file Index.hpp.

References Index(), max(), and min().

Referenced by ~Index().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator* [1/2]

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

Definition at line 134 of file Index.hpp.

References Index().

◆ operator* [2/2]

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

Definition at line 138 of file Index.hpp.

References Index().

◆ operator+ [1/2]

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

Definition at line 114 of file Index.hpp.

References Index().

◆ operator+ [2/2]

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

Definition at line 118 of file Index.hpp.

References Index().

◆ operator- [1/3]

KOKKOS_INLINE_FUNCTION friend Index operator- ( const Index & i)
friend

Definition at line 130 of file Index.hpp.

References Index().

◆ operator- [2/3]

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

Definition at line 122 of file Index.hpp.

References Index().

◆ operator- [3/3]

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

Definition at line 126 of file Index.hpp.

References Index().

◆ operator/

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

Definition at line 142 of file Index.hpp.

References first_m, Index(), and stride_m.

Member Data Documentation

◆ first_m

◆ length_m

size_t ippl::Index::length_m
private

◆ stride_m

int ippl::Index::stride_m
private

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