radarlib 1.4.6
OdimH5v20::DataMatrix< T > Class Template Reference

Matrix of data values. More...

#include <radarlib/odimh5v20_support.hpp>

Inheritance diagram for OdimH5v20::DataMatrix< T >:
OdimH5v20::RayMatrix< T >

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.
 

Detailed Description

template<class T>
class OdimH5v20::DataMatrix< T >

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

See also
OdimData

Constructor & Destructor Documentation

◆ DataMatrix() [1/3]

template<class T >
OdimH5v20::DataMatrix< T >::DataMatrix ( )

Create an empty 0x0 matrix.

Create an empty 0x0 matrix The default fill value for resize operations will be 0

◆ DataMatrix() [2/3]

template<class T >
OdimH5v20::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

Parameters
rowsnumber of rows to store in the matrix
colsnumber of cols for each row

◆ DataMatrix() [3/3]

template<class T >
OdimH5v20::DataMatrix< T >::DataMatrix ( int  rows,
int  cols,
value 
)

Create an empty rows x cols matrix, setting elements to 0.

Parameters
rowsnumber of rows to store in the matrix
colsnumber of cols for each row
valuenumber value used to fill the new allocated cells

Member Function Documentation

◆ resize() [1/2]

template<class T >
void OdimH5v20::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

Parameters
rowsthe new rows number
colsthe new cols number

◆ resize() [2/2]

template<class T >
void OdimH5v20::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

Parameters
rowsthe new rows number
colsthe new cols number
fillvaluevalue used to initialize matrix cells

◆ erase()

template<class T >
void OdimH5v20::DataMatrix< T >::erase ( )

Set all matrix values to the current fill value.

◆ fill()

template<class T >
void OdimH5v20::DataMatrix< T >::fill ( value)

Set all matrix values to the given value.

◆ elem()

template<class T >
T & OdimH5v20::DataMatrix< T >::elem ( const int  r,
const int  b 
)

Reference to the element (r,b)

Parameters
rrow index from 0 to rows-1
bcol index from 0 to cols-1
Examples
create_odim_object.cpp, create_polar_volume.cpp, read_polar_volume.cpp, and read_polar_volume2.cpp.

◆ get()

template<class T >
const T * OdimH5v20::DataMatrix< T >::get ( ) const

Return the pointer to the underneath data buffer.

◆ getRowCount()

template<class T >
int OdimH5v20::DataMatrix< T >::getRowCount ( ) const

Return the number of rows.

◆ getColCount()

template<class T >
int OdimH5v20::DataMatrix< T >::getColCount ( ) const

Return the number of cols.


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