A .NET implementation of matrices and their operations.
In mathematics, a matrix (plural matrices) is a rectangular array of numbers, symbols, or expressions. The numbers, symbols or expressions in the matrix are called its entries or its elements. The horizontal and vertical lines of entries in a matrix are called rows and columns, respectively.
From Wikipedia.
Matrices are commonly written in box brackets or large parentheses:
A matrix can be created using a multidimentional array of elements.
var elements = new[,]
{
{1, 0, 0},
{0, 1, 0},
{0, 0, 1}
};
matrix = new Matrix<int>(elements);
This creates an identity matrix of size 3.
A matrix can be created using a builder method, delegating the process of creating the set of elements to another object.
Func<int, int, int> delegateBuilder = (i, j) => i == j ? 1 : 0;
matrix = new Matrix<int>(3, 3, delegateBuilder);
This creates an identity matrix of size 3.
The elements can be reteieved using the indexer of the matrix object.
var i = 0, j = 0;
var firstElement = matrix[i, j];
var ith = matrix.NumberOfRows;
var jth = matrix.NumberOfColumns;
var sum = matrix1 + matrix2;
var product = matrix * scalarValue;
var matrixResult = matrixLeft * matrixRight;
The project is written in respect of the rules normalized by Microsoft for C# programming and ReSharper convention. Please, be compliant to those rules when contributing.
The project is written in respect of the principles of Test Driven Development. Please, think to add unit tests for your code when contributing.
The code is written Jämes Ménétrey (aka ZenLulz) in the context of mathematics courses teached in the University of Applied Sciences Western Switzerland.