High-performance C++ multi-dimensional arrays

前端 未结 8 1018
天涯浪人
天涯浪人 2021-02-04 09:29

I am looking for advice regarding high performance multi-dimensional array libraries/classes for C++. What I really need is:

  • the ability to dynamically allocate

相关标签:
8条回答
  • 2021-02-04 09:58

    From a performance perspective, I have tried boost::MultiArray and Armadillo. Neither were fast, in that both had slow access time compared to arrays or vectors, and I was able to beat these packages in an operation such as x1(4:10) = x2(1:6) + x2(2:7) + x2(3:8) by using a simple hand-coded loop (with the help of my compiler's optimization, I'm sure). When you get into matrix multiplication, these packages might offer some benefit via LAPACK and BLAS but you can always use those interfaces on your own.

    0 讨论(0)
  • 2021-02-04 10:01

    Also another shameless self-promotion,

    https://github.com/dwwork/FortCpp/

    I've posted my own personal solution to this problem up on GitHub. I'm not a C++ expert by any stretch, but I thought I'd at least throw it out there.

    0 讨论(0)
提交回复
热议问题