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
3
votes
1 answer

What is wrong with my Fourier Transformation (Convolution) in MathNet.Numerics? - C#

I am trying to do a simple Convolution between 2 audio files using the MathNet.Numerics's FFT (Fast Fourier Transformation), but I get some weird background sounds, after the IFFT. I tested if it's the Convolution or the Transformations, thats…
Dejan Skledar
  • 11,280
  • 7
  • 44
  • 70
3
votes
1 answer

Math.NET Numerics - Matrix from an array of doubles

Assuming I have: double[] someArray = new [] { 11, 12, 13, 14, 21, 22, 23, 24, 31, 32, 33, 34, 41, 42, 43, 44 }; Is there any out of the box way of creating a 4x4 matrix out of this array without having to split it into 4 arrays myself? I know it is…
johnildergleidisson
  • 2,087
  • 3
  • 30
  • 50
3
votes
1 answer

Solving a least squares matrix having constrained the results

I have a rectangular matrix thus: 1, 3, 2, 4, n.. 4, 2, 1, 5, n.. n.. and a vector thus: 1, 2, 5, 6, 7, n.. I need to solve the least-squares equation for all columns in the matrix, but I want to constrain the results such that all answers are…
Simon
  • 151
  • 5
3
votes
2 answers

c# Mathnet Numerics -- get index of non-zero sparse matrix elements

I want to create a custom optimized matrix operation (a smart kronecker product based on what I know about the sparse matrices i'm using) using MathNet.numerics for csharp. Is there an accessor to get the non-zero elements of a sparse matrix? (or…
user1167650
  • 3,177
  • 11
  • 34
  • 46
2
votes
2 answers

How can I fit a sphere to a set of 3d points with least squares method?

I am trying to fit a sphere to a set of 3d points by using the method I found here: https://jekel.me/2015/Least-Squares-Sphere-Fit. I do understand why and how the input matrix and vector are formed, but I have not understood the least squares…
Christian
  • 317
  • 1
  • 14
2
votes
1 answer

Mathnet Numerics with Intel MKL running much slower on Intel Xeon Gold than an old i7-7700HQ laptop

I have several functions doing matrix computations using MathNet Numerics + Intel MKL provider. The matrices are not too large, something like 40x100, and the operations involve some pseudoinverses, eigenvalues, and similar linear algebra…
vgru
  • 49,838
  • 16
  • 120
  • 201
2
votes
2 answers

Algorithm to find the bitangent of a 2D curve

I'm looking for an algorithm to calculate the bitangent of a curve, ie. the line below a curve that intersects it at exactly two points: Specifically, I am looking for the two x-values where the bitangent intersects the curve. These are examples…
ekglimmer
  • 27
  • 6
2
votes
2 answers

Matrix concatenation using MathNet.Numerics.LinearAlgebra in .NET Framework

I would like to perform row-wise and column-wise matrix concatenation using .NET Framework with MathNet library. For example, if I have 3 matrices A, B, C of dimension nxn, I would like create a new matrix D of dimension 2nx2n where // I have used…
Ram Sam
  • 21
  • 1
2
votes
1 answer

List.unfold/Array.unfold causes memory blowout

Friends, the following code runs fine when using Seq.unfold. However, List.unfold or Array.unfold (as shown below) causes the program to never terminate. I'm mostly just curious as to why that is. However, I am biased in general towards only using…
2
votes
2 answers

Looking for a sample how to do weighted linear regression

I'm trying to use MathNet to calculate weighted linear regression of my data. The documentation is here. I'm trying to find a x + b = y such that it would best fit a list of (x,y,w), where w is weight of each point. var r =…
Arsen Zahray
  • 24,367
  • 48
  • 131
  • 224
2
votes
1 answer

How do I calculate the sqrt in MathNet.Symbolics

I'm using the MathNet.Symbolics library to simplyfy expressions like this : string f = Infix.Print(Infix.ParseOrThrow("A+5*2")) This works as expected (f = A+10) but trying to get the root of a number is a lot harder than I expected. For example…
user4543491
2
votes
1 answer

Add second indexer to Math.NET Numerics

Not sure how to meet the demands of stackoverflow on this one... I'd like to modify the MathNET Numerics package so that I can use the indexer to access or assign to a sub-matrix as follows: A[rows, cols] where rows and cols are int[] I've written…
gwizardry
  • 501
  • 1
  • 6
  • 19
2
votes
1 answer

C# MathNet FFT Definition

I have some problem when testing FFT from MathNet: The idea is that if I apply FFT to the characteristic function of a gaussian variable I should find the gaussian density function. When I plot VectorFFT the figure does seems a density function but…
plccrl
  • 21
  • 2
2
votes
1 answer

FFT with Math.NET 4.0 - Complex32[] vs. Complex[]

I have a problem calculating the FFT from my data set, using Math.NET with .NET4.0. I used .NET 3.5 with Math.NET like this without any errors: public Ergebnisse_FFT_Abs_PSD_MNF FFT_Abs_PSD_MNF(double[] data) { Complex[] samples =…
JoMa
  • 25
  • 5
2
votes
1 answer

C# Matrix calculations and SVD using own generic type (with Math.NET Numerics)

I have written my own struct for interval arithmetic, to keep it simple let's just say this is a value defined by a lower and an upper bound. Some of you might know be familiar with the type Range, which is quite similar. I overloaded the whole…
selmaohneh
  • 553
  • 2
  • 17
1 2
3
15 16