HepMC3 event record library
Public Member Functions | Static Public Member Functions | Protected Attributes | Static Protected Attributes | Private Types | Friends
unchecked_mutable_reference< T, Dims > Class Template Reference
+ Inheritance diagram for unchecked_mutable_reference< T, Dims >:
+ Collaboration diagram for unchecked_mutable_reference< T, Dims >:

Public Member Functions

template<typename... Ix>
T & operator() (Ix...index)
 Mutable, unchecked access to data at the given indices. More...
 
template<ssize_t D = Dims, typename = enable_if_t<D == 1 || Dynamic>>
T & operator[] (ssize_t index)
 
template<typename... Ix>
T * mutable_data (Ix...ix)
 Mutable pointer access to the data at the given indices. More...
 
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. More...
 
ssize_t shape (ssize_t dim) const
 Returns the shape (i.e. size) of dimension dim More...
 
ssize_t ndim () const
 Returns the number of dimensions of the array. More...
 
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. More...
 
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) More...
 

Protected Attributes

const unsigned char * data_
 
conditional_t< Dynamic, const
ssize_t *, std::array< ssize_t,(size_t)
Dims > > 
shape_
 
conditional_t< Dynamic, const
ssize_t *, std::array< ssize_t,(size_t)
Dims > > 
strides_
 
const ssize_t dims_
 

Static Protected Attributes

static constexpr bool Dynamic = Dims < 0
 

Private Types

using ConstBase = unchecked_reference< T, Dims >
 

Friends

class pybind11::array
 

Detailed Description

template<typename T, ssize_t Dims>
class unchecked_mutable_reference< T, Dims >

Definition at line 425 of file numpy.h.

Member Function Documentation

const T* data ( Ix...  ix) const
inlineinherited

Pointer access to the data at the given indices.

Definition at line 396 of file numpy.h.

References unchecked_reference< T, Dims >::operator()().

static constexpr ssize_t itemsize ( )
inlinestaticinherited

Returns the item size, i.e. sizeof(T)

Definition at line 399 of file numpy.h.

T* mutable_data ( Ix...  ix)
inline

Mutable pointer access to the data at the given indices.

Definition at line 450 of file numpy.h.

References unchecked_reference< T, Dims >::operator()().

ssize_t nbytes ( ) const
inlineinherited

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).

Definition at line 419 of file numpy.h.

References unchecked_reference< T, Dims >::itemsize(), and unchecked_reference< T, Dims >::size().

ssize_t ndim ( ) const
inlineinherited

Returns the number of dimensions of the array.

Definition at line 405 of file numpy.h.

const T& operator() ( Ix...  index) const
inlineinherited

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).

Definition at line 383 of file numpy.h.

T& operator() ( Ix...  index)
inline

Mutable, unchecked access to data at the given indices.

Definition at line 436 of file numpy.h.

const T& operator[] ( ssize_t  index) const
inlineinherited

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).

Definition at line 393 of file numpy.h.

References unchecked_reference< T, Dims >::operator()().

T& operator[] ( ssize_t  index)
inline

Mutable, unchecked access data at the given index; this operator only participates if the reference is to a 1-dimensional array (or has runtime dimensions). When present, this is exactly equivalent to obj(index).

Definition at line 447 of file numpy.h.

References unchecked_reference< T, Dims >::operator()().

ssize_t shape ( ssize_t  dim) const
inlineinherited

Returns the shape (i.e. size) of dimension dim

Definition at line 402 of file numpy.h.

enable_if_t<!Dyn, ssize_t> size ( ) const
inlineinherited

Returns the total number of elements in the referenced array, i.e. the product of the shapes.

Definition at line 409 of file numpy.h.


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