"Go" C + + matrix operations Library recommended

Source: Internet
Author: User
Tags lapack intel mkl

"Original link" http://www.52ml.net/13002.htmlArmadillo:C++ under the MATLAB substitute

Address: http://arma.sourceforge.net/

License: MPL 2.0

At present, one of the most widely used C + + matrix operations Library, is the use of MATLAB in C + + operation Matrix is a good choice, many Matlab matrix operation function can find corresponding, this is accustomed to matlab people is very convenient, In addition, if you want to translate the code of the MATLAB research into C + +, using Armadillo will be very convenient, here is a simple MATLAB to Armadillo syntax conversion. Some of the armadillo features are listed below:

    • Supports integers, floating-point numbers, and complex matrices.
    • Supports matrix-by-element operations, including ABS Conj Conv_to EPS Imag/real Misc Functions (exp, log, pow, sqrt, round, sign, ...) · Trigonometric functions (cos, sin, ...) Wait a minute.
    • Supports matrix chunking operations.
    • Supports operation of the whole matrix Diagvec Min/max Prod Sum Statistics (mean, StdDev, ...) · Accu As_scalar Det Dot/cdot/norm_dot Log_det Norm Rank Trace and so on.
    • Matlab users, you can even find your familiar hist HISTC Unique Cumsum Sort_index Find Repmat Linspace and other functions.
    • In addition to its own matrix base operations, it is possible to automatically detect if Blas is installed, or faster Openblas, Intel MKL, AMD ACML, and use them instead of their own basic operations.
    • Provides an interface for matrix decomposition operations using LAPACK, SVD QR Lu FFT and so on.
    • Sparse matrix classes are provided to support common operations, but there is no implementation of matrix decomposition for the time being.
    • The updates are active, with some open source projects for computer vision, machine learning, and physics, such as the Mlpack machine learning Library.

Overall very useful matrix library, speed because you can use Openblas and other libraries to accelerate, so it is good. Online can find a person called Nghia Ho wrote about and Eigen and OpenCV speed comparison do reference, the speed is slightly excellent. However, it may be more painful to run on windows because of the matrix decomposition calculations that rely on lapack and other libraries.

EIGEN3: Powerful and requires only header files

Address: http://eigen.tuxfamily.org/

License: Mainly MPL 2.0, partly with code from a third party LGPL

Very powerful matrix operations Library, I have been using, we have all agreed. Using a similar way of MATLAB operation of the matrix, you can see the official correspondence with the maltab here, the individual feel simple and matlab correspondence, may not be as good as armadillo corresponding, but the function is absolutely powerful. The eigen contains most of the matrix algorithms you can use, as well as a number of third-party interfaces. An important feature of Eigen is that there is no dependency on the library, which itself consists of only a number of header files, so it is very lightweight and easy to cross the platform. All you have to do is put the used header files together with your code. Some features of Eigen:

    • Support for integers, floating-point numbers, complex numbers, and the use of template programming, you can provide matrix operations for special data structures. For example, when using Ceres-solver to do optimization problems (such as bundle adjustment), sometimes you need to use template programming to write a target function, Ceres can automatically replace the template with an internal one can automatically find a special type of double. If you want to do a matrix calculation in this template function, it is very convenient to use Eigen.
    • Matrix operations are supported per element, block, and whole.
    • Includes a large number of matrix decomposition algorithms including LU,LDLT,QR, SVD and so on.
    • Support for using Intel MKL acceleration
    • Some features support multithreading
    • Sparse matrix support is good, to this year's new Eigen3.2, has brought its own sparselu, SPARSEQR, conjugate gradient (conjugategradient solver), BI conjugate gradient stabilized Solver, such as the function of sparse matrix solution. The interface of SPQR, umfpack and other external sparse matrix libraries is also provided.
    • Support common geometric operations, including rotation matrix, four-tuple, matrix transformation, Angleaxis (Euler angle and Rodrigues transform) and so on.
    • The update is active, many users (Google, williowgarage), using Eigen's more famous open source projects are ROS (robotic operating system), PCL (Point Cloud Processing Library), Google Ceres (optimization algorithm). The OPENCV is brought to the Eigen interface.

Overall, it's worth it if you often do more complex matrix calculations, or if you want to cross-platform.

"Go" C + + matrix operations Library recommended

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.