Mercurial > pytave
comparison pytave.cc @ 101:0c19ed1ce349
Remove Numeric array support. Use numpy exclusively.
author | David Grundberg <individ@acc.umu.se> |
---|---|
date | Mon, 09 Apr 2012 21:22:32 +0200 |
parents | ff70627aa203 |
children | 896fdc369789 |
comparison
equal
deleted
inserted
replaced
100:ff70627aa203 | 101:0c19ed1ce349 |
---|---|
105 // Initialize Python Numeric Array | 105 // Initialize Python Numeric Array |
106 | 106 |
107 // This is actually a macro that becomes a block expression. If an error | 107 // This is actually a macro that becomes a block expression. If an error |
108 // occurs, e.g. Numeric Array not installed, an exception is set. | 108 // occurs, e.g. Numeric Array not installed, an exception is set. |
109 import_array() | 109 import_array() |
110 #ifdef HAVE_NUMPY | 110 |
111 // Let boost use numpy | 111 // Let boost use numpy |
112 numeric::array::set_module_and_type ("numpy", "ndarray"); | 112 numeric::array::set_module_and_type ("numpy", "ndarray"); |
113 #endif | |
114 } | |
115 | |
116 string get_module_name () { | |
117 return numeric::array::get_module_name (); | |
118 } | 113 } |
119 | 114 |
120 boost::python::tuple get_exceptions() { | 115 boost::python::tuple get_exceptions() { |
121 return make_tuple(object(handle<PyObject>( | 116 return make_tuple(object(handle<PyObject>( |
122 octave_error_exception::excclass)), | 117 octave_error_exception::excclass)), |
392 | 387 |
393 BOOST_PYTHON_MODULE(_pytave) { /* {{{ */ | 388 BOOST_PYTHON_MODULE(_pytave) { /* {{{ */ |
394 using namespace boost::python; | 389 using namespace boost::python; |
395 | 390 |
396 def("init", pytave::init); | 391 def("init", pytave::init); |
397 def("get_module_name", pytave::get_module_name); | |
398 def("feval", pytave::func_eval); | 392 def("feval", pytave::func_eval); |
399 def("eval", pytave::str_eval); | 393 def("eval", pytave::str_eval); |
400 def("getvar", pytave::getvar); | 394 def("getvar", pytave::getvar); |
401 def("setvar", pytave::setvar); | 395 def("setvar", pytave::setvar); |
402 def("isvar", pytave::isvar); | 396 def("isvar", pytave::isvar); |