|
Cholla 3.0.1-dev
Cholla - Massively parallel hydro on GPUs
|
A data only struct that acts as a simple 3 element vector. More...
#include <basic_structs.h>
Public Member Functions | |
| __device__ __host__ T * | data () |
| Returns the pointer to the data array. | |
| __device__ __host__ T & | operator[] (std::size_t i) |
| Overload for the [] operator to allow array-like access. Const version is needed if the object instance is declared as const. | |
| __device__ __host__ const T & | operator[] (std::size_t i) const |
| __device__ __host__ T & | x () noexcept |
| Directly access the x, y, and z elements. Const version is needed if the object instance is declared as const. | |
| __device__ __host__ const T & | x () const noexcept |
| __device__ __host__ T & | y () noexcept |
| __device__ __host__ const T & | y () const noexcept |
| __device__ __host__ T & | z () noexcept |
| __device__ __host__ const T & | z () const noexcept |
Public Attributes | |
| T | arr_ [3] |
A data only struct that acts as a simple 3 element vector.
Because this is an aggregate type, you can construct it as:
|
inline |
Returns the pointer to the data array.
To ensure this class is an aggregate, constructors are implicitly defined. The destructor & move/copy assignment operations are also implicitly defined
|
inline |
Overload for the [] operator to allow array-like access. Const version is needed if the object instance is declared as const.
| i | Which element to access. Allowable values are 0, 1, and 2, all other values have undefined behaviour that will result in a segfault or illegally memory access |
|
inlinenoexcept |
Directly access the x, y, and z elements. Const version is needed if the object instance is declared as const.
| T hydro_utilities::VectorXYZ< T >::arr_[3] |
Tracks the values held by the class. To ensure the class is an aggregate, it needs to be public. With that said, it should be treated as an implementation detail and not accessed directly