Scarab  2.8.1
Project 8 C++ Utility Library
Classes | Macros | Typedefs | Functions | Variables
test_numpy_array.cpp File Reference
#include "pybind11_tests.h"
#include <pybind11/numpy.h>
#include <pybind11/stl.h>
#include <cstdint>
Include dependency graph for test_numpy_array.cpp:

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>
ssize_t index_at (const arr &a, Ix... idx)
 
template<typename... Ix>
ssize_t index_at_t (const arr_t &a, Ix... idx)
 
template<typename... Ix>
ssize_t offset_at (const arr &a, Ix... idx)
 
template<typename... Ix>
ssize_t offset_at_t (const arr_t &a, Ix... idx)
 
template<typename... Ix>
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)
 
void test_submodule_numpy_array (py::module &)
 

Variables

static int data_i = 42
 
test_initializer numpy_array ("numpy_array", test_submodule_numpy_array)
 

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); });
const detail::type_info * type
Definition: cast.h:453

Definition at line 111 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()

ssize_t at_t ( const arr_t a,
Ix...  idx 
)

Definition at line 108 of file test_numpy_array.cpp.

◆ auxiliaries()

py::handle auxiliaries ( T &&  r,
T2 &&  r2 
)

Definition at line 117 of file test_numpy_array.cpp.

◆ data()

arr data ( const arr a,
Ix...  index 
)

Definition at line 82 of file test_numpy_array.cpp.

◆ data_t()

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

DtypeCheck get_dtype_check ( const char *  name)

Definition at line 24 of file test_numpy_array.cpp.

◆ get_dtype_size_check()

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

ssize_t index_at ( const arr a,
Ix...  idx 
)

Definition at line 104 of file test_numpy_array.cpp.

◆ index_at_t()

ssize_t index_at_t ( const arr_t a,
Ix...  idx 
)

Definition at line 105 of file test_numpy_array.cpp.

◆ mutate_at_t()

arr_t& mutate_at_t ( arr_t a,
Ix...  idx 
)

Definition at line 109 of file test_numpy_array.cpp.

◆ mutate_data()

arr& mutate_data ( arr a,
Ix...  index 
)

Definition at line 90 of file test_numpy_array.cpp.

◆ mutate_data_t()

arr_t& mutate_data_t ( arr_t a,
Ix...  index 
)

Definition at line 97 of file test_numpy_array.cpp.

◆ offset_at()

ssize_t offset_at ( const arr a,
Ix...  idx 
)

Definition at line 106 of file test_numpy_array.cpp.

◆ offset_at_t()

ssize_t offset_at_t ( const arr_t a,
Ix...  idx 
)

Definition at line 107 of file test_numpy_array.cpp.

◆ test_submodule_numpy_array()

void test_submodule_numpy_array ( py::module sm)

Definition at line 135 of file test_numpy_array.cpp.

Variable Documentation

◆ data_i

int data_i = 42
static

Definition at line 133 of file test_numpy_array.cpp.

◆ numpy_array

test_initializer numpy_array("numpy_array", test_submodule_numpy_array)