IMatrix Class Referenceabstract

Basic OpenViBE matrix interface. More...

Inheritance diagram for IMatrix:
IObject CMatrix

Public Member Functions

Accessors
virtual const OpenViBE::uint32 getDimensionCount (void) const =0
 Gets the dimension count for this matrix. More...
 
virtual const OpenViBE::uint32 getDimensionSize (const OpenViBE::uint32 ui32DimensionIndex) const =0
 Gets the dimension size for a given dimension index. More...
 
virtual const char * getDimensionLabel (const OpenViBE::uint32 ui32DimensionIndex, const OpenViBE::uint32 ui32DimensionEntryIndex) const =0
 Gets the dimension label for a given dimension index / dimension entry index pair. More...
 
virtual const OpenViBE::float64 * getBuffer (void) const =0
 Gets the raw buffer for this matrix. More...
 
virtual const OpenViBE::uint32 getBufferElementCount (void) const =0
 Gets the total number of elements in the matrix. More...
 
Modifiers
virtual OpenViBE::boolean setDimensionCount (const OpenViBE::uint32 ui32DimensionCount)=0
 Sets dimension count for this matrix. More...
 
virtual OpenViBE::boolean setDimensionSize (const OpenViBE::uint32 ui32DimensionIndex, const OpenViBE::uint32 ui32DimensionSize)=0
 Sets the dimension size for this matrix on a given dimension index. More...
 
virtual OpenViBE::boolean setDimensionLabel (const OpenViBE::uint32 ui32DimensionIndex, const OpenViBE::uint32 ui32DimensionEntryIndex, const char *sDimensionLabel)=0
 Sets the dimension label for this matrix on a given dimension index / dimension entry index pair. More...
 
virtual OpenViBE::float64 * getBuffer (void)=0
 Gets a writable raw buffer for this matrix. More...
 
- Public Member Functions inherited from IObject
virtual OpenViBE::CIdentifier getClassIdentifier (void) const =0
 Returns the final class identifier of the concrete class. More...
 
virtual OpenViBE::boolean isDerivedFromClass (const OpenViBE::CIdentifier &rClassIdentifier) const
 Checks if this object is compatible with a class identifier. More...
 
virtual OpenViBE::boolean acceptVisitor (OpenViBE::IObjectVisitor &rObjectVisitor)
 Requests this object to accept a visitor. More...
 

Detailed Description

Basic OpenViBE matrix interface.

Author
Yann Renard (INRIA/IRISA)
Date
2007-11-21 This interface offers functionalities to basically manipulate an n-dimensional matrix. The manipulation that can be done are very limited and nearly limits to memory manipulation. This is basically an unified way for storing matrices content in OpenViBE

OpenViBE provides an standalone implementation of this interface in OpenViBE::CMatrix

Member Function Documentation

virtual const OpenViBE::uint32 getDimensionCount ( void  ) const
pure virtual

Gets the dimension count for this matrix.

Returns
the dimension count for this matrix
Note
Uninitialized matrices should return 0

Implemented in CMatrix.

virtual const OpenViBE::uint32 getDimensionSize ( const OpenViBE::uint32  ui32DimensionIndex) const
pure virtual

Gets the dimension size for a given dimension index.

Parameters
ui32DimensionIndex[in] : the dimension index which size has to be returned
Returns
the dimension size for the specified dimension index
Note
Each dimension can have a different size

Implemented in CMatrix.

virtual const char* getDimensionLabel ( const OpenViBE::uint32  ui32DimensionIndex,
const OpenViBE::uint32  ui32DimensionEntryIndex 
) const
pure virtual

Gets the dimension label for a given dimension index / dimension entry index pair.

Parameters
ui32DimensionIndex[in] : the dimension index
ui32DimensionEntryIndex[in] : the dimension entry index for the specified dimension index
Returns
the dimension label for the given dimension index / dimension entry index pair
Note
The string is permanent pointer until the dimension size or the label itself changes

Implemented in CMatrix.

virtual const OpenViBE::float64* getBuffer ( void  ) const
pure virtual

Gets the raw buffer for this matrix.

Returns
the raw buffer for this matrix
Note
The raw buffer is permanent pointer until the dimension count or any dimension size changes

When the raw buffer is acquired, the elements are accessed sequentially, using each dimension after the other. Suppose a matrix of 2 dimensions. First dimension size is 2 and second dimension size is 3 :

IMatrix* l_pMatrix= // ...
l_pMatrix->setDimensionCount(2);
l_pMatrix->setDimensionSize(0, 2);
l_pMatrix->setDimensionSize(1, 3);
float64* l_pMatrixRawBuffer=l_pMatrix->getBuffer();
l_pMatrixRawBuffer[0]; // this is l_pMatrixRawBuffer[0*3 + 0];
l_pMatrixRawBuffer[1]; // this is l_pMatrixRawBuffer[0*3 + 1];
l_pMatrixRawBuffer[2]; // this is l_pMatrixRawBuffer[0*3 + 2];
l_pMatrixRawBuffer[3]; // this is l_pMatrixRawBuffer[1*3 + 0];
l_pMatrixRawBuffer[4]; // this is l_pMatrixRawBuffer[1*3 + 1];
l_pMatrixRawBuffer[5]; // this is l_pMatrixRawBuffer[1*3 + 2];
l_pMatrixRawBuffer[i*3+j]; // this is index i of the first dimension, and j of the second dimension
See also
getBufferElementCount

Implemented in CMatrix.

virtual const OpenViBE::uint32 getBufferElementCount ( void  ) const
pure virtual

Gets the total number of elements in the matrix.

Returns
the total number of elements in the matrix
Note
The value returned by this function is the size of the raw buffer returned by getBuffer

Implemented in CMatrix.

virtual OpenViBE::boolean setDimensionCount ( const OpenViBE::uint32  ui32DimensionCount)
pure virtual

Sets dimension count for this matrix.

Parameters
ui32DimensionCount[in] : the number of dimension for this matrix
Returns
true in case of success.
false in case of error.

Implemented in CMatrix.

virtual OpenViBE::boolean setDimensionSize ( const OpenViBE::uint32  ui32DimensionIndex,
const OpenViBE::uint32  ui32DimensionSize 
)
pure virtual

Sets the dimension size for this matrix on a given dimension index.

Parameters
ui32DimensionIndex[in] : the dimension index which size has to be changed
ui32DimensionSize[in] : the new dimension size for this dimension
Returns
true in case of success.
false in case of error.

Implemented in CMatrix.

virtual OpenViBE::boolean setDimensionLabel ( const OpenViBE::uint32  ui32DimensionIndex,
const OpenViBE::uint32  ui32DimensionEntryIndex,
const char *  sDimensionLabel 
)
pure virtual

Sets the dimension label for this matrix on a given dimension index / dimension entry index pair.

Parameters
ui32DimensionIndex[in] : the dimension index
ui32DimensionEntryIndex[in] : the entry index in the specificed dimension which label has to be changed
sDimensionLabel[in] : the new dimension label to apply to this dimension index / dimension entry index pair
Returns
true in case of success.
false in case of error.

Implemented in CMatrix.

virtual OpenViBE::float64* getBuffer ( void  )
pure virtual

Gets a writable raw buffer for this matrix.

Returns
the raw buffer for this matrix
Note
The raw buffer is permanent pointer until the dimension count or any dimension size changes
See also
IMatrix::getBufferElementCount
IMatrix::getBuffer const

Implemented in CMatrix.