numpycpp
 All Classes Namespaces Files Functions Typedefs Pages
Public Member Functions | List of all members
boost::python::numpy::arrayt< T > Class Template Reference

This class defines operators () and [] to allow for direct memory access to array elements of type T. More...

#include <numpy.hpp>

Inheritance diagram for boost::python::numpy::arrayt< T >:
boost::python::numpy::arraytbase

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 ()
 
operator() (int x) const
 
operator() (int x, int y) const
 
operator() (int x, int y, int z) const
 
operator() (int x, int y, int z, int w) const
 
operator() (int *c) const
 
operator[] (int i) const
 
const T * data () const
 
- Public Member Functions inherited from boost::python::numpy::arraytbase
 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

- Public Types inherited from boost::python::numpy::arraytbase
typedef Py_ssize_t ssize_t
 
- Protected Member Functions inherited from boost::python::numpy::arraytbase
 arraytbase (object const &a, int typesize)
 
void construct (object const &a, int typesize)
 
- Protected Attributes inherited from boost::python::numpy::arraytbase
object obj
 
PyObject * objptr
 

Detailed Description

template<class T>
class boost::python::numpy::arrayt< T >

This class defines operators () and [] to allow for direct memory access to array elements of type T.

Definition at line 354 of file numpy.hpp.

Constructor & Destructor Documentation

template<class T>
boost::python::numpy::arrayt< T >::arrayt ( arraytbase const &  a)
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.

See Also
arrayt(object const &a)

Definition at line 369 of file numpy.hpp.

Member Function Documentation

template<class T>
T& boost::python::numpy::arrayt< T >::operator() ( int  x)
inline

Various accessors exist which use offset() internally.

See Also
arraytbase::offset

Definition at line 389 of file numpy.hpp.


The documentation for this class was generated from the following file: