![]() |
BoB robotics
The Brains on Board robotics library
|
#include <numpy.h>
Public Member Functions | |
template<typename... Ix> | |
const T & | operator() (Ix... index) const |
template<ssize_t D = Dims, typename = enable_if_t<D == 1 || Dynamic>> | |
const T & | operator[] (ssize_t index) const |
template<typename... Ix> | |
const T * | data (Ix... ix) const |
Pointer access to the data at the given indices. | |
ssize_t | shape (ssize_t dim) const |
Returns the shape (i.e. size) of dimension dim | |
ssize_t | ndim () const |
Returns the number of dimensions of the array. | |
template<bool Dyn = Dynamic> | |
enable_if_t<!Dyn, ssize_t > | size () const |
Returns the total number of elements in the referenced array, i.e. the product of the shapes. | |
template<bool Dyn = Dynamic> | |
enable_if_t< Dyn, ssize_t > | size () const |
ssize_t | nbytes () const |
Static Public Member Functions | |
static constexpr ssize_t | itemsize () |
Returns the item size, i.e. sizeof(T) | |
Protected Member Functions | |
template<bool Dyn = Dynamic> | |
unchecked_reference (const void *data, const ssize_t *shape, const ssize_t *strides, enable_if_t<!Dyn, ssize_t >) | |
template<bool Dyn = Dynamic> | |
unchecked_reference (const void *data, const ssize_t *shape, const ssize_t *strides, enable_if_t< Dyn, ssize_t > dims) | |
Static Protected Attributes | |
static constexpr bool | Dynamic = Dims < 0 |
Friends | |
class | pybind11::array |
Proxy class providing unsafe, unchecked const access to array data. This is constructed through the unchecked<T, N>()
method of array
or the unchecked<N>()
method of array_t<T>
. Dims
will be -1 for dimensions determined at runtime.
|
inline |
Returns the total number of bytes used by the referenced data. Note that the actual span in memory may be larger if the referenced array has non-contiguous strides (e.g. for a slice).
|
inline |
Unchecked const reference access to data at the given indices. For a compile-time known number of dimensions, this requires the correct number of arguments; for run-time dimensionality, this is not checked (and so is up to the caller to use safely).
|
inline |
Unchecked const reference access to data; this operator only participates if the reference is to a 1-dimensional array. When present, this is exactly equivalent to obj(index)
.