Thanks for sharing, I published a PowerShell module that does that with a little bit of syntactic tricks to make using Math.Net with PowerShell easier, please feel free to check it out, your feedback is always welcome.
https://mathnetpowershell.codeplex.com/
Here is a sample code/output:
PS C:> $m = m "1 5;5 9"
PS C:> $m
SparseMatrix 2x2-Single 100.00 % Filled
PS C:> $n
SparseMatrix 2x2-Single 50.00 % Filled
PS C:> $n
SparseMatrix 2x2-Single 50.00 % Filled
SparseMatrix 2x2-Single 50.00 % Filled
PS C:> $p
SparseMatrix 2x2-Single 100.00 % Filled
19
PS C:> det $p
-32
PS C:> t $p
SparseMatrix 2x2-Single 100.00 % Filled
SparseMatrix 2x1-Single 50.00 % Filled
SparseMatrix 2x1-Single 0.00 % Filled
PS C:> $o
SparseMatrix 3x3-Single 100.00 % Filled
1
8
4
https://mathnetpowershell.codeplex.com/
Here is a sample code/output:
PS C:> $m = m "1 5;5 9"
PS C:> $m
SparseMatrix 2x2-Single 100.00 % Filled
1 5
5 9
PS C:> $n = i 2PS C:> $n
SparseMatrix 2x2-Single 50.00 % Filled
1 0
0 1
PS C:> $n[1,1]=2PS C:> $n
SparseMatrix 2x2-Single 50.00 % Filled
1 0
0 2
PS C:> inv $nSparseMatrix 2x2-Single 50.00 % Filled
1 0
0 0.5
PS C:> $p = $m * $nPS C:> $p
SparseMatrix 2x2-Single 100.00 % Filled
1 10
5 18
PS C:> trc $p19
PS C:> det $p
-32
PS C:> t $p
SparseMatrix 2x2-Single 100.00 % Filled
1 5
10 18
PS C:> m "1 0" | tSparseMatrix 2x1-Single 50.00 % Filled
1
0
PS C:> m -rows 2 -columns 1SparseMatrix 2x1-Single 0.00 % Filled
0
0
PS C:> $o = m -matrixFile Samples\sampleMatrix.txtPS C:> $o
SparseMatrix 3x3-Single 100.00 % Filled
1 5 6
7 8 9
6 5 4
PS C:> $o.Diagonal()1
8
4