This class defines operators () and [] to allow for direct memory access to array elements of type T. More...
#include <numpy.hpp>
Public Member Functions | |
arrayt (arraytbase const &a) | |
Construct a new instance from the base class. More... | |
arrayt (object const &a) | |
Construct a new instance from a boost::python object. | |
void | init (object const &a_) |
Take hold of another array. Same rules as for the constructors apply. | |
T & | operator() (int x) |
T & | operator() (int x, int y) |
T & | operator() (int x, int y, int z) |
T & | operator() (int x, int y, int z, int w) |
T & | operator() (int *c) |
T & | operator[] (int i) |
T * | data () |
T | operator() (int x) const |
T | operator() (int x, int y) const |
T | operator() (int x, int y, int z) const |
T | operator() (int x, int y, int z, int w) const |
T | operator() (int *c) const |
T | operator[] (int i) const |
const T * | data () const |
![]() | |
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 |
Additional Inherited Members | |
![]() | |
typedef Py_ssize_t | ssize_t |
![]() | |
arraytbase (object const &a, int typesize) | |
void | construct (object const &a, int typesize) |
![]() | |
object | obj |
PyObject * | objptr |
This class defines operators () and [] to allow for direct memory access to array elements of type T.
|
inline |
Construct a new instance from the base class.
The constructors check if the referenced array is behaved (in numpy terms), which means that it must satisfy certain alignment and byte order criteria. (See numpy documentation). The constructor also checks if sizeof(T) is equal to the numpy data type of a. If the checks fail an exception of std::invalid_argument is raised.
|
inline |
Various accessors exist which use offset() internally.