I am just testing to see if I can utilize math.Net Numerics for upcoming Linear Algebra classes and I am having trouble. I normally use R and Python but I felt like testing this out. I literally am brand new to Visual Studio. For some reason I get like 26 errors when trying to just test how to script for instance the first example in this website below. I added the math.Net Numerics 3.20.0 in the NuGet Package Manager. I also have attached what my UI looks like. Anybody know how I need to start the script. Do I need to open with a class and method?
https://numerics.mathdotnet.com/#Using-Math-NET-Numerics-with-C
Here is the code:
using MathNet.Numerics.LinearAlgebra;
using MathNet.Numerics.LinearAlgebra.Double;
Matrix<double> A = DenseMatrix.OfArray(new double[,] {
{1,1,1,1},
{1,2,3,4},
{4,3,2,1}});
Vector<double>[] nullspace = A.Kernel();
// verify: the following should be approximately (0,0,0)
(A* (2* nullspace[0] - 3* nullspace[1]))
Here are the errors when I copy and paste code into a new project in VS.
Error CS8124 Tuple must contain at least two elements.
Error CS1026 ) expected
Error CS1031 Type expected
Error CS8124 Tuple must contain at least two elements.
Error CS1026 ) expected
Error CS1022 Type or namespace definition, or end-of-file expected
Error CS1031 Type expected
Error CS0650 Bad array declarator: To declare a managed array the rank specifier precedes the variable's identifier. To declare a fixed size buffer field, use the fixed keyword before the field type.
Error CS0270 Array size cannot be specified in a variable declaration (try initializing with a 'new' expression)
Error CS1002 ; expected
Error CS1022 Type or namespace definition, or end-of-file expected
Error CS1031 Type expected
Error CS0650 Bad array declarator: To declare a managed array the rank specifier precedes the variable's identifier. To declare a fixed size buffer field, use the fixed keyword before the field type.
Error CS0270 Array size cannot be specified in a variable declaration (try initializing with a 'new' expression)
Error CS1002 ; expected
Error CS1022 Type or namespace definition, or end-of-file expected
Error CS0116 A namespace cannot directly contain members such as fields or methods
Error CS0116 A namespace cannot directly contain members such as fields or methods
Error CS0214 Pointers and fixed size buffers may only be used in an unsafe context
Error CS0208 Cannot take the address of, get the size of, or declare a pointer to a managed type ('?')
Error CS0102 The type '' already contains a definition
Error CS0214 Pointers and fixed size buffers may only be used in an unsafe
Error CS0208 Cannot take the address of, get the size of, or declare a pointer to a managed type ('?')
Error CS0102 The type '' already contains a definition
Error CS0103 The name 'A' does not exist in the current context
Error CS0103 The name 'A' does not exist in the current context.