High-performance C++ multi-dimensional arrays

前端 未结 8 1005
天涯浪人
天涯浪人 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.

提交回复
热议问题