Classes | Macros | Enumerations | Functions
test_numpy_dtypes.cpp File Reference
#include <pybind11/numpy.h>
#include "pybind11_tests.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 ArrayStruct &v)
 
std::ostream & operator<< (std::ostream &os, const ComplexStruct &v)
 
std::ostream & operator<< (std::ostream &os, const EnumStruct &v)
 
std::ostream & operator<< (std::ostream &os, const NestedStruct &v)
 
std::ostream & operator<< (std::ostream &os, const PackedStruct &v)
 
std::ostream & operator<< (std::ostream &os, const SimpleStruct &v)
 
std::ostream & operator<< (std::ostream &os, const StringStruct &v)
 
template<typename S >
py::list print_recarray (py::array_t< S, 0 > arr)
 
 PYBIND11_PACKED (struct EnumStruct { E1 e1;E2 e2;})
 
 PYBIND11_PACKED (struct NestedStruct { SimpleStruct a;PackedStruct b;})
 
 PYBIND11_PACKED (struct PackedStruct { bool bool_;uint32_t uint_;float float_;long double ldbl_;})
 
 PYBIND11_PACKED (struct StructWithUglyNames { int8_t __x__;uint64_t __y__;})
 
py::array_t< int32_t, 0 > test_array_ctors (int i)
 
py::list test_dtype_ctors ()
 
 TEST_SUBMODULE (numpy_dtypes, m)
 

Macro Definition Documentation

◆ PYBIND11_PACKED

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

Definition at line 17 of file test_numpy_dtypes.cpp.

◆ SET_TEST_VALS

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

Definition at line 156 of file test_numpy_dtypes.cpp.

Enumeration Type Documentation

◆ E1

enum E1 : int64_t
strong
Enumerator

Definition at line 102 of file test_numpy_dtypes.cpp.

◆ E2

enum E2 : uint8_t
Enumerator

Definition at line 103 of file test_numpy_dtypes.cpp.

Function Documentation

◆ create_recarray()

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

Definition at line 165 of file test_numpy_dtypes.cpp.

◆ mkarray_via_buffer()

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

Definition at line 151 of file test_numpy_dtypes.cpp.

◆ operator<<() [1/7]

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

Definition at line 122 of file test_numpy_dtypes.cpp.

◆ operator<<() [2/7]

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

Definition at line 86 of file test_numpy_dtypes.cpp.

◆ operator<<() [3/7]

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

Definition at line 146 of file test_numpy_dtypes.cpp.

◆ operator<<() [4/7]

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

Definition at line 56 of file test_numpy_dtypes.cpp.

◆ operator<<() [5/7]

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

Definition at line 47 of file test_numpy_dtypes.cpp.

◆ operator<<() [6/7]

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

Definition at line 29 of file test_numpy_dtypes.cpp.

◆ operator<<() [7/7]

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

Definition at line 110 of file test_numpy_dtypes.cpp.

◆ print_recarray()

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

Definition at line 176 of file test_numpy_dtypes.cpp.

◆ PYBIND11_PACKED() [1/4]

PYBIND11_PACKED ( struct EnumStruct { E1 e1;E2 e2;}  )

◆ PYBIND11_PACKED() [2/4]

PYBIND11_PACKED ( struct NestedStruct { SimpleStruct a;PackedStruct b;}  )

◆ PYBIND11_PACKED() [3/4]

PYBIND11_PACKED ( struct PackedStruct { bool bool_;uint32_t uint_;float float_;long double ldbl_;}  )

◆ PYBIND11_PACKED() [4/4]

PYBIND11_PACKED ( struct StructWithUglyNames { int8_t __x__;uint64_t __y__;}  )

◆ test_array_ctors()

py::array_t<int32_t, 0> test_array_ctors ( int  i)

Definition at line 188 of file test_numpy_dtypes.cpp.

◆ test_dtype_ctors()

py::list test_dtype_ctors ( )

Definition at line 273 of file test_numpy_dtypes.cpp.

◆ TEST_SUBMODULE()

TEST_SUBMODULE ( numpy_dtypes  ,
m   
)

Definition at line 301 of file test_numpy_dtypes.cpp.

s
RealScalar s
Definition: level1_cplx_impl.h:126
uint32_t
unsigned int uint32_t
Definition: ms_stdint.h:85
bool_
Definition: pytypes.h:1798
L
MatrixXd L
Definition: LLT_example.cpp:6
tree::f
Point2(* f)(const Point3 &, OptionalJacobian< 2, 3 >)
Definition: testExpression.cpp:218
float_
Definition: pytypes.h:1870
i
int i
Definition: BiCGSTAB_step_by_step.cpp:9


gtsam
Author(s):
autogenerated on Sat Nov 16 2024 04:09:52