I have recently started using the MathNET library and it is awesome. I am working heavily with matrices and vectors. The library works great, but I am finding that I have to use casting all the time; an example of this would be:
using MathNet.Numerics.LinearAlgebra.Double;
...
Matrix P = (DenseMatrix)(T.Multiply(P.TransposeAndMultiply(T)) +
R.Multiply(Q.TransposeAndMultiply(R)));
or
using MathNet.Numerics.LinearAlgebra.Double;
...
Vector a, v, y;
Matrix F, K, Z;
...
Matrix FI = (DenseMatrix)F.Inverse();
if (FI != null)
K = (DenseMatrix)K.Multiply(FI);
...
v = (DenseVector)(y - Z.Multiply(a));
Why do I have to cast using ((DenseMatrix)
/(DenseVector)
) and is there a way around having to do this for each operation?