Documentation
¶
Index ¶
- type Dimension
- type Matrix
- func (a Matrix[T]) Add(err *error, b Matrix[T]) Matrix[T]
- func (a Matrix[T]) ApproxEqual(b Matrix[T], errorMargin T) bool
- func (a Matrix[T]) Clone() Matrix[T]
- func (a Matrix[T]) Equal(b Matrix[T]) bool
- func (a Matrix[T]) Inverse(err *error) Matrix[T]
- func (a Matrix[T]) Multiply(err *error, b Matrix[T]) Matrix[T]
- func (a Matrix[T]) MultiplyScalar(err *error, x T) Matrix[T]
- func (a Matrix[T]) String() string
- func (a Matrix[T]) Subtract(err *error, b Matrix[T]) Matrix[T]
- func (a Matrix[T]) Transpose(err *error) Matrix[T]
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Matrix ¶
type Matrix[T constraints.Integer | constraints.Float] struct { Dimensions Dimension Values [][]T }
func New ¶
func New[T constraints.Integer | constraints.Float](err *error, values ...[]T) Matrix[T]
New instantiates a Matrix with the passed values.
func NewIdentity ¶
func NewIdentity[T constraints.Integer | constraints.Float](err *error, dim Dimension) Matrix[T]
NewIdentity instantiates an identity matrix of the specified dimensions.
func NewZero ¶
func NewZero[T constraints.Integer | constraints.Float](err *error, dim Dimension) Matrix[T]
NewZero instantiates a zero matrix of the specified dimensions.
func (Matrix[T]) ApproxEqual ¶
func (Matrix[T]) Multiply ¶
Multiply multiplies the matrix by another matrix. The height of matix B must match the width of matrix A.
func (Matrix[T]) MultiplyScalar ¶
MultiplyScalar multiplies the Matrix by a scalar.
Click to show internal directories.
Click to hide internal directories.