joshuajerin / pg_linearalgebra

Matrix Operations Extension for postgres

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

pg_linearalgebra

A PostgreSQL extension for basic linear algebra operations.

Functions

mAdd(matrix1: &str, matrix2: &str, rows: i32, cols: i32) -> Result<String, &'static str>

Adds two matrices.

Example

SELECT mAdd('[[1.0, 2.0], [3.0, 4.0]]', '[[5.0, 6.0], [7.0, 8.0]]', 2, 2);

mSubtract(matrix1: &str, matrix2: &str, rows: i32, cols: i32) -> Result<String, &'static str>

Subtracts matrix2 from matrix1.

Example

SELECT mSubtract('[[1.0, 2.0], [3.0, 4.0]]', '[[5.0, 6.0], [7.0, 8.0]]', 2, 2);

mMultiply(matrix1: &str, matrix2: &str, rows: i32, cols: i32) -> Result<String, &'static str>

Multiplies two matrices.

Example

SELECT mMultiply('[[1.0, 2.0], [3.0, 4.0]]', '[[5.0, 6.0], [7.0, 8.0]]', 2, 2);

mTranspose(matrix: &str, rows: i32, cols: i32) -> Result<String, &'static str>

Transposes a matrix.

Example

SELECT mTranspose('[[1.0, 2.0], [3.0, 4.0]]', 2, 2);

mSvd(matrix: &str, rows: i32, cols: i32) -> Result<String, &'static str>

Computes the Singular Value Decomposition of a matrix.

Example

SELECT mSvd('[[1.0, 2.0], [3.0, 4.0], [5.0, 6.0]]', 3, 2);

About

Matrix Operations Extension for postgres


Languages

Language:Rust 100.0%