dense

package
v0.1.5 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) *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.

Types

type Matrix added in v0.1.5

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

func Convert added in v0.1.5

func Convert(m types.Matrix) *Matrix

Convert the given matrix to *dense.Matrix. If the given matrix is already typed as *dense.Matrix, just returns it. In other cases, create a new matrix.

func Zeros

func Zeros(rows, columns int) *Matrix

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

func (*Matrix) Add added in v0.1.5

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

func (*Matrix) All added in v0.1.5

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

func (*Matrix) Base added in v0.1.5

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

func (*Matrix) Column added in v0.1.5

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

func (*Matrix) Columns added in v0.1.5

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

func (*Matrix) Diagonal added in v0.1.5

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

func (*Matrix) Equal added in v0.1.5

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

func (*Matrix) Get added in v0.1.5

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

func (*Matrix) MarshalJSON added in v0.1.5

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

func (*Matrix) Max added in v0.1.5

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

func (*Matrix) Min added in v0.1.5

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

func (*Matrix) Multiply added in v0.1.5

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

func (*Matrix) NonZeros added in v0.1.5

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

func (*Matrix) Row added in v0.1.5

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

func (*Matrix) Rows added in v0.1.5

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

func (*Matrix) Scalar added in v0.1.5

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

func (*Matrix) Serialize added in v0.1.5

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

func (*Matrix) Shape added in v0.1.5

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

func (*Matrix) Subtract added in v0.1.5

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

func (*Matrix) Transpose added in v0.1.5

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

func (*Matrix) UnmarshalJSON added in v0.1.5

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

func (*Matrix) Update added in v0.1.5

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

func (*Matrix) View added in v0.1.5

func (m *Matrix) 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