cppyabm  1.0.17
An agent-based library to integrate C++ and Python
Classes | Macros | Typedefs | Functions
test_numpy_array.cpp File Reference
#include "pybind11_tests.h"
#include <pybind11/numpy.h>
#include <pybind11/stl.h>
#include <cstdint>

Go to the source code of this file.

Classes

struct  DtypeCheck
 
struct  DtypeSizeCheck
 

Macros

#define def_index_fn(name, type)
 

Typedefs

using arr = py::array
 
using arr_t = py::array_t< uint16_t, 0 >
 

Functions

template<typename T >
DtypeCheck get_dtype_check (const char *name)
 
std::vector< DtypeCheckget_concrete_dtype_checks ()
 
template<typename T >
DtypeSizeCheck get_dtype_size_check ()
 
std::vector< DtypeSizeCheckget_platform_dtype_size_checks ()
 
template<typename... Ix>
arr data (const arr &a, Ix... index)
 
template<typename... Ix>
arr data_t (const arr_t &a, Ix... index)
 
template<typename... Ix>
arrmutate_data (arr &a, Ix... index)
 
template<typename... Ix>
arr_tmutate_data_t (arr_t &a, Ix... index)
 
template<typename... Ix>
py::ssize_t index_at (const arr &a, Ix... idx)
 
template<typename... Ix>
py::ssize_t index_at_t (const arr_t &a, Ix... idx)
 
template<typename... Ix>
py::ssize_t offset_at (const arr &a, Ix... idx)
 
template<typename... Ix>
py::ssize_t offset_at_t (const arr_t &a, Ix... idx)
 
template<typename... Ix>
py::ssize_t at_t (const arr_t &a, Ix... idx)
 
template<typename... Ix>
arr_tmutate_at_t (arr_t &a, Ix... idx)
 
template<typename T , typename T2 >
py::handle auxiliaries (T &&r, T2 &&r2)
 
 TEST_SUBMODULE (numpy_array, sm)
 

Macro Definition Documentation

◆ def_index_fn

#define def_index_fn (   name,
  type 
)
Value:
sm.def(#name, [](type a) { return name(a); }); \
sm.def(#name, [](type a, int i) { return name(a, i); }); \
sm.def(#name, [](type a, int i, int j) { return name(a, i, j); }); \
sm.def(#name, [](type a, int i, int j, int k) { return name(a, i, j, k); });

Definition at line 112 of file test_numpy_array.cpp.

Typedef Documentation

◆ arr

using arr = py::array

Definition at line 78 of file test_numpy_array.cpp.

◆ arr_t

using arr_t = py::array_t<uint16_t, 0>

Definition at line 79 of file test_numpy_array.cpp.

Function Documentation

◆ at_t()

template<typename... Ix>
py::ssize_t at_t ( const arr_t a,
Ix...  idx 
)

Definition at line 108 of file test_numpy_array.cpp.

◆ auxiliaries()

template<typename T , typename T2 >
py::handle auxiliaries ( T &&  r,
T2 &&  r2 
)

Definition at line 117 of file test_numpy_array.cpp.

◆ data()

template<typename... Ix>
arr data ( const arr a,
Ix...  index 
)

Definition at line 82 of file test_numpy_array.cpp.

◆ data_t()

template<typename... Ix>
arr data_t ( const arr_t a,
Ix...  index 
)

Definition at line 86 of file test_numpy_array.cpp.

◆ get_concrete_dtype_checks()

std::vector<DtypeCheck> get_concrete_dtype_checks ( )

Definition at line 32 of file test_numpy_array.cpp.

◆ get_dtype_check()

template<typename T >
DtypeCheck get_dtype_check ( const char *  name)

Definition at line 24 of file test_numpy_array.cpp.

◆ get_dtype_size_check()

template<typename T >
DtypeSizeCheck get_dtype_size_check ( )

Definition at line 55 of file test_numpy_array.cpp.

◆ get_platform_dtype_size_checks()

std::vector<DtypeSizeCheck> get_platform_dtype_size_checks ( )

Definition at line 64 of file test_numpy_array.cpp.

◆ index_at()

template<typename... Ix>
py::ssize_t index_at ( const arr a,
Ix...  idx 
)

Definition at line 104 of file test_numpy_array.cpp.

◆ index_at_t()

template<typename... Ix>
py::ssize_t index_at_t ( const arr_t a,
Ix...  idx 
)

Definition at line 105 of file test_numpy_array.cpp.

◆ mutate_at_t()

template<typename... Ix>
arr_t& mutate_at_t ( arr_t a,
Ix...  idx 
)

Definition at line 109 of file test_numpy_array.cpp.

◆ mutate_data()

template<typename... Ix>
arr& mutate_data ( arr a,
Ix...  index 
)

Definition at line 90 of file test_numpy_array.cpp.

◆ mutate_data_t()

template<typename... Ix>
arr_t& mutate_data_t ( arr_t a,
Ix...  index 
)

Definition at line 97 of file test_numpy_array.cpp.

◆ offset_at()

template<typename... Ix>
py::ssize_t offset_at ( const arr a,
Ix...  idx 
)

Definition at line 106 of file test_numpy_array.cpp.

◆ offset_at_t()

template<typename... Ix>
py::ssize_t offset_at_t ( const arr_t a,
Ix...  idx 
)

Definition at line 107 of file test_numpy_array.cpp.

◆ TEST_SUBMODULE()

TEST_SUBMODULE ( numpy_array  ,
sm   
)

Definition at line 135 of file test_numpy_array.cpp.

test_multiple_inheritance.i
i
Definition: test_multiple_inheritance.py:22
name
Annotation for function names.
Definition: attr.h:36
type
Definition: pytypes.h:915