matrices

package
v0.20.0 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2025 License: MIT Imports: 4 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[T common.Numbers] [][]T

func New

func New[T common.Numbers](rows, cols int) Matrix[T]

New returns a new, empty matrix of the given dimensions

func (Matrix[T]) Cols

func (A Matrix[T]) Cols() int

func (Matrix[T]) Copy

func (A Matrix[T]) Copy() Matrix[T]

func (Matrix[T]) Get added in v0.18.0

func (A Matrix[T]) Get(row, col int) T

func (Matrix[T]) Mul

func (A Matrix[T]) Mul(B, C Matrix[T]) Matrix[T]

Mul multiplies AxB, putting the result in C

func (Matrix[T]) Print

func (A Matrix[T]) Print(title string, f func(int) string)

Print prints the matrix to the screen, f() [optional] formats row/col numbers to strings

func (Matrix[T]) Rows

func (A Matrix[T]) Rows() int

func (Matrix[T]) Set

func (A Matrix[T]) Set(value T)

Set sets all cells to value

func (Matrix[T]) SetRow

func (A Matrix[T]) SetRow(row int, value T)

SetRow sets all cells in that row to value

Jump to

Keyboard shortcuts

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