Documentation
¶
Overview ¶
Package m2c implements complex matrices 2x2. Point your browser to http://g14n.info/m2c for more info.
Index ¶
- func Det(m Matrix) complex128
- func Eq(l Matrix, r Matrix) bool
- type CannotInvertMatrixError
- type Matrix
- func Add(l Matrix, r Matrix) Matrix
- func Conj(m Matrix) Matrix
- func I() Matrix
- func Inv(m Matrix) (Matrix, error)
- func J() Matrix
- func Mul(l Matrix, r Matrix) Matrix
- func Neg(m Matrix) Matrix
- func NewMatrix(a, b, c, d complex128) Matrix
- func Scalar(m Matrix, c complex128) Matrix
- func Sub(l Matrix, r Matrix) Matrix
- func T(m Matrix) Matrix
- func Zero() Matrix
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CannotInvertMatrixError ¶
type CannotInvertMatrixError struct {
// contains filtered or unexported fields
}
CannotInvertMatrixError complains cause it is not possible to invert a matrix if determinant is zero.
func (*CannotInvertMatrixError) Error ¶
func (e *CannotInvertMatrixError) Error() string
type Matrix ¶
type Matrix struct {
A, B, C, D complex128
}
Matrix with two rows, two columns and Complex numbers as values.
func Inv ¶
Inv inverts given matrix respect to multiplication. If it has determinant equal to zero, an error will be returned as second argument.
func Scalar ¶
func Scalar(m Matrix, c complex128) Matrix
Scalar multiplies matrix by a complex number.
Click to show internal directories.
Click to hide internal directories.