最新バージョンのMath.NETをダウンロードしたところ、使用時に問題が発生しました。
ライブラリが.NET4.0プロジェクトで実行されることを意図していたのでしょうか。
アップデート:
コンパイルされたdllは「Net40」フォルダ内にありますが、2.0プロジェクトで参照できないということですか?
このコードを試してみたところ、TypeLoadException
(VS2008、ターゲットフレームワーク3.5)を入手しました。
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
using MathNet.Numerics.LinearAlgebra.Double;
namespace MathNetTest
{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
double[,] A = new double[3, 3];
A[0, 0] = 1;
A[0, 1] = 0.2;
A[0, 2] = 1;
A[1, 0] = 1.5;
A[1, 1] = -1.2;
A[1, 2] = 1.1;
A[2, 0] = 0.45;
A[2, 1] = 2.1;
A[2, 2] = -0.76;
Matrix XA = new DenseMatrix(A);
Matrix XB = new DenseMatrix(A);
Matrix C = (Matrix)(XA * XB);
}
}
}