|
| 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.
|
| |
| | 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__ Dim3 | dim3 () const noexcept |
| |
| template<int N = dim, std::enable_if_t<(1<=N &&N<=3), int > = 0> |
| __host__ __device__ Dim3 | dim3 (int fill_extra) const noexcept |
| |
| template<typename T = int> |
| __host__ __device__ Array< T, dim > | toArray () const noexcept |
| |
| __host__ __device__ int | sum () const noexcept |
| |
| __host__ __device__ int | max () const noexcept |
| | maximum (no absolute values) value
|
| |
| __host__ __device__ 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__ bool | operator== (int val) const noexcept |
| | Returns true if all components are equal to the argument val.
|
| |
| __host__ __device__ bool | operator!= (int val) const noexcept |
| | Returns true if any component is not equal to the argument val.
|
| |
| __host__ __device__ bool | operator== (const IntVectND< dim > &rhs) const noexcept |
| | Returns true if this is equivalent to rhs.
|
| |
| __host__ __device__ bool | operator!= (const IntVectND< dim > &rhs) const noexcept |
| | Returns true if this is different from rhs.
|
| |
| __host__ __device__ bool | operator< (const IntVectND< dim > &rhs) const noexcept |
| | Return true if this is lexicographically less than rhs.
|
| |
| __host__ __device__ bool | operator<= (const IntVectND< dim > &rhs) const noexcept |
| | Return true if this is lexicographically less than or equal to rhs.
|
| |
| __host__ __device__ bool | operator> (const IntVectND< dim > &rhs) const noexcept |
| | Return true if this is lexicographically greater than rhs.
|
| |
| __host__ __device__ bool | operator>= (const IntVectND< dim > &rhs) const noexcept |
| | Return true if this is lexicographically greater than or equal to rhs.
|
| |
| __host__ __device__ 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__ bool | allLT (int rhs) const noexcept |
| | Returns true if this is less than argument for all components.
|
| |
| __host__ __device__ 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__ bool | allLE (int rhs) const noexcept |
| | Returns true if this is less than or equal to argument for all components.
|
| |
| __host__ __device__ 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__ bool | allGT (int rhs) const noexcept |
| | Returns true if this is greater than argument for all components.
|
| |
| __host__ __device__ 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__ bool | allGE (int rhs) const noexcept |
| | Returns true if this is greater than or equal to argument for all components.
|
| |
| __host__ __device__ IntVectND< dim > | operator+ () const noexcept |
| | Unary plus – for completeness.
|
| |
| __host__ __device__ IntVectND< dim > | operator- () const noexcept |
| | Unary Minus – negates all components.
|
| |
| __host__ __device__ IntVectND< dim > & | operator+= (int s) noexcept |
| | Modifies IntVectND by addition of a scalar to each component.
|
| |
| __host__ __device__ IntVectND< dim > & | operator+= (const IntVectND< dim > &p) noexcept |
| | Modifies IntVectND by component-wise addition with argument.
|
| |
| __host__ __device__ IntVectND< dim > & | operator*= (int s) noexcept |
| | Modifies IntVectND by multiplication of a scalar to each component.
|
| |
| __host__ __device__ IntVectND< dim > & | operator*= (const IntVectND< dim > &p) noexcept |
| | Modifies IntVectND by component-wise multiplication with argument.
|
| |
| __host__ __device__ IntVectND< dim > & | operator/= (int s) noexcept |
| | Modifies IntVectND by division by a scalar to each component.
|
| |
| __host__ __device__ IntVectND< dim > & | operator/= (const IntVectND< dim > &p) noexcept |
| | Modifies IntVectND by component-wise division with argument.
|
| |
| __host__ __device__ IntVectND< dim > & | operator-= (int s) noexcept |
| | Modifies IntVectND by subtraction of a scalar to each component.
|
| |
| __host__ __device__ IntVectND< dim > & | operator-= (const IntVectND< dim > &p) noexcept |
| | Modifies IntVectND by component-wise subtraction with argument.
|
| |
| __host__ __device__ IntVectND< dim > | operator+ (const IntVectND< dim > &p) const noexcept |
| | Returns component-wise sum of IntVectND.
|
| |
| __host__ __device__ IntVectND< dim > | operator+ (int s) const noexcept |
| | Return an IntVectND that is this IntVectND + s.
|
| |
| __host__ __device__ IntVectND< dim > | operator- (const IntVectND< dim > &p) const noexcept |
| | Returns component-wise difference of IntVectND and argument.
|
| |
| __host__ __device__ IntVectND< dim > | operator- (int s) const noexcept |
| | Return an IntVectND that is this IntVectND - s.
|
| |
| __host__ __device__ IntVectND< dim > | operator* (const IntVectND< dim > &p) const noexcept |
| | Returns component-wise product of IntVectND and argument.
|
| |
| __host__ __device__ IntVectND< dim > | operator* (int s) const noexcept |
| | Returns component-wise product of IntVectND and s.
|
| |
| __host__ __device__ IntVectND< dim > | operator/ (const IntVectND< dim > &p) const noexcept |
| | Returns component-wise division of IntVectND by argument.
|
| |
| __host__ __device__ IntVectND< dim > | operator/ (int s) const noexcept |
| | Returns component-wise division of IntVectND by s.
|
| |
| __host__ __device__ IntVectND< dim > & | min (const IntVectND< dim > &p) noexcept |
| | Modifies IntVectND by taking component-wise min with argument.
|
| |
| __host__ __device__ IntVectND< dim > & | max (const IntVectND< dim > &p) noexcept |
| | Modifies IntVectND by taking component-wise max with argument.
|
| |
| __host__ __device__ IntVectND< dim > & | scale (int s) noexcept |
| | Modify IntVectND by multiplying each coordinate by s.
|
| |
| __host__ __device__ 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__ IntVectND< dim > & | shift (int coord, int s) noexcept |
| | Modify IntVectND by adding s to given coordinate.
|
| |
| __host__ __device__ IntVectND< dim > & | shift (const IntVectND< dim > &iv) noexcept |
| | Equivalent to shift(0,iv[0]).shift(1,iv[1]) ...
|
| |
| __host__ __device__ 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__ 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__ 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__ 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.
|
| |
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.