Questions tagged [mathnet-numerics]

Math.NET Numerics is an opensource numerical library for .Net, Silverlight and Mono.

Math.NET Numerics is the numerical foundation of the Math.NET project, aiming to provide methods and algorithms for numerical computations in science, engineering and every day use. Covered topics include special functions, linear algebra, probability models, random numbers, statistics, interpolation, integration, curve fitting, integral transforms (FFT) and more.

In addition to the core .NET package (which is written entirely in C#), Numerics specifically supports F# 3.0 with idiomatic extension modules and maintains mathematical data structures like BigRational that originated in the F# PowerPack. If a performance boost is needed, the managed-code provider backing its linear algebra routines and decompositions can be exchanged with wrappers for optimized native implementations such as Intel MKL.

Supports Mono and .NET 4.0 on Linux, Mac and Windows, the portable version also Silverlight 5, WindowsPhone 8 and .NET for Windows Store apps.

Source: GitHub: Math.NET Numerics ReadMe file

230 questions
9
votes
2 answers

Parallel.For not utilising all cores

I'm doing heavy mathematical computations using Math.Net Numerics parallely inside Parallel.For block. When I run code in my local system with 4 cores(2*2), it's using all 4 cores. But when I run same code in our dev server with 8 cores(4*2), it's…
malkam
  • 2,337
  • 1
  • 14
  • 17
7
votes
1 answer

Cuda Native Provider - Missing MathNet.Numerics.CUDA.dll

Math.Net 3.7.0 Release Notes on nuget mention a CUDA native provider. Control.UseNativeCUDA(); throws a DllNotFoundException for MathNet.Numerics.CUDA.dll. For the MKL-provider i need to install an extra NuGet-Package. Is there no package for the…
Robert
  • 101
  • 7
7
votes
3 answers

Exponential based Curve-Fit using Math.Net

I'm very new to the Math.Net Library and I'm having problems trying to do curve-fitting based on an exponential function. More specifically I intend to use this function: f(x) = a*exp(b*x) + c*exp(d*x) Using MATLAB I get pretty good results, as…
eol
  • 23,236
  • 5
  • 46
  • 64
7
votes
1 answer

MathNet.Numerics vs Matlab Forward Fourier answers mismatch?

I'm little stuck here. The results of Forward Fourier by MathNet Numerics seem to be little less by half of those by MATLAB. MathNet.Numerics on WindowsPhone 8 Complex[] samples = { new Complex(5, 0), new Complex(6, 0), new Complex(1, 0), new…
Octane
  • 1,200
  • 11
  • 11
7
votes
2 answers

Cross Product using Math.Net Numerics with C#

I have two vectors MathNet.Numerics.LinearAlgebra.Generic.Vector, like the following: Vector v1 = new DenseVector(new double[] { 1, 2, 3 }); Vector v2 = new DenseVector(new double[] { 3, 2, 1 }); I basicly want to…
Sait
  • 19,045
  • 18
  • 72
  • 99
6
votes
0 answers

Get REAL and IMAG from complex number in parsed equation

I am evaluating Math.NET Symbolics for use in our application where we want a simple math parser for the user to calculate custom equations from our measurement data. Our data is in the form of Complex numbers. To test I use the following…
6
votes
0 answers

What is the Math.NET equivalent of numpy.where?

I'm porting a piece of python code that currently uses numpy, to IronPython (the reasons for this have to do with the specifics of the platform I'm scripting in). Due to incompatibilities of numpy and IronPython, I need to replace every numpy…
6
votes
3 answers

Can Math.NET solve any matrix?

I am trying to use Math.NET to solve the following system: Coefficient Matrix A: var matrixA = DenseMatrix.OfArray(new[,] { { 20000, 0, 0, -20000, 0, 0, 0, 0, 0 }, { 0, 666.66666666666663, 2000, 0, -666.66666666666663, 2000, 0, 0, 0 }, …
Matt VS
  • 278
  • 4
  • 19
5
votes
0 answers

Getting R, P value, and T Statistic for each coefficient in multiple regression (math.net)

I'm using https://numerics.mathdotnet.com/Regression.html for reference. I attempted to get the r value for each independent variable in my code below but I don't know if this is correct and if this is the correct way to do it, how to also get the p…
DarthVegan
  • 1,719
  • 7
  • 25
  • 42
5
votes
0 answers

slow matrix operations compared to R

The following calculation runs much slower than it does in R: let result = (X.Transpose() * b * X).Inverse() * (X.Transpose() * b) * e // about 4 seconds on my machine or this: let result = (X.Transpose() * b * X).QR().Solve((X.Transpose() * b) *…
5
votes
1 answer

DebuggerTypeProxy for generic type hierarchy

I'm trying to write a debugger type proxy/surrogate for matrices and vectors in Math.NET Numerics, so the debugger shows more useful information (also in F# FSI). The type hierarchy is as follows: Generic.Matrix Double.Matrix :…
Christoph Rüegg
  • 4,626
  • 1
  • 20
  • 34
4
votes
2 answers

GoodnessOfFit.StandardError wrong answer

Why am I getting the wrong answer (err2) from GoodnessOfFit.StandardError? In the code below, I do the computation myself and get the right answer (err3). I get the right answer from GoodnessOfFit.RSquared. Note: esttime and phrf are double[].…
phv3773
  • 487
  • 4
  • 10
4
votes
1 answer

Converting an F# Function with multiple parameters to a Func Type - MathNet.Numerics

In this question: In F# how can I produce an expression with a type of Func? it is shown that a single valued lambda expression is automatically cast/converted to a Func type and then accepted in the function. I'm working with the…
4
votes
1 answer

Math.Net Numerics - Fitting sinus function

I'm new here and I hope that perhaps the experts outthere can help me: I want to fit the sinus function f(x) = a *sin(b* (x+c))+d via the library "math.net numerics" in C#. At the beginning I tried the following example code: // data points: we…
Biläl
  • 43
  • 4
4
votes
2 answers

How can I convert matrix to Matrix?

I want to calculate something like: Matrix * Matrix the Matrix has about 6M*3 elements , how can I convert the Matrix to Matrix so that I can get a Matrix result.
xcl
  • 45
  • 4
1
2 3
15 16