MCPcopy Create free account
hub / github.com/arnauddri/algorithms / Matrix

Struct Matrix

data-structures/matrix/matrix.go:23–32  ·  view source on GitHub ↗

type Matrix interface { CountRows() int CountCols() int GetElm(i int, j int) float64 trace() float64 SetElm(i int, j int, v float64) add(*Matrix) error substract(*Matrix) error scale(float64) copy() []float64 diagonalCopy() []float64 }

Source from the content-addressed store, hash-verified

21//}
22
23type Matrix struct {
24 // Number of rows
25 rows int
26 // Number of columns
27 cols int
28 // Matrix stored as a flat array: Aij = Elements[i*step + j]
29 Elements []float64
30 // Offset between rows
31 step int
32}
33
34func MakeMatrix(Elements []float64, rows, cols int) *Matrix {
35 A := new(Matrix)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected