Documentation
¶
Overview ¶
Package matrix provides a generic matrix abstraction.
Index ¶
- func ON(u Matrix) (bool, error)
- func Orthogonal(u Matrix) (bool, error)
- type Matrix
- func Add(u, v Matrix) (Matrix, error)
- func AddVec(u Matrix, v rn.VecN) (Matrix, error)
- func Mult(u, v Matrix) (Matrix, error)
- func New(rows, cols int) Matrix
- func NewFromVec(vectors ...rn.VecN) Matrix
- func ScalarMult(u Matrix, s float64) Matrix
- func Sub(u, v Matrix) (Matrix, error)
- func SubVec(u Matrix, v rn.VecN) (Matrix, error)
- func Transpose(u Matrix) Matrix
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ON ¶
ON returns true if the matrix is an ON-matrix. It returns an error if the matrix is not quadratic.
func Orthogonal ¶
Orthogonal returns true if the matrix is orthogonal. An error will be returned if the matrix is not quadratic.
Types ¶
type Matrix ¶
type Matrix [][]float64
Matrix is an extension of a 2d slice if float64.
func Add ¶
Add adds the matrices together. The matrices must have the same ammount of rows and columns.
func AddVec ¶
AddVec adds the vector to the matrix. The vector must be of the same length as the matrix rows.
func Mult ¶
Mult multiplies the matrices together to form a new matrix. The new matrix will have the same rows as u and columns as v.
func NewFromVec ¶
NewFromVec creates a new matrix from a set of vectors. The vectors are assummed as column vectors with the same length.
func ScalarMult ¶
ScalarMult multiplies the vector u with the scalar s.
func Sub ¶
Sub subtracts the matrix v from u. The matrices must have the same ammount of rows and columns.