This project has moved and is read-only. For the latest updates, please go here.

DenseMatrix Multiplied with Scalar

Jun 21, 2011 at 8:32 PM
Edited Jun 21, 2011 at 8:33 PM


I'm trying to multiply a DenseMatrix with a scalar as such:

Complex32 tau1 = new Complex32(0.1f, 0f);
M = M + Mold.Multiply(tau1);

where M an Mold each is a 3x3 denseMatrix()

Getting these errors from VS2010:

error CS0012: The type 'System.Numerics.BigInteger' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Numerics, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089'.
error CS0266: Cannot implicitly convert type 'MathNet.Numerics.LinearAlgebra.Generic.Matrix<MathNet.Numerics.Complex32>' to 'MathNet.Numerics.LinearAlgebra.Complex32.DenseMatrix'. An explicit conversion exists (are you missing a cast?)

Can someone please give me advice on how to solve this?






Jun 22, 2011 at 3:09 PM


Any of these should work:

M = M + (Mold * tau1);
M = (DenseMatrix)(M + Mold.Multiply(tau1));
M = M + (DenseMatrix)Mold.Multiply(tau1);

The problem is that Mold.Multiply(tau1) returns a Matrix<T> not a DenseMatrix.


Jun 22, 2011 at 5:11 PM
Edited Jun 22, 2011 at 5:14 PM

Hi Marcus,

Thanks for helping out! I needed to include the system.Numerics and now it works!