Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lierdakil/cpp-ndarray
Thin wrapper around numpy.ndarray for boost.python
https://github.com/lierdakil/cpp-ndarray
Last synced: 16 days ago
JSON representation
Thin wrapper around numpy.ndarray for boost.python
- Host: GitHub
- URL: https://github.com/lierdakil/cpp-ndarray
- Owner: lierdakil
- License: bsd-3-clause
- Archived: true
- Created: 2014-04-12T20:21:17.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2019-08-07T14:59:36.000Z (over 5 years ago)
- Last Synced: 2024-07-31T22:58:36.351Z (3 months ago)
- Language: C++
- Size: 5.86 KB
- Stars: 0
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
cpp-ndarray
===========
This is a thin wrapper around numpy.ndarray for boost.pythonMultidimensional array indexing uses operator() with variadic templates for C++11 mode or with va\_args for C++03 mode.
C++11 mode is detected via boost/config/compiler framework.
With variadic templates, some runtime checking is preformed on array size and number of dimensions. This can be disabled by defining ndarr\_assert(x) before including ndarray.h, which can yield a small performance benefit, but increase chance of memory corruption due to programmer errors.
Code for using boost::python::extract for numpy.ndarray import can be enabled by defining NUMPY\_EXTRACT, but one should define
```c++
template
boost::python::handle<> array_from_python_str::array_type;
```in some cpp file and initialize converter by calling
```c++
array_from_python_str("numpy","ndarray");
```