Create a Matrix from a 2-D tensor.
Constructor that allocates memory for Matrix (most common).
The number of rows in the matrix.
The number of columns in the matrix.
Storage for matrix elements; length must be equal to rows * columns.
Matrix multiplication.
Synonym for submatrix.
Synonym for submatrix.
Range of rows to extract.
Range of columns to extract.
The specified submatrix.
2D coordinates element access
Linear element access
View the matrix as a flat array of data.
Helper for equals.
Helper for equals.
The number of columns in the matrix.
Convolve this matrix with another.
Convolve this matrix with another. Useful for convolving two filters. Works only with square, odd-sized filters.
The matrix to be convolved with this.
The convolution of the filters, larger than either.
Make a copy of a Matrix.
Dot product of "this" and "that"
Test "this" and "other" for deep equality.
Test "this" and "other" for deep equality. Allows "==" to work.
Expand the matrix, optionally extending the border into the expanded region.
Expand the matrix, optionally extending the border into the expanded region. This operation is a key part of the FFT. The new matrix is of size "bigRows" x "bigColumns" and element (0, 0) of this is anchored at (0, 0) in the larger matrix. If "borderFill" is true, then the four edges of the matrix are extended evenly in all directions, as though the bigger matrix were actually a torus with opposite edges touching.
Flip the matrix left-to-right and top-to-bottom.
Flip the matrix left-to-right and top-to-bottom. This is useful for creating correlation matrices that are implemented using convolution.
Get the data in the tensor, flattened to a linear array.
Get the data in the tensor, flattened to a linear array.
Required because of overriding equals.
Required because of overriding equals.
The number of "numbers" held in the tensor.
The number of "numbers" held in the tensor.
Compute the Moore-Penrose pseudo inverse.
Find the rank of a matrix.
Find the rank of a matrix.
Rank of the matrix.
Tensor accessor.
Reduce the matrix to a scalar.
The number of rows in the matrix.
Attempt to separate this matrix into an outer product of two vectors.
Attempt to separate this matrix into an outer product of two vectors. Relies on a tolerance, here taken to be the machine epsilon.
Some((verticalVector, horizontalVector)) if separable, otherwise None.
Shape of the matrix.
Shift a matrix with zero fill on the edges.
Shift a matrix with zero fill on the edges.
Number of rows to shift this
down.
Number of columns to shift this
to the right.
Shifted matrix, zero-filling on edges.
Shift "this" matrix down by "shift" rows and right by "shift" columns, expand to a "bigRows" x "bigColumns" complex matrix, padding with zeros everywhere an element is not defined by "this".
Shifts the elements of a matrix cyclicly as though it were a torus, wrapping around the left side to the right side, and the top to the bottom.
Shifts the elements of a matrix cyclicly as though it were a torus, wrapping around the left side to the right side, and the top to the bottom. The rotation is specified by the tuple("deltaRows", "deltaColumns"). For example, the tuple value (2, 3) would cause the element at location (0, 0) to be moved to location (2, 3). In a 5 x 5 matrix, the same tuple would cause the element at (4, 4) to be moved to (1, 2), wrapping around the torus. Returns the cyclicly shifted matrix.
Get the size of the matrix as a string.
Flatten the rows of this matrix to a vector.
Trim "this" to a "smallRows" x "smallColumns" matrix.
Write the row "row" with the data in "vector".
Update a subset of a matrix.
Update a subset of a matrix.
Range of rows to update.
Range of columns to update.
The new values to be written in the submatrix specified
by rows
and columns
. This must have the exact same shape
as (rows, columns), or it must be a 1 x 1 matrix, in which case
it is treated like a scalar.
Modify an element given its 2D coordinates.
Modify an element given its linear position.
A matrix.
In the following descriptions, "v" represents a vector, "s" a scalar, "m" a matrix, "b" a boolean, "i" and integer, "d" a double, "r" a range of integers (e.g. "1 to 5" or "3 until 9").
The update operations, such as "+=", update the elements of the matrix in place.