matrix

package module
v0.0.0-...-9fc1c13 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2013 License: BSD-3-Clause Imports: 3 Imported by: 0

README

Matrix

About some conventional real matrix operations, such as addition, subtraction, multiplication, dot multiplication, dot divide, rank, inverse, Hessberg, QR, eigenvalues, Gauss, norm, linear Equations etc. of course, also including determinant

Documentation

Overview

======================================================================

Copyright (C) 2013 Yao Peng
All rights reserved

filename :matrix.go
description :some real matrix operations

mail:yaopengdn@126.com
http://weibo.com/u/2151926144

======================================================================

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MatrixErr

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

func (*MatrixErr) Error

func (me *MatrixErr) Error() string

type Matrixf64

type Matrixf64 [][]float64

func Diagf64

func Diagf64(any []float64) Matrixf64

func If64

func If64(d int) Matrixf64

func NewMatrixf64

func NewMatrixf64(any [][]float64) Matrixf64

Matrixf64

func NewVectorf64

func NewVectorf64(any []float64) Matrixf64

func Of64

func Of64(rows, cols int) Matrixf64

func (*Matrixf64) Add

func (m *Matrixf64) Add(rm *Matrixf64) (ret *Matrixf64)

func (*Matrixf64) Cond

func (m *Matrixf64) Cond() (ret float64)

func (*Matrixf64) Det

func (m *Matrixf64) Det() (ret float64)

func (*Matrixf64) Dist

func (m *Matrixf64) Dist() (ret float64)

func (*Matrixf64) DivDot

func (m *Matrixf64) DivDot(d float64) (ret *Matrixf64)

func (*Matrixf64) DotDiv

func (m *Matrixf64) DotDiv(d float64) (ret *Matrixf64)

func (*Matrixf64) DotMul

func (m *Matrixf64) DotMul(d float64) (ret *Matrixf64)

func (*Matrixf64) Eig

func (m *Matrixf64) Eig() (ret []complex128)

func (*Matrixf64) Equal

func (m *Matrixf64) Equal(rm *Matrixf64) bool

func (*Matrixf64) Gauss

func (m *Matrixf64) Gauss() *Matrixf64

func (*Matrixf64) GetColNum

func (m *Matrixf64) GetColNum() int

func (*Matrixf64) GetRowNum

func (m *Matrixf64) GetRowNum() int

func (*Matrixf64) GetVectorSum

func (m *Matrixf64) GetVectorSum() (sum float64)

func (*Matrixf64) Hess

func (m *Matrixf64) Hess() (Q, B Matrixf64)

func (*Matrixf64) InsertCols

func (m *Matrixf64) InsertCols(im *Matrixf64, col int) *Matrixf64

func (*Matrixf64) InsertRows

func (m *Matrixf64) InsertRows(im *Matrixf64, row int) *Matrixf64

func (*Matrixf64) Inv

func (m *Matrixf64) Inv() *Matrixf64

func (*Matrixf64) IsSquare

func (m *Matrixf64) IsSquare() bool

func (*Matrixf64) IsSymmetric

func (m *Matrixf64) IsSymmetric() bool

func (*Matrixf64) LU

func (m *Matrixf64) LU() *Matrixf64

func (*Matrixf64) MELU

func (m *Matrixf64) MELU() *Matrixf64

Column pivoting LU decomposition

func (*Matrixf64) MatrixNorm1

func (m *Matrixf64) MatrixNorm1() (ret float64)

func (*Matrixf64) MatrixNorm2

func (m *Matrixf64) MatrixNorm2() (ret float64)

func (*Matrixf64) MatrixNormInf

func (m *Matrixf64) MatrixNormInf() (ret float64)

func (*Matrixf64) Mul

func (m *Matrixf64) Mul(rm *Matrixf64) (ret *Matrixf64)

func (*Matrixf64) Piece

func (m *Matrixf64) Piece(row, col []int) *Matrixf64

please make sure 'm' is big enough to contain these rows or columns, or system will throw a panic

func (*Matrixf64) Print

func (m *Matrixf64) Print()

func (*Matrixf64) QR

func (m *Matrixf64) QR() (Q, R Matrixf64)

func (*Matrixf64) Rank

func (m *Matrixf64) Rank() int

func (*Matrixf64) Replace

func (m *Matrixf64) Replace(im *Matrixf64, row, col int) *Matrixf64

please make sure 'm' has enough space to accommodate the smaller matrix 'im' , or system will throw a panic

func (*Matrixf64) Rou

func (m *Matrixf64) Rou() (ret float64)

func (*Matrixf64) Solve

func (m *Matrixf64) Solve(b *Matrixf64) *Matrixf64
please make sure the matrix 'm' is an LU matrix.

for example, a non-singular equation Ax = b, the code is below:

x := A.LU().Solve(b)

func (*Matrixf64) SolveEquation

func (m *Matrixf64) SolveEquation(b *Matrixf64) (x *Matrixf64, e error)

If you can guarantee that the coefficient matrix is nonsingular, should use 'Solve' instead of this for its low efficiency

func (*Matrixf64) Sub

func (m *Matrixf64) Sub(rm *Matrixf64) (ret *Matrixf64)

func (*Matrixf64) T

func (m *Matrixf64) T() *Matrixf64

func (*Matrixf64) VectorNorm1

func (m *Matrixf64) VectorNorm1() (ret float64)

func (*Matrixf64) VectorNorm2

func (m *Matrixf64) VectorNorm2() (ret float64)

func (*Matrixf64) VectorNormInf

func (m *Matrixf64) VectorNormInf() (ret float64)

func (*Matrixf64) VectorToSlice

func (m *Matrixf64) VectorToSlice() []float64

Jump to

Keyboard shortcuts

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