Classes | Macros | Typedefs | Enumerations | Functions
numpy.h File Reference
#include "pybind11.h"
#include "complex.h"
#include <numeric>
#include <algorithm>
#include <array>
#include <cstdint>
#include <cstdlib>
#include <cstring>
#include <sstream>
#include <string>
#include <functional>
#include <utility>
#include <vector>
#include <typeindex>
Include dependency graph for numpy.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  array
 
struct  array_info< T >
 
struct  array_info< char[N]>
 
struct  array_info< std::array< char, N > >
 
struct  array_info< std::array< T, N > >
 
struct  array_info< T[N]>
 
struct  array_info_scalar< T >
 
class  array_t< T, ExtraFlags >
 
class  common_iterator
 
struct  compare_buffer_info< T, detail::enable_if_t< detail::is_pod_struct< T >::value > >
 
class  dtype
 
struct  field_descriptor
 
struct  format_descriptor< char[N]>
 
struct  format_descriptor< std::array< char, N > >
 
struct  format_descriptor< T, detail::enable_if_t< detail::array_info< T >::is_array > >
 
struct  format_descriptor< T, detail::enable_if_t< detail::is_pod_struct< T >::value > >
 
struct  format_descriptor< T, detail::enable_if_t< std::is_enum< T >::value > >
 
struct  handle_type_name< array >
 
struct  handle_type_name< array_t< T, Flags > >
 
struct  is_complex< T >
 
struct  is_complex< std::complex< T > >
 
struct  is_std_array< T >
 
struct  is_std_array< std::array< T, N > >
 
class  multi_array_iterator< N >
 
struct  npy_api
 
struct  npy_format_descriptor< T, SFINAE >
 
struct  npy_format_descriptor< T, SFINAE >
 
struct  npy_format_descriptor< char[N]>
 
struct  npy_format_descriptor< std::array< char, N > >
 
struct  npy_format_descriptor< T, enable_if_t< array_info< T >::is_array > >
 
struct  npy_format_descriptor< T, enable_if_t< satisfies_any_of< T, std::is_arithmetic, is_complex >::value > >
 
struct  npy_format_descriptor< T, enable_if_t< std::is_enum< T >::value > >
 
struct  npy_format_descriptor_name< T, typename >
 
struct  npy_format_descriptor_name< T, enable_if_t< is_complex< T >::value > >
 
struct  npy_format_descriptor_name< T, enable_if_t< std::is_floating_point< T >::value > >
 
struct  npy_format_descriptor_name< T, enable_if_t< std::is_integral< T >::value > >
 
struct  numpy_internals
 
struct  numpy_type_info
 
struct  array_t< T, ExtraFlags >::private_ctor
 
struct  npy_api::PyArray_Dims
 
struct  PyArray_Proxy
 
struct  PyArrayDescr_Proxy
 
struct  pyobject_caster< array_t< T, ExtraFlags > >
 
struct  PyVoidScalarObject_Proxy
 
struct  same_size< T >
 
struct  type_caster< unchecked_mutable_reference< T, Dim > >
 
struct  type_caster< unchecked_reference< T, Dim > >
 
class  unchecked_mutable_reference< T, Dims >
 
class  unchecked_reference< T, Dims >
 
struct  vectorize_arg< T >
 
struct  vectorize_helper< Func, Return, Args >
 

Macros

#define DECL_NPY_API(Func)   api.Func##_ = (decltype(api.Func##_)) api_ptr[API_##Func];
 
#define PYBIND11_DECL_CHAR_FMT
 
#define PYBIND11_EVAL(...)   PYBIND11_EVAL4 (PYBIND11_EVAL4 (PYBIND11_EVAL4 (__VA_ARGS__)))
 
#define PYBIND11_EVAL0(...)   __VA_ARGS__
 
#define PYBIND11_EVAL1(...)   PYBIND11_EVAL0 (PYBIND11_EVAL0 (PYBIND11_EVAL0 (__VA_ARGS__)))
 
#define PYBIND11_EVAL2(...)   PYBIND11_EVAL1 (PYBIND11_EVAL1 (PYBIND11_EVAL1 (__VA_ARGS__)))
 
#define PYBIND11_EVAL3(...)   PYBIND11_EVAL2 (PYBIND11_EVAL2 (PYBIND11_EVAL2 (__VA_ARGS__)))
 
#define PYBIND11_EVAL4(...)   PYBIND11_EVAL3 (PYBIND11_EVAL3 (PYBIND11_EVAL3 (__VA_ARGS__)))
 
#define PYBIND11_FIELD_DESCRIPTOR(T, Field)   PYBIND11_FIELD_DESCRIPTOR_EX(T, Field, #Field)
 
#define PYBIND11_FIELD_DESCRIPTOR_EX(T, Field, Name)
 
#define PYBIND11_MAP2_LIST(f, t, ...)   PYBIND11_EVAL (PYBIND11_MAP2_LIST1 (f, t, __VA_ARGS__, (), 0))
 
#define PYBIND11_MAP2_LIST0(f, t, x1, x2, peek, ...)   f(t, x1, x2) PYBIND11_MAP2_LIST_NEXT (peek, PYBIND11_MAP2_LIST1) (f, t, peek, __VA_ARGS__)
 
#define PYBIND11_MAP2_LIST1(f, t, x1, x2, peek, ...)   f(t, x1, x2) PYBIND11_MAP2_LIST_NEXT (peek, PYBIND11_MAP2_LIST0) (f, t, peek, __VA_ARGS__)
 
#define PYBIND11_MAP2_LIST_NEXT(test, next)   PYBIND11_MAP2_LIST_NEXT1 (PYBIND11_MAP_GET_END test, next)
 
#define PYBIND11_MAP2_LIST_NEXT1(test, next)   PYBIND11_MAP_NEXT0 (test, PYBIND11_MAP_COMMA next, 0)
 
#define PYBIND11_MAP_COMMA   ,
 
#define PYBIND11_MAP_END(...)
 
#define PYBIND11_MAP_GET_END()   0, PYBIND11_MAP_END
 
#define PYBIND11_MAP_LIST(f, t, ...)   PYBIND11_EVAL (PYBIND11_MAP_LIST1 (f, t, __VA_ARGS__, (), 0))
 
#define PYBIND11_MAP_LIST0(f, t, x, peek, ...)   f(t, x) PYBIND11_MAP_LIST_NEXT (peek, PYBIND11_MAP_LIST1) (f, t, peek, __VA_ARGS__)
 
#define PYBIND11_MAP_LIST1(f, t, x, peek, ...)   f(t, x) PYBIND11_MAP_LIST_NEXT (peek, PYBIND11_MAP_LIST0) (f, t, peek, __VA_ARGS__)
 
#define PYBIND11_MAP_LIST_NEXT(test, next)   PYBIND11_MAP_LIST_NEXT1 (PYBIND11_MAP_GET_END test, next)
 
#define PYBIND11_MAP_LIST_NEXT1(test, next)   PYBIND11_MAP_NEXT0 (test, PYBIND11_MAP_COMMA next, 0)
 
#define PYBIND11_MAP_NEXT(test, next)   PYBIND11_MAP_NEXT1 (PYBIND11_MAP_GET_END test, next)
 
#define PYBIND11_MAP_NEXT0(test, next, ...)   next PYBIND11_MAP_OUT
 
#define PYBIND11_MAP_NEXT1(test, next)   PYBIND11_MAP_NEXT0 (test, next, 0)
 
#define PYBIND11_MAP_OUT
 
#define PYBIND11_NUMPY_DTYPE(Type, ...)
 
#define PYBIND11_NUMPY_DTYPE_EX(Type, ...)
 

Typedefs

template<class T >
using array_iterator = typename std::add_pointer< T >::type
 
template<typename T >
using is_pod_struct = all_of< std::is_standard_layout< T >, std::is_trivially_copyable< T >, satisfies_none_of< T, std::is_reference, std::is_array, is_std_array, std::is_arithmetic, is_complex, std::is_enum > >
 
template<typename T >
using remove_all_extents_t = typename array_info< T >::type
 

Enumerations

enum  broadcast_trivial { broadcast_trivial::non_trivial, broadcast_trivial::c_trivial, broadcast_trivial::f_trivial }
 

Functions

template<class T >
array_iterator< Tarray_begin (const buffer_info &buffer)
 
PyArrayDescr_Proxyarray_descriptor_proxy (PyObject *ptr)
 
const PyArrayDescr_Proxyarray_descriptor_proxy (const PyObject *ptr)
 
template<class T >
array_iterator< Tarray_end (const buffer_info &buffer)
 
PyArray_Proxyarray_proxy (void *ptr)
 
const PyArray_Proxyarray_proxy (const void *ptr)
 
template<size_t N>
broadcast_trivial broadcast (const std::array< buffer_info, N > &buffers, ssize_t &ndim, std::vector< ssize_t > &shape)
 
template<ssize_t Dim = 0, typename Strides >
ssize_t byte_offset_unsafe (const Strides &)
 
template<ssize_t Dim = 0, typename Strides , typename... Ix>
ssize_t byte_offset_unsafe (const Strides &strides, ssize_t i, Ix...index)
 
bool check_flags (const void *ptr, int flag)
 
numpy_internalsget_numpy_internals ()
 
PYBIND11_NOINLINE void load_numpy_internals (numpy_internals *&ptr)
 
template<typename Concrete >
constexpr int platform_lookup ()
 
template<typename Concrete , typename T , typename... Ts, typename... Ints>
constexpr int platform_lookup (int I, Ints...Is)
 
PYBIND11_NOINLINE void register_structured_dtype (any_container< field_descriptor > fields, const std::type_info &tinfo, ssize_t itemsize, bool(*direct_converter)(PyObject *, void *&))
 
template<typename Return , typename... Args>
detail::vectorize_helper< Return(*)(Args...), Return, Args... > vectorize (Return(*f)(Args...))
 
template<typename Func , detail::enable_if_t< detail::is_lambda< Func >::value, int > = 0>
auto vectorize (Func &&f) -> decltype(detail::vectorize_extractor(std::forward< Func >(f),(detail::function_signature_t< Func > *) nullptr))
 
template<typename Return , typename Class , typename... Args, typename Helper = detail::vectorize_helper<decltype(std::mem_fn(std::declval<Return (Class::*)(Args...)>())), Return, Class *, Args...>>
Helper vectorize (Return(Class::*f)(Args...))
 
template<typename Func , typename Return , typename... Args>
vectorize_helper< Func, Return, Args... > vectorize_extractor (const Func &f, Return(*)(Args...))
 

Macro Definition Documentation

#define DECL_NPY_API (   Func)    api.Func##_ = (decltype(api.Func##_)) api_ptr[API_##Func];
#define PYBIND11_DECL_CHAR_FMT
Value:
static constexpr auto name = _("S") + _<N>(); \
static pybind11::dtype dtype() { return pybind11::dtype(std::string("S") + std::to_string(N)); }
Definition: numpy.h:449
#define N
Definition: gksort.c:12
Annotation for function names.
Definition: attr.h:36

Definition at line 1058 of file numpy.h.

#define PYBIND11_EVAL (   ...)    PYBIND11_EVAL4 (PYBIND11_EVAL4 (PYBIND11_EVAL4 (__VA_ARGS__)))

Definition at line 1219 of file numpy.h.

#define PYBIND11_EVAL0 (   ...)    __VA_ARGS__

Definition at line 1214 of file numpy.h.

#define PYBIND11_EVAL1 (   ...)    PYBIND11_EVAL0 (PYBIND11_EVAL0 (PYBIND11_EVAL0 (__VA_ARGS__)))

Definition at line 1215 of file numpy.h.

#define PYBIND11_EVAL2 (   ...)    PYBIND11_EVAL1 (PYBIND11_EVAL1 (PYBIND11_EVAL1 (__VA_ARGS__)))

Definition at line 1216 of file numpy.h.

#define PYBIND11_EVAL3 (   ...)    PYBIND11_EVAL2 (PYBIND11_EVAL2 (PYBIND11_EVAL2 (__VA_ARGS__)))

Definition at line 1217 of file numpy.h.

#define PYBIND11_EVAL4 (   ...)    PYBIND11_EVAL3 (PYBIND11_EVAL3 (PYBIND11_EVAL3 (__VA_ARGS__)))

Definition at line 1218 of file numpy.h.

#define PYBIND11_FIELD_DESCRIPTOR (   T,
  Field 
)    PYBIND11_FIELD_DESCRIPTOR_EX(T, Field, #Field)

Definition at line 1210 of file numpy.h.

#define PYBIND11_FIELD_DESCRIPTOR_EX (   T,
  Field,
  Name 
)
Value:
::pybind11::detail::field_descriptor { \
Name, offsetof(T, Field), sizeof(decltype(std::declval<T>().Field)), \
::pybind11::format_descriptor<decltype(std::declval<T>().Field)>::format(), \
::pybind11::detail::npy_format_descriptor<decltype(std::declval<T>().Field)>::dtype() \
}
Definition: numpy.h:449

Definition at line 1202 of file numpy.h.

#define PYBIND11_MAP2_LIST (   f,
  t,
  ... 
)    PYBIND11_EVAL (PYBIND11_MAP2_LIST1 (f, t, __VA_ARGS__, (), 0))

Definition at line 1263 of file numpy.h.

#define PYBIND11_MAP2_LIST0 (   f,
  t,
  x1,
  x2,
  peek,
  ... 
)    f(t, x1, x2) PYBIND11_MAP2_LIST_NEXT (peek, PYBIND11_MAP2_LIST1) (f, t, peek, __VA_ARGS__)

Definition at line 1258 of file numpy.h.

#define PYBIND11_MAP2_LIST1 (   f,
  t,
  x1,
  x2,
  peek,
  ... 
)    f(t, x1, x2) PYBIND11_MAP2_LIST_NEXT (peek, PYBIND11_MAP2_LIST0) (f, t, peek, __VA_ARGS__)

Definition at line 1260 of file numpy.h.

#define PYBIND11_MAP2_LIST_NEXT (   test,
  next 
)    PYBIND11_MAP2_LIST_NEXT1 (PYBIND11_MAP_GET_END test, next)

Definition at line 1256 of file numpy.h.

#define PYBIND11_MAP2_LIST_NEXT1 (   test,
  next 
)    PYBIND11_MAP_NEXT0 (test, PYBIND11_MAP_COMMA next, 0)

Definition at line 1253 of file numpy.h.

#define PYBIND11_MAP_COMMA   ,

Definition at line 1222 of file numpy.h.

#define PYBIND11_MAP_END (   ...)

Definition at line 1220 of file numpy.h.

#define PYBIND11_MAP_GET_END ( )    0, PYBIND11_MAP_END

Definition at line 1223 of file numpy.h.

#define PYBIND11_MAP_LIST (   f,
  t,
  ... 
)    PYBIND11_EVAL (PYBIND11_MAP_LIST1 (f, t, __VA_ARGS__, (), 0))

Definition at line 1241 of file numpy.h.

#define PYBIND11_MAP_LIST0 (   f,
  t,
  x,
  peek,
  ... 
)    f(t, x) PYBIND11_MAP_LIST_NEXT (peek, PYBIND11_MAP_LIST1) (f, t, peek, __VA_ARGS__)

Definition at line 1236 of file numpy.h.

#define PYBIND11_MAP_LIST1 (   f,
  t,
  x,
  peek,
  ... 
)    f(t, x) PYBIND11_MAP_LIST_NEXT (peek, PYBIND11_MAP_LIST0) (f, t, peek, __VA_ARGS__)

Definition at line 1238 of file numpy.h.

#define PYBIND11_MAP_LIST_NEXT (   test,
  next 
)    PYBIND11_MAP_LIST_NEXT1 (PYBIND11_MAP_GET_END test, next)

Definition at line 1234 of file numpy.h.

#define PYBIND11_MAP_LIST_NEXT1 (   test,
  next 
)    PYBIND11_MAP_NEXT0 (test, PYBIND11_MAP_COMMA next, 0)

Definition at line 1231 of file numpy.h.

#define PYBIND11_MAP_NEXT (   test,
  next 
)    PYBIND11_MAP_NEXT1 (PYBIND11_MAP_GET_END test, next)

Definition at line 1226 of file numpy.h.

#define PYBIND11_MAP_NEXT0 (   test,
  next,
  ... 
)    next PYBIND11_MAP_OUT

Definition at line 1224 of file numpy.h.

#define PYBIND11_MAP_NEXT1 (   test,
  next 
)    PYBIND11_MAP_NEXT0 (test, next, 0)

Definition at line 1225 of file numpy.h.

#define PYBIND11_MAP_OUT

Definition at line 1221 of file numpy.h.

#define PYBIND11_NUMPY_DTYPE (   Type,
  ... 
)
Value:
::pybind11::detail::npy_format_descriptor<Type>::register_dtype \
(::std::vector<::pybind11::detail::field_descriptor> \
#define PYBIND11_FIELD_DESCRIPTOR(T, Field)
Definition: numpy.h:1210
#define PYBIND11_MAP_LIST(f, t,...)
Definition: numpy.h:1241

Definition at line 1244 of file numpy.h.

#define PYBIND11_NUMPY_DTYPE_EX (   Type,
  ... 
)
Value:
::pybind11::detail::npy_format_descriptor<Type>::register_dtype \
(::std::vector<::pybind11::detail::field_descriptor> \
#define PYBIND11_FIELD_DESCRIPTOR_EX(T, Field, Name)
Definition: numpy.h:1202
#define PYBIND11_MAP2_LIST(f, t,...)
Definition: numpy.h:1263

Definition at line 1266 of file numpy.h.

Typedef Documentation

template<class T >
using array_iterator = typename std::add_pointer<T>::type

Definition at line 1274 of file numpy.h.

template<typename T >
using is_pod_struct = all_of< std::is_standard_layout<T>, std::is_trivially_copyable<T>, satisfies_none_of<T, std::is_reference, std::is_array, is_std_array, std::is_arithmetic, is_complex, std::is_enum> >

Definition at line 329 of file numpy.h.

template<typename T >
using remove_all_extents_t = typename array_info<T>::type

Definition at line 315 of file numpy.h.

Enumeration Type Documentation

enum broadcast_trivial
strong
Enumerator
non_trivial 
c_trivial 
f_trivial 

Definition at line 1391 of file numpy.h.

Function Documentation

template<class T >
array_iterator<T> array_begin ( const buffer_info buffer)

Definition at line 1277 of file numpy.h.

PyArrayDescr_Proxy* array_descriptor_proxy ( PyObject *  ptr)
inline

Definition at line 266 of file numpy.h.

const PyArrayDescr_Proxy* array_descriptor_proxy ( const PyObject *  ptr)
inline

Definition at line 270 of file numpy.h.

template<class T >
array_iterator<T> array_end ( const buffer_info buffer)

Definition at line 1282 of file numpy.h.

PyArray_Proxy* array_proxy ( void *  ptr)
inline

Definition at line 258 of file numpy.h.

const PyArray_Proxy* array_proxy ( const void *  ptr)
inline

Definition at line 262 of file numpy.h.

template<size_t N>
broadcast_trivial broadcast ( const std::array< buffer_info, N > &  buffers,
ssize_t ndim,
std::vector< ssize_t > &  shape 
)

Definition at line 1398 of file numpy.h.

template<ssize_t Dim = 0, typename Strides >
ssize_t byte_offset_unsafe ( const Strides &  )

Definition at line 331 of file numpy.h.

template<ssize_t Dim = 0, typename Strides , typename... Ix>
ssize_t byte_offset_unsafe ( const Strides &  strides,
ssize_t  i,
Ix...  index 
)

Definition at line 333 of file numpy.h.

bool check_flags ( const void *  ptr,
int  flag 
)
inline

Definition at line 274 of file numpy.h.

numpy_internals& get_numpy_internals ( )
inline

Definition at line 108 of file numpy.h.

PYBIND11_NOINLINE void load_numpy_internals ( numpy_internals *&  ptr)
inline

Definition at line 104 of file numpy.h.

template<typename Concrete >
constexpr int platform_lookup ( )

Definition at line 119 of file numpy.h.

template<typename Concrete , typename T , typename... Ts, typename... Ints>
constexpr int platform_lookup ( int  I,
Ints...  Is 
)

Definition at line 123 of file numpy.h.

PYBIND11_NOINLINE void register_structured_dtype ( any_container< field_descriptor fields,
const std::type_info &  tinfo,
ssize_t  itemsize,
bool(*)(PyObject *, void *&)  direct_converter 
)
inline

Definition at line 1095 of file numpy.h.

template<typename Return , typename... Args>
detail::vectorize_helper<Return (*)(Args...), Return, Args...> vectorize ( Return(*)(Args...)  f)

Definition at line 1626 of file numpy.h.

template<typename Func , detail::enable_if_t< detail::is_lambda< Func >::value, int > = 0>
auto vectorize ( Func &&  f) -> decltype( detail::vectorize_extractor(std::forward<Func>(f), (detail::function_signature_t<Func> *) nullptr))

Definition at line 1632 of file numpy.h.

template<typename Return , typename Class , typename... Args, typename Helper = detail::vectorize_helper<decltype(std::mem_fn(std::declval<Return (Class::*)(Args...)>())), Return, Class *, Args...>>
Helper vectorize ( Return(Class::*)(Args...)  f)

Definition at line 1640 of file numpy.h.

template<typename Func , typename Return , typename... Args>
vectorize_helper<Func, Return, Args...> vectorize_extractor ( const Func &  f,
Return(*)(Args...)   
)

Definition at line 1613 of file numpy.h.



gtsam
Author(s):
autogenerated on Sat May 8 2021 02:51:32