Flair
Framework Libre Air
|
Class defining a matrix. More...
#include <Matrix.h>
Classes | |
class | Type |
Public Member Functions | |
Matrix (const Object *parent, const cvmatrix_descriptor *descriptor, ScalarType const &elementDataType, std::string name="", uint32_t n=1) | |
Constructor. More... | |
Matrix (const Object *parent, uint32_t rows, uint32_t cols, ScalarType const &elementDataType, std::string name="", uint32_t n=1) | |
Constructor. More... | |
~Matrix () | |
Destructor. More... | |
float | Value (uint32_t row, uint32_t col) const |
Element value. More... | |
float | ValueNoMutex (uint32_t row, uint32_t col) const |
Element value. More... | |
void | SetValue (uint32_t row, uint32_t col, float value) |
Set element value. More... | |
void | SetValueNoMutex (uint32_t row, uint32_t col, float value) |
Set element value. More... | |
std::string | Name (uint32_t row, uint32_t col) const |
Element name. More... | |
IODataElement * | Element (uint32_t row, uint32_t col) const |
Element. More... | |
IODataElement * | Element (uint32_t index) const |
Element. More... | |
uint32_t | Rows (void) const |
Number of rows. More... | |
uint32_t | Cols (void) const |
Number of colomns. More... | |
Type const & | GetDataType () const |
void | RawRead (char *dst) const |
Raw read datas. More... | |
void | RawWrite (char *src) |
Raw write datas. More... | |
Public Member Functions inherited from flair::core::io_data | |
io_data (const Object *parent, std::string name, int n) | |
Constructor. More... | |
virtual | ~io_data () |
Destructor. More... | |
void | SetDataTime (Time time) |
Set data time, also caluculates the delta time based on last call. More... | |
void | SetDataTime (Time time, Time deltaTime) |
Set data time and delta time (thus delta time is not based on last call) More... | |
Time | DataTime (void) const |
Data time. More... | |
Time | DataDeltaTime (void) const |
Data delta time. More... | |
void | GetDataTime (Time &time, Time &deltaTime) const |
Get data time and delta time. More... | |
const io_data * | Prev (int n) const |
Previous data. More... | |
Public Member Functions inherited from flair::core::Mutex | |
Mutex (const Object *parent, std::string name="") | |
Constructor. More... | |
~Mutex () | |
Destructor. More... | |
void | GetMutex (void) const |
GetMutex. More... | |
void | ReleaseMutex (void) const |
ReleaseMutex. More... | |
Public Member Functions inherited from flair::core::Object | |
Object (const Object *parent=NULL, std::string name="", std::string type="") | |
Constructor. More... | |
virtual | ~Object () |
Destructor. More... | |
std::string | ObjectName (void) const |
Name. More... | |
std::string | ObjectType (void) const |
Type. More... | |
const Object * | Parent (void) const |
Parent. More... | |
std::vector< const Object * > * | TypeChilds (void) const |
Childs of the same type. More... | |
std::vector< const Object * > * | Childs (void) const |
Childs. More... | |
void | Information (const char *function, int line, const char *format,...) const |
Formatted information. More... | |
void | Warning (const char *function, const char *format,...) const |
Formatted warning. More... | |
void | Error (const char *function, const char *format,...) const |
Formatted error. More... | |
bool | ErrorOccured (bool recursive=true) const |
Has an errror occured? More... | |
Additional Inherited Members | |
Public Types inherited from flair::core::Object | |
enum | color_t { Auto = 0, Red = 31, Green = 32, Orange = 33 } |
Protected Member Functions inherited from flair::core::io_data | |
void | AppendLogDescription (std::string description, DataType const &datatype) |
Specify the description of the reimplemented class data's. More... | |
void | SetPtrToCircle (void **ptr) |
Set the datas to circle. More... | |
Protected Attributes inherited from flair::core::io_data | |
io_data * | prev |
Pointer to previous data. More... | |
Class defining a matrix.
flair::core::Matrix::Matrix | ( | const Object * | parent, |
const cvmatrix_descriptor * | descriptor, | ||
ScalarType const & | elementDataType, | ||
std::string | name = "" , |
||
uint32_t | n = 1 |
||
) |
Constructor.
Construct an io_data representing a matrix.
It uses a cvmatrix_descriptor to get size and elements' names.
Names are used for graphs and logs.
All values are initialized to 0.
parent | parent |
descriptor | matrix description, it is safe to destroy it after calling this constructor |
type | type of matrix elements |
name | name |
n | number of samples |
flair::core::Matrix::Matrix | ( | const Object * | parent, |
uint32_t | rows, | ||
uint32_t | cols, | ||
ScalarType const & | elementDataType, | ||
std::string | name = "" , |
||
uint32_t | n = 1 |
||
) |
Constructor.
Construct an io_data representing a matrix.
Elements are unamed.
All values are initialized to 0.
parent | parent |
rows | matrix rows |
cols | matrix cols |
type | type of matrix elements |
name | name |
n | number of samples |
flair::core::Matrix::~Matrix | ( | ) |
Destructor.
float flair::core::Matrix::Value | ( | uint32_t | row, |
uint32_t | col | ||
) | const |
float flair::core::Matrix::ValueNoMutex | ( | uint32_t | row, |
uint32_t | col | ||
) | const |
Element value.
Element is not accessed by locking and unlocking the io_data Mutex.
Thus, this function should be called with Mutex locked.
This function is usefull when multiple successive access are done to the elments of the matrix. It avoids unnecessary locking and unlocking.
row | element row |
col | element col |
void flair::core::Matrix::SetValue | ( | uint32_t | row, |
uint32_t | col, | ||
float | value | ||
) |
void flair::core::Matrix::SetValueNoMutex | ( | uint32_t | row, |
uint32_t | col, | ||
float | value | ||
) |
Set element value.
Element is not accessed by locking and unlocking the io_data Mutex.
Thus, this function should be called with Mutex locked.
This function is usefull when multiple successive access are done to the elments of the matrix. It avoids unnecessary locking and unlocking.
row | element row |
col | element col |
value | element value |
std::string flair::core::Matrix::Name | ( | uint32_t | row, |
uint32_t | col | ||
) | const |
Element name.
If Matrix was created without cvmatrix_descriptor, element name is empty.
row | element row |
col | element col |
IODataElement* flair::core::Matrix::Element | ( | uint32_t | row, |
uint32_t | col | ||
) | const |
Element.
Get a pointer to a specific element. This pointer can be used for plotting.
row | element row |
col | element col |
IODataElement* flair::core::Matrix::Element | ( | uint32_t | index | ) | const |
Element.
Get a pointer to a specific element. This pointer can be used for plotting.
This function can be used for a 1D matrix.
index | element index |
uint32_t flair::core::Matrix::Rows | ( | void | ) | const |
Number of rows.
uint32_t flair::core::Matrix::Cols | ( | void | ) | const |
Number of colomns.
|
virtual |
Raw read datas.
Reimplemented from io_data.
See io_data::RawRead.
dst | destination buffer |
Implements flair::core::io_data.
|
virtual |
Raw write datas.
Copy the source to the internal datas. Source must be of the corresponding size.
src | source buffer |
Reimplemented from flair::core::io_data.