Time-of-Flight Library(ToF)  3.2.2
chronoptics::tof::Matrix Class Reference

2D matrix wrapper More...

#include <calibration.hpp>

+ Inheritance diagram for chronoptics::tof::Matrix:

Public Member Functions

 Matrix (tof_matrix_t ptr=nullptr)
 Construct from pointer.
 
 Matrix (int32_t rows, int32_t cols, MatType mat_type)
 Create new matrix. More...
 
int32_t rows () const
 Number of rows. More...
 
int32_t cols () const
 Number of columns. More...
 
MatType mat_type () const
 Matrix type. More...
 
void * data ()
 Get the pointer to the underlying data. More...
 
template<typename T >
const T & at (size_t pos) const
 Get the data at location p, templated because the data type can differ. More...
 
template<typename T >
T & at (size_t pos)
 Get the data at location p, templated because the data type can differ. More...
 
template<typename T >
const T * begin () const
 Return iterator to beginning, templated because the data type can differ. More...
 
template<typename T >
T * begin ()
 Return iterator to beginning, templated because the data type can differ. More...
 
template<typename T >
const T * end () const
 Return iterator to end, templated because the data type can differ. More...
 
template<typename T >
T * end ()
 Return iterator to end, templated because the data type can differ. More...
 

Detailed Description

2D matrix wrapper

Definition at line 13 of file calibration.hpp.

Constructor & Destructor Documentation

◆ Matrix()

chronoptics::tof::Matrix::Matrix ( int32_t  rows,
int32_t  cols,
MatType  mat_type 
)
inline

Create new matrix.

Parameters
rowsNumber of rows
colsNumber of columns
mat_typeMatrix type

Definition at line 25 of file calibration.hpp.

References cols(), mat_type(), and rows().

Member Function Documentation

◆ at() [1/2]

template<typename T >
T& chronoptics::tof::Matrix::at ( size_t  pos)
inline

Get the data at location p, templated because the data type can differ.

Parameters
posLocation of the data to get
Returns
Data of type T

Definition at line 74 of file calibration.hpp.

References data().

◆ at() [2/2]

template<typename T >
const T& chronoptics::tof::Matrix::at ( size_t  pos) const
inline

Get the data at location p, templated because the data type can differ.

Parameters
posLocation of the data to get
Returns
Data of type T

Definition at line 64 of file calibration.hpp.

◆ begin() [1/2]

template<typename T >
T* chronoptics::tof::Matrix::begin ( )
inline

Return iterator to beginning, templated because the data type can differ.

Returns
Begin iterator to T

Definition at line 91 of file calibration.hpp.

References data().

◆ begin() [2/2]

template<typename T >
const T* chronoptics::tof::Matrix::begin ( ) const
inline

Return iterator to beginning, templated because the data type can differ.

Returns
Begin iterator to T

Definition at line 82 of file calibration.hpp.

◆ cols()

int32_t chronoptics::tof::Matrix::cols ( ) const
inline

Number of columns.

Returns
Columns

Definition at line 39 of file calibration.hpp.

Referenced by end(), and Matrix().

◆ data()

void* chronoptics::tof::Matrix::data ( )
inline

Get the pointer to the underlying data.

Returns
Data

Definition at line 53 of file calibration.hpp.

Referenced by at(), begin(), and end().

◆ end() [1/2]

template<typename T >
T* chronoptics::tof::Matrix::end ( )
inline

Return iterator to end, templated because the data type can differ.

Returns
End iterator to T

Definition at line 108 of file calibration.hpp.

References cols(), data(), and rows().

◆ end() [2/2]

template<typename T >
const T* chronoptics::tof::Matrix::end ( ) const
inline

Return iterator to end, templated because the data type can differ.

Returns
End iterator to T

Definition at line 99 of file calibration.hpp.

References cols(), and rows().

◆ mat_type()

MatType chronoptics::tof::Matrix::mat_type ( ) const
inline

Matrix type.

Returns
Matrix type

Definition at line 46 of file calibration.hpp.

Referenced by Matrix().

◆ rows()

int32_t chronoptics::tof::Matrix::rows ( ) const
inline

Number of rows.

Returns
Rows

Definition at line 32 of file calibration.hpp.

Referenced by end(), and Matrix().