PJ33
Member
- Joined
- Jul 23, 2021
- Messages
- 7
- Programming Experience
- 1-3
Hello I am new in C# and I try to understand on how to read the documentation of libraries and implement it.
Here an example from
is shown:
I tried to understand how this is related to the documentation found here: MatrixBuilder<T> - Math.NET Numerics Documentation
What I understand is that I need to import the general library MathNet.Numerics and then the specific part of the library which is of interest, MathNet.Numerics.LinearAlgebra.
I am not sure why new wasn't used when the new Matrix object is created though.
My last question is why we use Build before of random.
I would expect to use this command:
Also, in the documentation there is everywhere this:
As far as I understand T correspond to the type of the matrix thus we use double, but how is this called (<T>) and are there any more of this that is good to know to be able to use documentation?
Thank you in advance.
Here an example from
Math.NET Numerics
numerics.mathdotnet.com
using System;
using MathNet.Numerics;
using MathNet.Numerics.LinearAlgebra;
class Program
{
static void Main(string[] args)
{
// Evaluate a special function
Console.WriteLine(SpecialFunctions.Erf(0.5));
// Solve a random linear equation system with 500 unknowns
var m = Matrix<double>.Build.Random(500, 500);
var v = Vector<double>.Build.Random(500);
var y = m.Solve(v);
Console.WriteLine(y);
}
}
I tried to understand how this is related to the documentation found here: MatrixBuilder<T> - Math.NET Numerics Documentation
What I understand is that I need to import the general library MathNet.Numerics and then the specific part of the library which is of interest, MathNet.Numerics.LinearAlgebra.
I am not sure why new wasn't used when the new Matrix object is created though.
My last question is why we use Build before of random.
I would expect to use this command:
var m = new Matrix<double>.Random(500,500)
Also, in the documentation there is everywhere this:
Matrix<T>
As far as I understand T correspond to the type of the matrix thus we use double, but how is this called (<T>) and are there any more of this that is good to know to be able to use documentation?
Thank you in advance.