PLearn 0.1
Static Public Member Functions
PLearn::ConvertToPyObject< Vec > Struct Template Reference

PLearn Vec: use numarray. More...

#include <PythonObjectWrapper.h>

List of all members.

Static Public Member Functions

static PyObject * newPyObject (const Vec &)

Detailed Description

template<>
struct PLearn::ConvertToPyObject< Vec >

PLearn Vec: use numarray.

Definition at line 620 of file PythonObjectWrapper.h.


Member Function Documentation

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;
}

Here is the call graph for this function:


The documentation for this struct was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines