matrix

package
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 1, 2024 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApproxEqual

func ApproxEqual(m1 [][]float64, m2 [][]float64, precision float64) bool

ApproxEqual returns true if two input matrices are equal, where their values are within some user-specified amount of relative precision.

func DenseLogSymmetric

func DenseLogSymmetric(inMatrix *mat.Dense) *mat.Dense

DenseLogSymmetric calculates the logarithm of an input square matrix *mat.Dense using the following identity: For a square matrix A, log(A) = V*log(D')*V^{-1}, where A=VDV^-1 is the eigen decomposition of A, and D' is the element-wise logarithm of the eigenvalue diagonal matrix. Since we take in a symmetric matrix, the logarithm is guaranteed to be real-valued, so we discard the imaginary portion of the eigen decomposition.

func FractionalSymmetricMatrixExponentiation

func FractionalSymmetricMatrixExponentiation(inMat *mat.Dense, power float64) *mat.Dense

FractionalSymmetricMatrixExponentiation calculates A^t, where A is a symmetric square matrix *mat.Dense and t is a float64 power. Note that t does not have to be an integer, but can be a fractional power. A^t is calculated with the identity A^t = exp(t*log(A))

func IsSymmetric

func IsSymmetric(m *mat.Dense) bool

IsSymmetric returns true if an input mat.Dense m is symmetric, false otherwise. The check is that a symmetric matrix is equal to its transpose.

func Rref

func Rref(m [][]float64) [][]float64

Rref returns an input matrix in row reduced echelon form using Gaussian elimination.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL