A simple ndarray
class template using C++11.
In C/C++, it is hard to pass a two dimensional array. This project provides
a simple ndarray
data structure to attack this problem. It has used Variadic
Template in C++11 to improve performance in indexing by operator()
.
In the ndarray
class template, only datatype
and dimension are template parameter. Considering flexibility, The width of a
specific axis is specified at run time, which slightly affects the compile
time optimization. Nevertheless, the efficiency is still comparable to the
C style 'multidimensional' array, which is actually array of arrays of...arrays.
- Use
operator[]
for raw index - Use
operator()
for multidimensional index - Big five
- Elementwise
+ - * /
- Iterator
- Index rolling
The doc can be generated by doxygen Doxyfile
.