matrix

package
v0.0.0-...-bd79bcd Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2017 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Matrix

type Matrix struct {
	// contains filtered or unexported fields
}

Matrix matrix

func Identity

func Identity(n int) *Matrix

Identity Return the identity square matrix

func LoadFromArray

func LoadFromArray(size1, size2 int, data []float64) *Matrix

LoadFromArray load from a array

func LoadFromStr

func LoadFromStr(str string) *Matrix

LoadFromStr load from str load from [1 2 3; 4 5 6; 7 8 9]

func New

func New(i, j int) *Matrix

New create a matrix

func NewS

func NewS(n int) *Matrix

NewS create a square matrix

func Ones

func Ones(n, m int) *Matrix

Ones matrix filled with 1

func Product

func Product(A, B *Matrix) (*Matrix, error)

Product The product of two matrices

func Rand

func Rand(n, m int) *Matrix

Rand Rand float64 [0.0,1.0)

func Zeros

func Zeros(n, m int) *Matrix

Zeros matrix filled with 0

func (*Matrix) Add

func (m *Matrix) Add(m2 *Matrix) error

Add two matrix add

func (*Matrix) AddConstant

func (m *Matrix) AddConstant(x float64)

AddConstant two matrix element mul

func (*Matrix) At

func (m *Matrix) At(i, j int) float64

At Get (i,j) value

func (*Matrix) Col

func (m *Matrix) Col(c int) *vector.Vector

Col Get Col c

func (*Matrix) Copy

func (m *Matrix) Copy() *Matrix

Copy matrix hard copy

func (*Matrix) DivElement

func (m *Matrix) DivElement(m2 *Matrix) error

DivElement two matrix element mul

func (*Matrix) Fprintf

func (m *Matrix) Fprintf(w io.Writer, format string)

Fprintf write format

func (*Matrix) Get

func (m *Matrix) Get(i, j int) float64

Get Get (i,j) value

func (*Matrix) MulElement

func (m *Matrix) MulElement(m2 *Matrix) error

MulElement two matrix element mul

func (*Matrix) Norm1

func (m *Matrix) Norm1() float64

Norm1 norm TODO

func (*Matrix) Norm2

func (m *Matrix) Norm2() float64

Norm2 norm TODO

func (*Matrix) NormInf

func (m *Matrix) NormInf() float64

NormInf norm TODO

func (*Matrix) Print

func (m *Matrix) Print()

Print print matrix to stdout

func (*Matrix) Printf

func (m *Matrix) Printf(format string)

Printf print matrix

func (*Matrix) Row

func (m *Matrix) Row(r int) *vector.Vector

Row Get row r

func (*Matrix) Scale

func (m *Matrix) Scale(x float64)

Scale two matrix element mul

func (*Matrix) Set

func (m *Matrix) Set(i, j int, v float64)

Set Set (i,j) value for v

func (*Matrix) Shape

func (m *Matrix) Shape() (int, int)

Shape matrix shape

func (*Matrix) Singular

func (m *Matrix) Singular() int

Singular is singular?

func (*Matrix) Sub

func (m *Matrix) Sub(m2 *Matrix) error

Sub two matrix sub

func (*Matrix) SwapCols

func (m *Matrix) SwapCols(i, j int) error

SwapCols swap col i, j

func (*Matrix) SwapRows

func (m *Matrix) SwapRows(i, j int) error

SwapRows swap row i, j

func (*Matrix) T

func (m *Matrix) T() *Matrix

T matrix transpose

Jump to

Keyboard shortcuts

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