The blo Library
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
blo::Array2DFixed< T, M, N > Class Template Reference

Small 2D array, fixed size. More...

#include <Array2DFixed.h>

Inheritance diagram for blo::Array2DFixed< T, M, N >:
blo::SmallMatrix< T, 3, 1 > blo::SmallMatrix< T, N, N > blo::SmallMatrix< T, M, N >

Public Member Functions

 Array2DFixed ()=default
 Default constructor.
 
 Array2DFixed (const T &val)
 Constructs array of specified value.
 
 Array2DFixed (const std::initializer_list< const std::initializer_list< T > > &lists)
 Constructs array that is a copy of specified initializer lists.
 
 Array2DFixed (const Array2DFixed< T, M, N > &rhs)=default
 Copy constructor.
 
virtual ~Array2DFixed ()=default
 Destructor.
 
Array2DFixed< T, M, N > & operator= (const Array2DFixed< T, M, N > &rhs)=default
 Copy assignment operator.
 
T * operator[] (int i)
 Index array row.
 
const T * operator[] (int i) const
 Index array row.
 
T * ptrData ()
 Retrieves the pointer to the beginning of the array.
 
const T * ptrData () const
 Retrieves the pointer to the beginning of the array.
 
void set (const T &val)
 Sets array elements to a value.
 

Static Public Member Functions

static int rows ()
 Number of rows in the array.
 
static int height ()
 Height of the array.
 
static int columns ()
 Number of columns in the array.
 
static int width ()
 Width of the array.
 
static int stride1 ()
 Stride in bytes between the rows in the array.
 
static int step ()
 Step in bytes between the rows in the array.
 
static int ld ()
 Leading dimension between the rows in the array.
 
static int stride2 ()
 Stride in bytes between the elements in the array.
 

Detailed Description

template<typename T, size_t M, size_t N>
class blo::Array2DFixed< T, M, N >

Small 2D array, fixed size.

Template Parameters
TData type.
MSize of first dimension.
NSize of second dimension.

Constructor & Destructor Documentation

◆ Array2DFixed() [1/4]

template<typename T , size_t M, size_t N>
blo::Array2DFixed< T, M, N >::Array2DFixed ( )
default

Default constructor.

◆ Array2DFixed() [2/4]

template<typename T , size_t M, size_t N>
blo::Array2DFixed< T, M, N >::Array2DFixed ( const T &  val)
explicit

Constructs array of specified value.

Parameters
valConstant value to assign to each element in the array.

◆ Array2DFixed() [3/4]

template<typename T , size_t M, size_t N>
blo::Array2DFixed< T, M, N >::Array2DFixed ( const std::initializer_list< const std::initializer_list< T > > &  lists)

Constructs array that is a copy of specified initializer lists.

Parameters
listsInitializer lists.

◆ Array2DFixed() [4/4]

template<typename T , size_t M, size_t N>
blo::Array2DFixed< T, M, N >::Array2DFixed ( const Array2DFixed< T, M, N > &  rhs)
default

Copy constructor.

◆ ~Array2DFixed()

template<typename T , size_t M, size_t N>
virtual blo::Array2DFixed< T, M, N >::~Array2DFixed ( )
virtualdefault

Destructor.

Member Function Documentation

◆ columns()

template<typename T , size_t M, size_t N>
static int blo::Array2DFixed< T, M, N >::columns ( )
static

Number of columns in the array.

Returns
Number of columns in the array.

◆ height()

template<typename T , size_t M, size_t N>
static int blo::Array2DFixed< T, M, N >::height ( )
static

Height of the array.

Returns
Height of the array.

◆ ld()

template<typename T , size_t M, size_t N>
static int blo::Array2DFixed< T, M, N >::ld ( )
static

Leading dimension between the rows in the array.

Returns
Leading dimension between the rows in the array.

◆ operator=()

template<typename T , size_t M, size_t N>
Array2DFixed< T, M, N > & blo::Array2DFixed< T, M, N >::operator= ( const Array2DFixed< T, M, N > &  rhs)
default

Copy assignment operator.

◆ operator[]() [1/2]

template<typename T , size_t M, size_t N>
T * blo::Array2DFixed< T, M, N >::operator[] ( int  i)

Index array row.

Note
Index array element using array[i][j].
Parameters
iRow of the array.
Returns
Pointer to the row.

◆ operator[]() [2/2]

template<typename T , size_t M, size_t N>
const T * blo::Array2DFixed< T, M, N >::operator[] ( int  i) const

Index array row.

Note
Index array element using array[i][j].
Parameters
iRow of the array.
Returns
Pointer to the row.

◆ ptrData() [1/2]

template<typename T , size_t M, size_t N>
T * blo::Array2DFixed< T, M, N >::ptrData ( )

Retrieves the pointer to the beginning of the array.

Returns
Pointer to the beginning of the array.

◆ ptrData() [2/2]

template<typename T , size_t M, size_t N>
const T * blo::Array2DFixed< T, M, N >::ptrData ( ) const

Retrieves the pointer to the beginning of the array.

Returns
Pointer to the beginning of the array.

◆ rows()

template<typename T , size_t M, size_t N>
static int blo::Array2DFixed< T, M, N >::rows ( )
static

Number of rows in the array.

Returns
Number of rows in the array.

◆ set()

template<typename T , size_t M, size_t N>
void blo::Array2DFixed< T, M, N >::set ( const T &  val)

Sets array elements to a value.

Parameters
valConstant value to assign to each element in the array.

◆ step()

template<typename T , size_t M, size_t N>
static int blo::Array2DFixed< T, M, N >::step ( )
static

Step in bytes between the rows in the array.

Returns
Step in bytes between the rows in the array.

◆ stride1()

template<typename T , size_t M, size_t N>
static int blo::Array2DFixed< T, M, N >::stride1 ( )
static

Stride in bytes between the rows in the array.

Returns
Stride in bytes between the rows in the array.

◆ stride2()

template<typename T , size_t M, size_t N>
static int blo::Array2DFixed< T, M, N >::stride2 ( )
static

Stride in bytes between the elements in the array.

Returns
Stride in bytes between the elements in the array.

◆ width()

template<typename T , size_t M, size_t N>
static int blo::Array2DFixed< T, M, N >::width ( )
static

Width of the array.

Returns
Width of the array.

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