c++ - C++ 中 Fortran 风格的多维数组

标签 c++ multidimensional-array fortran

是否有一个 C++ 库提供 Fortran 风格的多维数组,支持切片、作为过程参数传递和体面的文档?我调查了blitz++但它死了!

最佳答案

我强烈建议 Armadillo :

Armadillo is a C++ linear algebra library (matrix maths) aiming towards a good balance between speed and ease of use

它是一个C++模板库:

A delayed evaluation approach is employed (at compile-time) to combine several operations into one and reduce (or eliminate) the need for temporaries; this is automatically accomplished through template meta-programming

网页中的一个简单例子:

#include <iostream>
#include <armadillo>

int main(int argc, char** argv)
{
    arma::mat A = arma::randu<arma::mat>(4,5);
    arma::mat B = arma::randu<arma::mat>(4,5);

    std::cout << A*B.t() << std::endl;

    return 0;
}

关于c++ - C++ 中 Fortran 风格的多维数组,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9677288/

相关文章:

c++ - 使用命名管道 (C++) 将图像发送到 FFMPEG

C++ 基于链表的树结构。理智地在列表之间复制节点

c++ - OS X 上的链接器错误 "ld: framework not found SFML"

c++ - 模板移动构造函数

php - 如何通过 Jquery.post 发布 JSON 多维数据?

javascript - 如何在 javascript/php 中调用具有子级的数组列表

arrays - 我们如何对rust-ndarray中的数组进行算术运算?

python - 使用 Homebrew 软件为 numpy 安装 gfortran

fortran - 如何对文件夹中的所有文件运行 FORTRAN 程序?

fortran - 如何停止 Fortran 列表定向读取 '/' 上的分隔字符串