dense

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2015 License: MIT Imports: 7 Imported by: 4

Documentation

Overview

Package "dense" provides an implementation of mutable dense matrix.

Index

Constants

View Source
const (
	AlreadyInitializedError  = "AlreadyInitializedError"
	IncompatibleVersionError = "IncompatibleVersion"
)

Variables

This section is empty.

Functions

func Deserialize added in v0.1.1

func Deserialize(reader io.Reader) (types.Matrix, error)

Deserialize a matrix from the given reader.

func New

func New(rows, columns int) func(elements ...float64) types.Matrix

Create a new matrix with given elements. When "rows" and "columns" is not positive, validates.NON_POSITIVE_SIZE_PANIC will be caused. In addition, when the product of "row"s and "column" doesn't equal to the size of "elements", validates.INVALID_ELEMENTS_PANIC will be caused.

func Zeros

func Zeros(rows, columns int) types.Matrix

Create a new zero matrix. When "rows" and "columns" is not positive, validates.NON_POSITIVE_SIZE_PANIC will be caused.

Types

type DenseMatrix added in v0.1.4

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

func (*DenseMatrix) Add added in v0.1.4

func (m *DenseMatrix) Add(n types.Matrix) types.Matrix

func (*DenseMatrix) All added in v0.1.4

func (m *DenseMatrix) All() types.Cursor

func (*DenseMatrix) Base added in v0.1.4

func (m *DenseMatrix) Base() types.Matrix

func (*DenseMatrix) Column added in v0.1.4

func (m *DenseMatrix) Column(column int) types.Matrix

func (*DenseMatrix) Columns added in v0.1.4

func (m *DenseMatrix) Columns() (columns int)

func (*DenseMatrix) Diagonal added in v0.1.4

func (m *DenseMatrix) Diagonal() types.Cursor

func (*DenseMatrix) Equal added in v0.1.4

func (m *DenseMatrix) Equal(n types.Matrix) bool

func (*DenseMatrix) Get added in v0.1.4

func (m *DenseMatrix) Get(row, column int) (element float64)

func (*DenseMatrix) MarshalJSON added in v0.1.4

func (m *DenseMatrix) MarshalJSON() ([]byte, error)

func (*DenseMatrix) Max added in v0.1.4

func (m *DenseMatrix) Max() (element float64, row, column int)

func (*DenseMatrix) Min added in v0.1.4

func (m *DenseMatrix) Min() (element float64, row, column int)

func (*DenseMatrix) Multiply added in v0.1.4

func (m *DenseMatrix) Multiply(n types.Matrix) types.Matrix

func (*DenseMatrix) NonZeros added in v0.1.4

func (m *DenseMatrix) NonZeros() types.Cursor

func (*DenseMatrix) Row added in v0.1.4

func (m *DenseMatrix) Row(row int) types.Matrix

func (*DenseMatrix) Rows added in v0.1.4

func (m *DenseMatrix) Rows() (rows int)

func (*DenseMatrix) Scalar added in v0.1.4

func (m *DenseMatrix) Scalar(s float64) types.Matrix

func (*DenseMatrix) Serialize added in v0.1.4

func (m *DenseMatrix) Serialize(writer io.Writer) error

func (*DenseMatrix) Shape added in v0.1.4

func (m *DenseMatrix) Shape() (rows, columns int)

func (*DenseMatrix) Subtract added in v0.1.4

func (m *DenseMatrix) Subtract(n types.Matrix) types.Matrix

func (*DenseMatrix) Transpose added in v0.1.4

func (m *DenseMatrix) Transpose() types.Matrix

func (*DenseMatrix) UnmarshalJSON added in v0.1.4

func (m *DenseMatrix) UnmarshalJSON(b []byte) error

func (*DenseMatrix) Update added in v0.1.4

func (m *DenseMatrix) Update(row, column int, element float64) types.Matrix

func (*DenseMatrix) View added in v0.1.4

func (m *DenseMatrix) View(row, column, rows, columns int) types.Matrix

Jump to

Keyboard shortcuts

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