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.

The MLDesigner `PtMatrix` class stores data as a simple C array, and therefore uses row ordering. Row ordering also seems more natural for operations such as image and video processing, but it might make it more difficult to interface `PtMatrix` class with Fortran library calls (since Fortran uses column ordering to store arrays). The limits of interfacing `PtMatrix` class with other software is discussed in Future Extensions.

The design decision to store data entries in a C array rather than in an array of vector objects has a greater effect on performance than the decision whether to use row or column ordering.

There are a couple of advantages in implementing a matrix class as an array of vector class objects: referencing an entry may be faster, and it is easier to do operations on a whole row or column of the matrix, depending on whether the format is an array of column vectors or an array of row vectors.

An entry lookup in an array of row vectors requires two index lookups: one to find the desired row vector in the array and one to find the desired entry of that row. A linear array, in contrast, requires a multiplication to find the location of first element of the desired row and then an index lookup to find the column in that row. For example, `A[row][col]` is equivalent to looking up `&data + (row*numRows + col)` if the entries are stored in a C array `data[]`, whereas it is `*(&rowArray + row) + col` if looking up the entry in an array of vectors format.

Although the array of vectors format has faster lookups, it is also more extensive to create and delete the matrix. Each vector of the array must be created in the matrix constructor, and each vector must also be deleted by the matrix destructor. The array of vectors format also requires more memory to store the data and the extra array of vectors.

With the advantages and disadvantages of the two systems in mind, we chose to implement the `PtMatrix` class with the data stored in a standard C array. MLDesignerâ€™s environment is such that matrices are created and deleted constantly as needed by the primitives: this negates much of the speedup gained from faster lookups. Also, it was useful to keep the design of the class simple and the memory usage efficient because of MLDesignerâ€™s increasing size and complexity.