|
Michele De Stefano's C++ Utilities
|
Namespace of all Michele De Stefano's C++ Python utilities. More...
Namespaces | |
| numpy | |
| Contains utilities for the creation of NumPy extensions. | |
| ublas | |
| Contains several utilities for interfacing Python with Boost's uBLAS. | |
Classes | |
| class | Dictionary |
| Wraps a Python dictionary. More... | |
| class | FileObj |
| Class for easily managment of Python file objects from C++ code. More... | |
| class | iFileObj |
| Class for easily managment of Python input file objects from C++ code. More... | |
| struct | index_error |
Exception used for detecting and raising IndexError Python exceptions. More... | |
| class | List |
| Wraps a Python list. More... | |
| class | Obj |
| This is a simple wrapper around the PyObject* datatype. More... | |
| class | oFileObj |
| Class for easily managment of Python output file objects from C++ code. More... | |
| class | ProxyPySeqElement |
| Default Reference type for the PySequenceIterator class. More... | |
| class | PySeqIt_Access |
| Accessor class for the PySequenceIterator. More... | |
| class | PySequenceIterator |
| Iterator that allows to scan a Python sequence composed by homogeneous elements. More... | |
| class | Sequence |
| Wraps a generic Python sequence. More... | |
| class | Sequence_Base |
| Base class for all generic sequence types. More... | |
| struct | support_random_access |
| Adds support for random access operator (i.e. square brackets) to a class that has to be exposed to the Python interpreter. The access is only in read mode. More... | |
| struct | support_random_getset_access |
| Adds support for random get/set access operator (i.e. square brackets) to a class that has to be exposed to the Python interpreter. The access is both in read and write mode. More... | |
| class | Tuple |
| Wraps a Python tuple. More... | |
Functions | |
| template<class T > | |
| T | get (PyObject *po) |
| Primary template for extracting a value from a Python object. More... | |
| PyObject * | to_python (void) |
| Converts a value into a Python object. More... | |
| size_t | len (PyObject *o) |
| Retrieves the length of a sequence object. More... | |
Namespace of all Michele De Stefano's C++ Python utilities.
|
inline |
Primary template for extracting a value from a Python object.
It is meant to be specialized for each particular data type.
| T | The data type of the value to be extracted. |
Primary template for extracting a value from a Python object.
| M | The data type of a dense uBLAS matrix. |
| po | The Numpy array object to convert from. |
Primary template for extracting a value from a Python object.
| M | The data type of a uBLAS compressed_matrix. |
| po | The Numpy array object to convert from. |
Primary template for extracting a value from a Python object.
| ublas_vec_T | The data type of a dense uBLAS vector. |
| po | The Numpy array object to be converted. |
Definition at line 56 of file matrix.hpp.
References mds_utils::python::Obj::attr(), mds_utils::python::Obj::get_ownership(), and len().
|
inline |
Retrieves the length of a sequence object.
Throws an exception if it is not possible to retrieve a length for the object.
| o | The object whose length has to be queried. |
Definition at line 54 of file sequence.hpp.
Referenced by mds_utils::python::ublas::get().
| PyObject* mds_utils::python::to_python | ( | void | ) |
Converts a value into a Python object.
It is meant to be overloaded for each particular data type. Default specializations are given for basic types. The end user can specialize this for user-defined classes.
Referenced by mds_utils::python::List::append(), mds_utils::python::Dictionary::contains(), mds_utils::python::Dictionary::del_item(), mds_utils::python::Dictionary::get_item(), mds_utils::python::List::insert(), mds_utils::python::Obj::operator()(), mds_utils::python::PySequenceIterator< T >::operator=(), mds_utils::python::Obj::operator=(), mds_utils::python::support_random_access< Dummy_Container >::py_get_item(), mds_utils::python::Sequence_Base< List >::set(), and mds_utils::python::Dictionary::set_item().