Simd Library Documentation.

Home | Release Notes | Download | Documentation | Forum | SourceForge | GitHub

Index structure. More...

Public Member Functions

SIMD_INLINE Index ()
 
SIMD_INLINE Index (ptrdiff_t w, ptrdiff_t h, ptrdiff_t d=1)
 
SIMD_INLINE Index (const Size &s, ptrdiff_t d=1)
 
SIMD_INLINE Index (const Index &i)
 
SIMD_INLINE void Resize (ptrdiff_t w, ptrdiff_t h, ptrdiff_t d)
 
SIMD_INLINE void Resize (const Size &s, ptrdiff_t d)
 
SIMD_INLINE ptrdiff_t Offset (ptrdiff_t x, ptrdiff_t y, ptrdiff_t c) const
 
template<class T , class A >
SIMD_INLINE const T * Get (const std::vector< T, A > &v, ptrdiff_t x, ptrdiff_t y, ptrdiff_t c) const
 
template<class T , class A >
SIMD_INLINE T * Get (std::vector< T, A > &v, ptrdiff_t x, ptrdiff_t y, ptrdiff_t c) const
 
SIMD_INLINE Neural::Size Size () const
 
SIMD_INLINE ptrdiff_t Area () const
 
SIMD_INLINE ptrdiff_t Volume () const
 

Data Fields

ptrdiff_t width
 A width of 3D-array.
 
ptrdiff_t height
 A height of 3D-array.
 
ptrdiff_t depth
 A depth of 3D-array.
 

Detailed Description

Index structure.

Provides access to complex 3D-array inside simple 1D-array.

Constructor & Destructor Documentation

SIMD_INLINE Index ( )

Creates a new Index structure that contains the default (0, 0, 0) parameters.

SIMD_INLINE Index ( ptrdiff_t  w,
ptrdiff_t  h,
ptrdiff_t  d = 1 
)

Creates a new Index structure that contains the specified parameters.

Parameters
[in]w- initial value for width.
[in]h- initial value for height.
[in]d- initial value for depth (default value is equal to 1).
SIMD_INLINE Index ( const Size s,
ptrdiff_t  d = 1 
)

Creates a new Index structure that contains the specified parameters.

Parameters
[in]s- initial size (width and height).
[in]d- initial value for depth (default value is equal to 1).
SIMD_INLINE Index ( const Index i)

Creates a new Index structure on the base of another Index structure.

Parameters
[in]i- another Index structure.

Member Function Documentation

SIMD_INLINE void Resize ( ptrdiff_t  w,
ptrdiff_t  h,
ptrdiff_t  d 
)

Recreates the Index structure with specified width, height and depth.

Parameters
[in]w- new value for width.
[in]h- new value for height.
[in]d- new value for depth.
SIMD_INLINE void Resize ( const Size s,
ptrdiff_t  d 
)

Recreates the Index structure with specified width, height and depth.

Parameters
[in]s- new size (width and height).
[in]d- new value for depth.
SIMD_INLINE ptrdiff_t Offset ( ptrdiff_t  x,
ptrdiff_t  y,
ptrdiff_t  c 
) const

Gets offset for 3D-point with specified coordinates.

Parameters
[in]x- x-coordinate of 3D-point.
[in]y- y-coordinate of 3D-point.
[in]c- z-coordinate(channel) of 3D-point.
Returns
- an offset of the point in 1D-array.
SIMD_INLINE const T* Get ( const std::vector< T, A > &  v,
ptrdiff_t  x,
ptrdiff_t  y,
ptrdiff_t  c 
) const

Gets constant address of 3D-point in 1D-array (std::vector).

Parameters
[in]v- std::vector.
[in]x- x-coordinate of 3D-point.
[in]y- y-coordinate of 3D-point.
[in]c- z-coordinate(channel) of 3D-point.
Returns
- a constant address of the point in std::vector.
SIMD_INLINE T* Get ( std::vector< T, A > &  v,
ptrdiff_t  x,
ptrdiff_t  y,
ptrdiff_t  c 
) const

Gets address of 3D-point in 1D-array (std::vector).

Parameters
[in]v- std::vector.
[in]x- x-coordinate of 3D-point.
[in]y- y-coordinate of 3D-point.
[in]c- z-coordinate(channel) of 3D-point.
Returns
- an address of the point in std::vector.
SIMD_INLINE Neural::Size Size ( ) const

Gets 2D-size (width and height) of the channel in the Index.

Returns
- a new Point structure with width and height.
SIMD_INLINE ptrdiff_t Area ( ) const

Gets area of the channel plane in the Index.

Returns
- an area of the channel.
SIMD_INLINE ptrdiff_t Volume ( ) const

Gets total size (volume) of the Index.

Returns
- total size (volume) of 3D-array.