peijunz-archive / ndarray

A simple N-Dimensional Array class template

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

N-Dimensional Array class template

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.

Implemented features

  • Use operator[] for raw index
  • Use operator() for multidimensional index
  • Big five
  • Elementwise + - * /
  • Iterator
  • Index rolling

Doxygen doc

The doc can be generated by doxygen Doxyfile.

Also at http://peijun.me/percolation/classndarray.html

About

A simple N-Dimensional Array class template


Languages

Language:C++ 98.7%Language:QMake 1.3%