Hermes
hermes::Size3< T > Class Template Reference

Holds 2-dimensional size. More...

Public Member Functions

HERMES_DEVICE_CALLABLE Size3 ()
 Default constructor.
 
HERMES_DEVICE_CALLABLE Size3 (T size)
 Single value constructor. More...
 
HERMES_DEVICE_CALLABLE Size3 (T _width, T _height, T _depth)
 Constructor. More...
 
HERMES_DEVICE_CALLABLEoperator[] (int i) const
 Dimension size const access. More...
 
HERMES_DEVICE_CALLABLE T & operator[] (int i)
 Dimension size access. More...
 
HERMES_DEVICE_CALLABLE Size3< T > operator+ (const Size3< T > &b) const
 Addition. More...
 
HERMES_DEVICE_CALLABLE Size3< T > operator- (const Size3< T > &b) const
 Subtraction. More...
 
HERMES_DEVICE_CALLABLE bool operator== (const Size3< T > &b) const
 Dimension-wise comparison. More...
 
HERMES_DEVICE_CALLABLE bool operator!= (const Size3< T > &b) const
 Dimension-wise comparison. More...
 
HERMES_DEVICE_CALLABLEtotal () const
 Computes total size area. More...
 
HERMES_DEVICE_CALLABLE Size2< T > slice (int d1=0, int d2=1) const
 Gets 2-dimensional slice. More...
 

Public Attributes

width {0}
 0-th dimension size
 
height {0}
 1-th dimension size
 
depth {0}
 2-th dimension size
 

Detailed Description

template<typename T>
class hermes::Size3< T >

Holds 2-dimensional size.

Precondition
T must be an unsigned integer type
Template Parameters
T

Constructor & Destructor Documentation

◆ Size3() [1/2]

template<typename T >
HERMES_DEVICE_CALLABLE hermes::Size3< T >::Size3 ( size)
inlineexplicit

Single value constructor.

Parameters
size

◆ Size3() [2/2]

template<typename T >
HERMES_DEVICE_CALLABLE hermes::Size3< T >::Size3 ( _width,
_height,
_depth 
)
inline

Constructor.

Parameters
_width
_height
_depth

Member Function Documentation

◆ operator!=()

template<typename T >
HERMES_DEVICE_CALLABLE bool hermes::Size3< T >::operator!= ( const Size3< T > &  b) const
inline

Dimension-wise comparison.

Parameters
b
Returns

◆ operator+()

template<typename T >
HERMES_DEVICE_CALLABLE Size3<T> hermes::Size3< T >::operator+ ( const Size3< T > &  b) const
inline

Addition.

Parameters
b
Returns

◆ operator-()

template<typename T >
HERMES_DEVICE_CALLABLE Size3<T> hermes::Size3< T >::operator- ( const Size3< T > &  b) const
inline

Subtraction.

Warning
This method does not check underflow condition
Parameters
b
Returns

◆ operator==()

template<typename T >
HERMES_DEVICE_CALLABLE bool hermes::Size3< T >::operator== ( const Size3< T > &  b) const
inline

Dimension-wise comparison.

Parameters
b
Returns

◆ operator[]() [1/2]

template<typename T >
HERMES_DEVICE_CALLABLE T& hermes::Size3< T >::operator[] ( int  i)
inline

Dimension size access.

Precondition
i must be inside interval [0,2]
Warning
This method does not check input value
Parameters
i
Returns

◆ operator[]() [2/2]

template<typename T >
HERMES_DEVICE_CALLABLE T hermes::Size3< T >::operator[] ( int  i) const
inline

Dimension size const access.

Precondition
i must be inside interval [0,2]
Warning
This method does not check input value
Parameters
i
Returns

◆ slice()

template<typename T >
HERMES_DEVICE_CALLABLE Size2<T> hermes::Size3< T >::slice ( int  d1 = 0,
int  d2 = 1 
) const
inline

Gets 2-dimensional slice.

Precondition
d1 and d2 must be inside interval [0,2]
Warning
This method does not check input values
Parameters
d1
d2
Returns

◆ total()

template<typename T >
HERMES_DEVICE_CALLABLE T hermes::Size3< T >::total ( ) const
inline

Computes total size area.

Returns
width * height * depth

The documentation for this class was generated from the following file: