|
| array () |
|
| array (const pybind11::dtype &dt, ShapeContainer shape, StridesContainer strides, const void *ptr=nullptr, handle base=handle()) |
|
| array (const pybind11::dtype &dt, ShapeContainer shape, const void *ptr=nullptr, handle base=handle()) |
|
template<typename T , typename = detail::enable_if_t<std::is_integral<T>::value && !std::is_same<bool, T>::value>> |
| array (const pybind11::dtype &dt, T count, const void *ptr=nullptr, handle base=handle()) |
|
template<typename T > |
| array (ShapeContainer shape, StridesContainer strides, const T *ptr, handle base=handle()) |
|
template<typename T > |
| array (ShapeContainer shape, const T *ptr, handle base=handle()) |
|
template<typename T > |
| array (ssize_t count, const T *ptr, handle base=handle()) |
|
| array (const buffer_info &info, handle base=handle()) |
|
pybind11::dtype | dtype () const |
| Array descriptor (dtype) More...
|
|
ssize_t | size () const |
| Total number of elements. More...
|
|
ssize_t | itemsize () const |
| Byte size of a single element. More...
|
|
ssize_t | nbytes () const |
| Total number of bytes. More...
|
|
ssize_t | ndim () const |
| Number of dimensions. More...
|
|
object | base () const |
| Base object. More...
|
|
const ssize_t * | shape () const |
| Dimensions of the array. More...
|
|
ssize_t | shape (ssize_t dim) const |
| Dimension along a given axis. More...
|
|
const ssize_t * | strides () const |
| Strides of the array. More...
|
|
ssize_t | strides (ssize_t dim) const |
| Stride along a given axis. More...
|
|
int | flags () const |
| Return the NumPy array flags. More...
|
|
bool | writeable () const |
| If set, the array is writeable (otherwise the buffer is read-only) More...
|
|
bool | owndata () const |
| If set, the array owns the data (will be freed when the array is deleted) More...
|
|
template<typename... Ix> |
const void * | data (Ix... index) const |
|
template<typename... Ix> |
void * | mutable_data (Ix... index) |
|
template<typename... Ix> |
ssize_t | offset_at (Ix... index) const |
|
ssize_t | offset_at () const |
|
template<typename... Ix> |
ssize_t | index_at (Ix... index) const |
|
template<typename T , ssize_t Dims = -1> |
detail::unchecked_mutable_reference< T, Dims > | mutable_unchecked () & |
|
template<typename T , ssize_t Dims = -1> |
detail::unchecked_reference< T, Dims > | unchecked () const & |
|
array | squeeze () |
| Return a new view with all of the dimensions of length 1 removed. More...
|
|
void | resize (ShapeContainer new_shape, bool refcheck=true) |
|
buffer_info | request (bool writable=false) const |
|
| object ()=default |
|
| PYBIND11_DEPRECATED ("Use reinterpret_borrow<object>() or reinterpret_steal<object>()") object(handle h |
|
| object (const object &o) |
| Copy constructor; always increases the reference count. More...
|
|
| object (object &&other) noexcept |
| Move constructor; steals the object from other and preserves its reference count. More...
|
|
| ~object () |
| Destructor; automatically calls handle::dec_ref() More...
|
|
handle | release () |
|
object & | operator= (const object &other) |
|
object & | operator= (object &&other) noexcept |
|
template<typename T > |
T | cast () const & |
|
template<typename T > |
T | cast () && |
|
| object (handle h, borrowed_t) |
|
| object (handle h, stolen_t) |
|
template<typename T > |
T | cast () const & |
|
template<typename T > |
T | cast () && |
|
template<> |
void | cast () const & |
|
template<> |
void | cast () && |
|
Public Member Functions inherited from handle |
| handle ()=default |
| The default constructor creates a handle with a nullptr -valued pointer. More...
|
|
| handle (PyObject *ptr) |
| Creates a handle from the given raw Python object pointer. More...
|
|
PyObject * | ptr () const |
| Return the underlying PyObject * pointer. More...
|
|
PyObject *& | ptr () |
|
const handle & | inc_ref () const & |
|
const handle & | dec_ref () const & |
|
template<typename T > |
T | cast () 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 |
|
template<> |
void | cast () const |
|
Definition at line 556 of file numpy.h.
template<typename T , ssize_t Dims = -1>
detail::unchecked_mutable_reference<T, Dims> array::mutable_unchecked |
( |
| ) |
& |
|
inline |
Returns a proxy object that provides access to the array's data without bounds or dimensionality checking. Will throw if the array is missing the writeable
flag. Use with care: the array must not be destroyed or reshaped for the duration of the returned object, and the caller must take care not to access invalid dimensions or dimension indices.
Definition at line 738 of file numpy.h.
template<typename T , ssize_t Dims = -1>
detail::unchecked_reference<T, Dims> array::unchecked |
( |
| ) |
const & |
|
inline |
Returns a proxy object that provides const access to the array's data without bounds or dimensionality checking. Unlike mutable_unchecked()
, this does not require that the underlying array have the writable
flag. Use with care: the array must not be destroyed or reshaped for the duration of the returned object, and the caller must take care not to access invalid dimensions or dimension indices.
Definition at line 752 of file numpy.h.