Generic object that represents size and shape.
More...
#include <dim4.hpp>
Generic object that represents size and shape.
- Examples
- graphics/gravity_sim.cpp, and unified/basic.cpp.
Definition at line 25 of file dim4.hpp.
◆ dim4() [1/4]
Default constructor. Creates an invalid dim4 object.
◆ dim4() [2/4]
Creates an new dim4 given a set of dimension.
◆ dim4() [3/4]
Copy constructor.
- Parameters
-
[in] | other | The dim4 that will be copied |
◆ dim4() [4/4]
dim4 |
( |
const unsigned |
ndims, |
|
|
const dim_t *const |
dims |
|
) |
| |
Constructs a dim4 object from a C array of dim_t objects.
Creates a new dim4 from a C array. If the C array is less than 4, all values past ndims
will be assigned the value 1.
- Parameters
-
[in] | ndims | The number of elements in the C array. Must be less than 4 |
[in] | dims | The values to assign to each element of dim4 |
◆ elements() [1/2]
Returns the number of elements represented by this dim4.
◆ elements() [2/2]
Returns the number of elements represented by this dim4.
◆ get() [1/2]
Returns the underlying pointer to the dim4 object.
Definition at line 103 of file dim4.hpp.
◆ get() [2/2]
const dim_t * get |
( |
| ) |
const |
|
inline |
Returns the underlying pointer to the dim4 object.
Definition at line 106 of file dim4.hpp.
◆ ndims() [1/2]
Returns the number of axis whose values are greater than one.
◆ ndims() [2/2]
Returns the number of axis whose values are greater than one.
◆ operator!=()
bool operator!= |
( |
const dim4 & |
other | ) |
const |
Returns true if two dim4s store different values.
◆ operator*=()
Element-wise multiplication of the dim4 objects.
◆ operator+=()
Element-wise addition of the dim4 objects.
◆ operator-=()
Element-wise subtraction of the dim4 objects.
◆ operator==()
bool operator== |
( |
const dim4 & |
other | ) |
const |
Returns true if the two dim4 represent the same shape.
◆ operator[]() [1/2]
dim_t & operator[] |
( |
const unsigned |
dim | ) |
|
Returns the reference to the element at a give index.
(Must be less than 4)
◆ operator[]() [2/2]
const dim_t & operator[] |
( |
const unsigned |
dim | ) |
const |
Returns the reference to the element at a give index.
(Must be less than 4)
◆ dims
The documentation for this class was generated from the following file: