What's a good C++ library for matrix operations

前端 未结 8 1325
温柔的废话
温柔的废话 2021-01-04 09:31

I need to do multiplication on matrices. I\'m looking for a library that can do it fast. I\'m using the Visual C++ 2008 compiler and I have a core i7 860 so if the library i

8条回答
  •  走了就别回头了
    2021-01-04 10:32

    it can't race with scientific libraries, but with visual c++ it is at hand

    #include 
    #include 
    #pragma comment (lib,"Gdiplus.lib")
    using namespace Gdiplus;
    
    int main()
    {
        ULONG_PTR gpToken = 0;
        GdiplusStartup(&gpToken, &GdiplusStartupInput(), NULL);
        //lib inited
    
        Matrix A;
        A.Translate(10,20);
    
        Matrix B;
        B.Rotate(35.0);
    
        A.Multiply(&B);
        if (A.IsInvertible())
            A.Invert();
        if (!A.IsIdentity())
            A.RotateAt(120.0, PointF(10,10));
    
        //getting values
        REAL elements[6];
        A.GetElements(elements);
    
        //lib stopped
        GdiplusShutdown(gpToken);
        return 0;
    }
    

    so with this you can easily take the matrix multiplication obstacle (on Windows)

    GdiPlus Matrix Documentation

提交回复
热议问题