This tag doesn't currently have an excerpt. Help contribute by writing one
Questions tagged [math.net]
256 questions
3
votes
3 answers
F# using System.Random() to get random number lists give the same lists
I have been searching other questions, where users would instantiate many System.Random()'s within a loop or method and therefore create many of the same randoms from the same clock. But here I have one instantiated System.Random() but when I try to…

Copperström
- 359
- 2
- 6
3
votes
3 answers
How to refactor code to make it functional style?
Playing with F#, I'm trying to think of code in a more functional way. A large part of my work happens to be numerical in nature so I'm thinking whether this re-education makes sense. Is writing numerical code in a functional way like trying to fit…

professor bigglesworth
- 560
- 4
- 16
3
votes
1 answer
Infix.ParseOrUndefined sequence order
I am using MathNet and trying to parse 2x^2 + x to epression using
Infix.Print(Infix.ParseOrUndefined("2x^2 + x"));
but it returns x + 2x^2. I want to keep the order of the source because I am going to convert it in LaTex using LaTeX.Print.
How can…

Renton Thurston
- 69
- 7
3
votes
2 answers
Matlab equivalent functions using mathdotnet
How can we implement below matlab function in C# using math.net library.
Multivariate normal random distribution- http://in.mathworks.com/help/stats/mvnrnd.html
r = mvnrnd(MU,SIGMA,cases)
Also below math.net function not returning any results. I've…

malkam
- 2,337
- 1
- 14
- 17
3
votes
1 answer
How to simplify formula with MathNet.Symbolics?
I'm using the MathNet.Symbolics library to simplify an algebraic formulas like
string f = Infix.Print(Infix.ParseOrThrow("L+H+L+H"))
And I correctly get f="2*L+2*H"
My problem arise when I need to subtract two of these formulas:
string f =…

Michele mpp Marostica
- 2,445
- 4
- 29
- 45
3
votes
1 answer
How can I cast Vector to Vector?
I am working in C# with the Math.Net Numerics library and mainly using Vector and Matrix objects (doing linear regressions, finding eigenvalues, etc...). Mostly I'm working with complex numbers so I'm using Vector (or matrix…

WHM
- 33
- 3
3
votes
2 answers
How to calculate a Goodness of Fit using Math.net?
Say, I have a die that is 19 times as likely to produce a six as a one, because it has been tampered with.
When I throw this die 60 times the expected versus observed frequencies of the six possible outcomes are:
1: 10, 1
2: 10, 10
3: 10, 10
4: 10,…

Dabblernl
- 15,831
- 18
- 96
- 148
3
votes
1 answer
Math.Net Numerics - how to run examples
First trial with Math.Net and moving from C++\Cli to C# to use Math.Net, so everything is new today.
How do I set-up and run the examples such as this one Matrix Transpose. Should I create a class and copy this code into it? I notice the interface…

jdelange
- 763
- 2
- 10
- 22
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
Performance of ILNumerics of simple math operations over vectors vs system array and Math.NET
I am recently doing some studies on numerical algorithms in C#. Therefore I did some experiments in search for the most suitable math library for .NET. One thing I do very often is to evaluate objective functions, which usually are functions that…

doraemon
- 403
- 6
- 15
3
votes
3 answers
Is there a linspace() like method in Math.Net
Is there function in Math.Net like (MatLab/Octave/numpy)'s linspace() which takes 3 parameters (min, max, length) and creates an vector/array of evenly spaced values between min and max? It is not hard to implement but if there was a function…

Alexander Van Atta
- 870
- 11
- 34
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
1 answer
How to format an equation into a C# Form using Math.Net?
I am trying to find a way to format an equation in C#. The steps and result I am trying to achieve are something as follows:
First, declare a simple string equation in code like string equation = "a/(b^2)"
Second, have this string be displayed on…

Alex Schmidt
- 67
- 7
2
votes
1 answer
Are vectors and matrices reference or value types? Math.Net Numerics
Excuse my ignorance, but are vectors and matrices reference or value types? Not sure if that makes a difference, but I am referring to those created from an array?
I tried to look it up online quickly, but couldn't find the answer.
I tried a few…

user20593243
- 57
- 5
2
votes
1 answer
Math.net check if two matrices are almost equal?
Libraries like numpy for python make it really simple to check whether two matrices are almost equal (numpy.allclose/numpy.isclose). I couldn't find anything similar for math.net. How would I check that two matrices are equal up to a tolerance in…

emilaz
- 1,722
- 1
- 15
- 31