【发布时间】:2011-11-10 20:44:01
【问题描述】:
我刚刚下载了最新版本的 Math.NET,但在使用时遇到了一些问题。
该库可能是为了在 .NET 4.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);
}
}
}
【问题讨论】:
-
我猜你的意思是:mathdotnet.com
-
您遇到的错误是什么?
-
我相信当使用 .NET 4.0 System.Numerics dll 的特定方法时出现此错误,因为它是在 2.0 应用程序中运行的 4.0 dll。
标签: c# .net math.net mathnet-numerics