Mercurial > pytave
diff pytave.cc @ 70:e3de0f6f1552
experimental NumPy support
author | Jaroslav Hajek <highegg@gmail.com> |
---|---|
date | Fri, 19 Jun 2009 13:51:36 +0200 |
parents | 11cff59bc932 |
children | e9834fd34416 |
line wrap: on
line diff
--- a/pytave.cc Wed Jun 17 11:49:14 2009 +0200 +++ b/pytave.cc Fri Jun 19 13:51:36 2009 +0200 @@ -80,6 +80,13 @@ // This is actually a macro that becomes a block expression. If an error // occurs, e.g. Numeric Array not installed, an exception is set. import_array() +#ifdef HAVE_NUMPY + numeric::array::set_module_and_type ("numpy", "ndarray"); +#endif + } + + string get_module_name () { + return numeric::array::get_module_name (); } boost::python::tuple get_exceptions() { @@ -301,6 +308,7 @@ using namespace boost::python; def("init", pytave::init); + def("get_module_name", pytave::get_module_name); def("feval", pytave::func_eval); def("eval", pytave::str_eval); def("getvar", pytave::getvar);