# Matrix Class

The default matrix class is a row-major-order Matrix and Inherits from

Vector<

RealVector>

Everything worthwhile doing in this library can be represented as a Matrix or a collection of Matrices. Matrices represent systems of linear equations

*most of the time*. Although the basic matrix class can be used to represent graphs, I do not recommend it for this purpose as it's values are floating point and not suited to discrete data structures.

In general, operations that return every element ( i, j ) of the initial matrix are

*in-place operations*. If the matrix operation

*can* return a matrix of different dimensions then you should assume that a new matrix has been created and returned.

__In-place__ operations do not generate a new matrix, they only act upon the elements of the initial matrix. if there is not an obvious return value for an operation, then a reference to the original matrix is returned. For example Inverse is

*in place*, however

*GetSubmatrix* returns a new matrix. I haven't yet implemented a simple method to copy a matrix, but the GetSubmatrix method can be called in such a way to do this easily. In place methods return a reference to the modified
matrix and

__not a new matrix__. This is to facilitate chaining of expressions, which allows for you to create some lethal one-liners using this library.

Example of Inversion using In-Place Methods

Matrix A = Matrix.Random( 5, 5, 36, 0, 1000 );
Matrix Inv;
Inv = A.Augment( Matrix.Identity( 5, 5 ) ).
ForwardElimination( Double.Epsilon ).
Normalize().
SolveByBackSubstitution().
DeAugment( i, j );
Assert( (A*Inv).Equals( Matrix.Identity( 5, 5 ), 0.00001 ) );

### Matrix Operations that return a reference to the Original Matrix's Instance

- Do - performs a subroutine for each element of the matrix given either the value of the element or the coordinates of the element
- Set - sets each element of the matrix to a value given by a user defined function
- ForwardElimination - Perform Gaussian Elimination taking the matrix to Row Echelon Form
- Normalize - divides each element on a row by the value of the pivot
- SolveByBackSubstitution - if used after ForwardElimination and Normalize it takes the matrix to Row Canonical Form
- Augment - Appends a matrix to the horizontal end of this matrix

### Matrix Operations that return something else

- GetSubmatrix
- Determinant
- Multiplication Operator
- DeAugment (returns the portion of the matrix that was removed)

## Properties

- this.M - the number of rows
- this.N - the number of columns

## Operators

- * - Multiplication - Matrix multiplication

## Static Methods

- Create
- Random
- GetFromUserInput

### Method Dependency Graph

### Method Dependency Matrix