Matrix Data Types

Each of the scalar numeric types has an equivalent matrix type, which uses a more complex version of the user-defined type mechanism.

The primary support for matrix types in MLDesigner is the PtMatrix class. PtMatrix is derived from the Message class, and uses the various kernel support functions for working with the Message data type as described in Defining New Data Types. This section discusses the PtMatrix class and how to write primitives and programs using this class.

Design philosophy

The PtMatrix class implements two dimensional arrays. There are two main styles of implementation: a vector of vectors, or a simple array. In addition, there are two main formats of storing the entries: column ordering, where all the entries in the first column are stored before the entries of the second column, and row ordering, where the entries are stored starting with the first row.

PtMatrix Class

The PtMatrix base class is derived from the Message class so the programmer can work with matrices using Envelope class and message-handling system.

Public Functions and Operators for the PtMatrix Class

The functions and operators listed below are implemented by all matrix classes ComplexMatrix, FixMatrix, FloatMatrix, and IntMatrix unless otherwise noted.

Writing Primitives Using the PtMatrix Class

This section describes how to use the matrix data classes when writing primitives. Some examples are given here, more can be found among the primitives in $MLD→MLD Libraries→SDF→Matrix and $MLD→MLD Libraries→SDF→Image.

Future Extensions