HepMC3 event record library
Public Types | Public Member Functions | Static Public Member Functions | Data Fields | Protected Attributes
array Class Reference
+ Inheritance diagram for array:
+ Collaboration diagram for array:

Public Types

enum  { c_style = detail::npy_api::NPY_ARRAY_C_CONTIGUOUS_, f_style = detail::npy_api::NPY_ARRAY_F_CONTIGUOUS_, forcecast = detail::npy_api::NPY_ARRAY_FORCECAST_ }
 
using ShapeContainer = detail::any_container< ssize_t >
 
using StridesContainer = detail::any_container< ssize_t >
 

Public Member Functions

 array (const pybind11::dtype &dt, ShapeContainer shape, StridesContainer strides, const void *ptr=nullptr, handle base=handle())
 
 std::move (shape)
 
void fail_dim_check (ssize_t dim, const std::string &msg) const
 
template<typename... Ix>
ssize_t byte_offset (Ix...index) const
 
void check_writeable () const
 
template<typename... Ix>
void check_dimensions (Ix...index) const
 
void check_dimensions_impl (ssize_t, const ssize_t *) const
 
template<typename... Ix>
void check_dimensions_impl (ssize_t axis, const ssize_t *shape, ssize_t i, Ix...index) const
 
buffer_info request (bool writable=false) const
 
 PYBIND11_DEPRECATED ("Use reinterpret_borrow<object>() or reinterpret_steal<object>()") object(handle h
 
handle release ()
 
template<typename T >
cast () const &
 
template<typename T >
cast ()&&
 
PyObject * ptr () const
 Return the underlying PyObject * pointer. More...
 
PyObject *& ptr ()
 
const handleinc_ref () const &
 
const handledec_ref () const &
 
 operator bool () const
 Return true when the handle wraps a valid Python object. More...
 
bool operator== (const handle &h) const
 
bool operator!= (const handle &h) const
 
bool check () const
 

Static Public Member Functions

static PyObject * raw_array (PyObject *ptr, int ExtraFlags=0)
 Create array from any object – always returns a new reference. More...
 

Data Fields

 __pad0__: array(dt
 
 ptr
 
 base
 
bool is_borrowed: handle(h) { if (is_borrowed) inc_ref()
 

Protected Attributes

PyObject * m_ptr = nullptr
 

Detailed Description

Definition at line 556 of file numpy.h.

Member Function Documentation

const handle& dec_ref ( ) const
inlineinherited
\rst
Manually decrease the reference count of the Python object. Usually, it is
preferable to use the `object` class which derives from `handle` and calls
this function automatically. Returns a reference to itself.

Definition at line 199 of file pytypes.h.

const handle& inc_ref ( ) const
inlineinherited
\rst
Manually increase the reference count of the Python object. Usually, it is
preferable to use the `object` class which derives from `handle` and calls
this function automatically. Returns a reference to itself.

Definition at line 192 of file pytypes.h.

operator bool ( ) const
inlineexplicitinherited

Return true when the handle wraps a valid Python object.

Definition at line 207 of file pytypes.h.

bool operator== ( const handle h) const
inlineinherited
\rst
Deprecated: Check that the underlying pointers are the same.
Equivalent to ``obj1 is obj2`` in Python.

Definition at line 213 of file pytypes.h.

PyObject* ptr ( ) const
inlineinherited

Return the underlying PyObject * pointer.

Definition at line 184 of file pytypes.h.

static PyObject* raw_array ( PyObject *  ptr,
int  ExtraFlags = 0 
)
inlinestatic

Create array from any object – always returns a new reference.

Definition at line 825 of file numpy.h.

handle release ( )
inlineinherited
\rst
Resets the internal pointer to ``nullptr`` without decreasing the
object's reference count. The function returns a raw handle to the original
Python object.

Definition at line 249 of file pytypes.h.

References handle::handle().


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