A Real vector in dim-dimensional space. More...
#include <AMReX_RealVect.H>
Public Member Functions | |
| template<int N, std::enable_if_t<(N==3), int > > | |
| __host__ __device__ RealVectND< dim > | crossProduct (const RealVectND< dim > &a_rhs) const noexcept |
Constructors and Accessors | |
| constexpr | RealVectND () noexcept |
| RealVectND (const std::vector< Real > &vr) noexcept | |
| template<class... Args, std::enable_if_t<(sizeof...(Args)+2==dim) &&IsConvertible_v< Real, Args... >, int > = 0> | |
| __host__ __device__ constexpr | RealVectND (Real i, Real j, Args... ks) noexcept |
| __host__ __device__ constexpr | RealVectND (Real s) noexcept |
| __host__ __device__ | RealVectND (const Real *a) noexcept |
| __host__ __device__ constexpr | RealVectND (const IntVectND< dim > &iv) noexcept |
| __host__ __device__ constexpr | RealVectND (const GpuArray< Real, dim > ga) noexcept |
| Real & | operator[] (int i) &&=delete |
| __host__ __device__ constexpr Real & | operator[] (int i) &noexcept |
| __host__ __device__ constexpr const Real & | operator[] (int i) const &noexcept |
| template<std::size_t i> | |
| __host__ __device__ constexpr Real & | get () noexcept |
| Returns a reference to the i'th coordinate of the RealVectND. Used by structured bindings. | |
| template<std::size_t i> | |
| __host__ __device__ constexpr const Real & | get () const noexcept |
| Returns a reference to the i'th coordinate of the RealVectND. Used by structured bindings. | |
| __host__ __device__ constexpr GpuArray< Real, dim > | to_array () const noexcept |
Iterators | |
| __host__ __device__ constexpr Real * | begin () noexcept |
| __host__ __device__ constexpr const Real * | begin () const noexcept |
| __host__ __device__ constexpr Real * | end () noexcept |
| __host__ __device__ constexpr const Real * | end () const noexcept |
Comparison Operators | |
| __host__ __device__ constexpr bool | operator== (const RealVectND &p) const noexcept |
| __host__ __device__ constexpr bool | operator!= (const RealVectND &p) const noexcept |
| __host__ __device__ bool | operator< (const RealVectND &p) const noexcept |
| __host__ __device__ bool | operator<= (const RealVectND &p) const noexcept |
| __host__ __device__ bool | operator> (const RealVectND &p) const noexcept |
| __host__ __device__ bool | operator>= (const RealVectND &p) const noexcept |
Arithmetic Operators | |
| __host__ __device__ RealVectND & | operator+= (Real s) noexcept |
| __host__ __device__ RealVectND | operator+ (Real s) const noexcept |
| __host__ __device__ RealVectND & | operator+= (const RealVectND &p) noexcept |
| __host__ __device__ RealVectND & | operator-= (Real s) noexcept |
| __host__ __device__ RealVectND & | operator-= (const RealVectND &p) noexcept |
| __host__ __device__ RealVectND | operator- (Real s) const noexcept |
| __host__ __device__ RealVectND & | operator*= (Real s) noexcept |
| __host__ __device__ Real | dotProduct (const RealVectND &a_rhs) const noexcept |
| template<int N = dim, std::enable_if_t<(N==3), int > = 0> | |
| __host__ __device__ RealVectND | crossProduct (const RealVectND &a_rhs) const noexcept |
| __host__ __device__ RealVectND & | operator*= (const RealVectND &p) noexcept |
| __host__ __device__ RealVectND | operator* (Real s) const noexcept |
| __host__ __device__ RealVectND & | operator/= (Real s) noexcept |
| __host__ __device__ RealVectND & | operator/= (const RealVectND &p) noexcept |
| __host__ __device__ RealVectND | operator/ (Real s) const noexcept |
| __host__ __device__ RealVectND & | scale (Real s) noexcept |
| __host__ __device__ IntVectND< dim > | floor () const noexcept |
| __host__ __device__ IntVectND< dim > | ceil () const noexcept |
| __host__ __device__ IntVectND< dim > | round () const noexcept |
Other arithmetic operators | |
| __host__ __device__ RealVectND & | min (const RealVectND &p) noexcept |
| __host__ __device__ RealVectND & | max (const RealVectND &p) noexcept |
Unary operators | |
| __host__ __device__ RealVectND | operator+ () const noexcept |
| __host__ __device__ RealVectND | operator- () const noexcept |
| __host__ __device__ Real | sum () const noexcept |
| __host__ __device__ Real | vectorLength () const noexcept |
| __host__ __device__ Real | radSquared () const noexcept |
| __host__ __device__ Real | product () const noexcept |
| __host__ __device__ int | minDir (const bool &a_doAbs) const noexcept |
| __host__ __device__ int | maxDir (const bool &a_doAbs) const noexcept |
Data pointer functions | |
| __host__ __device__ const Real * | dataPtr () const noexcept |
| __host__ __device__ Real * | dataPtr () noexcept |
Static Public Attributes | |
Constants | |
| static const RealVectND | Zero {Real(0)} |
| static const RealVectND | Unit {Real(1)} |
Static public members functions | |
| using | value_type = Real |
| Real | vect [dim] = {} |
| template<int new_dim> | |
| __host__ __device__ RealVectND< new_dim > | shrink () const noexcept |
| Returns a new RealVectND of size new_dim and assigns the first new_dim values of this RealVectND to it. | |
| template<int new_dim> | |
| __host__ __device__ RealVectND< new_dim > | expand (Real fill_extra=0.) const noexcept |
| Returns a new RealVectND of size new_dim and assigns all values of this RealVectND to it andĀ fill_extra to the remaining elements. | |
| template<int new_dim> | |
| __host__ __device__ RealVectND< new_dim > | resize (Real fill_extra=0.) const noexcept |
| Returns a new RealVectND of size new_dim by either shrinking or expanding this RealVectND. | |
| __host__ static __device__ constexpr RealVectND | TheZeroVector () noexcept |
| __host__ static __device__ constexpr RealVectND | TheUnitVector () noexcept |
| __host__ static __device__ constexpr std::size_t | size () noexcept |
| __host__ static __device__ constexpr int | isize () noexcept |
A Real vector in dim-dimensional space.
The class RealVectND is an implementation of a Real vector in a dim-dimensional space. RealVectND 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::RealVectND< dim >::value_type = Real |
|
inlineconstexprnoexcept |
Construct a RealVectND whose components are zero.
|
inlineexplicitnoexcept |
|
inlineconstexprnoexcept |
Construct a RealVectND given the specific values for its coordinates.
|
inlineexplicitconstexprnoexcept |
|
inlineexplicitnoexcept |
Construct a RealVectND setting the coordinates to the corresponding values in the Real array a.
|
inlineconstexprnoexcept |
Construct a RealVectND from an IntVectND by coercing each component from int to Real.
|
inlineconstexprnoexcept |
Construct a RealVectND from a GpuArray
|
inlineconstexprnoexcept |
Return pointer to the first component.
|
inlineconstexprnoexcept |
Return pointer to the first component.
|
inlinenoexcept |
Returns an IntVectND<dim> whose components are the std::floor of the RealVectND components.
|
inlinenoexcept |
Returns the result of the cross product with another RealVectND
|
inlinenoexcept |
|
inlinenoexcept |
Only for sending stuff to Fortran
|
inlinenoexcept |
Only for sending stuff to Fortran
|
inlinenoexcept |
Returns the result of the scalar product with another RealVectND
|
inlineconstexprnoexcept |
Return pointer to the one past last component
|
inlineconstexprnoexcept |
Return pointer to the one past last component
|
inlinenoexcept |
Returns a new RealVectND of size new_dim and assigns all values of this RealVectND to it andĀ fill_extra to the remaining elements.
|
inlinenoexcept |
Returns an IntVectND<dim> whose components are the std::floor of the RealVectND components.
|
inlineconstexprnoexcept |
Returns a reference to the i'th coordinate of the RealVectND. Used by structured bindings.
|
inlineconstexprnoexcept |
Returns a reference to the i'th coordinate of the RealVectND. Used by structured bindings.
|
inlinestaticconstexprnoexcept |
|
inlinenoexcept |
Modifies this RealVectND by taking component-wise max with RealVectND argument.
|
inlinenoexcept |
Component with the maximum value of this RealVectND (returns 0 if they are all the same). a_doAbs : if true then take the absolute value before comparing
|
inlinenoexcept |
Modifies this RealVectND by taking component-wise min with RealVectND argument.
|
inlinenoexcept |
Component with the minimum value of this RealVectND (returns 0 if they are all the same). a_doAbs : if true then take the absolute value before comparing
|
inlineconstexprnoexcept |
Returns true if this RealVectND is different from argument RealVectND. All comparisons between analogous components must be satisfied.
|
inlinenoexcept |
Returns a RealVectND that is this RealVectND with each component multiplied by a scalar.
|
inlinenoexcept |
Modifies this RealVectND by component-wise multiplication by argument.
|
inlinenoexcept |
Modifies this RealVectND by multiplying each component by a scalar.
|
inlinenoexcept |
Unary plus – for completeness.
|
inlinenoexcept |
Returns a RealVectND that is this RealVectND with a scalar s added to each component.
|
inlinenoexcept |
Modifies this RealVectND by component-wise addition by argument.
|
inlinenoexcept |
Modifies this RealVectND by addition of a scalar to each component.
|
inlinenoexcept |
Unary minus – negates all components of this RealVectND.
|
inlinenoexcept |
Returns a RealVectND that is this RealVectND with a scalar s subtracted from each component.
|
inlinenoexcept |
Modifies this RealVectND by component-wise subtraction by argument.
|
inlinenoexcept |
Modifies this RealVectND by subtraction of a scalar from each component.
|
inlinenoexcept |
Returns a RealVectND that is this RealVectND with each component divided by a scalar.
|
inlinenoexcept |
Modifies this RealVectND by component-wise division by argument.
|
inlinenoexcept |
Modifies this RealVectND by dividing each component by a scalar.
|
inlinenoexcept |
Returns true if this RealVectND is less than argument RealVectND. All comparisons between analogous components must be satisfied. Note that, since the comparison is component-wise, it is possible for an RealVectND to be neither greater than, less than, nor equal to another.
|
inlinenoexcept |
Returns true if this RealVectND is less than or equal to argument RealVectND. All comparisons between analogous components must be satisfied. Note that, since the comparison is component-wise, it is possible for an RealVectND to be neither greater than or equal to, less than or equal to, nor equal to another.
|
inlineconstexprnoexcept |
Returns true if this RealVectND is equivalent to argument RealVectND. All comparisons between analogous components must be satisfied.
|
inlinenoexcept |
Returns true if this RealVectND is greater than argument RealVectND. All comparisons between analogous components must be satisfied. Note that, since the comparison is component-wise, it is possible for an RealVectND to be neither greater than, less than, nor equal to another.
|
inlinenoexcept |
Returns true if this RealVectND is greater than or equal to argument RealVectND. All comparisons between analogous components must be satisfied. Note that, since the comparison is component-wise, it is possible for an RealVectND to be neither greater than or equal to, less than or equal to, nor equal to another.
|
delete |
Prevent rvalue assignment to the i'th coordinate of the RealVectND.
|
inlineconstexprnoexcept |
Returns a modifiable lvalue reference to the i'th coordinate of the RealVectND.
|
inlineconstexprnoexcept |
Returns the i'th coordinate of the RealVectND.
|
inlinenoexcept |
Product of all components of this RealVectND.
|
inlinenoexcept |
sum squares–no square root
|
inlinenoexcept |
Returns a new RealVectND of size new_dim by either shrinking or expanding this RealVectND.
|
inlinenoexcept |
Returns an IntVectND<dim> whose components are the std::floor of the RealVectND components.
|
inlinenoexcept |
Modifies this RealVectND by multiplying each component by a scalar.
|
inlinenoexcept |
Returns a new RealVectND of size new_dim and assigns the first new_dim values of this RealVectND to it.
|
inlinestaticconstexprnoexcept |
|
inlinenoexcept |
Sum of all components of this RealVectND.
|
inlinestaticconstexprnoexcept |
The unit vector in dim-dimensional space.
|
inlinestaticconstexprnoexcept |
The zero vector in dim-dimensional space.
|
inlineconstexprnoexcept |
|
inlinenoexcept |
sqrt(sum squares)
|
inlinestaticconstexpr |
This is a RealVectND all of whose components are equal to one.
|
protected |
The individual components of this RealVectND.
|
inlinestaticconstexpr |
This is a RealVectND all of whose components are equal to zero.