numpy的风格数组用于C ++? [英] NumPy style arrays for C++?

查看:241
本文介绍了numpy的风格数组用于C ++?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有任何C ++(或C)具有与切片,矢量运算支持numpy的状阵列,添加和删减内容库中逐个元素等?

Are there any C++ (or C) libs that have NumPy-like arrays with support for slicing, vectorized operations, adding and subtracting contents element-by-element, etc.?

推荐答案

下面是一些免费的软件那会适合您的需求。

Here is several free softwares that would suits your needs.


  1. 借助 GNU科学图书馆是用C编写的这因而GPL软件有一个C状分配和编程的方法(指针,等等)。随着 GSLwrap ,你可以编程的C ++的方式,同时仍使用GSL。 GSL有 BLAS 实现,但你可以使用的 ATLAS 而不是默认的CBLAS,如果你想要更多的表演。

  1. The GNU Scientific Library is a GPL software written in C. It thus have a C-like allocation and way of programming (pointers, etc.). With the GSLwrap, you can have a C++ way of programming, while still using the GSL. GSL has a BLAS implementation, but you can use ATLAS instead of the default CBLAS, if you want even more performances.

借助升压/ uBLAS库库是一个BSL库,用C ++编写和分发作为升压包。这是一个C ++ - 实施BLAS标准的方式。的uBLAS带有一些线性代数函数,并且有一个实验结合ATLAS

The boost/uBLAS library is a BSL library, written in C++ and distributed as a boost package. It is a C++-way of implementing the BLAS standard. uBLAS comes with a few linear algebra functions, and there is an experimental binding to ATLAS.

是一个线性代数库,用C ++编写的LGPL3(或GPL2下发布)。这是一个C ++的编程方式,但比其他两个更集成(更多的算法和数据结构都可用)。艾根声称比上面的BLAS实现更快,而不是按照实际标准BLAS API。艾根似乎并不把大量的并行执行工作。

eigen is a linear-algebra library, written in C++, distributed under the LGPL3 (or GPL2). It's a C++ way of programming, but more integrated than the two others (more algorithms and data structures are available). Eigen claim to be faster than the BLAS implementations above, while not following the de-facto standard BLAS API. Eigen does not seems to put a lot of effort on parallel implementation.

犰狳是LGPL3库,在C ++。它结合了 LAPACK (由numpy的使用的库)。它使用递归模板和模板元编程,这是一个很好的点(我不知道其他图书馆也这样做呢?)。

Armadillo is LGPL3 library, in C++. It has binding for LAPACK (the library used by numpy). It uses recursive templates and template meta-programming, which is a good point (I don't know if other libraries are doing it also?).

这些替代品是非常好的,如果你只是想获得的数据结构和基本线性代数。根据您的风格有关,牌照或系统管理员挑战的味道(在安装大的库,例如LAPACK可能是困难的),你可以选择最适合您的需求之一。

These alternatives are really good if you just want to get data structures and basic linear algebra. Depending on your taste about style, license or sysadmin challenges (installing big libraries like LAPACK may be difficult), you may choose the one that best suits your needs.

这篇关于numpy的风格数组用于C ++?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆