Matrix¶
This chapter describes the Matrix interface. It represents a matrix that can be used to perform linear algebraic calculations on a set of input data, e.g. to perform coordinate transformations. The generic equation to calculate n output values from m input values, using a \(n \times m\) matrix (rows \(×\) columns) is shown in the following equation:
Usage¶
A matrix can be defined in XML and retrieved via the API. Alternatively, a matrix can be created and configured using the API as follows:
Create a matrix instance using the CreateMatrix method on the TopController interface.
A signal data type must be specified during creation. The matrix values and output signals will have this type. The available data types are Float, Double and Bool. For Bool the matrix calculation equates to OR functionality.
Connect the inputs.
Set the matrix values.
Connect the output signals on inputs of the target entities.
A Matrix is destroyed by calling Dispose (for C#) or Destroy (for C++).
It is allowed to change values in matrices while the matrix is in use.
Inputs¶
The matrix has a number of inputs, which are named following the convention shown in table Matrix inputs.
Name |
Data type |
Description |
Input# |
<data type of matrix> |
Matrix input with index in the interval [0, \(m\) − 1] for a \(n × m\) matrix with \(m\) inputs |
Signals¶
The interface contains the signals listed in table Matrix signals.
Name |
Data type |
R/W |
Description |
Output# |
<data type of matrix> |
R |
Matrix output with index in the interval [0, \(n\) − 1] for a \(n × m\) matrix with \(n\) outputs |
See also
- Matrix
XML configuration example of the matrix interface.