Generic object that represents size and shape.
More...
#include <dim4.hpp>
|
| | dim4 () |
| | Default constructor. Creates an invalid dim4 object.
|
| | dim4 (dim_t first, dim_t second=1, dim_t third=1, dim_t fourth=1) |
| | Creates an new dim4 given a set of dimension.
|
| | dim4 (const dim4 &other) |
| | Copy constructor.
|
| | dim4 (const unsigned ndims, const dim_t *const dims) |
| | Constructs a dim4 object from a C array of dim_t objects.
|
| dim_t | elements () |
| | Returns the number of elements represented by this dim4.
|
| dim_t | elements () const |
| | Returns the number of elements represented by this dim4.
|
| dim_t | ndims () |
| | Returns the number of axis whose values are greater than one.
|
| dim_t | ndims () const |
| | Returns the number of axis whose values are greater than one.
|
| bool | operator== (const dim4 &other) const |
| | Returns true if the two dim4 represent the same shape.
|
| bool | operator!= (const dim4 &other) const |
| | Returns true if two dim4s store different values.
|
| dim4 & | operator*= (const dim4 &other) |
| | Element-wise multiplication of the dim4 objects.
|
| dim4 & | operator+= (const dim4 &other) |
| | Element-wise addition of the dim4 objects.
|
| dim4 & | operator-= (const dim4 &other) |
| | Element-wise subtraction of the dim4 objects.
|
| dim_t & | operator[] (const unsigned dim) |
| | Returns the reference to the element at a give index.
|
| const dim_t & | operator[] (const unsigned dim) const |
| | Returns the reference to the element at a give index.
|
| dim_t * | get () |
| | Returns the underlying pointer to the dim4 object.
|
| const dim_t * | get () const |
| | Returns the underlying pointer to the dim4 object.
|
Generic object that represents size and shape.
- Examples
- computer_vision/matching.cpp, financial/black_scholes_options.cpp, graphics/fractal.cpp, graphics/gravity_sim.cpp, graphics/surface.cpp, helloworld/helloworld.cpp, image_processing/brain_segmentation.cpp, image_processing/morphing.cpp, image_processing/optical_flow.cpp, machine_learning/geneticalgorithm.cpp, machine_learning/rbm.cpp, pde/bhrt.cpp, pde/boltzmann_cfd.cpp, pde/swe.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]
| dim4 |
( |
const dim4 & | other | ) |
|
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: