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 }
| 21 | //} |
| 22 | |
| 23 | type 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 | |
| 34 | func MakeMatrix(Elements []float64, rows, cols int) *Matrix { |
| 35 | A := new(Matrix) |
nothing calls this directly
no outgoing calls
no test coverage detected