The Matrix data structure is essentially a 2-dimensional array.

.ds.matrix(data[, options]) or .ds.matrix(options)

A matrix can be initialized with the .ds.matrix() function of a JSAV instance.
If the data argument is provided, it should be an array of arrays, all of the
same length. If only options argument is provided, it needs to specify options
rows and columns specifying the size of the matrix.

style: The style of the array. Valid values are plain, matrix, and
table. Defaults to table.

For example, this would create a 2x2 matrix: var m = jsav.ds.matrix([[0, 1], [2, 3]]).
An empty 5x8 matrix using the matrix style could be created like this:

.swap(row1, col1, row2, col2[, options])

Swaps two values of the matrix, namely (row1, col1) with (ro2, col2).

.layout([options])

Recalculates the layout for the data structure.

Array methods

Like for the array, there are similar functions in the matrix that take the row number as the
first argument and the rest of the arguments similarly than the corresponding array function.
These functions are highlight, unhighlight, isHighlight,
css, value, addClass, hasClass,
removeClass, and toggleClass. So, for example, whereas the array
has function .addClass(col, className), the matrix has a function
.addClass(row, col, className).