Reputation: 11
Where can I find similar function as numpy.linalg.norm
(Python) for C++ or C#? This function is able to return one of seven different matrix norms, or one of an infinite number of vector norms, depending on the value of the ord
parameter.
Upvotes: 1
Views: 1723
Reputation: 21
You can use Vector2.Length() Example:
using System.Numerics;
namespace LinearAlgebraCSharp
{
class Program
{
static void Main(string[] args)
{
Vector2 vec1 = new Vector2(2, 3);
// Equivalent of <numpy.linalg.norm>
float vectorModule = vec1.Length();
}
}
}
Upvotes: 1
Reputation: 5940
For C# the numerics part of the Math.NET project may be what you want.
http://numerics.mathdotnet.com/
Upvotes: 0
Reputation: 78334
Depending on your platform and the depth of your pocket you might be interested in Intel's MKL which is callable from both C++ and C#
Upvotes: 1
Reputation: 367
You can compile blas and lapack with a Fortran Compiler and link against them in your C++ Program.
Upvotes: 0