matrix

package
v0.0.0-...-abf69a9 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2024 License: MIT Imports: 6 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 {
	Rows []Vector
}

func NewEmptyMatrix

func NewEmptyMatrix(m int, n int) Matrix

func NewMatrix

func NewMatrix(rows []Vector) Matrix

func NewMatrixWithValue

func NewMatrixWithValue(m, n, value int) Matrix

func ParseMatrix

func ParseMatrix(lines []string, separator string) (Matrix, error)

func ParseRuneMatrix

func ParseRuneMatrix(lines []string) Matrix

func (*Matrix) Clone

func (matrix *Matrix) Clone() Matrix

func (*Matrix) Column

func (matrix *Matrix) Column(n int) (*Vector, error)

func (*Matrix) Diagonals

func (matrix *Matrix) Diagonals() []Vector

func (*Matrix) Dot

func (matrix *Matrix) Dot(matrix2 Matrix) Matrix

func (*Matrix) Equal

func (matrix *Matrix) Equal(m Matrix) bool

func (*Matrix) Get

func (matrix *Matrix) Get(i int, j int) (int, error)

func (*Matrix) GetPoint

func (matrix *Matrix) GetPoint(p point.Point) (int, error)

func (*Matrix) Mirror

func (matrix *Matrix) Mirror() (*Matrix, error)

func (*Matrix) PatternMatch

func (matrix1 *Matrix) PatternMatch(matrix2 Matrix, mask Matrix) Matrix

func (*Matrix) PrintText

func (matrix *Matrix) PrintText()

func (*Matrix) PrintValues

func (matrix *Matrix) PrintValues()

func (*Matrix) Reduce

func (matrix *Matrix) Reduce(fn func(a int, b int) int, initial int) int

func (*Matrix) Row

func (matrix *Matrix) Row(i int) (*Vector, error)

func (*Matrix) Set

func (matrix *Matrix) Set(i int, j int, value int)

func (*Matrix) SetPoint

func (matrix *Matrix) SetPoint(p point.Point, value int)

func (*Matrix) Size

func (matrix *Matrix) Size() (int, int)

func (*Matrix) SubMatrix

func (matrix *Matrix) SubMatrix(iStart int, jStart int, iEnd int, jEnd int) Matrix

func (*Matrix) Transpose

func (matrix *Matrix) Transpose() (*Matrix, error)

type Vector

type Vector struct {
	Values []int
}

func NewEmptyVector

func NewEmptyVector(n int) Vector

func NewVector

func NewVector(values []int) Vector

func NewVectorWithValue

func NewVectorWithValue(n, value int) Vector

func ParseRuneVector

func ParseRuneVector(line string) Vector

func ParseVector

func ParseVector(line string, separator string) (Vector, error)

func VectorFromSlice

func VectorFromSlice(s []int) Vector

func (*Vector) All

func (v *Vector) All(f func(a int, b int) bool) bool

func (*Vector) Any

func (v *Vector) Any(f func(a int, b int) bool) bool

func (*Vector) Clone

func (v *Vector) Clone() Vector

func (*Vector) Equal

func (v *Vector) Equal(v2 Vector) bool

func (*Vector) Get

func (v *Vector) Get(n int) int

func (*Vector) PrintValues

func (v *Vector) PrintValues()

func (*Vector) Reduce

func (v *Vector) Reduce(fn func(a int, b int) int, initial int) int

func (*Vector) Remove

func (v *Vector) Remove(s int) Vector

func (*Vector) Reverse

func (v *Vector) Reverse() Vector

func (*Vector) Set

func (v *Vector) Set(position int, value int)

func (*Vector) Size

func (v *Vector) Size() int

func (*Vector) Slice

func (v *Vector) Slice(start int, end int) Vector

func (*Vector) ToTextString

func (v *Vector) ToTextString() string

func (*Vector) ToValuesString

func (v *Vector) ToValuesString() string

Jump to

Keyboard shortcuts

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