Classes | Macros | Enumerations | Functions
test_numpy_dtypes.cpp File Reference
#include "pybind11_tests.h"
#include <pybind11/numpy.h>
Include dependency graph for test_numpy_dtypes.cpp:

Go to the source code of this file.

Classes

struct  A
 
struct  ArrayStruct
 
struct  B
 
struct  ComplexStruct
 
struct  PartialNestedStruct
 
struct  PartialStruct
 
struct  SimpleStruct
 
struct  SimpleStructReordered
 
struct  StringStruct
 
struct  UnboundStruct
 

Macros

#define PYBIND11_PACKED(cls)   __pragma(pack(push, 1)) cls __pragma(pack(pop))
 
#define SET_TEST_VALS(s, i)
 

Enumerations

enum  E1 : int64_t { E1::A = -1, E1::B = 1 }
 
enum  E2 : uint8_t { X = 1, Y = 2 }
 

Functions

template<typename S >
py::array_t< S, 0 > create_recarray (size_t n)
 
template<typename T >
py::array mkarray_via_buffer (size_t n)
 
std::ostream & operator<< (std::ostream &os, const SimpleStruct &v)
 
std::ostream & operator<< (std::ostream &os, const PackedStruct &v)
 
std::ostream & operator<< (std::ostream &os, const NestedStruct &v)
 
std::ostream & operator<< (std::ostream &os, const ComplexStruct &v)
 
std::ostream & operator<< (std::ostream &os, const StringStruct &v)
 
std::ostream & operator<< (std::ostream &os, const ArrayStruct &v)
 
std::ostream & operator<< (std::ostream &os, const EnumStruct &v)
 
template<typename S >
py::list print_recarray (py::array_t< S, 0 > arr)
 
 PYBIND11_PACKED (struct PackedStruct{bool bool_;uint32_t uint_;float float_;long double ldbl_;})
 
 PYBIND11_PACKED (struct NestedStruct{SimpleStruct a;PackedStruct b;})
 
 PYBIND11_PACKED (struct StructWithUglyNames{int8_t __x__;uint64_t __y__;})
 
 PYBIND11_PACKED (struct EnumStruct{E1 e1;E2 e2;})
 
py::array_t< int32_t, 0 > test_array_ctors (int i)
 
py::list test_dtype_ctors ()
 
 TEST_SUBMODULE (numpy_dtypes, m)
 

Macro Definition Documentation

#define PYBIND11_PACKED (   cls)    __pragma(pack(push, 1)) cls __pragma(pack(pop))

Definition at line 16 of file test_numpy_dtypes.cpp.

#define SET_TEST_VALS (   s,
  i 
)
Value:
do { \
s.bool_ = (i) % 2 != 0; \
s.uint_ = (uint32_t) (i); \
s.float_ = (float) (i) * 1.5f; \
s.ldbl_ = (long double) (i) * -2.5L; } while (0)
unsigned int uint32_t
Definition: ms_stdint.h:85
RealScalar s

Definition at line 149 of file test_numpy_dtypes.cpp.

Enumeration Type Documentation

enum E1 : int64_t
strong
Enumerator

Definition at line 101 of file test_numpy_dtypes.cpp.

enum E2 : uint8_t
Enumerator

Definition at line 102 of file test_numpy_dtypes.cpp.

Function Documentation

template<typename S >
py::array_t<S, 0> create_recarray ( size_t  n)

Definition at line 156 of file test_numpy_dtypes.cpp.

template<typename T >
py::array mkarray_via_buffer ( size_t  n)

Definition at line 143 of file test_numpy_dtypes.cpp.

std::ostream& operator<< ( std::ostream &  os,
const SimpleStruct v 
)

Definition at line 28 of file test_numpy_dtypes.cpp.

std::ostream& operator<< ( std::ostream &  os,
const PackedStruct &  v 
)

Definition at line 46 of file test_numpy_dtypes.cpp.

std::ostream& operator<< ( std::ostream &  os,
const NestedStruct &  v 
)

Definition at line 55 of file test_numpy_dtypes.cpp.

std::ostream& operator<< ( std::ostream &  os,
const ComplexStruct v 
)

Definition at line 85 of file test_numpy_dtypes.cpp.

std::ostream& operator<< ( std::ostream &  os,
const StringStruct v 
)

Definition at line 109 of file test_numpy_dtypes.cpp.

std::ostream& operator<< ( std::ostream &  os,
const ArrayStruct v 
)

Definition at line 117 of file test_numpy_dtypes.cpp.

std::ostream& operator<< ( std::ostream &  os,
const EnumStruct &  v 
)

Definition at line 138 of file test_numpy_dtypes.cpp.

template<typename S >
py::list print_recarray ( py::array_t< S, 0 >  arr)

Definition at line 167 of file test_numpy_dtypes.cpp.

PYBIND11_PACKED ( struct PackedStruct{bool bool_;uint32_t uint_;float float_;long double ldbl_;}  )
PYBIND11_PACKED ( struct NestedStruct{SimpleStruct a;PackedStruct b;}  )
PYBIND11_PACKED ( struct StructWithUglyNames{int8_t __x__;uint64_t __y__;}  )
PYBIND11_PACKED ( struct EnumStruct{E1 e1;E2 e2;}  )
py::array_t<int32_t, 0> test_array_ctors ( int  i)

Definition at line 179 of file test_numpy_dtypes.cpp.

py::list test_dtype_ctors ( )

Definition at line 236 of file test_numpy_dtypes.cpp.

TEST_SUBMODULE ( numpy_dtypes  ,
m   
)

Definition at line 257 of file test_numpy_dtypes.cpp.



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