radarlib 1.4.6
|
Matrix of data values. More...
#include <radarlib/odimh5v21_support.hpp>
Public Member Functions | |
DataMatrix () | |
Create an empty 0x0 matrix. | |
DataMatrix (int rows, int cols) | |
Create an empty rows x cols matrix. | |
DataMatrix (int rows, int cols, T value) | |
Create an empty rows x cols matrix, setting elements to 0. | |
void | resize (const int rows, const int cols) |
Resize the matrix. | |
void | resize (const int rows, const int cols, const T fillvalue) |
Resize the matrix. | |
void | erase () |
Set all matrix values to the current fill value. | |
void | fill (T value) |
Set all matrix values to the given value. | |
T & | elem (const int r, const int b) |
Reference to the element (r,b) | |
const T * | get () const |
Return the pointer to the underneath data buffer. | |
int | getRowCount () const |
Return the number of rows. | |
int | getColCount () const |
Return the number of cols. | |
Matrix of data values.
This class represent matrix of values
The type of every value in the matrix is defined by the user using the template syntax
The internal data buffer is automatically allocated and deallocated The matrix can be resized but the previous values will be lost and the elements will be set to 0 or to the fill value specified in the constructor
OdimH5v21::DataMatrix< T >::DataMatrix | ( | ) |
Create an empty 0x0 matrix.
Create an empty 0x0 matrix The default fill value for resize operations will be 0
OdimH5v21::DataMatrix< T >::DataMatrix | ( | int | rows, |
int | cols ) |
Create an empty rows x cols matrix.
Create an empty rows x cols matrix, setting elements to 0 The default fill value for resize operations will be 0
rows | number of rows to store in the matrix |
cols | number of cols for each row |
OdimH5v21::DataMatrix< T >::DataMatrix | ( | int | rows, |
int | cols, | ||
T | value ) |
Create an empty rows x cols matrix, setting elements to 0.
rows | number of rows to store in the matrix |
cols | number of cols for each row |
value | number value used to fill the new allocated cells |
void OdimH5v21::DataMatrix< T >::resize | ( | const int | rows, |
const int | cols ) |
Resize the matrix.
Resize the matrix using the given number of rows and cols The previous matrix data will be erased and filled with the current fill value
rows | the new rows number |
cols | the new cols number |
void OdimH5v21::DataMatrix< T >::resize | ( | const int | rows, |
const int | cols, | ||
const T | fillvalue ) |
Resize the matrix.
Resize the matrix using the given number of rows and cols The previous matrix data will be erased and filled with the new fill value
rows | the new rows number |
cols | the new cols number |
fillvalue | value used to initialize matrix cells |
void OdimH5v21::DataMatrix< T >::erase | ( | ) |
Set all matrix values to the current fill value.
void OdimH5v21::DataMatrix< T >::fill | ( | T | value | ) |
Set all matrix values to the given value.
T & OdimH5v21::DataMatrix< T >::elem | ( | const int | r, |
const int | b ) |
Reference to the element (r,b)
r | row index from 0 to rows-1 |
b | col index from 0 to cols-1 |
const T * OdimH5v21::DataMatrix< T >::get | ( | ) | const |
Return the pointer to the underneath data buffer.
int OdimH5v21::DataMatrix< T >::getRowCount | ( | ) | const |
Return the number of rows.
int OdimH5v21::DataMatrix< T >::getColCount | ( | ) | const |
Return the number of cols.