# Matrix class

The Matrix class

Most of the class code is not optimized for high performance but for readability. You should be able to read the functions and understand what is going on with basic linear algebra knowledge.

For more reading see the page about `Matrix Math at Wikipedia`(Matrix

``````final Matrix a = Matrix([[1, 2], [3, 4]]);
final Vector b = Vector.column([2, 3]);
final Matrix e = Matrix([[8], [18]]);
Matrix result = a * b;
print(result);
print(result == e);
``````

This prints

``````[[8.0], [18.0]]
true
``````

## Constructors

Matrix(List<List<double>> _values)
Constructs a matrix from a List<List> value. [...]
Matrix.eye(int size)
Constructs an identity matrix of `size`
Matrix.fill(int m, int n, [ double fill = 0.0 ])
Constructs a `m`x`n` (rows x cols) Matrix fill with `fill=0.0`. [...]

## Properties

hashCode → int
Returns the hashCode for the matrix.
m → int
Returns the number of rows
n → int
Returns the number of columns
runtimeType → Type
A representation of the runtime type of the object.

## Methods

coFactors()
Calculates the Cofactors of the matrix. [...]
columnVector(int column)
Returns a column from the matrix as a vector. [...]
copy()
Returns a deep copy of the Matrix.
cut(int m, int n)
Cuts the given column `m` and row `n` from the matrix and returns the remainder. [...]
det() → double
Calculates the determinant of the matrix. [...]
inverse()
Calculates the matrix inverse. [...]
map()
Calls `f` for each element in the matrix and stores the result in a new matrix. [...]
rowVector(int row, [ bool deepCopy = true ])
Returns a row from the matrix as a vector. [...]
toString() → String
Prints the content of the matrix.
toVector([bool deepCopy = true ])
Returns the Vector representation of this Matrix if one of it's dimensions is 1. [...]
trace() → double
Calculates the trace of the Matrix. [...]
transpose()
Transposes the matrix [...]
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed.
inherited

## Operators

operator *(dynamic other)
Multiply an Matrix with a Matrix or a scalar [...]
operator +(Matrix other)
Add two matrices of same dimensions. [...]
operator -(Matrix other)
Subtract two matrices of same dimensions. [...]
operator ==(dynamic other) → bool
Equality check for each element in the matrix.
operator [](int m) → List<double>
Access a row of data from the matrix [...]
operator ~()
Negate all values [...]