PLearn 0.1
|
PLearn Vec: use numarray. More...
#include <PythonObjectWrapper.h>
Static Public Member Functions | |
static PyObject * | newPyObject (const Vec &) |
PLearn Vec: use numarray.
Definition at line 620 of file PythonObjectWrapper.h.
PyObject * PLearn::ConvertToPyObject< Vec >::newPyObject | ( | const Vec & | data | ) | [static] |
Definition at line 823 of file PythonObjectWrapper.cc.
References PLearn::TVec< T >::data(), PLearn::TVec< T >::isEmpty(), PLearn::TVec< T >::isNull(), PLearn::TVec< T >::size(), and tReal.
{ PyArrayObject* pyarr = 0; if (data.isNull() || data.isEmpty()) pyarr = NA_NewArray(NULL, tReal, 1, 0); else pyarr = NA_NewArray(data.data(), tReal, 1, data.size()); return (PyObject*)pyarr; }