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
1
vote
0 answers

Reproduce the results of using Python's spectrogram() in C#

I would like you to point out various insights from the perspective of a C# expert, a Python expert, and an EEG expert. I would like to get the same results using MathNet in C# as I get using scipy.signal.spectrogram in…
Ganessa
  • 782
  • 2
  • 7
  • 24
1
vote
1 answer

Complex number displaying as incredibly small decimal

Was using a method from the MathNet Library and tried applying its Cubic root finding function, but it outputs incredibly long decimals, and rounding doesn't seem to affect them. public static (Complex, Complex, Complex) FindCubic(double a, double…
BigBoronto
  • 33
  • 6
1
vote
1 answer

Multiple regression for percentiles using Math.NET

I am currently using Fit.MultiDim from Math.NET to calculate an estimated value for a data set that has 2 dimensions like so: using MathNet.Numerics; using System.Collections.Generic; using System.Linq; namespace Project { public class Program …
Marin Petkov
  • 2,128
  • 4
  • 17
  • 23
1
vote
0 answers

MathNet LU and SVD crashing

This is the example for LU. What could be wrong ? var maxVertexIndex = vertices.Keys.Max(i => i); var L = new SparseMatrix(maxVertexIndex, maxVertexIndex); //(fill L, code omitted) var rhs =…
Softlion
  • 12,281
  • 11
  • 58
  • 88
1
vote
1 answer

How to use a Gamma distribution in MathNet.Numerics

I want a distribution density curve that rises steeply from zero to its peak and then falls shallowly. At StatDist, a website where statistical distributions may be plotted online, I achieved this with a Gamma distribution, for example by specifying…
SimonOR
  • 151
  • 6
1
vote
1 answer

How to concatenate matrices with Math.Net. How to call for a particular row or column with Math.Net?

How can I call for a particular row or column? Lets say I have this 8 x 6 matrix and want to call only one row or one column and assign that to a new variable, How to go about this in c#. Here is a piece of the code: //The Eight Solutions as one…
康拉德
  • 11
  • 3
1
vote
1 answer

C# decide between complex or standard double type during runtime

I'm writing a sci-comp application in C# (not to be confused with comp-sci), which should accept user inputs as both real and complex numbers. This difference between possible inputs would ideally reflect in many points down the stream - if inputs…
1
vote
1 answer

Exponential Fit of n points

I have n points (up to 513 points) that I need to fit in y = y0 + a*exp(b*x) I have been using MathNet.Numerics.Fit.Exponential, but the problem is coeficient y0, or when I have negative Y points, the result is (NaN, NaN) Example Points just first…
Mr. SvaRoq
  • 11
  • 2
1
vote
1 answer

How Can I Find Function's Value by MathNet in C#

I need to find the function's value for the given value. For example, the function is 3x-6, and I would like to find f(1), using MathNet.Numerics; using MathNet.Symbolics; using Expr = MathNet.Symbolics.SymbolicExpression; var x =…
propeace
  • 13
  • 2
1
vote
1 answer

Equivalent functionality of Matlab unique() in MathNET.Numerics?

Is there a MathNET.Numerics equivalent of Matlab’s unique(A, 'rows') (or unique(A)), where A is a Matrix? I have searched extensively through the MathNET.Numerics library documentation, and cannot find anything resembling this functionality.…
Conrad
  • 2,197
  • 28
  • 53
1
vote
1 answer

Equivalent functionality of Matlab sortrows() in MathNET.Numerics?

Is there a MathNET.Numerics equivalent of Matlab’s sortrows(A, column), where A is a Matrix? To recall Matlab's documentation: B = sortrows(A,column) sorts A based on the columns specified in the vector column. For example, sortrows(A,4)…
Conrad
  • 2,197
  • 28
  • 53
1
vote
1 answer

How to display a derivative

Not sure this is the correct section of this site,but I have a question. So,i`m using MathNet.Numerics to calculate a derivatives. I want to display them in console. Code example using System; using MathNet.Numerics; namespace math { class…
DerzkeyBK
  • 165
  • 1
  • 9
1
vote
2 answers

MathNet.Symbolics Algebraic.Expand in descending order?

With MathNet.Symbolics library, I try to print a polynomial with a descending power order: using mse = MathNet.Symbolics.Expression; using MathNet.Symbolics; public void Symbolics() { var x1 = 2; var y2 = 3; var x2 = 4; //…
kizzer
  • 150
  • 7
1
vote
0 answers

Does MathNet.Numerics library support SIMD?

I was looking for a C# library that supports minimal vector and matrix operations and found that System.Numerics just do exactly that by using SIMD. Just for curiosity, does 3rd party math library like MathNet.Numerics support SIMD? While looking…
KimHajun
  • 148
  • 7
1
vote
1 answer

How to easily apply a Gauss filter to a list/array of doubles

My code works already, but IMHO ugly: public IList Points { get; private set; } public IList Points2 { get; private set; } void ApplyGaussFilter() { var gauss = MathNet.Numerics.Window.Gauss(5, 0.8); …
MarkusEgle
  • 2,795
  • 4
  • 41
  • 61