The blo Library
Loading...
Searching...
No Matches
Public Member Functions | List of all members
blo::Matrix< T > Class Template Reference

Matrix. More...

#include <Matrix.h>

Inheritance diagram for blo::Matrix< T >:
blo::Array2D< T >

Public Member Functions

 Matrix ()=default
 Default constructor.
 
 Matrix (int rows, int columns)
 Constructs matrix of specified size.
 
 Matrix (int rows, int columns, const T &val)
 Constructs matrix of specified size and value.
 
 Matrix (const T *pSrc, int srcStride1, int rows, int columns)
 Constructs matrix that is a copy of specified matrix.
 
 Matrix (const T *pSrc, int srcStride1, int srcStride2, int rows, int columns)
 Constructs matrix that is a copy of specified matrix.
 
 Matrix (const MatrixTranspose< T > &transpose)
 Constructs matrix that is a copy of specified matrix transpose.
 
 Matrix (const VectorTranspose< T > &transpose)
 Constructs matrix that is a copy of specified vector transpose.
 
 Matrix (const Matrix< T > &rhs)=default
 Copy constructor.
 
 Matrix (Matrix< T > &&rhs) noexcept=default
 Move constructor.
 
virtual ~Matrix ()=default
 Destructor.
 
Matrix< T > & operator= (const Matrix< T > &rhs)=default
 Copy assignment operator.
 
Matrix< T > & operator= (Matrix< T > &&rhs) noexcept=default
 Move assignment operator.
 
Matrix< T > & operator*= (const T &scalar)
 
Matrix< T > & operator/= (const T &scalar)
 
Matrix< T > & operator*= (const Matrix< T > &rhs)
 
Matrix< T > & operator*= (const MatrixTranspose< T > &rhs)
 
Matrix< T > & operator+= (const T &scalar)
 
Matrix< T > & operator+= (const Matrix< T > &rhs)
 
Matrix< T > & operator-= (const T &scalar)
 
Matrix< T > & operator-= (const Matrix< T > &rhs)
 
- Public Member Functions inherited from blo::Array2D< T >
 Array2D ()=default
 Default constructor.
 
 Array2D (int rows, int columns)
 Constructs array of specified size.
 
 Array2D (int rows, int columns, const T &val)
 Constructs array of specified size and value.
 
 Array2D (const T *pSrc, int srcStride1, int rows, int columns)
 Constructs array that is a copy of specified array.
 
 Array2D (const T *pSrc, int srcStride1, int srcStride2, int rows, int columns)
 Constructs array that is a copy of specified array.
 
 Array2D (const Array2D &rhs)
 Copy constructor.
 
 Array2D (Array2D &&rhs) noexcept
 Move constructor.
 
virtual ~Array2D ()
 Destructor.
 
Array2D & operator= (const Array2D &rhs)
 Copy assignment operator.
 
Array2D & operator= (Array2D &&rhs) noexcept
 Move assignment operator.
 
T * operator[] (int row)
 Index array row.
 
const T * operator[] (int row) const
 Index array row.
 
bool empty () const
 Tests if the array is empty.
 
void resize (int rows, int columns)
 Resizes array.
 
void clear ()
 Resizes array to zero rows and zero columns.
 
int rows () const
 Number of rows in the array.
 
int height () const
 Height of the array.
 
int columns () const
 Number of columns in the array.
 
int width () const
 Width of the array.
 
T * ptrData ()
 Retrieves the pointer to the beginning of the array.
 
const T * ptrData () const
 Retrieves the pointer to the beginning of the array.
 
int stride1 () const
 Stride in bytes between the rows in the array.
 
int step () const
 Step in bytes between the rows in the array.
 
int ld () const
 Leading dimension between the rows in the array.
 
void swap (Array2D &rhs)
 Swaps this array with another one.
 
void set (const T &val)
 Sets array elements to a value.
 

Additional Inherited Members

- Static Public Member Functions inherited from blo::Array2D< T >
static int stride2 ()
 Stride in bytes between the elements in the array.
 

Detailed Description

template<typename T>
class blo::Matrix< T >

Matrix.

Template Parameters
TData type.

Constructor & Destructor Documentation

◆ Matrix() [1/9]

template<typename T >
blo::Matrix< T >::Matrix ( )
default

Default constructor.

◆ Matrix() [2/9]

template<typename T >
blo::Matrix< T >::Matrix ( int  rows,
int  columns 
)

Constructs matrix of specified size.

Parameters
rowsNumber of rows in the matrix.
columnsNumber of columns in the matrix.

◆ Matrix() [3/9]

template<typename T >
blo::Matrix< T >::Matrix ( int  rows,
int  columns,
const T &  val 
)

Constructs matrix of specified size and value.

Parameters
rowsNumber of rows in the matrix.
columnsNumber of columns in the matrix.
valConstant value to assign to each element in the matrix.

◆ Matrix() [4/9]

template<typename T >
blo::Matrix< T >::Matrix ( const T *  pSrc,
int  srcStride1,
int  rows,
int  columns 
)

Constructs matrix that is a copy of specified matrix.

Parameters
pSrcPointer to the source matrix.
srcStride1Stride in bytes between the rows in the source matrix.
rowsNumber of rows in the matrix.
columnsNumber of columns in the matrix.

◆ Matrix() [5/9]

template<typename T >
blo::Matrix< T >::Matrix ( const T *  pSrc,
int  srcStride1,
int  srcStride2,
int  rows,
int  columns 
)

Constructs matrix that is a copy of specified matrix.

Parameters
pSrcPointer to the source matrix.
srcStride1Stride in bytes between the rows in the source matrix.
srcStride2Stride in bytes between the elements in the source matrix.
rowsNumber of rows in the matrix.
columnsNumber of columns in the matrix.

◆ Matrix() [6/9]

template<typename T >
blo::Matrix< T >::Matrix ( const MatrixTranspose< T > &  transpose)
explicit

Constructs matrix that is a copy of specified matrix transpose.

Parameters
transposeThe source matrix transpose.

◆ Matrix() [7/9]

template<typename T >
blo::Matrix< T >::Matrix ( const VectorTranspose< T > &  transpose)
explicit

Constructs matrix that is a copy of specified vector transpose.

Parameters
transposeThe source vector transpose.

◆ Matrix() [8/9]

template<typename T >
blo::Matrix< T >::Matrix ( const Matrix< T > &  rhs)
default

Copy constructor.

◆ Matrix() [9/9]

template<typename T >
blo::Matrix< T >::Matrix ( Matrix< T > &&  rhs)
defaultnoexcept

Move constructor.

◆ ~Matrix()

template<typename T >
virtual blo::Matrix< T >::~Matrix ( )
virtualdefault

Destructor.

Member Function Documentation

◆ operator*=() [1/3]

template<typename T >
Matrix< T > & blo::Matrix< T >::operator*= ( const Matrix< T > &  rhs)

◆ operator*=() [2/3]

template<typename T >
Matrix< T > & blo::Matrix< T >::operator*= ( const MatrixTranspose< T > &  rhs)

◆ operator*=() [3/3]

template<typename T >
Matrix< T > & blo::Matrix< T >::operator*= ( const T &  scalar)

◆ operator+=() [1/2]

template<typename T >
Matrix< T > & blo::Matrix< T >::operator+= ( const Matrix< T > &  rhs)

◆ operator+=() [2/2]

template<typename T >
Matrix< T > & blo::Matrix< T >::operator+= ( const T &  scalar)

◆ operator-=() [1/2]

template<typename T >
Matrix< T > & blo::Matrix< T >::operator-= ( const Matrix< T > &  rhs)

◆ operator-=() [2/2]

template<typename T >
Matrix< T > & blo::Matrix< T >::operator-= ( const T &  scalar)

◆ operator/=()

template<typename T >
Matrix< T > & blo::Matrix< T >::operator/= ( const T &  scalar)

◆ operator=() [1/2]

template<typename T >
Matrix< T > & blo::Matrix< T >::operator= ( const Matrix< T > &  rhs)
default

Copy assignment operator.

◆ operator=() [2/2]

template<typename T >
Matrix< T > & blo::Matrix< T >::operator= ( Matrix< T > &&  rhs)
defaultnoexcept

Move assignment operator.


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