Documentation ¶
Index ¶
- Constants
- Variables
- func Poly(xvalues, yvalues []float64, degree int) ([]float64, error)
- type Matrix
- func (m *Matrix) Arrays() [][]float64
- func (m *Matrix) Augment(m2 *Matrix) (*Matrix, error)
- func (m *Matrix) Col(col int) Vector
- func (m *Matrix) Copy() *Matrix
- func (m *Matrix) Diagonal() *Matrix
- func (m *Matrix) DiagonalVector() Vector
- func (m *Matrix) Each(action func(row, col int, value float64))
- func (m *Matrix) Epsilon() float64
- func (m *Matrix) Equals(other *Matrix) bool
- func (m *Matrix) Get(row, col int) float64
- func (m *Matrix) Inverse() (*Matrix, error)
- func (m *Matrix) IsSquare() bool
- func (m *Matrix) IsSymmetric() bool
- func (m *Matrix) L() *Matrix
- func (m *Matrix) LU() (l, u, p *Matrix)
- func (m *Matrix) Multiply(m2 *Matrix) (m3 *Matrix, err error)
- func (m *Matrix) Pivotize() *Matrix
- func (m *Matrix) QR() (q, r *Matrix)
- func (m *Matrix) Round() *Matrix
- func (m *Matrix) Row(row int) Vector
- func (m *Matrix) ScaleRow(row int, scale float64)
- func (m *Matrix) Set(row, col int, val float64)
- func (m *Matrix) Size() (rows, cols int)
- func (m *Matrix) String() string
- func (m *Matrix) SubMatrix(i, j, rows, cols int) *Matrix
- func (m *Matrix) SwapRows(i, j int)
- func (m *Matrix) Times(m2 *Matrix) (*Matrix, error)
- func (m *Matrix) Transpose() *Matrix
- func (m *Matrix) U() *Matrix
- func (m *Matrix) WithEpsilon(epsilon float64) *Matrix
- type Vector
Constants ¶
View Source
const (
// DefaultEpsilon represents the minimum precision for matrix math operations.
DefaultEpsilon = 0.000001
)
Variables ¶
View Source
var ( // ErrDimensionMismatch is a typical error. ErrDimensionMismatch = errors.New("dimension mismatch") // ErrSingularValue is a typical error. ErrSingularValue = errors.New("singular value") )
View Source
var ( // ErrPolyRegArraysSameLength is a common error. ErrPolyRegArraysSameLength = errors.New("polynomial array inputs must be the same length") )
Functions ¶
Types ¶
type Matrix ¶
type Matrix struct {
// contains filtered or unexported fields
}
Matrix represents a 2d dense array of floats.
func NewFromArrays ¶
NewFromArrays creates a matrix from a jagged array set.
func (*Matrix) DiagonalVector ¶
DiagonalVector returns a vector from the diagonal of a matrix.
func (*Matrix) IsSymmetric ¶
IsSymmetric returns if the matrix is symmetric about its diagonal.
func (*Matrix) Round ¶
Round rounds all the values in a matrix to it epsilon, returning a reference to the original
func (*Matrix) U ¶
U returns the matrix with zeros above the diagonal. Does not include the diagonal.
func (*Matrix) WithEpsilon ¶
WithEpsilon sets the epsilon on the matrix and returns a reference to the matrix.
Click to show internal directories.
Click to hide internal directories.