![]() |
Block-Structured AMR Software Framework
|
An Integer Vector in dim-Dimensional Space. More...
#include <AMReX_IntVect.H>
Classes | |
| struct | shift_hasher |
| Hash function for IntVectND. More... | |
Public Types | |
| using | hasher = shift_hasher |
| using | value_type = int |
Public Member Functions | |
| constexpr | IntVectND () noexcept |
| Construct an IntVectND whose components are all zero. | |
| template<class... Args, std::enable_if_t<(sizeof...(Args)+2==dim) &&IsConvertible_v< int, Args... >, int > = 0> | |
| __host__ __device__ constexpr | 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. | |
| __host__ __device__ constexpr | IntVectND (int s) noexcept |
| Construct an IntVectND whose components are all the same. | |
| __host__ __device__ | IntVectND (const int *a) noexcept |
| Construct an IntVectND setting the coordinates to the corresponding values in the integer array a. | |
| 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. | |
| constexpr | IntVectND (const Array< int, dim > &a) noexcept |
| Construct an IntVectND from an Array<int,dim>. | |
| 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> | |
| __host__ __device__ constexpr Dim3 | dim3 () const noexcept |
| template<int N = dim, std::enable_if_t<(1<=N &&N<=3), int > = 0> | |
| __host__ __device__ constexpr Dim3 | dim3 (int fill_extra) const noexcept |
| template<typename T = int> | |
| __host__ __device__ constexpr Array< T, dim > | toArray () const noexcept |
| __host__ __device__ constexpr int | sum () const noexcept |
| __host__ __device__ constexpr int | max () const noexcept |
| maximum (no absolute values) value | |
| __host__ __device__ constexpr int | min () const noexcept |
| minimum (no absolute values) value | |
| __host__ __device__ int | maxDir (bool a_doAbsValue) const noexcept |
| __host__ __device__ constexpr int & | operator[] (int i) noexcept |
| Returns a reference to the i'th coordinate of the IntVectND. | |
| __host__ __device__ constexpr const int & | operator[] (int i) const noexcept |
| Returns the i'th coordinate of the IntVectND. | |
| template<std::size_t i> | |
| __host__ __device__ constexpr int & | get () noexcept |
| Returns a reference to the i'th coordinate of the IntVectND. Used by structured bindings. | |
| template<std::size_t i> | |
| __host__ __device__ constexpr const int & | get () const noexcept |
| Returns a reference to the i'th coordinate of the IntVectND. Used by structured bindings. | |
| __host__ __device__ constexpr int * | begin () noexcept |
| Returns a pointer to the first element of the IntVectND. | |
| __host__ __device__ constexpr const int * | begin () const noexcept |
| Returns a pointer to the first element of the IntVectND. | |
| __host__ __device__ constexpr int * | end () noexcept |
| Returns a pointer to the (last+1) element of the IntVectND. | |
| __host__ __device__ constexpr const int * | end () const noexcept |
| Returns a pointer to the (last+1) element of the IntVectND. | |
| __host__ __device__ IntVectND & | setVal (int i, int val) noexcept |
| Set i'th coordinate of IntVectND to val. | |
| __host__ __device__ const int * | getVect () const &noexcept |
| Returns a const pointer to an array of coordinates of the IntVectND. Useful for arguments to FORTRAN calls. | |
| __host__ __device__ int * | getVect () &noexcept |
| __host__ __device__ int * | getVect () &&=delete |
| __host__ __device__ constexpr bool | operator== (int val) const noexcept |
| Returns true if all components are equal to the argument val. | |
| __host__ __device__ constexpr bool | operator!= (int val) const noexcept |
| Returns true if any component is not equal to the argument val. | |
| __host__ __device__ constexpr bool | operator== (const IntVectND< dim > &rhs) const noexcept |
| Returns true if this is equivalent to rhs. | |
| __host__ __device__ constexpr bool | operator!= (const IntVectND< dim > &rhs) const noexcept |
| Returns true if this is different from rhs. | |
| __host__ __device__ constexpr bool | operator< (const IntVectND< dim > &rhs) const noexcept |
| Return true if this is lexicographically less than rhs. | |
| __host__ __device__ constexpr bool | operator<= (const IntVectND< dim > &rhs) const noexcept |
| Return true if this is lexicographically less than or equal to rhs. | |
| __host__ __device__ constexpr bool | operator> (const IntVectND< dim > &rhs) const noexcept |
| Return true if this is lexicographically greater than rhs. | |
| __host__ __device__ constexpr bool | operator>= (const IntVectND< dim > &rhs) const noexcept |
| Return true if this is lexicographically greater than or equal to rhs. | |
| __host__ __device__ constexpr 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. | |
| __host__ __device__ constexpr bool | allLT (int rhs) const noexcept |
| Returns true if this is less than argument for all components. | |
| __host__ __device__ constexpr 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. | |
| __host__ __device__ constexpr bool | allLE (int rhs) const noexcept |
| Returns true if this is less than or equal to argument for all components. | |
| __host__ __device__ constexpr 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. | |
| __host__ __device__ constexpr bool | allGT (int rhs) const noexcept |
| Returns true if this is greater than argument for all components. | |
| __host__ __device__ constexpr 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. | |
| __host__ __device__ constexpr bool | allGE (int rhs) const noexcept |
| Returns true if this is greater than or equal to argument for all components. | |
| __host__ __device__ constexpr IntVectND< dim > | operator+ () const noexcept |
| Unary plus – for completeness. | |
| __host__ __device__ constexpr IntVectND< dim > | operator- () const noexcept |
| Unary Minus – negates all components. | |
| __host__ __device__ constexpr IntVectND< dim > & | operator+= (int s) noexcept |
| Modifies IntVectND by addition of a scalar to each component. | |
| __host__ __device__ constexpr IntVectND< dim > & | operator+= (const IntVectND< dim > &p) noexcept |
| Modifies IntVectND by component-wise addition with argument. | |
| __host__ __device__ constexpr IntVectND< dim > & | operator*= (int s) noexcept |
| Modifies IntVectND by multiplication of a scalar to each component. | |
| __host__ __device__ constexpr IntVectND< dim > & | operator*= (const IntVectND< dim > &p) noexcept |
| Modifies IntVectND by component-wise multiplication with argument. | |
| __host__ __device__ constexpr IntVectND< dim > & | operator/= (int s) noexcept |
| Modifies IntVectND by division by a scalar to each component. | |
| __host__ __device__ constexpr IntVectND< dim > & | operator/= (const IntVectND< dim > &p) noexcept |
| Modifies IntVectND by component-wise division with argument. | |
| __host__ __device__ constexpr IntVectND< dim > & | operator-= (int s) noexcept |
| Modifies IntVectND by subtraction of a scalar to each component. | |
| __host__ __device__ constexpr IntVectND< dim > & | operator-= (const IntVectND< dim > &p) noexcept |
| Modifies IntVectND by component-wise subtraction with argument. | |
| __host__ __device__ constexpr IntVectND< dim > | operator+ (const IntVectND< dim > &p) const noexcept |
| Returns component-wise sum of IntVectND. | |
| __host__ __device__ constexpr IntVectND< dim > | operator+ (int s) const noexcept |
| Return an IntVectND that is this IntVectND + s. | |
| __host__ __device__ constexpr IntVectND< dim > | operator- (const IntVectND< dim > &p) const noexcept |
| Returns component-wise difference of IntVectND and argument. | |
| __host__ __device__ constexpr IntVectND< dim > | operator- (int s) const noexcept |
| Return an IntVectND that is this IntVectND - s. | |
| __host__ __device__ constexpr IntVectND< dim > | operator* (const IntVectND< dim > &p) const noexcept |
| Returns component-wise product of IntVectND and argument. | |
| __host__ __device__ constexpr IntVectND< dim > | operator* (int s) const noexcept |
| Returns component-wise product of IntVectND and s. | |
| __host__ __device__ constexpr IntVectND< dim > | operator/ (const IntVectND< dim > &p) const noexcept |
| Returns component-wise division of IntVectND by argument. | |
| __host__ __device__ constexpr IntVectND< dim > | operator/ (int s) const noexcept |
| Returns component-wise division of IntVectND by s. | |
| __host__ __device__ constexpr IntVectND< dim > & | min (const IntVectND< dim > &p) noexcept |
| Modifies IntVectND by taking component-wise min with argument. | |
| __host__ __device__ constexpr IntVectND< dim > & | max (const IntVectND< dim > &p) noexcept |
| Modifies IntVectND by taking component-wise max with argument. | |
| __host__ __device__ constexpr IntVectND< dim > & | scale (int s) noexcept |
| Modify IntVectND by multiplying each coordinate by s. | |
| __host__ __device__ constexpr 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. | |
| __host__ __device__ constexpr IntVectND< dim > & | shift (int coord, int s) noexcept |
| Modify IntVectND by adding s to given coordinate. | |
| __host__ __device__ constexpr IntVectND< dim > & | shift (const IntVectND< dim > &iv) noexcept |
| Equivalent to shift(0,iv[0]).shift(1,iv[1]) ... | |
| __host__ __device__ constexpr IntVectND< dim > & | diagShift (int s) noexcept |
| Modify IntVectND by adding s to each coordinate. | |
| __host__ __device__ IntVectND< dim > & | coarsen (const IntVectND< dim > &p) noexcept |
| Modify IntVectND<dim> by component-wise integer projection. | |
| __host__ __device__ IntVectND< dim > & | coarsen (int p) noexcept |
| Modify IntVectND<dim> by component-wise integer projection. | |
| template<int new_dim> | |
| __host__ __device__ constexpr 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. | |
| template<int new_dim> | |
| __host__ __device__ constexpr 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. | |
| template<int new_dim> | |
| __host__ __device__ constexpr 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. | |
Static Public Member Functions | |
| __host__ static __device__ constexpr 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. | |
| __host__ static __device__ constexpr 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. | |
| __host__ static __device__ constexpr 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. | |
| __host__ static __device__ constexpr 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. | |
| __host__ static __device__ constexpr 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. | |
| __host__ static __device__ constexpr IntVectND< dim > | TheMaxVector () noexcept |
| __host__ static __device__ constexpr IntVectND< dim > | TheMinVector () noexcept |
| __host__ static __device__ constexpr std::size_t | size () noexcept |
| __host__ static __device__ constexpr int | isize () noexcept |
Public Attributes | |
| int | vect [dim] = {} |
Static Public Attributes | |
| static const IntVectND< dim > | Zero {0} |
| static const IntVectND< dim > | Unit {1} |
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.
| using amrex::IntVectND< dim >::hasher = shift_hasher |
| using amrex::IntVectND< dim >::value_type = int |
|
inlineconstexprnoexcept |
Construct an IntVectND whose components are all zero.
|
inlineconstexprnoexcept |
|
inlineexplicitconstexprnoexcept |
Construct an IntVectND whose components are all the same.
|
inlineexplicitnoexcept |
Construct an IntVectND setting the coordinates to the corresponding values in the integer array 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.
|
inlineexplicitconstexprnoexcept |
Construct an IntVectND from an Array<int,dim>.
|
inlineexplicitconstexprnoexcept |
|
inlineconstexprnoexcept |
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.
|
inlineconstexprnoexcept |
Returns true if this is greater than or equal to argument for all components.
|
inlineconstexprnoexcept |
Returns true if this is greater than argument for all components. NOTE: This is NOT a strict weak ordering usable by STL sorting algorithms.
|
inlineconstexprnoexcept |
Returns true if this is greater than argument for all components.
|
inlineconstexprnoexcept |
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.
|
inlineconstexprnoexcept |
Returns true if this is less than or equal to argument for all components.
|
inlineconstexprnoexcept |
Returns true if this is less than argument for all components. NOTE: This is NOT a strict weak ordering usable by STL sorting algorithms.
|
inlineconstexprnoexcept |
Returns true if this is less than argument for all components.
|
inlineconstexprnoexcept |
Returns a pointer to the first element of the IntVectND.
|
inlineconstexprnoexcept |
Returns a pointer to the first element of the IntVectND.
|
inlinenoexcept |
Modify IntVectND<dim> by component-wise integer projection.
|
inlinenoexcept |
Modify IntVectND<dim> by component-wise integer projection.
|
inlineconstexprnoexcept |
Modify IntVectND by adding s to each coordinate.
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
Returns a pointer to the (last+1) element of the IntVectND.
|
inlineconstexprnoexcept |
Returns a pointer to the (last+1) element of the IntVectND.
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
Returns a reference to the i'th coordinate of the IntVectND. Used by structured bindings.
|
inlineconstexprnoexcept |
Returns a reference to the i'th coordinate of the IntVectND. Used by structured bindings.
|
delete |
|
inlinenoexcept |
|
inlinenoexcept |
Returns a const pointer to an array of coordinates of the IntVectND. Useful for arguments to FORTRAN calls.
|
inlinestaticconstexprnoexcept |
|
inlineconstexprnoexcept |
maximum (no absolute values) value
|
inlineconstexprnoexcept |
Modifies IntVectND by taking component-wise max with argument.
|
inlinenoexcept |
|
inlineconstexprnoexcept |
minimum (no absolute values) value
|
inlineconstexprnoexcept |
Modifies IntVectND by taking component-wise min with argument.
|
inlineconstexprnoexcept |
Returns true if this is different from rhs.
|
inlineconstexprnoexcept |
Returns true if any component is not equal to the argument val.
|
inlineconstexprnoexcept |
Returns component-wise product of IntVectND and argument.
|
inlineconstexprnoexcept |
Returns component-wise product of IntVectND and s.
|
inlineconstexprnoexcept |
Modifies IntVectND by component-wise multiplication with argument.
|
inlineconstexprnoexcept |
Modifies IntVectND by multiplication of a scalar to each component.
|
inlineconstexprnoexcept |
Unary plus – for completeness.
|
inlineconstexprnoexcept |
Returns component-wise sum of IntVectND.
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
Modifies IntVectND by component-wise addition with argument.
|
inlineconstexprnoexcept |
Modifies IntVectND by addition of a scalar to each component.
|
inlineconstexprnoexcept |
Unary Minus – negates all components.
|
inlineconstexprnoexcept |
Returns component-wise difference of IntVectND and argument.
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
Modifies IntVectND by component-wise subtraction with argument.
|
inlineconstexprnoexcept |
Modifies IntVectND by subtraction of a scalar to each component.
|
inlineconstexprnoexcept |
Returns component-wise division of IntVectND by argument.
|
inlineconstexprnoexcept |
Returns component-wise division of IntVectND by s.
|
inlineconstexprnoexcept |
Modifies IntVectND by component-wise division with argument.
|
inlineconstexprnoexcept |
Modifies IntVectND by division by a scalar to each component.
|
inlineconstexprnoexcept |
Return true if this is lexicographically less than rhs.
|
inlineconstexprnoexcept |
Return true if this is lexicographically less than or equal to rhs.
|
inlineconstexprnoexcept |
Returns true if this is equivalent to rhs.
|
inlineconstexprnoexcept |
Returns true if all components are equal to the argument val.
|
inlineconstexprnoexcept |
Return true if this is lexicographically greater than rhs.
|
inlineconstexprnoexcept |
Return true if this is lexicographically greater than or equal to rhs.
|
inlineconstexprnoexcept |
Returns the i'th coordinate of the IntVectND.
|
inlineconstexprnoexcept |
Returns a reference to the i'th coordinate of the IntVectND.
|
inlineconstexprnoexcept |
Modify IntVectND by reflecting it in the plane defined by the index ref_ix and with normal in the direction of idir.
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
Modify IntVectND by multiplying each coordinate by s.
|
inlinenoexcept |
Set i'th coordinate of IntVectND to val.
|
inlineconstexprnoexcept |
Equivalent to shift(0,iv[0]).shift(1,iv[1]) ...
|
inlineconstexprnoexcept |
Modify IntVectND by adding s to given coordinate.
|
inlineconstexprnoexcept |
|
inlinestaticconstexprnoexcept |
|
inlineconstexprnoexcept |
Sum of all components of this IntVectND.
|
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.
|
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.
|
inlinestaticconstexprnoexcept |
|
inlinestaticconstexprnoexcept |
|
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.
|
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.
|
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.
|
inlineconstexprnoexcept |
|
inlinestaticconstexpr |
This is an IntVect all of whose components are equal to one.
| int amrex::IntVectND< dim >::vect[dim] = {} |
|
inlinestaticconstexpr |
This is an IntVect all of whose components are equal to zero.