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
0
votes
0 answers

How to reshape matrix in MathNet?

I have 1x4 Matrix [1, 2, 3, 4] And I want to get 2x2 Matrix [[1, 2], [3, 4]]. How can achieve this in Math.Net? I found Resize method, which does not what I need. Vector vector = Vector.Build.DenseOfArray(new double[] { 1, 2, 3, 4…
dankal444
  • 3,172
  • 1
  • 23
  • 35
0
votes
1 answer

c# MathNet Gamma distribution sampling not matching

I am trying to implement an event time sampling for different distributions using the MathNet library. I have them working for exponential, normal and weibull but the same process is not working for Gamma anyone know what I am doing wrong? Testing…
runfastman
  • 927
  • 2
  • 11
  • 31
0
votes
1 answer

Imaginary number comparison with C#

I want to analyse a polynomial and only output the real roots. I use the Systems.Numerics to get the complex number and then compare their imaginary component to a set value to find out if they are real. To analyse the polynom, I use…
Thrawn
  • 3
  • 3
0
votes
0 answers

Gaussian Distribution C#

So I want to distribute some points using the normal distribution. I cant figure it out. The goal is to have numberOfInstances many Points. I wanna have 5 intervals that have a different number of points Total = numberOfInstances and it should be…
Liri22
  • 13
  • 4
0
votes
1 answer

Where to tell the F# compiler to locate an assembly?

I'm trying to compile an F# program that wants to use arbitrary precision rational numbers. The source code contains open MathNet.Numerics and MathNet.Numerics and MathNet.Numerics.FSharp are installed in such a way that Visual Studio is happy. Now…
rwallace
  • 31,405
  • 40
  • 123
  • 242
0
votes
1 answer

C# Mathnet Numerics Polynomial Evaluate across an vector/array, do I have to loop?

Ok, so I'm attempting to fumble my way through a Matlab source code conversion into C#. Thus far I've been able to do everything without needing to implement any loops. data = vector of data Fourier.Forward(data.AsArray()) takes in data and…
Michael
  • 174
  • 2
  • 13
0
votes
0 answers

MathNet - prevent zero values in denominator

Question about MathNet (specifically Symbolics): is it possible to add constraints to prevent zeroes in the denominator of an expression? Say that you have this expression: 100 / (1 - X) If X is equal to 1, you will get a 0 in the denominator,…
alex93
  • 65
  • 5
0
votes
1 answer

How to get translation matrix 2D for coordinates transformation

I have two 2D coordinate systems A and B. I know how 3 points from the coordinate system A are translated into the coordinate system B. A1[x, y] => B1[x, y] A2[x, y] => B2[x, y] A3[x, y] => B3[x, y] Now, I have a point A4 from the coordinate system…
user2250152
  • 14,658
  • 4
  • 33
  • 57
0
votes
0 answers

How to efficiently grow a Matrix?

[Using Math.NET Numerics library] I have a method where I am adding an unknown amount of rows to a Matrix. What is the fastest, most efficient way to grow the Matrix? Anything better than: Matrix origDb = Matrix.Build.Dense(22,…
Conrad
  • 2,197
  • 28
  • 53
0
votes
1 answer

Is there a equivalent of the numpy.tile() function in C#?

I'm trying to use a alternative for numpy.tile() in C# to copy an array n times to create a matrix of this array. Maybe it can be found in the MathNet.Numerics.LinearAlgebra library, but I can't find anything.
Developper
  • 89
  • 1
  • 10
0
votes
0 answers

Storing Math.Numerics.Fit.Line data into two separate variables simultaneously

I am working on a excercise here which is gathering data from a file and then displaying it on graph. I am using a linkedIn video to help me here but I stumped on how they are able to store this extension method into two separate variables at the…
boolingBloke
  • 31
  • 1
  • 6
0
votes
2 answers

How to find entity index from matrix or vector in Mathnet, vb.net?

Lets say i have an matrix A=[1 2 3;4 5 6] Now i want to check whether 5 is present in it or not. The answer should be the row and column i.e Row=1 Col=1 I have tried find but not finding it useful. Thanks in advance
Anas Ahmed
  • 123
  • 9
0
votes
1 answer

Unable to define MathNet.Numerics.LinearAlgebra.Matrix as Const?

Here is the C# code : const MathNet.Numerics.LinearAlgebra.Matrix ket_Zero = MathNet.Numerics.LinearAlgebra.Matrix.Build.DenseOfRowMajor(2, 1, new MathNet.Numerics.Complex32[] { new…
Avon
  • 1
  • 2
0
votes
0 answers

MathNet.Numerics causing an internal exception

Currently, I am experiencing an exception caused by MathNet.Numerics C# library during the initial usage of Inverse() function. After first time usage, I dont have any problem. I might be missing some details. Simply following code is used. (Kt is…
Ugur
  • 1,257
  • 2
  • 20
  • 30
0
votes
0 answers

MathNet.Numerics find indices of minimums in a matrix that meet a condition

I'm trying to find the indices of the minimum values in a Matrix with MathNet.Numerics, but only for the values that meet a certain condition (in this case value >= 0). I can find one of the minimum actual values like this: var mat =…
MrEighteen
  • 434
  • 4
  • 16