16 m_.doc() =
"pybind11 wrapper of enum_py";
18 py::enum_<Color>(m_,
"Color", py::arithmetic())
19 .value(
"Red", Color::Red)
20 .value(
"Green", Color::Green)
21 .value(
"Blue", Color::Blue);
24 py::class_<Pet, std::shared_ptr<Pet>> pet(m_,
"Pet");
26 .def(py::init<const string&, Pet::Kind>(),
py::arg(
"name"),
py::arg(
"type"))
27 .def(
"setColor",[](Pet*
self,
const Color& color){
self->setColor(color);},
py::arg(
"color"))
28 .def(
"getColor",[](Pet*
self){
return self->getColor();})
32 py::enum_<Pet::Kind>(pet,
"Kind", py::arithmetic())
33 .value(
"Dog", Pet::Kind::Dog)
34 .value(
"Cat", Pet::Kind::Cat);
37 py::enum_<gtsam::VerbosityLM>(m_gtsam,
"VerbosityLM", py::arithmetic())
38 .value(
"SILENT", gtsam::VerbosityLM::SILENT)
39 .value(
"SUMMARY", gtsam::VerbosityLM::SUMMARY)
40 .value(
"TERMINATION", gtsam::VerbosityLM::TERMINATION)
41 .value(
"LAMBDA", gtsam::VerbosityLM::LAMBDA)
42 .value(
"TRYLAMBDA", gtsam::VerbosityLM::TRYLAMBDA)
43 .value(
"TRYCONFIG", gtsam::VerbosityLM::TRYCONFIG)
44 .value(
"DAMPED", gtsam::VerbosityLM::DAMPED)
45 .value(
"TRYDELTA", gtsam::VerbosityLM::TRYDELTA);
48 py::class_<gtsam::MCU, std::shared_ptr<gtsam::MCU>> mcu(m_gtsam,
"MCU");
52 py::enum_<gtsam::MCU::Avengers>(mcu,
"Avengers", py::arithmetic())
53 .value(
"CaptainAmerica", gtsam::MCU::Avengers::CaptainAmerica)
54 .value(
"IronMan", gtsam::MCU::Avengers::IronMan)
55 .value(
"Hulk", gtsam::MCU::Avengers::Hulk)
56 .value(
"Hawkeye", gtsam::MCU::Avengers::Hawkeye)
57 .value(
"Thor", gtsam::MCU::Avengers::Thor);
60 py::enum_<gtsam::MCU::GotG>(mcu,
"GotG", py::arithmetic())
61 .value(
"Starlord", gtsam::MCU::GotG::Starlord)
62 .value(
"Gamorra", gtsam::MCU::GotG::Gamorra)
63 .value(
"Rocket", gtsam::MCU::GotG::Rocket)
64 .value(
"Drax", gtsam::MCU::GotG::Drax)
65 .value(
"Groot", gtsam::MCU::GotG::Groot);
68 py::class_<gtsam::Optimizer<gtsam::GaussNewtonParams>, std::shared_ptr<gtsam::Optimizer<gtsam::GaussNewtonParams>>> optimizergaussnewtonparams(m_gtsam,
"OptimizerGaussNewtonParams");
69 optimizergaussnewtonparams
70 .def(
py::init<
const Optimizer<gtsam::GaussNewtonParams>::Verbosity&>(),
py::arg(
"verbosity"))
71 .def(
"setVerbosity",[](gtsam::Optimizer<gtsam::GaussNewtonParams>*
self,
const Optimizer<gtsam::GaussNewtonParams>::Verbosity
value){
self->setVerbosity(
value);},
py::arg(
"value"))
72 .def(
"getVerbosity",[](gtsam::Optimizer<gtsam::GaussNewtonParams>*
self){
return self->getVerbosity();})
73 .def(
"getVerbosity",[](gtsam::Optimizer<gtsam::GaussNewtonParams>*
self){
return self->getVerbosity();});
75 py::enum_<gtsam::Optimizer<gtsam::GaussNewtonParams>::Verbosity>(optimizergaussnewtonparams,
"Verbosity", py::arithmetic())
76 .
value(
"SILENT", gtsam::Optimizer<gtsam::GaussNewtonParams>::Verbosity::SILENT)
77 .value(
"SUMMARY", gtsam::Optimizer<gtsam::GaussNewtonParams>::Verbosity::SUMMARY)
78 .value(
"VERBOSE", gtsam::Optimizer<gtsam::GaussNewtonParams>::Verbosity::VERBOSE);
82 #include "python/specializations.h"