Block-Structured AMR Software Framework
amrex::IntVectND< dim > Class Template Reference

#include <AMReX_IntVect.H>

Classes

struct  shift_hasher
 

Public Types

using hasher = shift_hasher
 
using value_type = int
 

Public Member Functions

constexpr IntVectND () noexcept
 Construct an IntVectND whose components are all zero. More...
 
template<class... Args, std::enable_if_t<(sizeof...(Args)+2==dim) &&IsConvertible_v< int, Args... >, int > = 0>
constexpr AMREX_GPU_HOST_DEVICE IntVectND (int i, int j, Args...ks) noexcept
 Construct an IntVectND given the specific values for its coordinates. The inputs for this constructor are N integers, where N is equal to the number of dimensions of the IntVectND. More...
 
constexpr AMREX_GPU_HOST_DEVICE IntVectND (int s) noexcept
 Construct an IntVectND whose components are all the same. More...
 
AMREX_GPU_HOST_DEVICE IntVectND (const int *a) noexcept
 Construct an IntVectND setting the coordinates to the corresponding values in the integer array a. More...
 
 IntVectND (const Vector< int > &a) noexcept
 Construct an IntVectND from an Vector<int>. It is an error if the Vector<int> doesn't have the same dimension as this IntVectND. More...
 
 IntVectND (const Array< int, dim > &a) noexcept
 Construct an IntVectND from an Array<int,dim>. More...
 
template<int N = dim, std::enable_if_t<(1<=N &&N<=3), int > = 0>
constexpr IntVectND (Dim3 const &a) noexcept
 
template<int N = dim, std::enable_if_t<(1<=N &&N<=3), int > = 0>
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Dim3 dim3 () const noexcept
 
template<int N = dim, std::enable_if_t<(1<=N &&N<=3), int > = 0>
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Dim3 dim3 ([[maybe_unused]] int fill_extra) const noexcept
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE int sum () const noexcept
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE int max () const noexcept
 maximum (no absolute values) value More...
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE int min () const noexcept
 minimum (no absolute values) value More...
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE int maxDir (bool a_doAbsValue) const noexcept
 
AMREX_GPU_HOST_DEVICE constexpr AMREX_FORCE_INLINE intoperator[] (int i) noexcept
 Returns a reference to the i'th coordinate of the IntVectND. More...
 
AMREX_GPU_HOST_DEVICE constexpr AMREX_FORCE_INLINE const intoperator[] (int i) const noexcept
 Returns the i'th coordinate of the IntVectND. More...
 
template<std::size_t i>
AMREX_GPU_HOST_DEVICE constexpr AMREX_FORCE_INLINE intget () noexcept
 Returns a reference to the i'th coordinate of the IntVectND. Used by structured bindings. More...
 
template<std::size_t i>
AMREX_GPU_HOST_DEVICE constexpr AMREX_FORCE_INLINE const intget () const noexcept
 Returns a reference to the i'th coordinate of the IntVectND. Used by structured bindings. More...
 
AMREX_GPU_HOST_DEVICE constexpr AMREX_FORCE_INLINE intbegin () noexcept
 Returns a pointer to the first element of the IntVectND. More...
 
AMREX_GPU_HOST_DEVICE constexpr AMREX_FORCE_INLINE const intbegin () const noexcept
 Returns a pointer to the first element of the IntVectND. More...
 
AMREX_GPU_HOST_DEVICE constexpr AMREX_FORCE_INLINE intend () noexcept
 Returns a pointer to the (last+1) element of the IntVectND. More...
 
AMREX_GPU_HOST_DEVICE constexpr AMREX_FORCE_INLINE const intend () const noexcept
 Returns a pointer to the (last+1) element of the IntVectND. More...
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE IntVectNDsetVal (int i, int val) noexcept
 Set i'th coordinate of IntVectND to val. More...
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE const intgetVect () const &noexcept
 Returns a const pointer to an array of coordinates of the IntVectND. Useful for arguments to FORTRAN calls. More...
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE intgetVect () &noexcept
 
AMREX_GPU_HOST_DEVICE intgetVect () &&=delete
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool operator== (int val) const noexcept
 Returns true if all components are equal to the argument val. More...
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool operator!= (int val) const noexcept
 Returns true if any component is not equal to the argument val. More...
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool operator== (const IntVectND< dim > &rhs) const noexcept
 Returns true if this is equivalent to rhs. More...
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool operator!= (const IntVectND< dim > &rhs) const noexcept
 Returns true if this is different from rhs. More...
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool operator< (const IntVectND< dim > &rhs) const noexcept
 Return true if this is lexicographically less than rhs. More...
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool operator<= (const IntVectND< dim > &rhs) const noexcept
 Return true if this is lexicographically less than or equal to rhs. More...
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool operator> (const IntVectND< dim > &rhs) const noexcept
 Return true if this is lexicographically greater than rhs. More...
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool operator>= (const IntVectND< dim > &rhs) const noexcept
 Return true if this is lexicographically greater than or equal to rhs. More...
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool allLT (const IntVectND< dim > &rhs) const noexcept
 Returns true if this is less than argument for all components. NOTE: This is NOT a strict weak ordering usable by STL sorting algorithms. More...
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool allLT (int rhs) const noexcept
 Returns true if this is less than argument for all components. More...
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool allLE (const IntVectND< dim > &rhs) const noexcept
 Returns true if this is less than or equal to argument for all components. NOTE: This is NOT a strict weak ordering usable by STL sorting algorithms. More...
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool allLE (int rhs) const noexcept
 Returns true if this is less than or equal to argument for all components. More...
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool allGT (const IntVectND< dim > &rhs) const noexcept
 Returns true if this is greater than argument for all components. NOTE: This is NOT a strict weak ordering usable by STL sorting algorithms. More...
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool allGT (int rhs) const noexcept
 Returns true if this is greater than argument for all components. More...
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool allGE (const IntVectND< dim > &rhs) const noexcept
 Returns true if this is greater than or equal to argument for all components. NOTE: This is NOT a strict weak ordering usable by STL sorting algorithms. More...
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool allGE (int rhs) const noexcept
 Returns true if this is greater than or equal to argument for all components. More...
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE IntVectND< dim > operator+ () const noexcept
 Unary plus – for completeness. More...
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE IntVectND< dim > operator- () const noexcept
 Unary Minus – negates all components. More...
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE IntVectND< dim > & operator+= (int s) noexcept
 Modifies IntVectND by addition of a scalar to each component. More...
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE IntVectND< dim > & operator+= (const IntVectND< dim > &p) noexcept
 Modifies IntVectND by component-wise addition with argument. More...
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE IntVectND< dim > & operator*= (int s) noexcept
 Modifies IntVectND by multiplication of a scalar to each component. More...
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE IntVectND< dim > & operator*= (const IntVectND< dim > &p) noexcept
 Modifies IntVectND by component-wise multiplication with argument. More...
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE IntVectND< dim > & operator/= (int s) noexcept
 Modifies IntVectND by division by a scalar to each component. More...
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE IntVectND< dim > & operator/= (const IntVectND< dim > &p) noexcept
 Modifies IntVectND by component-wise division with argument. More...
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE IntVectND< dim > & operator-= (int s) noexcept
 Modifies IntVectND by subtraction of a scalar to each component. More...
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE IntVectND< dim > & operator-= (const IntVectND< dim > &p) noexcept
 Modifies IntVectND by component-wise subtraction with argument. More...
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE IntVectND< dim > operator+ (const IntVectND< dim > &p) const noexcept
 Returns component-wise sum of IntVectND<and argument. More...
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE IntVectND< dim > operator+ (int s) const noexcept
 Return an IntVectND that is this IntVectND + s. More...
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE IntVectND< dim > operator- (const IntVectND< dim > &p) const noexcept
 Returns component-wise difference of IntVectND and argument. More...
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE IntVectND< dim > operator- (int s) const noexcept
 Return an IntVectND that is this IntVectND - s. More...
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE IntVectND< dim > operator* (const IntVectND< dim > &p) const noexcept
 Returns component-wise product of IntVectND and argument. More...
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE IntVectND< dim > operator* (int s) const noexcept
 Returns component-wise product of IntVectND and s. More...
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE IntVectND< dim > operator/ (const IntVectND< dim > &p) const noexcept
 Returns component-wise division of IntVectND by argument. More...
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE IntVectND< dim > operator/ (int s) const noexcept
 Returns component-wise division of IntVectND by s. More...
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE IntVectND< dim > & min (const IntVectND< dim > &p) noexcept
 Modifies IntVectND by taking component-wise min with argument. More...
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE IntVectND< dim > & max (const IntVectND< dim > &p) noexcept
 Modifies IntVectND by taking component-wise max with argument. More...
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE IntVectND< dim > & scale (int s) noexcept
 Modify IntVectND by multiplying each coordinate by s. More...
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE IntVectND< dim > & reflect (int ref_ix, int idir) noexcept
 Modify IntVectND by reflecting it in the plane defined by the index ref_ix and with normal in the direction of idir. More...
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE IntVectND< dim > & shift (int coord, int s) noexcept
 Modify IntVectND by adding s to given coordinate. More...
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE IntVectND< dim > & shift (const IntVectND< dim > &iv) noexcept
 Equivalent to shift(0,iv[0]).shift(1,iv[1]) ... More...
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE IntVectND< dim > & diagShift (int s) noexcept
 Modify IntVectND by adding s to each coordinate. More...
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE IntVectND< dim > & coarsen (const IntVectND< dim > &p) noexcept
 Modify IntVectND<dim> by component-wise integer projection. More...
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE IntVectND< dim > & coarsen (int p) noexcept
 Modify IntVectND<dim> by component-wise integer projection. More...
 
template<int new_dim>
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE IntVectND< new_dim > shrink () const noexcept
 Returns a new IntVectND of size new_dim and assigns the first new_dim values of this IntVectND to it. More...
 
template<int new_dim>
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE IntVectND< new_dim > expand (int fill_extra=0) const noexcept
 Returns a new IntVectND of size new_dim and assigns all values of this IntVectND to it and fill_extra to the remaining elements. More...
 
template<int new_dim>
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE IntVectND< new_dim > resize (int fill_extra=0) const noexcept
 Returns a new IntVectND of size new_dim by either shrinking or expanding this IntVectND. More...
 

Static Public Member Functions

AMREX_GPU_HOST_DEVICE static constexpr AMREX_FORCE_INLINE IntVectND< dim > TheZeroVector () noexcept
 This static member function returns a reference to a constant IntVectND object, all of whose dim arguments are set to zero (0). Figuratively, it is the zero vector in dim-dimensional space. It is provided as a convenient way to specify the zero vector. More...
 
AMREX_GPU_HOST_DEVICE static constexpr AMREX_FORCE_INLINE IntVectND< dim > TheUnitVector () noexcept
 This static member function returns a reference to a constant IntVectND object, all of whose dim arguments are set to one (1). Figuratively, it is the unit vector in dim-dimensional space. It is provided as a convenient way to specify the unit vector. More...
 
AMREX_GPU_HOST_DEVICE static constexpr AMREX_FORCE_INLINE IntVectND< dim > TheDimensionVector (int d) noexcept
 This static member function returns a reference to a constant IntVectND object, all of whose dim arguments are set to zero except that the d-direction is set to one. More...
 
AMREX_GPU_HOST_DEVICE static constexpr AMREX_FORCE_INLINE IntVectND< dim > TheNodeVector () noexcept
 This static member function returns a reference to a constant IntVectND object, all of whose dim arguments are set to IndexType::NODE. It is provided as a convenience to our users when defining Boxes. More...
 
AMREX_GPU_HOST_DEVICE static constexpr AMREX_FORCE_INLINE IntVectND< dim > TheCellVector () noexcept
 This static member function returns a reference to a constant IntVectND object, all of whose dim arguments are set to IndexType::CELL. It is provided as a convenience to our users when defining Boxes. More...
 
AMREX_GPU_HOST_DEVICE static constexpr AMREX_FORCE_INLINE IntVectND< dim > TheMaxVector () noexcept
 
AMREX_GPU_HOST_DEVICE static constexpr AMREX_FORCE_INLINE IntVectND< dim > TheMinVector () noexcept
 
AMREX_GPU_HOST_DEVICE static constexpr AMREX_FORCE_INLINE std::size_t size () noexcept
 
AMREX_GPU_HOST_DEVICE static constexpr AMREX_FORCE_INLINE int isize () noexcept
 

Static Public Attributes

static const IntVectND< dim > Zero {0}
 
static const IntVectND< dim > Unit {1}
 

Private Attributes

int vect [dim] = {}
 

Detailed Description

template<int dim>
class amrex::IntVectND< dim >

An Integer Vector in dim-Dimensional Space

The class IntVectND is an implementation of an integer vector in a dim-dimensional space. It represents a point in a discrete space. IntVectND values are accessed using the operator[] function, as for a normal C++ array. In addition, the basic arithmetic operators have been overloaded to implement scaling and translation operations.

Member Typedef Documentation

◆ hasher

template<int dim>
using amrex::IntVectND< dim >::hasher = shift_hasher

◆ value_type

template<int dim>
using amrex::IntVectND< dim >::value_type = int

Constructor & Destructor Documentation

◆ IntVectND() [1/7]

template<int dim>
constexpr amrex::IntVectND< dim >::IntVectND ( )
inlineconstexprnoexcept

Construct an IntVectND whose components are all zero.

◆ IntVectND() [2/7]

template<int dim>
template<class... Args, std::enable_if_t<(sizeof...(Args)+2==dim) &&IsConvertible_v< int, Args... >, int > = 0>
constexpr AMREX_GPU_HOST_DEVICE amrex::IntVectND< dim >::IntVectND ( int  i,
int  j,
Args...  ks 
)
inlineconstexprnoexcept

Construct an IntVectND given the specific values for its coordinates. The inputs for this constructor are N integers, where N is equal to the number of dimensions of the IntVectND.

◆ IntVectND() [3/7]

template<int dim>
constexpr AMREX_GPU_HOST_DEVICE amrex::IntVectND< dim >::IntVectND ( int  s)
inlineexplicitconstexprnoexcept

Construct an IntVectND whose components are all the same.

◆ IntVectND() [4/7]

template<int dim>
AMREX_GPU_HOST_DEVICE amrex::IntVectND< dim >::IntVectND ( const int a)
inlineexplicitnoexcept

Construct an IntVectND setting the coordinates to the corresponding values in the integer array a.

◆ IntVectND() [5/7]

template<int dim>
amrex::IntVectND< dim >::IntVectND ( const Vector< int > &  a)
inlineexplicitnoexcept

Construct an IntVectND from an Vector<int>. It is an error if the Vector<int> doesn't have the same dimension as this IntVectND.

◆ IntVectND() [6/7]

template<int dim>
amrex::IntVectND< dim >::IntVectND ( const Array< int, dim > &  a)
inlineexplicitnoexcept

Construct an IntVectND from an Array<int,dim>.

◆ IntVectND() [7/7]

template<int dim>
template<int N = dim, std::enable_if_t<(1<=N &&N<=3), int > = 0>
constexpr amrex::IntVectND< dim >::IntVectND ( Dim3 const &  a)
inlineexplicitconstexprnoexcept

Member Function Documentation

◆ allGE() [1/2]

template<int dim>
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool amrex::IntVectND< dim >::allGE ( const IntVectND< dim > &  rhs) const
inlinenoexcept

Returns true if this is greater than or equal to argument for all components. NOTE: This is NOT a strict weak ordering usable by STL sorting algorithms.

◆ allGE() [2/2]

template<int dim>
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool amrex::IntVectND< dim >::allGE ( int  rhs) const
inlinenoexcept

Returns true if this is greater than or equal to argument for all components.

◆ allGT() [1/2]

template<int dim>
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool amrex::IntVectND< dim >::allGT ( const IntVectND< dim > &  rhs) const
inlinenoexcept

Returns true if this is greater than argument for all components. NOTE: This is NOT a strict weak ordering usable by STL sorting algorithms.

◆ allGT() [2/2]

template<int dim>
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool amrex::IntVectND< dim >::allGT ( int  rhs) const
inlinenoexcept

Returns true if this is greater than argument for all components.

◆ allLE() [1/2]

template<int dim>
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool amrex::IntVectND< dim >::allLE ( const IntVectND< dim > &  rhs) const
inlinenoexcept

Returns true if this is less than or equal to argument for all components. NOTE: This is NOT a strict weak ordering usable by STL sorting algorithms.

◆ allLE() [2/2]

template<int dim>
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool amrex::IntVectND< dim >::allLE ( int  rhs) const
inlinenoexcept

Returns true if this is less than or equal to argument for all components.

◆ allLT() [1/2]

template<int dim>
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool amrex::IntVectND< dim >::allLT ( const IntVectND< dim > &  rhs) const
inlinenoexcept

Returns true if this is less than argument for all components. NOTE: This is NOT a strict weak ordering usable by STL sorting algorithms.

◆ allLT() [2/2]

template<int dim>
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool amrex::IntVectND< dim >::allLT ( int  rhs) const
inlinenoexcept

Returns true if this is less than argument for all components.

◆ begin() [1/2]

template<int dim>
AMREX_GPU_HOST_DEVICE constexpr AMREX_FORCE_INLINE const int* amrex::IntVectND< dim >::begin ( ) const
inlineconstexprnoexcept

Returns a pointer to the first element of the IntVectND.

◆ begin() [2/2]

template<int dim>
AMREX_GPU_HOST_DEVICE constexpr AMREX_FORCE_INLINE int* amrex::IntVectND< dim >::begin ( )
inlineconstexprnoexcept

Returns a pointer to the first element of the IntVectND.

◆ coarsen() [1/2]

template<int dim>
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE IntVectND< dim > & amrex::IntVectND< dim >::coarsen ( const IntVectND< dim > &  p)
noexcept

Modify IntVectND<dim> by component-wise integer projection.

◆ coarsen() [2/2]

template<int dim>
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE IntVectND< dim > & amrex::IntVectND< dim >::coarsen ( int  p)
noexcept

Modify IntVectND<dim> by component-wise integer projection.

◆ diagShift()

template<int dim>
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE IntVectND<dim>& amrex::IntVectND< dim >::diagShift ( int  s)
inlinenoexcept

Modify IntVectND by adding s to each coordinate.

◆ dim3() [1/2]

template<int dim>
template<int N = dim, std::enable_if_t<(1<=N &&N<=3), int > = 0>
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Dim3 amrex::IntVectND< dim >::dim3 ( ) const
inlinenoexcept

◆ dim3() [2/2]

template<int dim>
template<int N = dim, std::enable_if_t<(1<=N &&N<=3), int > = 0>
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Dim3 amrex::IntVectND< dim >::dim3 ( [[maybe_unused] ] int  fill_extra) const
inlinenoexcept

◆ end() [1/2]

template<int dim>
AMREX_GPU_HOST_DEVICE constexpr AMREX_FORCE_INLINE const int* amrex::IntVectND< dim >::end ( ) const
inlineconstexprnoexcept

Returns a pointer to the (last+1) element of the IntVectND.

◆ end() [2/2]

template<int dim>
AMREX_GPU_HOST_DEVICE constexpr AMREX_FORCE_INLINE int* amrex::IntVectND< dim >::end ( )
inlineconstexprnoexcept

Returns a pointer to the (last+1) element of the IntVectND.

◆ expand()

template<int dim>
template<int new_dim>
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE IntVectND<new_dim> amrex::IntVectND< dim >::expand ( int  fill_extra = 0) const
inlinenoexcept

Returns a new IntVectND of size new_dim and assigns all values of this IntVectND to it and fill_extra to the remaining elements.

◆ get() [1/2]

template<int dim>
template<std::size_t i>
AMREX_GPU_HOST_DEVICE constexpr AMREX_FORCE_INLINE const int& amrex::IntVectND< dim >::get ( ) const
inlineconstexprnoexcept

Returns a reference to the i'th coordinate of the IntVectND. Used by structured bindings.

◆ get() [2/2]

template<int dim>
template<std::size_t i>
AMREX_GPU_HOST_DEVICE constexpr AMREX_FORCE_INLINE int& amrex::IntVectND< dim >::get ( )
inlineconstexprnoexcept

Returns a reference to the i'th coordinate of the IntVectND. Used by structured bindings.

◆ getVect() [1/3]

template<int dim>
AMREX_GPU_HOST_DEVICE int* amrex::IntVectND< dim >::getVect ( ) &&
delete

◆ getVect() [2/3]

template<int dim>
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE int* amrex::IntVectND< dim >::getVect ( ) &
inlinenoexcept

◆ getVect() [3/3]

template<int dim>
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE const int* amrex::IntVectND< dim >::getVect ( ) const &
inlinenoexcept

Returns a const pointer to an array of coordinates of the IntVectND. Useful for arguments to FORTRAN calls.

◆ isize()

template<int dim>
AMREX_GPU_HOST_DEVICE static constexpr AMREX_FORCE_INLINE int amrex::IntVectND< dim >::isize ( )
inlinestaticconstexprnoexcept

◆ max() [1/2]

template<int dim>
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE int amrex::IntVectND< dim >::max ( ) const
inlinenoexcept

maximum (no absolute values) value

◆ max() [2/2]

template<int dim>
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE IntVectND<dim>& amrex::IntVectND< dim >::max ( const IntVectND< dim > &  p)
inlinenoexcept

Modifies IntVectND by taking component-wise max with argument.

◆ maxDir()

template<int dim>
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE int amrex::IntVectND< dim >::maxDir ( bool  a_doAbsValue) const
noexcept

◆ min() [1/2]

template<int dim>
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE int amrex::IntVectND< dim >::min ( ) const
inlinenoexcept

minimum (no absolute values) value

◆ min() [2/2]

template<int dim>
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE IntVectND<dim>& amrex::IntVectND< dim >::min ( const IntVectND< dim > &  p)
inlinenoexcept

Modifies IntVectND by taking component-wise min with argument.

◆ operator!=() [1/2]

template<int dim>
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool amrex::IntVectND< dim >::operator!= ( const IntVectND< dim > &  rhs) const
inlinenoexcept

Returns true if this is different from rhs.

◆ operator!=() [2/2]

template<int dim>
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool amrex::IntVectND< dim >::operator!= ( int  val) const
inlinenoexcept

Returns true if any component is not equal to the argument val.

◆ operator*() [1/2]

template<int dim>
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE IntVectND<dim> amrex::IntVectND< dim >::operator* ( const IntVectND< dim > &  p) const
inlinenoexcept

Returns component-wise product of IntVectND and argument.

◆ operator*() [2/2]

template<int dim>
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE IntVectND<dim> amrex::IntVectND< dim >::operator* ( int  s) const
inlinenoexcept

Returns component-wise product of IntVectND and s.

◆ operator*=() [1/2]

template<int dim>
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE IntVectND<dim>& amrex::IntVectND< dim >::operator*= ( const IntVectND< dim > &  p)
inlinenoexcept

Modifies IntVectND by component-wise multiplication with argument.

◆ operator*=() [2/2]

template<int dim>
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE IntVectND<dim>& amrex::IntVectND< dim >::operator*= ( int  s)
inlinenoexcept

Modifies IntVectND by multiplication of a scalar to each component.

◆ operator+() [1/3]

template<int dim>
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE IntVectND<dim> amrex::IntVectND< dim >::operator+ ( ) const
inlinenoexcept

Unary plus – for completeness.

◆ operator+() [2/3]

template<int dim>
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE IntVectND<dim> amrex::IntVectND< dim >::operator+ ( const IntVectND< dim > &  p) const
inlinenoexcept

Returns component-wise sum of IntVectND<and argument.

◆ operator+() [3/3]

template<int dim>
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE IntVectND<dim> amrex::IntVectND< dim >::operator+ ( int  s) const
inlinenoexcept

Return an IntVectND that is this IntVectND + s.

◆ operator+=() [1/2]

template<int dim>
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE IntVectND<dim>& amrex::IntVectND< dim >::operator+= ( const IntVectND< dim > &  p)
inlinenoexcept

Modifies IntVectND by component-wise addition with argument.

◆ operator+=() [2/2]

template<int dim>
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE IntVectND<dim>& amrex::IntVectND< dim >::operator+= ( int  s)
inlinenoexcept

Modifies IntVectND by addition of a scalar to each component.

◆ operator-() [1/3]

template<int dim>
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE IntVectND<dim> amrex::IntVectND< dim >::operator- ( ) const
inlinenoexcept

Unary Minus – negates all components.

◆ operator-() [2/3]

template<int dim>
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE IntVectND<dim> amrex::IntVectND< dim >::operator- ( const IntVectND< dim > &  p) const
inlinenoexcept

Returns component-wise difference of IntVectND and argument.

◆ operator-() [3/3]

template<int dim>
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE IntVectND<dim> amrex::IntVectND< dim >::operator- ( int  s) const
inlinenoexcept

Return an IntVectND that is this IntVectND - s.

◆ operator-=() [1/2]

template<int dim>
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE IntVectND<dim>& amrex::IntVectND< dim >::operator-= ( const IntVectND< dim > &  p)
inlinenoexcept

Modifies IntVectND by component-wise subtraction with argument.

◆ operator-=() [2/2]

template<int dim>
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE IntVectND<dim>& amrex::IntVectND< dim >::operator-= ( int  s)
inlinenoexcept

Modifies IntVectND by subtraction of a scalar to each component.

◆ operator/() [1/2]

template<int dim>
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE IntVectND<dim> amrex::IntVectND< dim >::operator/ ( const IntVectND< dim > &  p) const
inlinenoexcept

Returns component-wise division of IntVectND by argument.

◆ operator/() [2/2]

template<int dim>
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE IntVectND<dim> amrex::IntVectND< dim >::operator/ ( int  s) const
inlinenoexcept

Returns component-wise division of IntVectND by s.

◆ operator/=() [1/2]

template<int dim>
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE IntVectND<dim>& amrex::IntVectND< dim >::operator/= ( const IntVectND< dim > &  p)
inlinenoexcept

Modifies IntVectND by component-wise division with argument.

◆ operator/=() [2/2]

template<int dim>
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE IntVectND<dim>& amrex::IntVectND< dim >::operator/= ( int  s)
inlinenoexcept

Modifies IntVectND by division by a scalar to each component.

◆ operator<()

template<int dim>
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool amrex::IntVectND< dim >::operator< ( const IntVectND< dim > &  rhs) const
inlinenoexcept

Return true if this is lexicographically less than rhs.

◆ operator<=()

template<int dim>
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool amrex::IntVectND< dim >::operator<= ( const IntVectND< dim > &  rhs) const
inlinenoexcept

Return true if this is lexicographically less than or equal to rhs.

◆ operator==() [1/2]

template<int dim>
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool amrex::IntVectND< dim >::operator== ( const IntVectND< dim > &  rhs) const
inlinenoexcept

Returns true if this is equivalent to rhs.

◆ operator==() [2/2]

template<int dim>
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool amrex::IntVectND< dim >::operator== ( int  val) const
inlinenoexcept

Returns true if all components are equal to the argument val.

◆ operator>()

template<int dim>
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool amrex::IntVectND< dim >::operator> ( const IntVectND< dim > &  rhs) const
inlinenoexcept

Return true if this is lexicographically greater than rhs.

◆ operator>=()

template<int dim>
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool amrex::IntVectND< dim >::operator>= ( const IntVectND< dim > &  rhs) const
inlinenoexcept

Return true if this is lexicographically greater than or equal to rhs.

◆ operator[]() [1/2]

template<int dim>
AMREX_GPU_HOST_DEVICE constexpr AMREX_FORCE_INLINE const int& amrex::IntVectND< dim >::operator[] ( int  i) const
inlineconstexprnoexcept

Returns the i'th coordinate of the IntVectND.

◆ operator[]() [2/2]

template<int dim>
AMREX_GPU_HOST_DEVICE constexpr AMREX_FORCE_INLINE int& amrex::IntVectND< dim >::operator[] ( int  i)
inlineconstexprnoexcept

Returns a reference to the i'th coordinate of the IntVectND.

◆ reflect()

template<int dim>
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE IntVectND<dim>& amrex::IntVectND< dim >::reflect ( int  ref_ix,
int  idir 
)
inlinenoexcept

Modify IntVectND by reflecting it in the plane defined by the index ref_ix and with normal in the direction of idir.

◆ resize()

template<int dim>
template<int new_dim>
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE IntVectND<new_dim> amrex::IntVectND< dim >::resize ( int  fill_extra = 0) const
inlinenoexcept

Returns a new IntVectND of size new_dim by either shrinking or expanding this IntVectND.

◆ scale()

template<int dim>
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE IntVectND<dim>& amrex::IntVectND< dim >::scale ( int  s)
inlinenoexcept

Modify IntVectND by multiplying each coordinate by s.

◆ setVal()

template<int dim>
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE IntVectND& amrex::IntVectND< dim >::setVal ( int  i,
int  val 
)
inlinenoexcept

Set i'th coordinate of IntVectND to val.

◆ shift() [1/2]

template<int dim>
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE IntVectND<dim>& amrex::IntVectND< dim >::shift ( const IntVectND< dim > &  iv)
inlinenoexcept

Equivalent to shift(0,iv[0]).shift(1,iv[1]) ...

◆ shift() [2/2]

template<int dim>
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE IntVectND<dim>& amrex::IntVectND< dim >::shift ( int  coord,
int  s 
)
inlinenoexcept

Modify IntVectND by adding s to given coordinate.

◆ shrink()

template<int dim>
template<int new_dim>
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE IntVectND<new_dim> amrex::IntVectND< dim >::shrink ( ) const
inlinenoexcept

Returns a new IntVectND of size new_dim and assigns the first new_dim values of this IntVectND to it.

◆ size()

template<int dim>
AMREX_GPU_HOST_DEVICE static constexpr AMREX_FORCE_INLINE std::size_t amrex::IntVectND< dim >::size ( )
inlinestaticconstexprnoexcept

◆ sum()

template<int dim>
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE int amrex::IntVectND< dim >::sum ( ) const
inlinenoexcept

Sum of all components of this IntVectND.

◆ TheCellVector()

template<int dim>
AMREX_GPU_HOST_DEVICE static constexpr AMREX_FORCE_INLINE IntVectND<dim> amrex::IntVectND< dim >::TheCellVector ( )
inlinestaticconstexprnoexcept

This static member function returns a reference to a constant IntVectND object, all of whose dim arguments are set to IndexType::CELL. It is provided as a convenience to our users when defining Boxes.

◆ TheDimensionVector()

template<int dim>
AMREX_GPU_HOST_DEVICE static constexpr AMREX_FORCE_INLINE IntVectND<dim> amrex::IntVectND< dim >::TheDimensionVector ( int  d)
inlinestaticconstexprnoexcept

This static member function returns a reference to a constant IntVectND object, all of whose dim arguments are set to zero except that the d-direction is set to one.

◆ TheMaxVector()

template<int dim>
AMREX_GPU_HOST_DEVICE static constexpr AMREX_FORCE_INLINE IntVectND<dim> amrex::IntVectND< dim >::TheMaxVector ( )
inlinestaticconstexprnoexcept

◆ TheMinVector()

template<int dim>
AMREX_GPU_HOST_DEVICE static constexpr AMREX_FORCE_INLINE IntVectND<dim> amrex::IntVectND< dim >::TheMinVector ( )
inlinestaticconstexprnoexcept

◆ TheNodeVector()

template<int dim>
AMREX_GPU_HOST_DEVICE static constexpr AMREX_FORCE_INLINE IntVectND<dim> amrex::IntVectND< dim >::TheNodeVector ( )
inlinestaticconstexprnoexcept

This static member function returns a reference to a constant IntVectND object, all of whose dim arguments are set to IndexType::NODE. It is provided as a convenience to our users when defining Boxes.

◆ TheUnitVector()

template<int dim>
AMREX_GPU_HOST_DEVICE static constexpr AMREX_FORCE_INLINE IntVectND<dim> amrex::IntVectND< dim >::TheUnitVector ( )
inlinestaticconstexprnoexcept

This static member function returns a reference to a constant IntVectND object, all of whose dim arguments are set to one (1). Figuratively, it is the unit vector in dim-dimensional space. It is provided as a convenient way to specify the unit vector.

◆ TheZeroVector()

template<int dim>
AMREX_GPU_HOST_DEVICE static constexpr AMREX_FORCE_INLINE IntVectND<dim> amrex::IntVectND< dim >::TheZeroVector ( )
inlinestaticconstexprnoexcept

This static member function returns a reference to a constant IntVectND object, all of whose dim arguments are set to zero (0). Figuratively, it is the zero vector in dim-dimensional space. It is provided as a convenient way to specify the zero vector.

Member Data Documentation

◆ Unit

template<int dim>
constexpr const IntVectND< dim > amrex::IntVectND< dim >::Unit {1}
inlinestaticconstexpr

This is an IntVect all of whose components are equal to one.

◆ vect

template<int dim>
int amrex::IntVectND< dim >::vect[dim] = {}
private

◆ Zero

template<int dim>
constexpr const IntVectND< dim > amrex::IntVectND< dim >::Zero {0}
inlinestaticconstexpr

This is an IntVect all of whose components are equal to zero.


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