matrices

package
v0.0.0-...-0a688d3 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2017 License: MIT Imports: 7 Imported by: 9

README

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Print

func Print(m Matrix)

Print will Print out a matrix

Types

type Matrix

type Matrix interface {
	// Returns dimensions of Matrix.
	Dim() (rows, cols int)

	// Returns number of elements of Matrix
	TotalElements() int

	// Returns true is a Matrix is square, Else false
	IsSquare() bool

	// Returns if a matrix is an Identity Matrix
	IsIdentity() bool

	// Returns Number of rows
	GetNumRows() int

	// Returns Number of columns
	GetNumCols() int

	// Type of Matrix
	Type() gcv.Type

	// Transpose of a Matrix
	Trans()

	// Conjuate of a Matrix
	Conj()

	// Conjugate (Hermitian) Transpose of a Matrix
	ConjTrans()

	// Returns a copy of Matrix
	Copy() Matrix

	// Returns all Elements
	Elements() v.Vectors

	// Trace of Matrix. Returns error if matrix is not square
	Tr() (gcv.Value, error)

	// Swaps two matrix rows
	Swap(rowA, rowB int)

	// Returns the Determinate of a matrix or error if matrix is not square.
	Det() (gcv.Value, error)

	// Inverse of Matrix. Returns error if there is no inverse
	Inv() (Matrix, error)

	// Get element at location (row, col)
	Get(row int, col int) gcv.Value

	// Set element at location (row, col)
	Set(row int, col int, value interface{})

	// Aug will take either a Vector or a Matrix and will create a new augmented matrix
	Aug(b interface{}) Matrix

	// Trim will trim off rows or columns from a matrix to for a new sub matrix.
	//  top are the number or rows to cut from the top.
	// bottom are the number of rows to cut from the bottom.
	// left are columns to cut from the left.
	// right are columns to cut from the right.
	Trim(top, bottom, left, right int) Matrix
}

Matrix is the main matirx interface for real matrices.

func MakeConjMatrix

func MakeConjMatrix(m Matrix) Matrix

MakeConjMatrix returns a new complex conjuate matrix of matrix

func MakeConjTransMatrix

func MakeConjTransMatrix(m Matrix) Matrix

MakeConjTransMatrix returns a new conjugate transpose matrix of matrix

func MakeMatrix

func MakeMatrix(elements ...v.Vector) Matrix

MakeMatrix returns a new matrix. takes individual v as args

func MakeMatrixAlt

func MakeMatrixAlt(elements v.Vectors) Matrix

MakeMatrixAlt returns a new matrix of type Matrix with predefined elements. takes type Vectors as arg

func MakeTransMatrix

func MakeTransMatrix(m Matrix) Matrix

MakeTransMatrix returns a new transpose matrix of matrix

func NewIdentityMatrix

func NewIdentityMatrix(degree int) Matrix

NewIdentityMatrix returns a new Identity Matrix of size (degree, degree)

func NewMatrix

func NewMatrix(rows int, cols int) Matrix

NewMatrix returns a new matrix of type Matrix

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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