| Constructor | make_matrix_ixj(i, j, e_00, …, e_ij) | Creates an ixj matrix with elements e_00, …, e_ij | make_matrix_1x3(1,3,1,2,3) | { {1.0,2.0,3.0} } |
| Constructor (2) | matrix_from_text(string) | Creates a matrix from the specified string | matrix_from_text(’{ {1,2,3}, {1,2,3} }’) | { {1.0,2.0,3.0}, {1.0,2.0,3.0} } |
| + (matrix addition) | matrix + matrix | Performs matrix addition | { {1,2,3}, {4,5,6} } + { {4,5,6}, {1,2,3} } | { {5.0,7.0,9.0}, {5.0,7.0,9.0} } |
| - (matrix subtraction) | matrix - matrix | Performs matrix subtraction | { {1,2,3}, {4,5,6} } - { {4,5,6}, {1,2,3} } | { {-3.0,-3.0,-3.0}, {3.0,3.0,3.0} } |
| * (scalar multiplication) | numeric * matrix | Performs scalar multiplication | 2 * { {4,5,6}, {1,2,3} } | { {2.0,4.0,6.0}, {8.0,10.0,12.0} } |
| * (matrix multiplication) | matrix * matrix | Performs matrix multiplication | { {1,2,3}, {4,5,6} } * { {1,2}, {3,4}, {5,6} } | { {22.0,28.0}, {49.0,64.0} } |
| / (scalar division) | matrix / numeric | Performs scalar division | { {1,2,3}, {4,5,6} } / 2 | { {0.5,1.0,1.5}, {2.0,2.5,3.0} } |
| transpose | transpose(matrix) | Returns the transpose of the matrix | transpose( { {1,2,3}, {4,5,6} } ) | { {1.0,4.0}, {2.0,5.0}, {3.0,6.0} } |
| determinant | det(matrix) | Returns the determinant of the matrix as a double | det( { {1,2}, {3,4} } ) | -2.0 |
| inverse | inverse(matrix) | Returns the inverse of a square, invertible matrix | inverse( { {1,2}, {3,4} } ) | { {-2.0, 1.0}, {1.5, -0.5} } |
| trace | matrix_trace(matrix) | Returns the trace of a square matrix as a double | matrix_trace( { {1,2,3}, {4,5,6}, {7,8,9} } ) | 15.0 |
| vector sum | vector_sum(matrix) | Returns the sum of elements in a one-dimensional matrix/vector | vector_sum( _R ) vector_sum( _C ) | 6.0 |
| vector min | vector_min(matrix) | Returns the minimum of elements in a one-dimensional matrix/vector | vector_min( _R ) vector_min( _C ) | 1.0 |
| vector max | vector_max(matrix) | Returns the maximum of elements in a one-dimensional matrix/vector | vector_max( _R ) vector_max( _C ) | 3.0 |
| vector argmin | vector_argmin(matrix) | Returns the 1-based position (index) of the minimum element in a one-dimensional matrix or vector (row or column vector). The first element has index 1. | vector_argmin(_R) | 2 |
| vector argmax | vector_argmax(matrix) | Returns the 1-based position (index) of the maximum element of a one-dimensional matrix or vector. The first element has index 1. | vector_argmax(_C) | 3 |
| softmax | softmax(matrix) | Returns the softmax of a one-dimensional matrix or vector. | softmax(_R) | {} |
| cross entropy loss | cross_entropy_loss(matrix, matrix) | Returns the cross entropy loss of two one-dimensional matrices or vectors. | cross_entropy_loss( _R, _C )
cross_entropy_loss( _C, _R )
cross_entropy_loss( _R, _R )
cross_entropy_loss( _C, _C ) | 0.69 |
| log loss | log_loss(matrix, matrix) | Returns the log loss of two one-dimensional matrices or vectors. | log_loss( _R, _C ) log_loss( _C, _R ) log_loss( _R, _R ) log_loss( _C, _C ) | 2.53 |
| logits loss | logits_loss(matrix, matrix) | Returns the logits loss of two one-dimensional matrices or vectors. | logits_loss( _R, _C ) logits_loss( _C, _R ) logits_loss( _R, _R ) logits_loss( _C, _C ) | 2.44 |
| hinge loss | hinge_loss(matrix, matrix) | Returns the hinge loss of two one-dimensional matrices or vectors. | hinge_loss( _R, _C ) hinge_loss( _C, _R ) hinge_loss( _R, _R ) hinge_loss( _C, _C ) | 3.5 |
| dot product | dot(matrix, matrix) | Returns the dot product of two one-dimensional matrices/vectors | dot( _R, _C ) dot( _C, _R ) dot( _R, _R ) dot( _C, _C ) | 14.0 |
| magnitude | abs(matrix) | Returns the magnitude of one-dimensional matrix/vector | abs( _R ) abs( _C ) | 3.74 |
| LUPQ decomp | LUPQ_decomp(matrix) | Returns LUPQ decomposition of a square matrix A as a tuple of 4 matrices where PAQ = LU | | |
| LUP decomp | LUP_decomp(matrix) | Returns LUP decomposition of a square matrix as a tuple of 3 matrices | | |
| QR decomp | qrdecomp(matrix) | Returns QR decomposition of a matrix as a tuple of 2 matrices | | |
| SVD decomp | SVD_decomp(matrix) | Returns SVD decomposition of a matrix as a tuple of 3 matrices | | |
| eigenvalues/vectors | eigen(matrix) | Returns eigenvalues and eigenvalues of a square matrix as a vector of pairs | | |
| identity matrix | identity_matrix(unsigned int) | Returns an identity matrix of the specified dimension | identity_matrix(3) | { {1.0,0.0,0.0}, {0.0,1.0,0.0}, {0.0,0.0,1.0} } |
| NULL matrix | null_matrix(unsigned int, unsigned int) | Returns a NULL matrix of the specified (row, col) dimensions | null_matrix(2, 3) | NULL |
| zero matrix | zero_matrix(unsigned int, unsigned int) | Returns a zero matrix of the specified (row, col) dimensions | zero_matrix(2, 3) | { {0.0,0.0,0.0}, {0.0,0.0,0.0} } |
| matrix dimension | matrix_dim(matrix) | Returns the dimensions of the specified matrix as a tuple of (row, col) integers. When the input matrix is NULL, the function returns NULL. | matrix_dim(_R{1, 2, 3}) | TUPLE<INT,INT>(1, 3) |
| Frobenius norm | frobenius(matrix) | Returns the Frobenius norm of a matrix. This norm is the matrix norm of an M`` x ``N matrix defined as the square root of the sum of the absolute squares of its elements. |a|^2 is the same as a^2, where a is a real number. | frobenius(matrix_from_text(‘{{3,4},{8,6}}‘))
| 11.180339887498949
|