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:

\[\begin{split}\begin{bmatrix} Output_0 \\ \vdots & \\ Output_{n-1} \end{bmatrix} = \begin{bmatrix} Matrix_{0,0} & \cdots & Matrix_{0,m-1} \\ \vdots & \ddots & \vdots \\ Matrix_{n-1,0} & \cdots & Matrix_{n-1,m-1} \end{bmatrix} \times \begin{bmatrix} Input_{0} \\ \vdots \\ Input_{m-1} \end{bmatrix}\end{split}\]

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:

  1. 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.

  2. Connect the inputs.

  3. Set the matrix values.

  4. 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.

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.

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.