elixir_linear_algebra v0.9.0 ELA.Matrix

Contains operations for working with matrices.

Summary

Functions

Performs elmentwise addition

Returns a tuple with the matrix dimensions as {rows, cols}

Elementwise multiplication with two matrices. This is known as the Hadmard product

Returns an identity matrix with the provided dimension

Returns the LU-decomposition of a matrix as a tuple {u, l, p}

Matrix multiplication. Can also multiply matrices with vectors. Always returns a matrix

Returns a matrix filled wiht zeroes as with n rows and m columns

Pivots them matrix a on the element on row n, column m (zero indexed). Pivoting performs row operations to make the pivot element 1 and all others in the same column 0

Returns a row equivalent matrix on reduced row echelon form

Elementwise mutiplication with a scalar

Performs elementwise subtraction

Functions

add(a, b)
add([[number]], [[number]]) :: [[number]]

Performs elmentwise addition

dim(a)
dim([[number]]) :: {integer, integer}

Returns a tuple with the matrix dimensions as {rows, cols}.

hadmard(a, b)

Elementwise multiplication with two matrices. This is known as the Hadmard product.

identity(n)
identity(number) :: [[number]]

Returns an identity matrix with the provided dimension.

lu(a)

Returns the LU-decomposition of a matrix as a tuple {u, l, p}.

lu_decompose_row(a, u, l, m, i, j)
mult(v, b)

Matrix multiplication. Can also multiply matrices with vectors. Always returns a matrix.

new(n, m)
new(number, number) :: [[number]]

Returns a matrix filled wiht zeroes as with n rows and m columns.

pivot(a, n, m)
pivot([[number]], number, number) :: [[number]]

Pivots them matrix a on the element on row n, column m (zero indexed). Pivoting performs row operations to make the pivot element 1 and all others in the same column 0.

reduce(a, i \\ 0)

Returns a row equivalent matrix on reduced row echelon form.

scalar(a, s)
scalar([[number]], number) :: [[number]]

Elementwise mutiplication with a scalar.

sub(a, b)
sub([[number]], [[number]]) :: [[number]]

Performs elementwise subtraction

transp(a)
transp([[number]]) :: [[number]]