The Open Master Hearing Aid (openMHA)
openMHA
Open community platform for hearing aid algorithm research
|
n-dimensional matrix with real or complex floating point values. More...
Public Member Functions | |
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_t & | operator= (const MHASignal::matrix_t &) |
MHASignal::matrix_t & | operator= (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_t & | real (const MHASignal::uint_vector_t &index) |
Access real part of an element in a n-dimensional matrix. More... | |
mha_real_t & | imag (const MHASignal::uint_vector_t &index) |
Access imaginary part of an element in a n-dimensional matrix. More... | |
mha_complex_t & | operator() (const MHASignal::uint_vector_t &index) |
Access complex value of an element in a n-dimensional matrix. More... | |
const mha_real_t & | real (const MHASignal::uint_vector_t &index) const |
Access real part of an element in a n-dimensional matrix. More... | |
const mha_real_t & | imag (const MHASignal::uint_vector_t &index) const |
Access imaginary part of an element in a n-dimensional matrix. More... | |
const mha_complex_t & | operator() (const MHASignal::uint_vector_t &index) const |
Access complex value of an element in a n-dimensional matrix. More... | |
mha_real_t & | real (unsigned int row, unsigned int col) |
Access real part of an element in a two-dimensional matrix. More... | |
mha_real_t & | imag (unsigned int row, unsigned int col) |
Access imaginary part of an element in a two-dimensional matrix. More... | |
mha_complex_t & | operator() (unsigned int row, unsigned int col) |
Access complex value of an element in a two-dimensional matrix. More... | |
const mha_real_t & | real (unsigned int row, unsigned int col) const |
Access real part of an element in a two-dimensional matrix. More... | |
const mha_real_t & | imag (unsigned int row, unsigned int col) const |
Access imaginary part of an element in a two-dimensional matrix. More... | |
const mha_complex_t & | operator() (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_t * | get_rdata () const |
Return pointer of real data. More... | |
const mha_complex_t * | get_cdata () const |
Return pointer of complex data. More... | |
Private Attributes | |
uint32_t | complex_ofs |
uint32_t | nelements |
union { | |
mha_real_t * rdata | |
mha_complex_t * cdata | |
}; | |
Private Attributes inherited from MHASignal::uint_vector_t | |
uint32_t | length |
uint32_t * | data |
Additional Inherited Members | |
Private Member Functions inherited from MHASignal::uint_vector_t | |
uint_vector_t (unsigned int len) | |
Constructor, initializes all elements to zero. More... | |
uint_vector_t (const uint_vector_t &) | |
uint_vector_t (const uint8_t *buf, unsigned int len) | |
Construct from memory area. More... | |
~uint_vector_t () | |
bool | operator== (const uint_vector_t &) const |
Check for equality. More... | |
uint_vector_t & | operator= (const uint_vector_t &) |
Assign from other uint_vector_t. More... | |
unsigned int | get_length () const |
Return the length of the vector. More... | |
const uint32_t & | operator[] (unsigned int k) const |
Read-only access to elements. More... | |
uint32_t & | operator[] (unsigned int k) |
Access to elements. More... | |
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 uint32_t * | getdata () const |
Return pointer to the data field. More... | |
n-dimensional matrix with real or complex floating point values.
MHASignal::matrix_t::matrix_t | ( | unsigned int | nrows, |
unsigned int | ncols, | ||
bool | b_is_complex = true |
||
) |
Create a two-dimensional matrix.
nrows | Number of rows |
ncols | Number of columns |
b_is_complex | Add space for complex values |
MHASignal::matrix_t::matrix_t | ( | const mha_spec_t & | spec | ) |
Create a two-dimensional matrix from a spectrum, copy values.
spec | Source spectrum structure |
MHASignal::matrix_t::matrix_t | ( | const MHASignal::uint_vector_t & | size, |
bool | b_is_complex = true |
||
) |
Create n-dimensional matrix, descriped by size argument.
size | Size vector |
b_is_complex | Add space for complex values |
MHASignal::matrix_t::matrix_t | ( | const MHASignal::matrix_t & | src | ) |
MHASignal::matrix_t::matrix_t | ( | const uint8_t * | buf, |
unsigned int | len | ||
) |
Construct from memory area.
MHASignal::matrix_t::~matrix_t | ( | ) |
matrix_t & MHASignal::matrix_t::operator= | ( | const MHASignal::matrix_t & | src | ) |
MHASignal::matrix_t & MHASignal::matrix_t::operator= | ( | const MHA_AC::comm_var_t & | v | ) |
Fill matrix with data of an AC variable object.
v | Source AC variable (comm_var_t) |
MHA_AC::comm_var_t MHASignal::matrix_t::get_comm_var | ( | ) |
Return a AC communication variable pointing to the data of the current matrix.
|
inline |
Return the dimension of the matrix.
|
inline |
Return the size of the matrix.
k | Dimension |
unsigned int MHASignal::matrix_t::get_nelements | ( | ) | const |
Return total number of elements.
bool MHASignal::matrix_t::is_same_size | ( | const MHASignal::matrix_t & | src | ) |
Test if matrix has same size as other.
|
inline |
Return information about complexity.
|
inline |
Access real part of an element in a n-dimensional matrix.
index | Index vector |
|
inline |
Access imaginary part of an element in a n-dimensional matrix.
index | Index vector |
|
inline |
Access complex value of an element in a n-dimensional matrix.
index | Index vector |
|
inline |
Access real part of an element in a n-dimensional matrix.
index | Index vector |
|
inline |
Access imaginary part of an element in a n-dimensional matrix.
index | Index vector |
|
inline |
Access complex value of an element in a n-dimensional matrix.
index | Index vector |
|
inline |
Access real part of an element in a two-dimensional matrix.
row | Row number of element |
col | Column number of element |
|
inline |
Access imaginary part of an element in a two-dimensional matrix.
row | Row number of element |
col | Column number of element |
|
inline |
Access complex value of an element in a two-dimensional matrix.
row | Row number of element |
col | Column number of element |
|
inline |
Access real part of an element in a two-dimensional matrix.
row | Row number of element |
col | Column number of element |
|
inline |
Access imaginary part of an element in a two-dimensional matrix.
row | Row number of element |
col | Column number of element |
|
inline |
Access complex value of an element in a two-dimensional matrix.
row | Row number of element |
col | Column number of element |
|
inline |
unsigned int MHASignal::matrix_t::get_index | ( | unsigned int | row, |
unsigned int | col | ||
) | const |
unsigned int MHASignal::matrix_t::get_index | ( | const MHASignal::uint_vector_t & | index | ) | const |
unsigned int MHASignal::matrix_t::numbytes | ( | ) | const |
Return number of bytes needed to store into memory.
unsigned int MHASignal::matrix_t::write | ( | uint8_t * | buf, |
unsigned int | len | ||
) | const |
Copy to memory area.
|
inline |
Return pointer of real data.
|
inline |
Return pointer of complex data.
|
private |
|
private |
mha_real_t* MHASignal::matrix_t::rdata |
mha_complex_t* MHASignal::matrix_t::cdata |
union { ... } |