Skip to content

peijunz-archive/ndarray

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

49 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published