Documentation ¶
Index ¶
- func ArrayToString[number Number](array []number, separator string) string
- func Malloc[number Number](rows, cols int) ([][]number, []number, error)
- func MatrixToString[number Number](matrix [][]number, separator string) string
- func ReadSlow(path string) ([][]float64, error)
- func Write[number Number](path string, matrix [][]number) error
- type Matrix
- func (m *Matrix) AddCol(index int)
- func (m *Matrix) AddRow(index int)
- func (m *Matrix) Calculate() ([]float64, error)
- func (m *Matrix) Extend(rows, cols int)
- func (m *Matrix) ExtendCols(cols int)
- func (m *Matrix) ExtendRows(rows int)
- func (m *Matrix) FillRandom(upper int) error
- func (m *Matrix) GetAdjugate() (newMatrix [][]float64)
- func (m *Matrix) GetInverse() (newMatrix [][]float64)
- func (m *Matrix) GetRoots() []float64
- func (m *Matrix) GetTranspose() (newMatrix [][]float64)
- func (m *Matrix) Multiply(matrix *Matrix) (newMatrix [][]float64)
- func (p *Matrix) Reset()
- func (m *Matrix) Resize(rows, cols int)
- func (m *Matrix) ResizeCols(cols int)
- func (m *Matrix) ResizeRows(rows int)
- func (m *Matrix) String() string
- func (m *Matrix) Write(data [][]float64) error
- func (m *Matrix) WriteBlank(rows, cols int) error
- type Number
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ArrayToString ¶
func Malloc ¶
allocates memory closely for contingious memory allocation afterwards
for i := range matrix { matrix[i] = memory[(i * cols):((i + 1) * cols)] }
func MatrixToString ¶
Types ¶
type Matrix ¶
type Matrix struct { Data [][]float64 Rows int Cols int Augmented bool Square bool Determinants []float64 Roots []float64 }
func (*Matrix) Calculate ¶
if matrix is not square, returns nil and error
matrix is square if matrix is not augmented and rows equals cols or matrix is augmented and rows equals cols - 1
calculates determinants and roots if matrix is augmented. returns determinants, not roots
if matrix is not augmented, returns [1]number. otherwise returns [cols]number
func (*Matrix) ExtendCols ¶
func (*Matrix) ExtendRows ¶
func (*Matrix) FillRandom ¶
func (*Matrix) GetAdjugate ¶
func (*Matrix) GetInverse ¶
func (*Matrix) GetTranspose ¶
func (*Matrix) ResizeCols ¶
func (*Matrix) ResizeRows ¶
func (*Matrix) WriteBlank ¶
Click to show internal directories.
Click to hide internal directories.