This project has moved. For the latest updates, please go here.

Initialize DenseMatrix

Jun 21, 2011 at 7:46 PM
Edited Jun 21, 2011 at 7:47 PM

Hi

I'm a C# Newbie and need support to get going with MathNet.

I have an array of DenseMatrices which I would like to load some complex data (real and imag) into.

My array of matrices is declared like this:

mArray = new DenseMatrix[N]; 
for (int k = 0; k < N; k++) 
  mArray[k] = new DenseMatrix(3, 3);

Now, why can't I do the following:

mArray[0][0, 0] = new Complex32(0.5f, -0.5f);

VS2010 prompts:

error CS0012: The type 'System.Numerics.Complex' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Numerics, Version=4.0.0.0,
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=4.0.0.0
error CS0029: Cannot implicitly convert type 'MathNet.Numerics.Complex32' to 'System.Numerics.Complex

This surely has something to do with a namespace issue.

Any help out there?

Cheers

 

 

 

 

 

 

 

 

 

 

 

 

Jun 21, 2011 at 7:56 PM

Resolved it myself!

Changed

using MathNet.Numerics.LinearAlgebra.Complex;

To

using MathNet.Numerics.LinearAlgebra.Complex32;

Sorry for the noise!