runs as written · runs with Bentrix's own convention, said in its note · refused by name, the note says what Bentrix lacks · not yet built.
Functions
matrix.abs#
matrix.abs(id: mat) → matsameEach element's absolute value
id | mat | required |
matrix.add_col#
matrix.add_col(id: mat, column: int?, array_id: arr?)A column inserted, at the end by default
id | mat | required |
column | int | optional |
array_id | arr | optional |
matrix.add_row#
matrix.add_row(id: mat, row: int?, array_id: arr?)A row inserted, at the end by default, from the array or of na
id | mat | required |
row | int | optional |
array_id | arr | optional |
matrix.avg#
matrix.avg(id: mat) → floatThe mean of the elements
id | mat | required |
matrix.col#
matrix.col(id: mat, column: int) → arr<elem>A column as a new array
id | mat | required |
column | int | required |
matrix.columns#
matrix.columns(id: mat) → intThe count of columns
id | mat | required |
matrix.concat#
matrix.concat(id1: mat, id2: mat) → matsameThe second's rows appended to the first, which is answered
id1 | mat | required |
id2 | mat | required |
matrix.copy#
matrix.copy(id: mat) → matsameA new matrix of the same elements
id | mat | required |
matrix.det#
matrix.det(id: mat) → floatThe determinant of a square matrix, by LU decomposition with partial pivoting
id | mat | required |
matrix.diff#
matrix.diff(id1: mat, id2: any) → matfElement by element, the second taken from the first; a matrix of floats
id1 | mat | required |
id2 | any | required |
matrix.eigenvalues#
matrix.eigenvalues(id: mat) → arr<float>Of a symmetric matrix, by Jacobi's rotations, descending; one not symmetric is refused
id | mat | required |
matrix.eigenvectors#
matrix.eigenvectors(id: mat) → matfOf a symmetric matrix, as columns matching the eigenvalues
id | mat | required |
matrix.elements_count#
matrix.elements_count(id: mat) → intRows × columns
id | mat | required |
matrix.fill#
matrix.fill(id: mat, value: elem, from_row: int?, to_row: int?, from_column: int?, to_column: int?)Fills the block [from, to)
id | mat | required |
value | elem | required |
from_row | int | optional |
to_row | int | optional |
from_column | int | optional |
to_column | int | optional |
matrix.get#
matrix.get(id: mat, row: int, column: int) → elemThe element; an index outside the matrix stops the script
id | mat | required |
row | int | required |
column | int | required |
matrix.inv#
matrix.inv(id: mat) → matfThe inverse of a square matrix; na everywhere for a singular one
id | mat | required |
matrix.is_antidiagonal#
matrix.is_antidiagonal(id: mat) → bool0 off the anti-diagonal
id | mat | required |
matrix.is_antisymmetric#
matrix.is_antisymmetric(id: mat) → boolEqual to its transpose negated
id | mat | required |
matrix.is_binary#
matrix.is_binary(id: mat) → boolEvery element 0 or 1
id | mat | required |
matrix.is_diagonal#
matrix.is_diagonal(id: mat) → bool0 off the diagonal
id | mat | required |
matrix.is_identity#
matrix.is_identity(id: mat) → boolThe identity
id | mat | required |
matrix.is_square#
matrix.is_square(id: mat) → boolAs many rows as columns
id | mat | required |
matrix.is_stochastic#
matrix.is_stochastic(id: mat) → boolNo element below 0, and every row summing to 1
id | mat | required |
matrix.is_symmetric#
matrix.is_symmetric(id: mat) → boolEqual to its transpose
id | mat | required |
matrix.is_triangular#
matrix.is_triangular(id: mat) → bool0 above or below the diagonal
id | mat | required |
matrix.is_zero#
matrix.is_zero(id: mat) → boolEvery element 0
id | mat | required |
matrix.kron#
matrix.kron(id1: mat, id2: mat) → matfThe Kronecker product; a matrix of floats
id1 | mat | required |
id2 | mat | required |
matrix.max#
matrix.max(id: mat) → elemThe greatest element
id | mat | required |
matrix.median#
matrix.median(id: mat) → floatThe middle of the elements
id | mat | required |
matrix.min#
matrix.min(id: mat) → elemThe least element
id | mat | required |
matrix.mode#
matrix.mode(id: mat) → elemThe most frequent element, the smallest of several
id | mat | required |
matrix.mult#
matrix.mult(id1: mat, id2: any) → matfThe matrix product; by an array, an array; by a number, each element; floats
id1 | mat | required |
id2 | any | required |
matrix.new#
matrix.new(rows: int?, columns: int?, initial_value: any?) → matGA new matrix of the call's element type, rows × columns of the initial value (na by default); at most 100,000 elements
rows | int | optional |
columns | int | optional |
initial_value | any | optional |
matrix.pinv#
matrix.pinv(id: mat) → matfThe pseudo-inverse of a matrix of full rank, through the normal equations; na everywhere otherwise
id | mat | required |
matrix.pow#
matrix.pow(id: mat, power: int) → matfThe square matrix to a whole power; the identity at 0
id | mat | required |
power | int | required |
matrix.rank#
matrix.rank(id: mat) → intThe count of independent rows, by Gaussian elimination
id | mat | required |
matrix.remove_col#
matrix.remove_col(id: mat, column: int?) → arr<elem>Takes a column out, the last by default, and answers it
id | mat | required |
column | int | optional |
matrix.remove_row#
matrix.remove_row(id: mat, row: int?) → arr<elem>Takes a row out, the last by default, and answers it
id | mat | required |
row | int | optional |
matrix.reshape#
matrix.reshape(id: mat, rows: int, columns: int)The same elements in a new shape of as many
id | mat | required |
rows | int | required |
columns | int | required |
matrix.reverse#
matrix.reverse(id: mat)The elements in reverse order
id | mat | required |
matrix.row#
matrix.row(id: mat, row: int) → arr<elem>A row as a new array
id | mat | required |
row | int | required |
matrix.rows#
matrix.rows(id: mat) → intThe count of rows
id | mat | required |
matrix.set#
matrix.set(id: mat, row: int, column: int, value: elem)Sets the element
id | mat | required |
row | int | required |
column | int | required |
value | elem | required |
matrix.sort#
matrix.sort(id: mat, column: int?, order: any?)The rows ordered by a column, ascending unless order.descending
id | mat | required |
column | int | optional |
order | any | optional |
matrix.submatrix#
matrix.submatrix(id: mat, from_row: int?, to_row: int?, from_column: int?, to_column: int?) → matsameThe block [from, to) as a new matrix
id | mat | required |
from_row | int | optional |
to_row | int | optional |
from_column | int | optional |
to_column | int | optional |
matrix.sum#
matrix.sum(id1: mat, id2: any) → matfElement by element with a matrix of the same shape or a number; a matrix of floats
id1 | mat | required |
id2 | any | required |
matrix.swap_columns#
matrix.swap_columns(id: mat, column1: int, column2: int)Swaps two columns
id | mat | required |
column1 | int | required |
column2 | int | required |
matrix.swap_rows#
matrix.swap_rows(id: mat, row1: int, row2: int)Swaps two rows
id | mat | required |
row1 | int | required |
row2 | int | required |
matrix.trace#
matrix.trace(id: mat) → floatThe sum of the diagonal
id | mat | required |
matrix.transpose#
matrix.transpose(id: mat) → matsameA new matrix, rows for columns
id | mat | required |