2
0
mirror of https://github.com/boostorg/python.git synced 2026-01-21 05:02:17 +00:00
Files
python/libs/numpy/test/shapes_mod.cpp
2011-07-03 16:40:30 +00:00

17 lines
314 B
C++

#include <boost/numpy.hpp>
namespace p = boost::python;
namespace np = boost::numpy;
np::ndarray reshape(np::ndarray old_array, p::tuple shape)
{
np::ndarray local_shape = old_array.reshape(shape);
return local_shape;
}
BOOST_PYTHON_MODULE(shapes_mod)
{
np::initialize();
p::def("reshape", reshape);
}