2
0
mirror of https://github.com/boostorg/python.git synced 2026-01-26 06:42:27 +00:00

added as_matrix call policy

This commit is contained in:
Jim Bosch
2012-04-21 16:46:28 -04:00
parent dca44829a6
commit 313dcbb628
3 changed files with 26 additions and 0 deletions

View File

@@ -24,10 +24,12 @@ np::ndarray c_empty(p::tuple shape, np::dtype dt)
np::ndarray transpose(np::ndarray arr) { return arr.transpose();}
np::ndarray squeeze(np::ndarray arr) { return arr.squeeze();}
np::ndarray reshape(np::ndarray arr,p::tuple tup) { return arr.reshape(tup);}
BOOST_PYTHON_MODULE(ndarray_mod)
{
np::initialize();
p::def("zeros", zeros);
p::def("zeros_matrix", zeros, np::as_matrix<>());
p::def("array", array2);
p::def("array", array1);
p::def("empty", empty1);