Charbel Badr
Charbel Badr

Reputation: 11

Linear Algebra Library

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

Answers (6)

Kabir Costa
Kabir Costa

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

corvuscorax
corvuscorax

Reputation: 5940

For C# the numerics part of the Math.NET project may be what you want.

http://numerics.mathdotnet.com/

Upvotes: 0

Ivan Kochurkin
Ivan Kochurkin

Reputation: 4491

Maybe alglib is appropriate for you?

Upvotes: 0

High Performance Mark
High Performance Mark

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

ChaosCakeCoder
ChaosCakeCoder

Reputation: 367

You can compile blas and lapack with a Fortran Compiler and link against them in your C++ Program.

Upvotes: 0

Konstantin Dinev
Konstantin Dinev

Reputation: 34905

See if this library makes sense for you:

Boost

Upvotes: 0

Related Questions