This tag doesn't currently have an excerpt. Help contribute by writing one
Questions tagged [math.net]
256 questions
1
vote
0 answers
Filter function from coefficients in C#?
Is there a function (possibly within Math.Net) that takes an array of numerator and denominator coefficients of a digital filter and uses that to filter an input array?
Something like MATLAB's filter() function or Python's scipy.signal.lfilter()…

MathuSum Mut
- 2,765
- 3
- 27
- 59
1
vote
1 answer
How to solve non-linear equation iteratively (using Math.NET Numerics)
I have a specific non-linear equation of type:
a(1+cos(b))^2 = 4x * exp(-2c*(a-x)^2)
Can Math.NET Numerics solve this equation iteratively to get x when a,b and c are given?
The Documentation only talks about linear equations.
Thanks in advance.

selmaohneh
- 553
- 2
- 17
1
vote
0 answers
The arguments type and the return type in specific methods of MathNet.Numerics
C# is a strongly-typed language, when I use MathNet.Numerics in C#, this put me to trouble.
for example:
when I call the PointwiseMultiply() method, the former matrix and the latter one must be the same type. That means I must convert a…

Shi Kouzhong
- 11
- 3
1
vote
2 answers
How to take inverse of a matrix with mathdotnet
I get all the values of invone as NaN with this. Can't figure out what is wrong. Is there any easier way to take inverse of a matrix other than mathdotnet? It is hard to google cause when you type inverse you get the transpose codes.
for(…

Alpay Aydıngüler
- 13
- 4
1
vote
1 answer
Math.NET - return matrix as string by row
I'm using Math.Net (http://numerics.mathdotnet.com/) to work with matrices.
I need a method that returns a matrix as a string.
So if my matrix looks like this:
{{1.0, 2}
{3 , 4}}
I need my return string to equal
"1 2 3 4"
Here is my code
var M =…

JAck28
- 899
- 4
- 15
- 40
1
vote
1 answer
Multiple dispatch behavior for operator overloads
The following gives a duplicate definition error:
let (.*) (m1 : Matrix) (m2 : Matrix) =
m1.Multiply(m2)
let (.*) (v1 : Vector) (v2 : Vector) =
v1.DotProduct(v2)
Is there a way to define an operator overload…

professor bigglesworth
- 560
- 4
- 16
1
vote
1 answer
Constrained Regression in R
I'm using the R type-provider from F# to access some regression related R functionality. I would like to estimate a regression when there is a constraint on the regression coefficients, so that their weighted average is 0. The weights sum to 1. The…

s952163
- 6,276
- 4
- 23
- 47
1
vote
1 answer
find roots of cubic polynomial
I'm trying to find the roots of a cubic polynomial ax^3+bx^2+cx+d=0 using math.numerics. The package is great, but I'm struggling to get started with it. Please can someone explain how to find the roots, and a simple explanation on how to run the…

Zeus
- 1,496
- 2
- 24
- 53
1
vote
1 answer
Converting System.Double[,] to DenseMatrix
The hessian function in Diffsharp returns something called System.Double[,]. Or if you hover on the variable it shows as a float[,]. This object seems a bit difficult to parse, I'm not sure why. This question is related but the answer doesn't seem…

professor bigglesworth
- 560
- 4
- 16
1
vote
1 answer
Assignment to mutable variable interferes with type inference of otherwise valid calculation
I'm attempting some Newton Raphson updates. Here is a piece of code that compiles and runs (warning: infinite loop).
let thetam = [|beta; sigSq|] |> DenseVector
let mutable gm = grad yt xt betah sigSqh // returns DenseVector
let hm = hess yt xt…

professor bigglesworth
- 560
- 4
- 16
1
vote
0 answers
How could I determine number of iterations untill convergence of iterative solvers in Math.NET?
I am using last version of Math.NET.
I tried "residualStopCriterion._lastIteration" but it only works in debug mode since it's a non-public member. I need to save this values in a file.

Amin
- 11
- 3
1
vote
1 answer
Math.Net Numerics library Transpose doesn't Work
So I want to transpose a matrix that I defined with
using MathNet.Numerics.LinearAlgebra.Double;
var MatrixValues = new double[]{1,1,2,2,3,3}
var M = Matrix.Build;
var C = M.Dense(3,2,MatrixValues);
var TR =…

Afshinzkh
- 111
- 1
- 14
1
vote
1 answer
Where is MathML in MathNet.Symbolics for c#?
Here it is for F#; Here it is in UnitTests. So it shall be at least in F# distribution thus in .net dll. And yet it does not show itself in Assembly Explorer
How to use MathNet.Symbolics MathML classes in CSharp?

DuckQueen
- 772
- 10
- 62
- 134
1
vote
1 answer
Compatibility .Net 4.0 and .Net 4.5. Could not load file or Assembly 'FSharp.Core, Version=4.3.1.0.'
I want to use the library Math.NET Symbolics in the F# project.
But when I run simple code:
open MathNet.Symbolics
open MathNet.Symbolics.Operators
...
let expr = Infix.parseOrThrow("sin(x) * y")
let symbols = Map.ofList [ "x", Real 2.0; "y", Real…

FoggyFinder
- 2,230
- 2
- 20
- 34
1
vote
1 answer
What is the MathNet equivalent of MATLAB prod(v)?
I am porting some MatLab code to MathDotNet / C#
What is the function to return each element in a vector multiplied together?
In MatLab i can do prod(v)
What is the equivalent of this in MathDotNet?

Joe Booth
- 501
- 1
- 4
- 13