The Open Master Hearing Aid (openMHA)  openMHA
Open community platform for hearing aid algorithm research
MHA_AC::ac2matrix_t Class Reference

Copy AC variable to a matrix. More...

Inheritance diagram for MHA_AC::ac2matrix_t:
Inheritance graph

Public Member Functions

 ac2matrix_t (algo_comm_t &ac, const std::string &name)
 Constructor. More...
 
void update ()
 Update contents of the matrix from the AC space. More...
 
const std::string & getname () const
 Return name of AC variable/matrix. More...
 
const std::string & getusername () const
 Return user specified name of AC variable/matrix. More...
 
void insert (algo_comm_t &ac)
 Insert matrix into an AC space (other than source AC space) More...
 
- Public Member Functions inherited from MHASignal::matrix_t
 matrix_t (unsigned int nrows, unsigned int ncols, bool b_is_complex=true)
 Create a two-dimensional matrix. More...
 
 matrix_t (const mha_spec_t &spec)
 Create a two-dimensional matrix from a spectrum, copy values. More...
 
 matrix_t (const MHASignal::uint_vector_t &size, bool b_is_complex=true)
 Create n-dimensional matrix, descriped by size argument. More...
 
 matrix_t (const MHASignal::matrix_t &)
 
 matrix_t (const uint8_t *buf, unsigned int len)
 Construct from memory area. More...
 
 ~matrix_t ()
 
MHASignal::matrix_toperator= (const MHASignal::matrix_t &)
 
MHASignal::matrix_toperator= (const MHA_AC::comm_var_t &v)
 Fill matrix with data of an AC variable object. More...
 
MHA_AC::comm_var_t get_comm_var ()
 Return a AC communication variable pointing to the data of the current matrix. More...
 
unsigned int dimension () const
 Return the dimension of the matrix. More...
 
unsigned int size (unsigned int k) const
 Return the size of the matrix. More...
 
unsigned int get_nelements () const
 Return total number of elements. More...
 
bool is_same_size (const MHASignal::matrix_t &)
 Test if matrix has same size as other. More...
 
bool iscomplex () const
 Return information about complexity. More...
 
mha_real_treal (const MHASignal::uint_vector_t &index)
 Access real part of an element in a n-dimensional matrix. More...
 
mha_real_timag (const MHASignal::uint_vector_t &index)
 Access imaginary part of an element in a n-dimensional matrix. More...
 
mha_complex_toperator() (const MHASignal::uint_vector_t &index)
 Access complex value of an element in a n-dimensional matrix. More...
 
const mha_real_treal (const MHASignal::uint_vector_t &index) const
 Access real part of an element in a n-dimensional matrix. More...
 
const mha_real_timag (const MHASignal::uint_vector_t &index) const
 Access imaginary part of an element in a n-dimensional matrix. More...
 
const mha_complex_toperator() (const MHASignal::uint_vector_t &index) const
 Access complex value of an element in a n-dimensional matrix. More...
 
mha_real_treal (unsigned int row, unsigned int col)
 Access real part of an element in a two-dimensional matrix. More...
 
mha_real_timag (unsigned int row, unsigned int col)
 Access imaginary part of an element in a two-dimensional matrix. More...
 
mha_complex_toperator() (unsigned int row, unsigned int col)
 Access complex value of an element in a two-dimensional matrix. More...
 
const mha_real_treal (unsigned int row, unsigned int col) const
 Access real part of an element in a two-dimensional matrix. More...
 
const mha_real_timag (unsigned int row, unsigned int col) const
 Access imaginary part of an element in a two-dimensional matrix. More...
 
const mha_complex_toperator() (unsigned int row, unsigned int col) const
 Access complex value of an element in a two-dimensional matrix. More...
 
unsigned int get_nreals () const
 
unsigned int get_index (unsigned int row, unsigned int col) const
 
unsigned int get_index (const MHASignal::uint_vector_t &index) const
 
unsigned int numbytes () const
 Return number of bytes needed to store into memory. More...
 
unsigned int write (uint8_t *buf, unsigned int len) const
 Copy to memory area. More...
 
const mha_real_tget_rdata () const
 Return pointer of real data. More...
 
const mha_complex_tget_cdata () const
 Return pointer of complex data. More...
 

Additional Inherited Members

- Private Member Functions inherited from MHA_AC::ac2matrix_helper_t
 ac2matrix_helper_t (algo_comm_t &, const std::string &)
 
void getvar ()
 
- Private Attributes inherited from MHA_AC::ac2matrix_helper_t
algo_comm_tac
 
std::string name
 
std::string username
 
MHASignal::uint_vector_t size
 
bool is_complex
 
comm_var_t acvar
 

Detailed Description

Copy AC variable to a matrix.

This class constructs a matrix of same size as an AC variable and can copy the AC variable to itself. The update() function is real-time safe.

Constructor & Destructor Documentation

◆ ac2matrix_t()

MHA_AC::ac2matrix_t::ac2matrix_t ( algo_comm_t ac,
const std::string &  name 
)

Constructor.

Parameters
acAC handle
nameName of AC variable to be copied

Member Function Documentation

◆ update()

void MHA_AC::ac2matrix_t::update ( )

Update contents of the matrix from the AC space.

This function is real-time safe. The copy operation performance is of the order of the number of elements in the matrix.

◆ getname()

const std::string& MHA_AC::ac2matrix_t::getname ( ) const
inline

Return name of AC variable/matrix.

◆ getusername()

const std::string& MHA_AC::ac2matrix_t::getusername ( ) const
inline

Return user specified name of AC variable/matrix.

◆ insert()

void MHA_AC::ac2matrix_t::insert ( algo_comm_t ac)

Insert matrix into an AC space (other than source AC space)

Parameters
acAC space handle to insert data
Note
The AC variable data buffer points to the data of the matrix. Modifications of the AC variable directly modify the data of the matrix; after deletion of the matrix, the data buffer is invalid.

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