This is the base class from which type specific variants are derived. More...
#include <numpy.hpp>
Public Types | |
typedef Py_ssize_t | ssize_t |
Public Member Functions | |
arraytbase (object const &a=object()) | |
const ssize_t * | shape () const |
const ssize_t * | dims () const |
const ssize_t * | strides () const |
Returned in number of bytes. | |
int | itemtype () const |
int | itemsize () const |
int | rank () const |
int | ndim () const |
bool | isWriteable () const |
bool | isCContiguous () const |
bool | isFContiguous () const |
const object & | getObject () const |
ssize_t | offset (int x) const |
Returned in number of bytes. More... | |
ssize_t | offset (int x, int y) const |
ssize_t | offset (int x, int y, int z) const |
ssize_t | offset (int x, int y, int z, int w) const |
ssize_t | offset (const int *c) const |
c must point to an array of at least rank() items. | |
char * | bytes () |
Access to the array's memory block. | |
const char * | bytes () const |
Protected Member Functions | |
arraytbase (object const &a, int typesize) | |
void | construct (object const &a, int typesize) |
Protected Attributes | |
object | obj |
PyObject * | objptr |
This is the base class from which type specific variants are derived.
It stores only the object pointer and an instance of boost::python::numeric::array for reference counting. Therefore the referenced object can be changed during the lifetime of an arraytbase instance. An instance of this class can be extracted from a boost::python object obj by extract<arraytbase>(obj) or by automatic conversion by boost::pythons function wrapping facilities.
Members provided access to basic information that don't require casting to a specific element type.
arraytbase is not derived from boost::python::object because i don't want its members (operator() in particular) to get in the way of my own definitions.
|
inline |
Returned in number of bytes.
Returns the position within memory corresponding to the given integer coordinates. No range checking is performed in release builds. However access is protected by use of the assert macro.