go.matrix: github.com/skelterjohn/go.matrix Index | Files

package matrix

import "github.com/skelterjohn/go.matrix"

Linear algebra.

Index

Package Files

arithmetic.go dense.go dense_arithmetic.go dense_basic.go dense_data.go dense_decomp.go dense_eigen.go dense_svd.go error.go matrix.go pivot.go pivot_arithmetic.go pivot_basic.go sparse.go sparse_arithmetic.go sparse_basic.go util.go

Variables

var (
    WhichParMethod  = 2
    WhichSyncMethod = 1
)
var (
    //The matrix returned was nil.
    ErrorNilMatrix error_ = error_(errorNilMatrix)
    //The dimensions of the inputs do not make sense for this operation.
    ErrorDimensionMismatch error_ = error_(errorDimensionMismatch)
    //The indices provided are out of bounds.
    ErrorIllegalIndex error_ = error_(errorIllegalIndex)
    //The matrix provided has a singularity.
    ExceptionSingular error_ = error_(exceptionSingular)
    //The matrix provided is not positive semi-definite.
    ExceptionNotSPD error_ = error_(exceptionNotSPD)
)

func ApproxEquals Uses

func ApproxEquals(A, B MatrixRO, ε float64) bool

Tests to see if the difference between two matrices, element-wise, exceeds ε.

func Equals Uses

func Equals(A, B MatrixRO) bool

Tests the element-wise equality of the two matrices.

func String Uses

func String(A MatrixRO) string

type DenseMatrix Uses

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

A matrix backed by a flat array of all elements.

func Diagonal Uses

func Diagonal(d []float64) *DenseMatrix

func Difference Uses

func Difference(A, B MatrixRO) (C *DenseMatrix)

Finds the difference between two matrices.

func Eye Uses

func Eye(span int) *DenseMatrix

Create an identity matrix with span rows and span columns.

func Kronecker Uses

func Kronecker(A, B MatrixRO) (C *DenseMatrix)

The Kronecker product. (http://en.wikipedia.org/wiki/Kronecker_product)

func MakeDenseCopy Uses

func MakeDenseCopy(A MatrixRO) *DenseMatrix

func MakeDenseMatrix Uses

func MakeDenseMatrix(elements []float64, rows, cols int) *DenseMatrix

func MakeDenseMatrixStacked Uses

func MakeDenseMatrixStacked(data [][]float64) *DenseMatrix

func Normals Uses

func Normals(rows, cols int) *DenseMatrix

func Numbers Uses

func Numbers(rows, cols int, num float64) *DenseMatrix

func Ones Uses

func Ones(rows, cols int) *DenseMatrix

func ParallelProduct Uses

func ParallelProduct(A, B MatrixRO) (C *DenseMatrix)

Uses a number of goroutines to do the dot products necessary for the matrix multiplication in parallel.

func ParseMatlab Uses

func ParseMatlab(txt string) (A *DenseMatrix, err error)

Take a matlab-style matrix representation

eg [a b c; d e f]

func Product Uses

func Product(A MatrixRO, Bs ...MatrixRO) (C *DenseMatrix)

Finds the Product of two matrices.

func Scaled Uses

func Scaled(A MatrixRO, f float64) (B *DenseMatrix)

Scales a matrix by a scalar.

func Sum Uses

func Sum(A MatrixRO, Bs ...MatrixRO) (C *DenseMatrix)

Finds the sum of two matrices.

func Unvectorize Uses

func Unvectorize(V MatrixRO, rows, cols int) (A *DenseMatrix)

func Vectorize Uses

func Vectorize(Am MatrixRO) (V *DenseMatrix)

func Zeros Uses

func Zeros(rows, cols int) *DenseMatrix

func (*DenseMatrix) Add Uses

func (A *DenseMatrix) Add(B MatrixRO) error

func (*DenseMatrix) AddDense Uses

func (A *DenseMatrix) AddDense(B *DenseMatrix) error

func (*DenseMatrix) Array Uses

func (A *DenseMatrix) Array() []float64

Returns the contents of this matrix stored into a flat array (row-major).

func (*DenseMatrix) Arrays Uses

func (A *DenseMatrix) Arrays() [][]float64

Returns an array of slices referencing the matrix data. Changes to the slices effect changes to the matrix.

func (*DenseMatrix) Augment Uses

func (A *DenseMatrix) Augment(B *DenseMatrix) (C *DenseMatrix, err error)

Get a new matrix [A B].

func (*DenseMatrix) AugmentFill Uses

func (A *DenseMatrix) AugmentFill(B, C *DenseMatrix) (err error)

func (*DenseMatrix) BufferCol Uses

func (A *DenseMatrix) BufferCol(j int, buf []float64)

func (*DenseMatrix) BufferDiagonal Uses

func (A *DenseMatrix) BufferDiagonal(buf []float64)

func (*DenseMatrix) BufferRow Uses

func (A *DenseMatrix) BufferRow(i int, buf []float64)

func (*DenseMatrix) Cholesky Uses

func (A *DenseMatrix) Cholesky() (L *DenseMatrix, err error)

Returns the cholesky decomposition C of A, st CC'=A.

func (*DenseMatrix) ColCopy Uses

func (A *DenseMatrix) ColCopy(j int) []float64

returns a copy of the column (not a slice)

func (*DenseMatrix) Cols Uses

func (A *DenseMatrix) Cols() int

func (*DenseMatrix) Copy Uses

func (A *DenseMatrix) Copy() *DenseMatrix

func (*DenseMatrix) DenseMatrix Uses

func (A *DenseMatrix) DenseMatrix() *DenseMatrix

func (*DenseMatrix) Det Uses

func (A *DenseMatrix) Det() float64

func (*DenseMatrix) DiagonalCopy Uses

func (A *DenseMatrix) DiagonalCopy() []float64

returns a copy of the diagonal (not a slice)

func (*DenseMatrix) Eigen Uses

func (A *DenseMatrix) Eigen() (V, D *DenseMatrix, err error)

Returns V,D st V*D*inv(V) = A and D is diagonal (or block diagonal).

func (*DenseMatrix) ElementMult Uses

func (A *DenseMatrix) ElementMult(B MatrixRO) (Matrix, error)

func (*DenseMatrix) ElementMultDense Uses

func (A *DenseMatrix) ElementMultDense(B *DenseMatrix) (*DenseMatrix, error)

func (*DenseMatrix) FillCol Uses

func (A *DenseMatrix) FillCol(j int, buf []float64)

func (*DenseMatrix) FillDiagonal Uses

func (A *DenseMatrix) FillDiagonal(buf []float64)

func (*DenseMatrix) FillRow Uses

func (A *DenseMatrix) FillRow(i int, buf []float64)

func (*DenseMatrix) Get Uses

func (A *DenseMatrix) Get(i int, j int) (v float64)

Get the element in the ith row and jth column.

func (*DenseMatrix) GetColVector Uses

func (A *DenseMatrix) GetColVector(j int) *DenseMatrix

func (*DenseMatrix) GetMatrix Uses

func (A *DenseMatrix) GetMatrix(i, j, rows, cols int) *DenseMatrix

Get a submatrix starting at i,j with rows rows and cols columns. Changes to the returned matrix show up in the original.

func (*DenseMatrix) GetRowVector Uses

func (A *DenseMatrix) GetRowVector(i int) *DenseMatrix

func (*DenseMatrix) GetSize Uses

func (A *DenseMatrix) GetSize() (rows, cols int)

func (*DenseMatrix) InfinityNorm Uses

func (A *DenseMatrix) InfinityNorm() (ε float64)

func (*DenseMatrix) Inverse Uses

func (A *DenseMatrix) Inverse() (*DenseMatrix, error)

func (*DenseMatrix) L Uses

func (A *DenseMatrix) L() *DenseMatrix

Get a copy of this matrix with 0s above the diagonal.

func (*DenseMatrix) LU Uses

func (A *DenseMatrix) LU() (L, U *DenseMatrix, P *PivotMatrix)

return L,U,P, st PLU=A.

func (*DenseMatrix) LUInPlace Uses

func (A *DenseMatrix) LUInPlace() (P *PivotMatrix)

Overwrites A with [L\U] and returns P, st PLU=A. L is considered to have 1s in the diagonal.

func (*DenseMatrix) Minus Uses

func (A *DenseMatrix) Minus(B MatrixRO) (Matrix, error)

func (*DenseMatrix) MinusDense Uses

func (A *DenseMatrix) MinusDense(B *DenseMatrix) (*DenseMatrix, error)

func (*DenseMatrix) Nil Uses

func (A *DenseMatrix) Nil() bool

func (*DenseMatrix) NumElements Uses

func (A *DenseMatrix) NumElements() int

func (*DenseMatrix) OneNorm Uses

func (A *DenseMatrix) OneNorm() (ε float64)

func (*DenseMatrix) Plus Uses

func (A *DenseMatrix) Plus(B MatrixRO) (Matrix, error)

func (*DenseMatrix) PlusDense Uses

func (A *DenseMatrix) PlusDense(B *DenseMatrix) (*DenseMatrix, error)

func (*DenseMatrix) QR Uses

func (A *DenseMatrix) QR() (Q, R *DenseMatrix)

func (*DenseMatrix) RowCopy Uses

func (A *DenseMatrix) RowCopy(i int) []float64

returns a copy of the row (not a slice)

func (*DenseMatrix) Rows Uses

func (A *DenseMatrix) Rows() int

func (*DenseMatrix) SVD Uses

func (Arg *DenseMatrix) SVD() (theU, Σ, theV *DenseMatrix, err error)

Returns U, Σ, V st Σ is diagonal (or block diagonal) and UΣV'=Arg

func (*DenseMatrix) Scale Uses

func (A *DenseMatrix) Scale(f float64)

func (*DenseMatrix) ScaleAddRow Uses

func (m *DenseMatrix) ScaleAddRow(rd int, rs int, f float64)

func (*DenseMatrix) ScaleMatrix Uses

func (A *DenseMatrix) ScaleMatrix(B MatrixRO) error

func (*DenseMatrix) ScaleMatrixDense Uses

func (A *DenseMatrix) ScaleMatrixDense(B *DenseMatrix) error

func (*DenseMatrix) ScaleRow Uses

func (m *DenseMatrix) ScaleRow(r int, f float64)

func (*DenseMatrix) Set Uses

func (A *DenseMatrix) Set(i int, j int, v float64)

Set the element in the ith row and jth column to v.

func (*DenseMatrix) SetMatrix Uses

func (A *DenseMatrix) SetMatrix(i, j int, B *DenseMatrix)

Copy B into A, with B's 0, 0 aligning with A's i, j

func (*DenseMatrix) Solve Uses

func (A *DenseMatrix) Solve(b MatrixRO) (*DenseMatrix, error)

func (*DenseMatrix) SolveDense Uses

func (A *DenseMatrix) SolveDense(b *DenseMatrix) (*DenseMatrix, error)

func (*DenseMatrix) SparseMatrix Uses

func (A *DenseMatrix) SparseMatrix() *SparseMatrix

Create a sparse matrix copy.

func (*DenseMatrix) Stack Uses

func (A *DenseMatrix) Stack(B *DenseMatrix) (C *DenseMatrix, err error)

Get a new matrix [A; B], with A above B.

func (*DenseMatrix) StackFill Uses

func (A *DenseMatrix) StackFill(B, C *DenseMatrix) (err error)

func (*DenseMatrix) String Uses

func (A *DenseMatrix) String() string

func (*DenseMatrix) Subtract Uses

func (A *DenseMatrix) Subtract(B MatrixRO) error

func (*DenseMatrix) SubtractDense Uses

func (A *DenseMatrix) SubtractDense(B *DenseMatrix) error

func (*DenseMatrix) SwapRows Uses

func (m *DenseMatrix) SwapRows(r1 int, r2 int)

func (*DenseMatrix) Symmetric Uses

func (A *DenseMatrix) Symmetric() bool

func (*DenseMatrix) Times Uses

func (A *DenseMatrix) Times(B MatrixRO) (Matrix, error)

func (*DenseMatrix) TimesDense Uses

func (A *DenseMatrix) TimesDense(B *DenseMatrix) (C *DenseMatrix, err error)

func (*DenseMatrix) TimesDenseFill Uses

func (A *DenseMatrix) TimesDenseFill(B, C *DenseMatrix) (err error)

func (*DenseMatrix) Trace Uses

func (A *DenseMatrix) Trace() float64

func (*DenseMatrix) Transpose Uses

func (A *DenseMatrix) Transpose() *DenseMatrix

func (*DenseMatrix) TransposeInPlace Uses

func (A *DenseMatrix) TransposeInPlace() (err error)

func (*DenseMatrix) TwoNorm Uses

func (A *DenseMatrix) TwoNorm() float64

func (*DenseMatrix) U Uses

func (A *DenseMatrix) U() *DenseMatrix

Get a copy of this matrix with 0s below the diagonal.

type Matrix Uses

type Matrix interface {
    MatrixRO

    //Set the element at the ith row and jth column to v.
    Set(i int, j int, v float64)

    Add(MatrixRO) error
    Subtract(MatrixRO) error
    Scale(float64)
}

A mutable matrix.

func Inverse Uses

func Inverse(A MatrixRO) (B Matrix)

func Transpose Uses

func Transpose(A MatrixRO) (B Matrix)

type MatrixRO Uses

type MatrixRO interface {
    //Returns true if the underlying object is nil.
    Nil() bool

    //The number of rows in this matrix.
    Rows() int
    //The number of columns in this matrix.
    Cols() int

    //The number of elements in this matrix.
    NumElements() int
    //The size pair, (Rows(), Cols())
    GetSize() (int, int)

    //The element in the ith row and jth column.
    Get(i, j int) float64

    Plus(MatrixRO) (Matrix, error)
    Minus(MatrixRO) (Matrix, error)
    Times(MatrixRO) (Matrix, error)

    //The determinant of this matrix.
    Det() float64
    //The trace of this matrix.
    Trace() float64

    //A pretty-print string.
    String() string

    DenseMatrix() *DenseMatrix
    SparseMatrix() *SparseMatrix
}

The MatrixRO interface defines matrix operations that do not change the underlying data, such as information requests or the creation of transforms

Read-only matrix types (at the moment, PivotMatrix).

type PivotMatrix Uses

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

A space-optimized structure for pivot matrices, ie a matrix with exactly one 1 in each row and each column.

func MakePivotMatrix Uses

func MakePivotMatrix(pivots []int, pivotSign float64) *PivotMatrix

func (*PivotMatrix) ColPivotDense Uses

func (P *PivotMatrix) ColPivotDense(A *DenseMatrix) (*DenseMatrix, error)

Equivalent to AxP, but streamlined to take advantage of the datastructures.

func (*PivotMatrix) ColPivotSparse Uses

func (P *PivotMatrix) ColPivotSparse(A *SparseMatrix) (*SparseMatrix, error)

Equivalent to AxP, but streamlined to take advantage of the datastructures.

func (*PivotMatrix) Cols Uses

func (A *PivotMatrix) Cols() int

func (*PivotMatrix) Copy Uses

func (P *PivotMatrix) Copy() *PivotMatrix

Make a copy of this PivotMatrix.

func (*PivotMatrix) DenseMatrix Uses

func (P *PivotMatrix) DenseMatrix() *DenseMatrix

Convert this PivotMatrix into a DenseMatrix.

func (*PivotMatrix) Det Uses

func (P *PivotMatrix) Det() float64

func (*PivotMatrix) Get Uses

func (P *PivotMatrix) Get(i, j int) float64

func (*PivotMatrix) GetSize Uses

func (A *PivotMatrix) GetSize() (rows, cols int)

func (*PivotMatrix) InfinityNorm Uses

func (A *PivotMatrix) InfinityNorm() float64

func (*PivotMatrix) Inverse Uses

func (A *PivotMatrix) Inverse() *PivotMatrix

func (*PivotMatrix) Minus Uses

func (P *PivotMatrix) Minus(A MatrixRO) (Matrix, error)

func (*PivotMatrix) Nil Uses

func (A *PivotMatrix) Nil() bool

func (*PivotMatrix) NumElements Uses

func (A *PivotMatrix) NumElements() int

func (*PivotMatrix) OneNorm Uses

func (A *PivotMatrix) OneNorm() float64

func (*PivotMatrix) Plus Uses

func (P *PivotMatrix) Plus(A MatrixRO) (Matrix, error)

func (*PivotMatrix) RowPivotDense Uses

func (P *PivotMatrix) RowPivotDense(A *DenseMatrix) (*DenseMatrix, error)

Equivalent to PxA, but streamlined to take advantage of the datastructures.

func (*PivotMatrix) RowPivotSparse Uses

func (P *PivotMatrix) RowPivotSparse(A *SparseMatrix) (*SparseMatrix, error)

Equivalent to PxA, but streamlined to take advantage of the datastructures.

func (*PivotMatrix) Rows Uses

func (A *PivotMatrix) Rows() int

func (*PivotMatrix) Solve Uses

func (P *PivotMatrix) Solve(b MatrixRO) (Matrix, error)

Returns x such that Px=b.

func (*PivotMatrix) SparseMatrix Uses

func (P *PivotMatrix) SparseMatrix() *SparseMatrix

Convert this PivotMatrix into a SparseMatrix.

func (*PivotMatrix) String Uses

func (A *PivotMatrix) String() string

func (*PivotMatrix) SwapRows Uses

func (P *PivotMatrix) SwapRows(r1, r2 int) error

Swap two rows in this PivotMatrix.

func (*PivotMatrix) Symmetric Uses

func (P *PivotMatrix) Symmetric() bool

func (*PivotMatrix) Times Uses

func (P *PivotMatrix) Times(A MatrixRO) (Matrix, error)

Multiply this pivot matrix by another.

func (*PivotMatrix) TimesPivot Uses

func (P *PivotMatrix) TimesPivot(A *PivotMatrix) (*PivotMatrix, error)

Multiplication optimized for when two pivots are the operands.

func (*PivotMatrix) Trace Uses

func (P *PivotMatrix) Trace() (r float64)

func (*PivotMatrix) Transpose Uses

func (P *PivotMatrix) Transpose() *PivotMatrix

func (*PivotMatrix) TwoNorm Uses

func (A *PivotMatrix) TwoNorm() float64

type SparseMatrix Uses

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

A sparse matrix based on go's map datastructure.

func MakeSparseMatrix Uses

func MakeSparseMatrix(elements map[int]float64, rows int, cols int) *SparseMatrix

Create a sparse matrix using the provided map as its backing.

func NormalsSparse Uses

func NormalsSparse(rows int, cols int, n int) *SparseMatrix

Creates a matrix and puts a standard normal in n random elements, with replacement.

func ZerosSparse Uses

func ZerosSparse(rows int, cols int) *SparseMatrix

func (*SparseMatrix) Add Uses

func (A *SparseMatrix) Add(B MatrixRO) error

Add another matrix to this one in place.

func (*SparseMatrix) AddSparse Uses

func (A *SparseMatrix) AddSparse(B *SparseMatrix) error

Add another matrix to this one in place, optimized for sparsity.

func (*SparseMatrix) Augment Uses

func (A *SparseMatrix) Augment(B *SparseMatrix) (*SparseMatrix, error)

Creates a new matrix [A B].

func (*SparseMatrix) Cols Uses

func (A *SparseMatrix) Cols() int

func (*SparseMatrix) Copy Uses

func (A *SparseMatrix) Copy() *SparseMatrix

func (*SparseMatrix) DenseMatrix Uses

func (A *SparseMatrix) DenseMatrix() *DenseMatrix

Convert this sparse matrix into a dense matrix.

func (*SparseMatrix) Det Uses

func (A *SparseMatrix) Det() float64

func (*SparseMatrix) ElementMult Uses

func (A *SparseMatrix) ElementMult(B MatrixRO) (*SparseMatrix, error)

Get the element-wise product of this matrix and another.

func (*SparseMatrix) ElementMultSparse Uses

func (A *SparseMatrix) ElementMultSparse(B *SparseMatrix) (*SparseMatrix, error)

Get the element-wise product of this matrix and another, optimized for sparsity.

func (*SparseMatrix) Get Uses

func (A *SparseMatrix) Get(i, j int) float64

func (*SparseMatrix) GetColIndex Uses

func (A *SparseMatrix) GetColIndex(index int) (j int)

Turn an element index into a column number.

func (*SparseMatrix) GetColVector Uses

func (A *SparseMatrix) GetColVector(j int) *SparseMatrix

Gets a reference to a column vector.

func (*SparseMatrix) GetIndex Uses

func (A *SparseMatrix) GetIndex(index int) float64

Looks up an element given its element index.

func (*SparseMatrix) GetMatrix Uses

func (A *SparseMatrix) GetMatrix(i, j, rows, cols int) (subMatrix *SparseMatrix)

Get a matrix representing a subportion of A. Changes to the new matrix will be reflected in A.

func (*SparseMatrix) GetRowColIndex Uses

func (A *SparseMatrix) GetRowColIndex(index int) (i int, j int)

Turn an element index into a row and column number.

func (*SparseMatrix) GetRowIndex Uses

func (A *SparseMatrix) GetRowIndex(index int) (i int)

Turn an element index into a row number.

func (*SparseMatrix) GetRowVector Uses

func (A *SparseMatrix) GetRowVector(i int) *SparseMatrix

Gets a reference to a row vector.

func (*SparseMatrix) GetSize Uses

func (A *SparseMatrix) GetSize() (rows, cols int)

func (*SparseMatrix) Indices Uses

func (A *SparseMatrix) Indices() (out chan int)

A channel that will carry the indices of non-zero elements.

func (*SparseMatrix) InfinityNorm Uses

func (A *SparseMatrix) InfinityNorm() (res float64)

func (*SparseMatrix) L Uses

func (A *SparseMatrix) L() *SparseMatrix

Returns a copy with all zeros above the diagonal.

func (*SparseMatrix) Minus Uses

func (A *SparseMatrix) Minus(B MatrixRO) (Matrix, error)

The difference between this matrix and another.

func (*SparseMatrix) MinusSparse Uses

func (A *SparseMatrix) MinusSparse(B *SparseMatrix) (*SparseMatrix, error)

The difference between this matrix and another sparse matrix, optimized for sparsity.

func (*SparseMatrix) Nil Uses

func (A *SparseMatrix) Nil() bool

func (*SparseMatrix) NumElements Uses

func (A *SparseMatrix) NumElements() int

func (*SparseMatrix) OneNorm Uses

func (A *SparseMatrix) OneNorm() (res float64)

func (*SparseMatrix) Plus Uses

func (A *SparseMatrix) Plus(B MatrixRO) (Matrix, error)

The sum of this matrix and another.

func (*SparseMatrix) PlusSparse Uses

func (A *SparseMatrix) PlusSparse(B *SparseMatrix) (*SparseMatrix, error)

The sum of this matrix and another sparse matrix, optimized for sparsity.

func (*SparseMatrix) Rows Uses

func (A *SparseMatrix) Rows() int

func (*SparseMatrix) Scale Uses

func (A *SparseMatrix) Scale(f float64)

Scale this matrix by f.

func (*SparseMatrix) ScaleAddRow Uses

func (A *SparseMatrix) ScaleAddRow(rd, rs int, f float64)

Add a multiple of row rs to row rd.

func (*SparseMatrix) ScaleMatrix Uses

func (A *SparseMatrix) ScaleMatrix(B MatrixRO) error

Scale this matrix by another, element-wise.

func (*SparseMatrix) ScaleMatrixSparse Uses

func (A *SparseMatrix) ScaleMatrixSparse(B *SparseMatrix) error

Scale this matrix by another sparse matrix, element-wise. Optimized for sparsity.

func (*SparseMatrix) ScaleRow Uses

func (A *SparseMatrix) ScaleRow(r int, f float64)

Scale a row by a scalar.

func (*SparseMatrix) Set Uses

func (A *SparseMatrix) Set(i int, j int, v float64)

func (*SparseMatrix) SetIndex Uses

func (A *SparseMatrix) SetIndex(index int, v float64)

Sets an element given its index.

func (*SparseMatrix) SparseMatrix Uses

func (A *SparseMatrix) SparseMatrix() *SparseMatrix

func (*SparseMatrix) Stack Uses

func (A *SparseMatrix) Stack(B *SparseMatrix) (*SparseMatrix, error)

Creates a new matrix [A;B], where A is above B.

func (*SparseMatrix) String Uses

func (A *SparseMatrix) String() string

func (*SparseMatrix) Subtract Uses

func (A *SparseMatrix) Subtract(B MatrixRO) error

Subtract another matrix from this one in place.

func (*SparseMatrix) SubtractSparse Uses

func (A *SparseMatrix) SubtractSparse(B *SparseMatrix) error

Subtract another matrix from this one in place, optimized for sparsity.

func (*SparseMatrix) SwapRows Uses

func (A *SparseMatrix) SwapRows(r1, r2 int)

Swap two rows in this matrix.

func (*SparseMatrix) Symmetric Uses

func (A *SparseMatrix) Symmetric() bool

func (*SparseMatrix) Times Uses

func (A *SparseMatrix) Times(B MatrixRO) (Matrix, error)

Get the product of this matrix and another.

func (*SparseMatrix) TimesSparse Uses

func (A *SparseMatrix) TimesSparse(B *SparseMatrix) (*SparseMatrix, error)

Get the product of this matrix and another, optimized for sparsity.

func (*SparseMatrix) Trace Uses

func (A *SparseMatrix) Trace() (res float64)

func (*SparseMatrix) Transpose Uses

func (A *SparseMatrix) Transpose() *SparseMatrix

func (*SparseMatrix) TwoNorm Uses

func (A *SparseMatrix) TwoNorm() float64

func (*SparseMatrix) U Uses

func (A *SparseMatrix) U() *SparseMatrix

Returns a copy with all zeros below the diagonal.

Package matrix imports 7 packages (graph) and is imported by 38 packages. Updated 2017-02-11. Refresh now. Tools for package owners.