diff --git a/python/all_mrpt_math1.cpp b/python/all_mrpt_math1.cpp index b5c05d6677..e433f637e0 100644 --- a/python/all_mrpt_math1.cpp +++ b/python/all_mrpt_math1.cpp @@ -1,11 +1,12 @@ #include "src/mrpt/math/CAtan2LookUpTable.cpp" #include "src/mrpt/math/CMatrixB.cpp" +#include "src/mrpt/math/CMatrixDynamic_2.cpp" #include "src/mrpt/math/CMatrixDynamic_1.cpp" #include "src/mrpt/math/CMatrixDynamic.cpp" #include "src/mrpt/math/CMatrixF.cpp" #include "src/mrpt/math/CMatrixFixed_1.cpp" #include "src/mrpt/math/CMatrixFixed_2.cpp" #include "src/mrpt/math/CMatrixFixed_3.cpp" -#include "src/mrpt/math/CMatrixFixed_4.cpp" #include "src/mrpt/math/CMatrixFixed.cpp" +#include "src/mrpt/math/MatrixVectorBase.cpp" #include "src/mrpt/math/CPolygon.cpp" diff --git a/python/patch-003.diff b/python/patch-003.diff index b41e393e13..9b6aae0632 100644 --- a/python/patch-003.diff +++ b/python/patch-003.diff @@ -1,334 +1,3 @@ -diff --git a/python/src/mrpt/math/CMatrixDynamic.cpp b/python/src/mrpt/math/CMatrixDynamic.cpp -index 43b379213..edd9586d4 100644 ---- a/python/src/mrpt/math/CMatrixDynamic.cpp -+++ b/python/src/mrpt/math/CMatrixDynamic.cpp -@@ -42,8 +42,8 @@ void bind_mrpt_math_CMatrixDynamic(std::function< pybind11::module &(std::string - cl.def("derived", (class mrpt::math::CMatrixDynamic & (mrpt::math::CMatrixDynamic::*)()) &mrpt::math::CMatrixDynamic::derived, "C++: mrpt::math::CMatrixDynamic::derived() --> class mrpt::math::CMatrixDynamic &", pybind11::return_value_policy::automatic); - cl.def("conservativeResize", (void (mrpt::math::CMatrixDynamic::*)(size_t, size_t)) &mrpt::math::CMatrixDynamic::conservativeResize, "C++: mrpt::math::CMatrixDynamic::conservativeResize(size_t, size_t) --> void", pybind11::arg("row"), pybind11::arg("col")); - cl.def("data", (float * (mrpt::math::CMatrixDynamic::*)()) &mrpt::math::CMatrixDynamic::data, "C++: mrpt::math::CMatrixDynamic::data() --> float *", pybind11::return_value_policy::automatic); -- cl.def("__call__", (float & (mrpt::math::CMatrixDynamic::*)(size_t, size_t)) &mrpt::math::CMatrixDynamic::operator(), "C++: mrpt::math::CMatrixDynamic::operator()(size_t, size_t) --> float &", pybind11::return_value_policy::automatic, pybind11::arg("row"), pybind11::arg("col")); -- cl.def("__getitem__", (float & (mrpt::math::CMatrixDynamic::*)(size_t)) &mrpt::math::CMatrixDynamic::operator[], "C++: mrpt::math::CMatrixDynamic::operator[](size_t) --> float &", pybind11::return_value_policy::automatic, pybind11::arg("ith")); -+ cl.def("__call__", (float & (mrpt::math::CMatrixDynamic::*)(size_t, size_t)) &mrpt::math::CMatrixDynamic::operator(), "C++: mrpt::math::CMatrixDynamic::operator()(size_t, size_t) --> float &", pybind11::return_value_policy::reference, pybind11::arg("row"), pybind11::arg("col")); -+ cl.def("__getitem__", (float & (mrpt::math::CMatrixDynamic::*)(size_t)) &mrpt::math::CMatrixDynamic::operator[], "C++: mrpt::math::CMatrixDynamic::operator[](size_t) --> float &", pybind11::return_value_policy::reference, pybind11::arg("ith")); - cl.def("cast_float", (class mrpt::math::CMatrixDynamic (mrpt::math::CMatrixDynamic::*)() const) &mrpt::math::CMatrixDynamic::cast_float, "C++: mrpt::math::CMatrixDynamic::cast_float() const --> class mrpt::math::CMatrixDynamic"); - cl.def("cast_double", (class mrpt::math::CMatrixDynamic (mrpt::math::CMatrixDynamic::*)() const) &mrpt::math::CMatrixDynamic::cast_double, "C++: mrpt::math::CMatrixDynamic::cast_double() const --> class mrpt::math::CMatrixDynamic"); - cl.def("llt_solve", (class mrpt::math::CVectorDynamic (mrpt::math::CMatrixDynamic::*)(const class mrpt::math::CVectorDynamic &) const) &mrpt::math::CMatrixDynamic::llt_solve, "C++: mrpt::math::CMatrixDynamic::llt_solve(const class mrpt::math::CVectorDynamic &) const --> class mrpt::math::CVectorDynamic", pybind11::arg("b")); -@@ -70,8 +70,8 @@ void bind_mrpt_math_CMatrixDynamic(std::function< pybind11::module &(std::string - cl.def("derived", (class mrpt::math::CMatrixDynamic & (mrpt::math::CMatrixDynamic::*)()) &mrpt::math::CMatrixDynamic::derived, "C++: mrpt::math::CMatrixDynamic::derived() --> class mrpt::math::CMatrixDynamic &", pybind11::return_value_policy::automatic); - cl.def("conservativeResize", (void (mrpt::math::CMatrixDynamic::*)(size_t, size_t)) &mrpt::math::CMatrixDynamic::conservativeResize, "C++: mrpt::math::CMatrixDynamic::conservativeResize(size_t, size_t) --> void", pybind11::arg("row"), pybind11::arg("col")); - cl.def("data", (unsigned char * (mrpt::math::CMatrixDynamic::*)()) &mrpt::math::CMatrixDynamic::data, "C++: mrpt::math::CMatrixDynamic::data() --> unsigned char *", pybind11::return_value_policy::automatic); -- cl.def("__call__", (unsigned char & (mrpt::math::CMatrixDynamic::*)(size_t, size_t)) &mrpt::math::CMatrixDynamic::operator(), "C++: mrpt::math::CMatrixDynamic::operator()(size_t, size_t) --> unsigned char &", pybind11::return_value_policy::automatic, pybind11::arg("row"), pybind11::arg("col")); -- cl.def("__getitem__", (unsigned char & (mrpt::math::CMatrixDynamic::*)(size_t)) &mrpt::math::CMatrixDynamic::operator[], "C++: mrpt::math::CMatrixDynamic::operator[](size_t) --> unsigned char &", pybind11::return_value_policy::automatic, pybind11::arg("ith")); -+ cl.def("__call__", (unsigned char & (mrpt::math::CMatrixDynamic::*)(size_t, size_t)) &mrpt::math::CMatrixDynamic::operator(), "C++: mrpt::math::CMatrixDynamic::operator()(size_t, size_t) --> unsigned char &", pybind11::return_value_policy::reference, pybind11::arg("row"), pybind11::arg("col")); -+ cl.def("__getitem__", (unsigned char & (mrpt::math::CMatrixDynamic::*)(size_t)) &mrpt::math::CMatrixDynamic::operator[], "C++: mrpt::math::CMatrixDynamic::operator[](size_t) --> unsigned char &", pybind11::return_value_policy::reference, pybind11::arg("ith")); - } - { // mrpt::math::CMatrixDynamic file:mrpt/math/CMatrixDynamic.h line:41 - pybind11::class_, std::shared_ptr>> cl(M("mrpt::math"), "CMatrixDynamic_unsigned_short_t", ""); -@@ -94,7 +94,7 @@ void bind_mrpt_math_CMatrixDynamic(std::function< pybind11::module &(std::string - cl.def("derived", (class mrpt::math::CMatrixDynamic & (mrpt::math::CMatrixDynamic::*)()) &mrpt::math::CMatrixDynamic::derived, "C++: mrpt::math::CMatrixDynamic::derived() --> class mrpt::math::CMatrixDynamic &", pybind11::return_value_policy::automatic); - cl.def("conservativeResize", (void (mrpt::math::CMatrixDynamic::*)(size_t, size_t)) &mrpt::math::CMatrixDynamic::conservativeResize, "C++: mrpt::math::CMatrixDynamic::conservativeResize(size_t, size_t) --> void", pybind11::arg("row"), pybind11::arg("col")); - cl.def("data", (unsigned short * (mrpt::math::CMatrixDynamic::*)()) &mrpt::math::CMatrixDynamic::data, "C++: mrpt::math::CMatrixDynamic::data() --> unsigned short *", pybind11::return_value_policy::automatic); -- cl.def("__call__", (unsigned short & (mrpt::math::CMatrixDynamic::*)(size_t, size_t)) &mrpt::math::CMatrixDynamic::operator(), "C++: mrpt::math::CMatrixDynamic::operator()(size_t, size_t) --> unsigned short &", pybind11::return_value_policy::automatic, pybind11::arg("row"), pybind11::arg("col")); -- cl.def("__getitem__", (unsigned short & (mrpt::math::CMatrixDynamic::*)(size_t)) &mrpt::math::CMatrixDynamic::operator[], "C++: mrpt::math::CMatrixDynamic::operator[](size_t) --> unsigned short &", pybind11::return_value_policy::automatic, pybind11::arg("ith")); -+ cl.def("__call__", (unsigned short & (mrpt::math::CMatrixDynamic::*)(size_t, size_t)) &mrpt::math::CMatrixDynamic::operator(), "C++: mrpt::math::CMatrixDynamic::operator()(size_t, size_t) --> unsigned short &", pybind11::return_value_policy::reference, pybind11::arg("row"), pybind11::arg("col")); -+ cl.def("__getitem__", (unsigned short & (mrpt::math::CMatrixDynamic::*)(size_t)) &mrpt::math::CMatrixDynamic::operator[], "C++: mrpt::math::CMatrixDynamic::operator[](size_t) --> unsigned short &", pybind11::return_value_policy::reference, pybind11::arg("ith")); - } - } -diff --git a/python/src/mrpt/math/CMatrixDynamic_1.cpp b/python/src/mrpt/math/CMatrixDynamic_1.cpp -index 2867b9ecf..7eae41c0a 100644 ---- a/python/src/mrpt/math/CMatrixDynamic_1.cpp -+++ b/python/src/mrpt/math/CMatrixDynamic_1.cpp -@@ -127,8 +127,8 @@ void bind_mrpt_math_CMatrixDynamic_1(std::function< pybind11::module &(std::stri - cl.def("derived", (class mrpt::math::CMatrixDynamic & (mrpt::math::CMatrixDynamic::*)()) &mrpt::math::CMatrixDynamic::derived, "C++: mrpt::math::CMatrixDynamic::derived() --> class mrpt::math::CMatrixDynamic &", pybind11::return_value_policy::automatic); - cl.def("conservativeResize", (void (mrpt::math::CMatrixDynamic::*)(size_t, size_t)) &mrpt::math::CMatrixDynamic::conservativeResize, "C++: mrpt::math::CMatrixDynamic::conservativeResize(size_t, size_t) --> void", pybind11::arg("row"), pybind11::arg("col")); - cl.def("data", (double * (mrpt::math::CMatrixDynamic::*)()) &mrpt::math::CMatrixDynamic::data, "C++: mrpt::math::CMatrixDynamic::data() --> double *", pybind11::return_value_policy::automatic); -- cl.def("__call__", (double & (mrpt::math::CMatrixDynamic::*)(size_t, size_t)) &mrpt::math::CMatrixDynamic::operator(), "C++: mrpt::math::CMatrixDynamic::operator()(size_t, size_t) --> double &", pybind11::return_value_policy::automatic, pybind11::arg("row"), pybind11::arg("col")); -- cl.def("__getitem__", (double & (mrpt::math::CMatrixDynamic::*)(size_t)) &mrpt::math::CMatrixDynamic::operator[], "C++: mrpt::math::CMatrixDynamic::operator[](size_t) --> double &", pybind11::return_value_policy::automatic, pybind11::arg("ith")); -+ cl.def("__call__", (double & (mrpt::math::CMatrixDynamic::*)(size_t, size_t)) &mrpt::math::CMatrixDynamic::operator(), "C++: mrpt::math::CMatrixDynamic::operator()(size_t, size_t) --> double &", pybind11::return_value_policy::reference, pybind11::arg("row"), pybind11::arg("col")); -+ cl.def("__getitem__", (double & (mrpt::math::CMatrixDynamic::*)(size_t)) &mrpt::math::CMatrixDynamic::operator[], "C++: mrpt::math::CMatrixDynamic::operator[](size_t) --> double &", pybind11::return_value_policy::reference, pybind11::arg("ith")); - cl.def("cast_float", (class mrpt::math::CMatrixDynamic (mrpt::math::CMatrixDynamic::*)() const) &mrpt::math::CMatrixDynamic::cast_float, "C++: mrpt::math::CMatrixDynamic::cast_float() const --> class mrpt::math::CMatrixDynamic"); - cl.def("cast_double", (class mrpt::math::CMatrixDynamic (mrpt::math::CMatrixDynamic::*)() const) &mrpt::math::CMatrixDynamic::cast_double, "C++: mrpt::math::CMatrixDynamic::cast_double() const --> class mrpt::math::CMatrixDynamic"); - cl.def("llt_solve", (class mrpt::math::CVectorDynamic (mrpt::math::CMatrixDynamic::*)(const class mrpt::math::CVectorDynamic &) const) &mrpt::math::CMatrixDynamic::llt_solve, "C++: mrpt::math::CMatrixDynamic::llt_solve(const class mrpt::math::CVectorDynamic &) const --> class mrpt::math::CVectorDynamic", pybind11::arg("b")); -diff --git a/python/src/mrpt/math/CMatrixFixed.cpp b/python/src/mrpt/math/CMatrixFixed.cpp -index e4a508e5f..342ed0569 100644 ---- a/python/src/mrpt/math/CMatrixFixed.cpp -+++ b/python/src/mrpt/math/CMatrixFixed.cpp -@@ -38,9 +38,9 @@ void bind_mrpt_math_CMatrixFixed(std::function< pybind11::module &(std::string c - cl.def("rows", (int (mrpt::math::CMatrixFixed::*)() const) &mrpt::math::CMatrixFixed::rows, "C++: mrpt::math::CMatrixFixed::rows() const --> int"); - cl.def("cols", (int (mrpt::math::CMatrixFixed::*)() const) &mrpt::math::CMatrixFixed::cols, "C++: mrpt::math::CMatrixFixed::cols() const --> int"); - cl.def("data", (double * (mrpt::math::CMatrixFixed::*)()) &mrpt::math::CMatrixFixed::data, "C++: mrpt::math::CMatrixFixed::data() --> double *", pybind11::return_value_policy::automatic); -- cl.def("__call__", (double & (mrpt::math::CMatrixFixed::*)(int, int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int, int) --> double &", pybind11::return_value_policy::automatic, pybind11::arg("row"), pybind11::arg("col")); -- cl.def("__call__", (double & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int) --> double &", pybind11::return_value_policy::automatic, pybind11::arg("i")); -- cl.def("__getitem__", (double & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator[], "C++: mrpt::math::CMatrixFixed::operator[](int) --> double &", pybind11::return_value_policy::automatic, pybind11::arg("i")); -+ cl.def("__call__", (double & (mrpt::math::CMatrixFixed::*)(int, int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int, int) --> double &", pybind11::return_value_policy::reference, pybind11::arg("row"), pybind11::arg("col")); -+ cl.def("__call__", (double & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int) --> double &", pybind11::return_value_policy::reference, pybind11::arg("i")); -+ cl.def("__getitem__", (double & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator[], "C++: mrpt::math::CMatrixFixed::operator[](int) --> double &", pybind11::return_value_policy::reference, pybind11::arg("i")); - cl.def("sum_At", (void (mrpt::math::CMatrixFixed::*)(const class mrpt::math::CMatrixFixed &)) &mrpt::math::CMatrixFixed::sum_At, "C++: mrpt::math::CMatrixFixed::sum_At(const class mrpt::math::CMatrixFixed &) --> void", pybind11::arg("A")); - cl.def("assign", (class mrpt::math::CMatrixFixed & (mrpt::math::CMatrixFixed::*)(const class mrpt::math::CMatrixFixed &)) &mrpt::math::CMatrixFixed::operator=, "C++: mrpt::math::CMatrixFixed::operator=(const class mrpt::math::CMatrixFixed &) --> class mrpt::math::CMatrixFixed &", pybind11::return_value_policy::automatic, pybind11::arg("")); - } -@@ -64,9 +64,9 @@ void bind_mrpt_math_CMatrixFixed(std::function< pybind11::module &(std::string c - cl.def("rows", (int (mrpt::math::CMatrixFixed::*)() const) &mrpt::math::CMatrixFixed::rows, "C++: mrpt::math::CMatrixFixed::rows() const --> int"); - cl.def("cols", (int (mrpt::math::CMatrixFixed::*)() const) &mrpt::math::CMatrixFixed::cols, "C++: mrpt::math::CMatrixFixed::cols() const --> int"); - cl.def("data", (double * (mrpt::math::CMatrixFixed::*)()) &mrpt::math::CMatrixFixed::data, "C++: mrpt::math::CMatrixFixed::data() --> double *", pybind11::return_value_policy::automatic); -- cl.def("__call__", (double & (mrpt::math::CMatrixFixed::*)(int, int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int, int) --> double &", pybind11::return_value_policy::automatic, pybind11::arg("row"), pybind11::arg("col")); -- cl.def("__call__", (double & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int) --> double &", pybind11::return_value_policy::automatic, pybind11::arg("i")); -- cl.def("__getitem__", (double & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator[], "C++: mrpt::math::CMatrixFixed::operator[](int) --> double &", pybind11::return_value_policy::automatic, pybind11::arg("i")); -+ cl.def("__call__", (double & (mrpt::math::CMatrixFixed::*)(int, int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int, int) --> double &", pybind11::return_value_policy::reference, pybind11::arg("row"), pybind11::arg("col")); -+ cl.def("__call__", (double & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int) --> double &", pybind11::return_value_policy::reference, pybind11::arg("i")); -+ cl.def("__getitem__", (double & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator[], "C++: mrpt::math::CMatrixFixed::operator[](int) --> double &", pybind11::return_value_policy::reference, pybind11::arg("i")); - cl.def("cast_float", (class mrpt::math::CMatrixFixed (mrpt::math::CMatrixFixed::*)() const) &mrpt::math::CMatrixFixed::cast_float, "C++: mrpt::math::CMatrixFixed::cast_float() const --> class mrpt::math::CMatrixFixed"); - cl.def("sum_At", (void (mrpt::math::CMatrixFixed::*)(const class mrpt::math::CMatrixFixed &)) &mrpt::math::CMatrixFixed::sum_At, "C++: mrpt::math::CMatrixFixed::sum_At(const class mrpt::math::CMatrixFixed &) --> void", pybind11::arg("A")); - cl.def("assign", (class mrpt::math::CMatrixFixed & (mrpt::math::CMatrixFixed::*)(const class mrpt::math::CMatrixFixed &)) &mrpt::math::CMatrixFixed::operator=, "C++: mrpt::math::CMatrixFixed::operator=(const class mrpt::math::CMatrixFixed &) --> class mrpt::math::CMatrixFixed &", pybind11::return_value_policy::automatic, pybind11::arg("")); -@@ -91,9 +91,9 @@ void bind_mrpt_math_CMatrixFixed(std::function< pybind11::module &(std::string c - cl.def("rows", (int (mrpt::math::CMatrixFixed::*)() const) &mrpt::math::CMatrixFixed::rows, "C++: mrpt::math::CMatrixFixed::rows() const --> int"); - cl.def("cols", (int (mrpt::math::CMatrixFixed::*)() const) &mrpt::math::CMatrixFixed::cols, "C++: mrpt::math::CMatrixFixed::cols() const --> int"); - cl.def("data", (double * (mrpt::math::CMatrixFixed::*)()) &mrpt::math::CMatrixFixed::data, "C++: mrpt::math::CMatrixFixed::data() --> double *", pybind11::return_value_policy::automatic); -- cl.def("__call__", (double & (mrpt::math::CMatrixFixed::*)(int, int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int, int) --> double &", pybind11::return_value_policy::automatic, pybind11::arg("row"), pybind11::arg("col")); -- cl.def("__call__", (double & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int) --> double &", pybind11::return_value_policy::automatic, pybind11::arg("i")); -- cl.def("__getitem__", (double & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator[], "C++: mrpt::math::CMatrixFixed::operator[](int) --> double &", pybind11::return_value_policy::automatic, pybind11::arg("i")); -+ cl.def("__call__", (double & (mrpt::math::CMatrixFixed::*)(int, int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int, int) --> double &", pybind11::return_value_policy::reference, pybind11::arg("row"), pybind11::arg("col")); -+ cl.def("__call__", (double & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int) --> double &", pybind11::return_value_policy::reference, pybind11::arg("i")); -+ cl.def("__getitem__", (double & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator[], "C++: mrpt::math::CMatrixFixed::operator[](int) --> double &", pybind11::return_value_policy::reference, pybind11::arg("i")); - cl.def("cast_float", (class mrpt::math::CMatrixFixed (mrpt::math::CMatrixFixed::*)() const) &mrpt::math::CMatrixFixed::cast_float, "C++: mrpt::math::CMatrixFixed::cast_float() const --> class mrpt::math::CMatrixFixed"); - cl.def("sum_At", (void (mrpt::math::CMatrixFixed::*)(const class mrpt::math::CMatrixFixed &)) &mrpt::math::CMatrixFixed::sum_At, "C++: mrpt::math::CMatrixFixed::sum_At(const class mrpt::math::CMatrixFixed &) --> void", pybind11::arg("A")); - cl.def("assign", (class mrpt::math::CMatrixFixed & (mrpt::math::CMatrixFixed::*)(const class mrpt::math::CMatrixFixed &)) &mrpt::math::CMatrixFixed::operator=, "C++: mrpt::math::CMatrixFixed::operator=(const class mrpt::math::CMatrixFixed &) --> class mrpt::math::CMatrixFixed &", pybind11::return_value_policy::automatic, pybind11::arg("")); -@@ -118,9 +118,9 @@ void bind_mrpt_math_CMatrixFixed(std::function< pybind11::module &(std::string c - cl.def("rows", (int (mrpt::math::CMatrixFixed::*)() const) &mrpt::math::CMatrixFixed::rows, "C++: mrpt::math::CMatrixFixed::rows() const --> int"); - cl.def("cols", (int (mrpt::math::CMatrixFixed::*)() const) &mrpt::math::CMatrixFixed::cols, "C++: mrpt::math::CMatrixFixed::cols() const --> int"); - cl.def("data", (double * (mrpt::math::CMatrixFixed::*)()) &mrpt::math::CMatrixFixed::data, "C++: mrpt::math::CMatrixFixed::data() --> double *", pybind11::return_value_policy::automatic); -- cl.def("__call__", (double & (mrpt::math::CMatrixFixed::*)(int, int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int, int) --> double &", pybind11::return_value_policy::automatic, pybind11::arg("row"), pybind11::arg("col")); -- cl.def("__call__", (double & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int) --> double &", pybind11::return_value_policy::automatic, pybind11::arg("i")); -- cl.def("__getitem__", (double & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator[], "C++: mrpt::math::CMatrixFixed::operator[](int) --> double &", pybind11::return_value_policy::automatic, pybind11::arg("i")); -+ cl.def("__call__", (double & (mrpt::math::CMatrixFixed::*)(int, int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int, int) --> double &", pybind11::return_value_policy::reference, pybind11::arg("row"), pybind11::arg("col")); -+ cl.def("__call__", (double & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int) --> double &", pybind11::return_value_policy::reference, pybind11::arg("i")); -+ cl.def("__getitem__", (double & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator[], "C++: mrpt::math::CMatrixFixed::operator[](int) --> double &", pybind11::return_value_policy::reference, pybind11::arg("i")); - cl.def("sum_At", (void (mrpt::math::CMatrixFixed::*)(const class mrpt::math::CMatrixFixed &)) &mrpt::math::CMatrixFixed::sum_At, "C++: mrpt::math::CMatrixFixed::sum_At(const class mrpt::math::CMatrixFixed &) --> void", pybind11::arg("A")); - cl.def("assign", (class mrpt::math::CMatrixFixed & (mrpt::math::CMatrixFixed::*)(const class mrpt::math::CMatrixFixed &)) &mrpt::math::CMatrixFixed::operator=, "C++: mrpt::math::CMatrixFixed::operator=(const class mrpt::math::CMatrixFixed &) --> class mrpt::math::CMatrixFixed &", pybind11::return_value_policy::automatic, pybind11::arg("")); - } -diff --git a/python/src/mrpt/math/CMatrixFixed_1.cpp b/python/src/mrpt/math/CMatrixFixed_1.cpp -index ed3593796..c0eee45ec 100644 ---- a/python/src/mrpt/math/CMatrixFixed_1.cpp -+++ b/python/src/mrpt/math/CMatrixFixed_1.cpp -@@ -38,9 +38,9 @@ void bind_mrpt_math_CMatrixFixed_1(std::function< pybind11::module &(std::string - cl.def("rows", (int (mrpt::math::CMatrixFixed::*)() const) &mrpt::math::CMatrixFixed::rows, "C++: mrpt::math::CMatrixFixed::rows() const --> int"); - cl.def("cols", (int (mrpt::math::CMatrixFixed::*)() const) &mrpt::math::CMatrixFixed::cols, "C++: mrpt::math::CMatrixFixed::cols() const --> int"); - cl.def("data", (double * (mrpt::math::CMatrixFixed::*)()) &mrpt::math::CMatrixFixed::data, "C++: mrpt::math::CMatrixFixed::data() --> double *", pybind11::return_value_policy::automatic); -- cl.def("__call__", (double & (mrpt::math::CMatrixFixed::*)(int, int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int, int) --> double &", pybind11::return_value_policy::automatic, pybind11::arg("row"), pybind11::arg("col")); -- cl.def("__call__", (double & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int) --> double &", pybind11::return_value_policy::automatic, pybind11::arg("i")); -- cl.def("__getitem__", (double & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator[], "C++: mrpt::math::CMatrixFixed::operator[](int) --> double &", pybind11::return_value_policy::automatic, pybind11::arg("i")); -+ cl.def("__call__", (double & (mrpt::math::CMatrixFixed::*)(int, int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int, int) --> double &", pybind11::return_value_policy::reference, pybind11::arg("row"), pybind11::arg("col")); -+ cl.def("__call__", (double & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int) --> double &", pybind11::return_value_policy::reference, pybind11::arg("i")); -+ cl.def("__getitem__", (double & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator[], "C++: mrpt::math::CMatrixFixed::operator[](int) --> double &", pybind11::return_value_policy::reference, pybind11::arg("i")); - cl.def("sum_At", (void (mrpt::math::CMatrixFixed::*)(const class mrpt::math::CMatrixFixed &)) &mrpt::math::CMatrixFixed::sum_At, "C++: mrpt::math::CMatrixFixed::sum_At(const class mrpt::math::CMatrixFixed &) --> void", pybind11::arg("A")); - cl.def("assign", (class mrpt::math::CMatrixFixed & (mrpt::math::CMatrixFixed::*)(const class mrpt::math::CMatrixFixed &)) &mrpt::math::CMatrixFixed::operator=, "C++: mrpt::math::CMatrixFixed::operator=(const class mrpt::math::CMatrixFixed &) --> class mrpt::math::CMatrixFixed &", pybind11::return_value_policy::automatic, pybind11::arg("")); - } -@@ -64,9 +64,9 @@ void bind_mrpt_math_CMatrixFixed_1(std::function< pybind11::module &(std::string - cl.def("rows", (int (mrpt::math::CMatrixFixed::*)() const) &mrpt::math::CMatrixFixed::rows, "C++: mrpt::math::CMatrixFixed::rows() const --> int"); - cl.def("cols", (int (mrpt::math::CMatrixFixed::*)() const) &mrpt::math::CMatrixFixed::cols, "C++: mrpt::math::CMatrixFixed::cols() const --> int"); - cl.def("data", (double * (mrpt::math::CMatrixFixed::*)()) &mrpt::math::CMatrixFixed::data, "C++: mrpt::math::CMatrixFixed::data() --> double *", pybind11::return_value_policy::automatic); -- cl.def("__call__", (double & (mrpt::math::CMatrixFixed::*)(int, int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int, int) --> double &", pybind11::return_value_policy::automatic, pybind11::arg("row"), pybind11::arg("col")); -- cl.def("__call__", (double & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int) --> double &", pybind11::return_value_policy::automatic, pybind11::arg("i")); -- cl.def("__getitem__", (double & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator[], "C++: mrpt::math::CMatrixFixed::operator[](int) --> double &", pybind11::return_value_policy::automatic, pybind11::arg("i")); -+ cl.def("__call__", (double & (mrpt::math::CMatrixFixed::*)(int, int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int, int) --> double &", pybind11::return_value_policy::reference, pybind11::arg("row"), pybind11::arg("col")); -+ cl.def("__call__", (double & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int) --> double &", pybind11::return_value_policy::reference, pybind11::arg("i")); -+ cl.def("__getitem__", (double & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator[], "C++: mrpt::math::CMatrixFixed::operator[](int) --> double &", pybind11::return_value_policy::reference, pybind11::arg("i")); - cl.def("cast_float", (class mrpt::math::CMatrixFixed (mrpt::math::CMatrixFixed::*)() const) &mrpt::math::CMatrixFixed::cast_float, "C++: mrpt::math::CMatrixFixed::cast_float() const --> class mrpt::math::CMatrixFixed"); - cl.def("sum_At", (void (mrpt::math::CMatrixFixed::*)(const class mrpt::math::CMatrixFixed &)) &mrpt::math::CMatrixFixed::sum_At, "C++: mrpt::math::CMatrixFixed::sum_At(const class mrpt::math::CMatrixFixed &) --> void", pybind11::arg("A")); - cl.def("assign", (class mrpt::math::CMatrixFixed & (mrpt::math::CMatrixFixed::*)(const class mrpt::math::CMatrixFixed &)) &mrpt::math::CMatrixFixed::operator=, "C++: mrpt::math::CMatrixFixed::operator=(const class mrpt::math::CMatrixFixed &) --> class mrpt::math::CMatrixFixed &", pybind11::return_value_policy::automatic, pybind11::arg("")); -@@ -91,9 +91,9 @@ void bind_mrpt_math_CMatrixFixed_1(std::function< pybind11::module &(std::string - cl.def("rows", (int (mrpt::math::CMatrixFixed::*)() const) &mrpt::math::CMatrixFixed::rows, "C++: mrpt::math::CMatrixFixed::rows() const --> int"); - cl.def("cols", (int (mrpt::math::CMatrixFixed::*)() const) &mrpt::math::CMatrixFixed::cols, "C++: mrpt::math::CMatrixFixed::cols() const --> int"); - cl.def("data", (double * (mrpt::math::CMatrixFixed::*)()) &mrpt::math::CMatrixFixed::data, "C++: mrpt::math::CMatrixFixed::data() --> double *", pybind11::return_value_policy::automatic); -- cl.def("__call__", (double & (mrpt::math::CMatrixFixed::*)(int, int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int, int) --> double &", pybind11::return_value_policy::automatic, pybind11::arg("row"), pybind11::arg("col")); -- cl.def("__call__", (double & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int) --> double &", pybind11::return_value_policy::automatic, pybind11::arg("i")); -- cl.def("__getitem__", (double & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator[], "C++: mrpt::math::CMatrixFixed::operator[](int) --> double &", pybind11::return_value_policy::automatic, pybind11::arg("i")); -+ cl.def("__call__", (double & (mrpt::math::CMatrixFixed::*)(int, int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int, int) --> double &", pybind11::return_value_policy::reference, pybind11::arg("row"), pybind11::arg("col")); -+ cl.def("__call__", (double & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int) --> double &", pybind11::return_value_policy::reference, pybind11::arg("i")); -+ cl.def("__getitem__", (double & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator[], "C++: mrpt::math::CMatrixFixed::operator[](int) --> double &", pybind11::return_value_policy::reference, pybind11::arg("i")); - cl.def("sum_At", (void (mrpt::math::CMatrixFixed::*)(const class mrpt::math::CMatrixFixed &)) &mrpt::math::CMatrixFixed::sum_At, "C++: mrpt::math::CMatrixFixed::sum_At(const class mrpt::math::CMatrixFixed &) --> void", pybind11::arg("A")); - } - { // mrpt::math::CMatrixFixed file:mrpt/math/CMatrixFixed.h line:34 -@@ -116,9 +116,9 @@ void bind_mrpt_math_CMatrixFixed_1(std::function< pybind11::module &(std::string - cl.def("rows", (int (mrpt::math::CMatrixFixed::*)() const) &mrpt::math::CMatrixFixed::rows, "C++: mrpt::math::CMatrixFixed::rows() const --> int"); - cl.def("cols", (int (mrpt::math::CMatrixFixed::*)() const) &mrpt::math::CMatrixFixed::cols, "C++: mrpt::math::CMatrixFixed::cols() const --> int"); - cl.def("data", (double * (mrpt::math::CMatrixFixed::*)()) &mrpt::math::CMatrixFixed::data, "C++: mrpt::math::CMatrixFixed::data() --> double *", pybind11::return_value_policy::automatic); -- cl.def("__call__", (double & (mrpt::math::CMatrixFixed::*)(int, int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int, int) --> double &", pybind11::return_value_policy::automatic, pybind11::arg("row"), pybind11::arg("col")); -- cl.def("__call__", (double & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int) --> double &", pybind11::return_value_policy::automatic, pybind11::arg("i")); -- cl.def("__getitem__", (double & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator[], "C++: mrpt::math::CMatrixFixed::operator[](int) --> double &", pybind11::return_value_policy::automatic, pybind11::arg("i")); -+ cl.def("__call__", (double & (mrpt::math::CMatrixFixed::*)(int, int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int, int) --> double &", pybind11::return_value_policy::reference, pybind11::arg("row"), pybind11::arg("col")); -+ cl.def("__call__", (double & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int) --> double &", pybind11::return_value_policy::reference, pybind11::arg("i")); -+ cl.def("__getitem__", (double & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator[], "C++: mrpt::math::CMatrixFixed::operator[](int) --> double &", pybind11::return_value_policy::reference, pybind11::arg("i")); - cl.def("sum_At", (void (mrpt::math::CMatrixFixed::*)(const class mrpt::math::CMatrixFixed &)) &mrpt::math::CMatrixFixed::sum_At, "C++: mrpt::math::CMatrixFixed::sum_At(const class mrpt::math::CMatrixFixed &) --> void", pybind11::arg("A")); - } - } -diff --git a/python/src/mrpt/math/CMatrixFixed_2.cpp b/python/src/mrpt/math/CMatrixFixed_2.cpp -index 7ce27e1bf..f8bc51568 100644 ---- a/python/src/mrpt/math/CMatrixFixed_2.cpp -+++ b/python/src/mrpt/math/CMatrixFixed_2.cpp -@@ -38,9 +38,9 @@ void bind_mrpt_math_CMatrixFixed_2(std::function< pybind11::module &(std::string - cl.def("rows", (int (mrpt::math::CMatrixFixed::*)() const) &mrpt::math::CMatrixFixed::rows, "C++: mrpt::math::CMatrixFixed::rows() const --> int"); - cl.def("cols", (int (mrpt::math::CMatrixFixed::*)() const) &mrpt::math::CMatrixFixed::cols, "C++: mrpt::math::CMatrixFixed::cols() const --> int"); - cl.def("data", (double * (mrpt::math::CMatrixFixed::*)()) &mrpt::math::CMatrixFixed::data, "C++: mrpt::math::CMatrixFixed::data() --> double *", pybind11::return_value_policy::automatic); -- cl.def("__call__", (double & (mrpt::math::CMatrixFixed::*)(int, int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int, int) --> double &", pybind11::return_value_policy::automatic, pybind11::arg("row"), pybind11::arg("col")); -- cl.def("__call__", (double & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int) --> double &", pybind11::return_value_policy::automatic, pybind11::arg("i")); -- cl.def("__getitem__", (double & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator[], "C++: mrpt::math::CMatrixFixed::operator[](int) --> double &", pybind11::return_value_policy::automatic, pybind11::arg("i")); -+ cl.def("__call__", (double & (mrpt::math::CMatrixFixed::*)(int, int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int, int) --> double &", pybind11::return_value_policy::reference, pybind11::arg("row"), pybind11::arg("col")); -+ cl.def("__call__", (double & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int) --> double &", pybind11::return_value_policy::reference, pybind11::arg("i")); -+ cl.def("__getitem__", (double & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator[], "C++: mrpt::math::CMatrixFixed::operator[](int) --> double &", pybind11::return_value_policy::reference, pybind11::arg("i")); - cl.def("sum_At", (void (mrpt::math::CMatrixFixed::*)(const class mrpt::math::CMatrixFixed &)) &mrpt::math::CMatrixFixed::sum_At, "C++: mrpt::math::CMatrixFixed::sum_At(const class mrpt::math::CMatrixFixed &) --> void", pybind11::arg("A")); - cl.def("assign", (class mrpt::math::CMatrixFixed & (mrpt::math::CMatrixFixed::*)(const class mrpt::math::CMatrixFixed &)) &mrpt::math::CMatrixFixed::operator=, "C++: mrpt::math::CMatrixFixed::operator=(const class mrpt::math::CMatrixFixed &) --> class mrpt::math::CMatrixFixed &", pybind11::return_value_policy::automatic, pybind11::arg("")); - } -@@ -64,9 +64,9 @@ void bind_mrpt_math_CMatrixFixed_2(std::function< pybind11::module &(std::string - cl.def("rows", (int (mrpt::math::CMatrixFixed::*)() const) &mrpt::math::CMatrixFixed::rows, "C++: mrpt::math::CMatrixFixed::rows() const --> int"); - cl.def("cols", (int (mrpt::math::CMatrixFixed::*)() const) &mrpt::math::CMatrixFixed::cols, "C++: mrpt::math::CMatrixFixed::cols() const --> int"); - cl.def("data", (double * (mrpt::math::CMatrixFixed::*)()) &mrpt::math::CMatrixFixed::data, "C++: mrpt::math::CMatrixFixed::data() --> double *", pybind11::return_value_policy::automatic); -- cl.def("__call__", (double & (mrpt::math::CMatrixFixed::*)(int, int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int, int) --> double &", pybind11::return_value_policy::automatic, pybind11::arg("row"), pybind11::arg("col")); -- cl.def("__call__", (double & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int) --> double &", pybind11::return_value_policy::automatic, pybind11::arg("i")); -- cl.def("__getitem__", (double & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator[], "C++: mrpt::math::CMatrixFixed::operator[](int) --> double &", pybind11::return_value_policy::automatic, pybind11::arg("i")); -+ cl.def("__call__", (double & (mrpt::math::CMatrixFixed::*)(int, int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int, int) --> double &", pybind11::return_value_policy::reference, pybind11::arg("row"), pybind11::arg("col")); -+ cl.def("__call__", (double & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int) --> double &", pybind11::return_value_policy::reference, pybind11::arg("i")); -+ cl.def("__getitem__", (double & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator[], "C++: mrpt::math::CMatrixFixed::operator[](int) --> double &", pybind11::return_value_policy::reference, pybind11::arg("i")); - cl.def("sum_At", (void (mrpt::math::CMatrixFixed::*)(const class mrpt::math::CMatrixFixed &)) &mrpt::math::CMatrixFixed::sum_At, "C++: mrpt::math::CMatrixFixed::sum_At(const class mrpt::math::CMatrixFixed &) --> void", pybind11::arg("A")); - } - { // mrpt::math::CMatrixFixed file:mrpt/math/CMatrixFixed.h line:34 -@@ -89,9 +89,9 @@ void bind_mrpt_math_CMatrixFixed_2(std::function< pybind11::module &(std::string - cl.def("rows", (int (mrpt::math::CMatrixFixed::*)() const) &mrpt::math::CMatrixFixed::rows, "C++: mrpt::math::CMatrixFixed::rows() const --> int"); - cl.def("cols", (int (mrpt::math::CMatrixFixed::*)() const) &mrpt::math::CMatrixFixed::cols, "C++: mrpt::math::CMatrixFixed::cols() const --> int"); - cl.def("data", (double * (mrpt::math::CMatrixFixed::*)()) &mrpt::math::CMatrixFixed::data, "C++: mrpt::math::CMatrixFixed::data() --> double *", pybind11::return_value_policy::automatic); -- cl.def("__call__", (double & (mrpt::math::CMatrixFixed::*)(int, int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int, int) --> double &", pybind11::return_value_policy::automatic, pybind11::arg("row"), pybind11::arg("col")); -- cl.def("__call__", (double & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int) --> double &", pybind11::return_value_policy::automatic, pybind11::arg("i")); -- cl.def("__getitem__", (double & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator[], "C++: mrpt::math::CMatrixFixed::operator[](int) --> double &", pybind11::return_value_policy::automatic, pybind11::arg("i")); -+ cl.def("__call__", (double & (mrpt::math::CMatrixFixed::*)(int, int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int, int) --> double &", pybind11::return_value_policy::reference, pybind11::arg("row"), pybind11::arg("col")); -+ cl.def("__call__", (double & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int) --> double &", pybind11::return_value_policy::reference, pybind11::arg("i")); -+ cl.def("__getitem__", (double & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator[], "C++: mrpt::math::CMatrixFixed::operator[](int) --> double &", pybind11::return_value_policy::reference, pybind11::arg("i")); - cl.def("sum_At", (void (mrpt::math::CMatrixFixed::*)(const class mrpt::math::CMatrixFixed &)) &mrpt::math::CMatrixFixed::sum_At, "C++: mrpt::math::CMatrixFixed::sum_At(const class mrpt::math::CMatrixFixed &) --> void", pybind11::arg("A")); - } - { // mrpt::math::CMatrixFixed file:mrpt/math/CMatrixFixed.h line:34 -@@ -114,9 +114,9 @@ void bind_mrpt_math_CMatrixFixed_2(std::function< pybind11::module &(std::string - cl.def("rows", (int (mrpt::math::CMatrixFixed::*)() const) &mrpt::math::CMatrixFixed::rows, "C++: mrpt::math::CMatrixFixed::rows() const --> int"); - cl.def("cols", (int (mrpt::math::CMatrixFixed::*)() const) &mrpt::math::CMatrixFixed::cols, "C++: mrpt::math::CMatrixFixed::cols() const --> int"); - cl.def("data", (double * (mrpt::math::CMatrixFixed::*)()) &mrpt::math::CMatrixFixed::data, "C++: mrpt::math::CMatrixFixed::data() --> double *", pybind11::return_value_policy::automatic); -- cl.def("__call__", (double & (mrpt::math::CMatrixFixed::*)(int, int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int, int) --> double &", pybind11::return_value_policy::automatic, pybind11::arg("row"), pybind11::arg("col")); -- cl.def("__call__", (double & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int) --> double &", pybind11::return_value_policy::automatic, pybind11::arg("i")); -- cl.def("__getitem__", (double & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator[], "C++: mrpt::math::CMatrixFixed::operator[](int) --> double &", pybind11::return_value_policy::automatic, pybind11::arg("i")); -+ cl.def("__call__", (double & (mrpt::math::CMatrixFixed::*)(int, int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int, int) --> double &", pybind11::return_value_policy::reference, pybind11::arg("row"), pybind11::arg("col")); -+ cl.def("__call__", (double & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int) --> double &", pybind11::return_value_policy::reference, pybind11::arg("i")); -+ cl.def("__getitem__", (double & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator[], "C++: mrpt::math::CMatrixFixed::operator[](int) --> double &", pybind11::return_value_policy::reference, pybind11::arg("i")); - cl.def("cast_float", (class mrpt::math::CMatrixFixed (mrpt::math::CMatrixFixed::*)() const) &mrpt::math::CMatrixFixed::cast_float, "C++: mrpt::math::CMatrixFixed::cast_float() const --> class mrpt::math::CMatrixFixed"); - cl.def("sum_At", (void (mrpt::math::CMatrixFixed::*)(const class mrpt::math::CMatrixFixed &)) &mrpt::math::CMatrixFixed::sum_At, "C++: mrpt::math::CMatrixFixed::sum_At(const class mrpt::math::CMatrixFixed &) --> void", pybind11::arg("A")); - cl.def("assign", (class mrpt::math::CMatrixFixed & (mrpt::math::CMatrixFixed::*)(const class mrpt::math::CMatrixFixed &)) &mrpt::math::CMatrixFixed::operator=, "C++: mrpt::math::CMatrixFixed::operator=(const class mrpt::math::CMatrixFixed &) --> class mrpt::math::CMatrixFixed &", pybind11::return_value_policy::automatic, pybind11::arg("")); -diff --git a/python/src/mrpt/math/CMatrixFixed_3.cpp b/python/src/mrpt/math/CMatrixFixed_3.cpp -index 7844b2818..2eb493a48 100644 ---- a/python/src/mrpt/math/CMatrixFixed_3.cpp -+++ b/python/src/mrpt/math/CMatrixFixed_3.cpp -@@ -38,9 +38,9 @@ void bind_mrpt_math_CMatrixFixed_3(std::function< pybind11::module &(std::string - cl.def("rows", (int (mrpt::math::CMatrixFixed::*)() const) &mrpt::math::CMatrixFixed::rows, "C++: mrpt::math::CMatrixFixed::rows() const --> int"); - cl.def("cols", (int (mrpt::math::CMatrixFixed::*)() const) &mrpt::math::CMatrixFixed::cols, "C++: mrpt::math::CMatrixFixed::cols() const --> int"); - cl.def("data", (double * (mrpt::math::CMatrixFixed::*)()) &mrpt::math::CMatrixFixed::data, "C++: mrpt::math::CMatrixFixed::data() --> double *", pybind11::return_value_policy::automatic); -- cl.def("__call__", (double & (mrpt::math::CMatrixFixed::*)(int, int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int, int) --> double &", pybind11::return_value_policy::automatic, pybind11::arg("row"), pybind11::arg("col")); -- cl.def("__call__", (double & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int) --> double &", pybind11::return_value_policy::automatic, pybind11::arg("i")); -- cl.def("__getitem__", (double & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator[], "C++: mrpt::math::CMatrixFixed::operator[](int) --> double &", pybind11::return_value_policy::automatic, pybind11::arg("i")); -+ cl.def("__call__", (double & (mrpt::math::CMatrixFixed::*)(int, int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int, int) --> double &", pybind11::return_value_policy::reference, pybind11::arg("row"), pybind11::arg("col")); -+ cl.def("__call__", (double & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int) --> double &", pybind11::return_value_policy::reference, pybind11::arg("i")); -+ cl.def("__getitem__", (double & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator[], "C++: mrpt::math::CMatrixFixed::operator[](int) --> double &", pybind11::return_value_policy::reference, pybind11::arg("i")); - cl.def("sum_At", (void (mrpt::math::CMatrixFixed::*)(const class mrpt::math::CMatrixFixed &)) &mrpt::math::CMatrixFixed::sum_At, "C++: mrpt::math::CMatrixFixed::sum_At(const class mrpt::math::CMatrixFixed &) --> void", pybind11::arg("A")); - } - { // mrpt::math::CMatrixFixed file:mrpt/math/CMatrixFixed.h line:34 -@@ -62,9 +62,9 @@ void bind_mrpt_math_CMatrixFixed_3(std::function< pybind11::module &(std::string - cl.def("rows", (int (mrpt::math::CMatrixFixed::*)() const) &mrpt::math::CMatrixFixed::rows, "C++: mrpt::math::CMatrixFixed::rows() const --> int"); - cl.def("cols", (int (mrpt::math::CMatrixFixed::*)() const) &mrpt::math::CMatrixFixed::cols, "C++: mrpt::math::CMatrixFixed::cols() const --> int"); - cl.def("data", (float * (mrpt::math::CMatrixFixed::*)()) &mrpt::math::CMatrixFixed::data, "C++: mrpt::math::CMatrixFixed::data() --> float *", pybind11::return_value_policy::automatic); -- cl.def("__call__", (float & (mrpt::math::CMatrixFixed::*)(int, int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int, int) --> float &", pybind11::return_value_policy::automatic, pybind11::arg("row"), pybind11::arg("col")); -- cl.def("__call__", (float & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int) --> float &", pybind11::return_value_policy::automatic, pybind11::arg("i")); -- cl.def("__getitem__", (float & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator[], "C++: mrpt::math::CMatrixFixed::operator[](int) --> float &", pybind11::return_value_policy::automatic, pybind11::arg("i")); -+ cl.def("__call__", (float & (mrpt::math::CMatrixFixed::*)(int, int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int, int) --> float &", pybind11::return_value_policy::reference, pybind11::arg("row"), pybind11::arg("col")); -+ cl.def("__call__", (float & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int) --> float &", pybind11::return_value_policy::reference, pybind11::arg("i")); -+ cl.def("__getitem__", (float & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator[], "C++: mrpt::math::CMatrixFixed::operator[](int) --> float &", pybind11::return_value_policy::reference, pybind11::arg("i")); - cl.def("cast_float", (class mrpt::math::CMatrixFixed (mrpt::math::CMatrixFixed::*)() const) &mrpt::math::CMatrixFixed::cast_float, "C++: mrpt::math::CMatrixFixed::cast_float() const --> class mrpt::math::CMatrixFixed"); - cl.def("sum_At", (void (mrpt::math::CMatrixFixed::*)(const class mrpt::math::CMatrixFixed &)) &mrpt::math::CMatrixFixed::sum_At, "C++: mrpt::math::CMatrixFixed::sum_At(const class mrpt::math::CMatrixFixed &) --> void", pybind11::arg("A")); - } -@@ -88,9 +88,9 @@ void bind_mrpt_math_CMatrixFixed_3(std::function< pybind11::module &(std::string - cl.def("rows", (int (mrpt::math::CMatrixFixed::*)() const) &mrpt::math::CMatrixFixed::rows, "C++: mrpt::math::CMatrixFixed::rows() const --> int"); - cl.def("cols", (int (mrpt::math::CMatrixFixed::*)() const) &mrpt::math::CMatrixFixed::cols, "C++: mrpt::math::CMatrixFixed::cols() const --> int"); - cl.def("data", (float * (mrpt::math::CMatrixFixed::*)()) &mrpt::math::CMatrixFixed::data, "C++: mrpt::math::CMatrixFixed::data() --> float *", pybind11::return_value_policy::automatic); -- cl.def("__call__", (float & (mrpt::math::CMatrixFixed::*)(int, int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int, int) --> float &", pybind11::return_value_policy::automatic, pybind11::arg("row"), pybind11::arg("col")); -- cl.def("__call__", (float & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int) --> float &", pybind11::return_value_policy::automatic, pybind11::arg("i")); -- cl.def("__getitem__", (float & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator[], "C++: mrpt::math::CMatrixFixed::operator[](int) --> float &", pybind11::return_value_policy::automatic, pybind11::arg("i")); -+ cl.def("__call__", (float & (mrpt::math::CMatrixFixed::*)(int, int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int, int) --> float &", pybind11::return_value_policy::reference, pybind11::arg("row"), pybind11::arg("col")); -+ cl.def("__call__", (float & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int) --> float &", pybind11::return_value_policy::reference, pybind11::arg("i")); -+ cl.def("__getitem__", (float & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator[], "C++: mrpt::math::CMatrixFixed::operator[](int) --> float &", pybind11::return_value_policy::reference, pybind11::arg("i")); - cl.def("cast_float", (class mrpt::math::CMatrixFixed (mrpt::math::CMatrixFixed::*)() const) &mrpt::math::CMatrixFixed::cast_float, "C++: mrpt::math::CMatrixFixed::cast_float() const --> class mrpt::math::CMatrixFixed"); - cl.def("sum_At", (void (mrpt::math::CMatrixFixed::*)(const class mrpt::math::CMatrixFixed &)) &mrpt::math::CMatrixFixed::sum_At, "C++: mrpt::math::CMatrixFixed::sum_At(const class mrpt::math::CMatrixFixed &) --> void", pybind11::arg("A")); - cl.def("assign", (class mrpt::math::CMatrixFixed & (mrpt::math::CMatrixFixed::*)(const class mrpt::math::CMatrixFixed &)) &mrpt::math::CMatrixFixed::operator=, "C++: mrpt::math::CMatrixFixed::operator=(const class mrpt::math::CMatrixFixed &) --> class mrpt::math::CMatrixFixed &", pybind11::return_value_policy::automatic, pybind11::arg("")); -@@ -115,9 +115,9 @@ void bind_mrpt_math_CMatrixFixed_3(std::function< pybind11::module &(std::string - cl.def("rows", (int (mrpt::math::CMatrixFixed::*)() const) &mrpt::math::CMatrixFixed::rows, "C++: mrpt::math::CMatrixFixed::rows() const --> int"); - cl.def("cols", (int (mrpt::math::CMatrixFixed::*)() const) &mrpt::math::CMatrixFixed::cols, "C++: mrpt::math::CMatrixFixed::cols() const --> int"); - cl.def("data", (float * (mrpt::math::CMatrixFixed::*)()) &mrpt::math::CMatrixFixed::data, "C++: mrpt::math::CMatrixFixed::data() --> float *", pybind11::return_value_policy::automatic); -- cl.def("__call__", (float & (mrpt::math::CMatrixFixed::*)(int, int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int, int) --> float &", pybind11::return_value_policy::automatic, pybind11::arg("row"), pybind11::arg("col")); -- cl.def("__call__", (float & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int) --> float &", pybind11::return_value_policy::automatic, pybind11::arg("i")); -- cl.def("__getitem__", (float & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator[], "C++: mrpt::math::CMatrixFixed::operator[](int) --> float &", pybind11::return_value_policy::automatic, pybind11::arg("i")); -+ cl.def("__call__", (float & (mrpt::math::CMatrixFixed::*)(int, int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int, int) --> float &", pybind11::return_value_policy::reference, pybind11::arg("row"), pybind11::arg("col")); -+ cl.def("__call__", (float & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int) --> float &", pybind11::return_value_policy::reference, pybind11::arg("i")); -+ cl.def("__getitem__", (float & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator[], "C++: mrpt::math::CMatrixFixed::operator[](int) --> float &", pybind11::return_value_policy::reference, pybind11::arg("i")); - cl.def("cast_float", (class mrpt::math::CMatrixFixed (mrpt::math::CMatrixFixed::*)() const) &mrpt::math::CMatrixFixed::cast_float, "C++: mrpt::math::CMatrixFixed::cast_float() const --> class mrpt::math::CMatrixFixed"); - cl.def("sum_At", (void (mrpt::math::CMatrixFixed::*)(const class mrpt::math::CMatrixFixed &)) &mrpt::math::CMatrixFixed::sum_At, "C++: mrpt::math::CMatrixFixed::sum_At(const class mrpt::math::CMatrixFixed &) --> void", pybind11::arg("A")); - cl.def("assign", (class mrpt::math::CMatrixFixed & (mrpt::math::CMatrixFixed::*)(const class mrpt::math::CMatrixFixed &)) &mrpt::math::CMatrixFixed::operator=, "C++: mrpt::math::CMatrixFixed::operator=(const class mrpt::math::CMatrixFixed &) --> class mrpt::math::CMatrixFixed &", pybind11::return_value_policy::automatic, pybind11::arg("")); -diff --git a/python/src/mrpt/math/CMatrixFixed_4.cpp b/python/src/mrpt/math/CMatrixFixed_4.cpp -index c2c8d6a73..5307d0b77 100644 ---- a/python/src/mrpt/math/CMatrixFixed_4.cpp -+++ b/python/src/mrpt/math/CMatrixFixed_4.cpp -@@ -39,9 +39,9 @@ void bind_mrpt_math_CMatrixFixed_4(std::function< pybind11::module &(std::string - cl.def("rows", (int (mrpt::math::CMatrixFixed::*)() const) &mrpt::math::CMatrixFixed::rows, "C++: mrpt::math::CMatrixFixed::rows() const --> int"); - cl.def("cols", (int (mrpt::math::CMatrixFixed::*)() const) &mrpt::math::CMatrixFixed::cols, "C++: mrpt::math::CMatrixFixed::cols() const --> int"); - cl.def("data", (double * (mrpt::math::CMatrixFixed::*)()) &mrpt::math::CMatrixFixed::data, "C++: mrpt::math::CMatrixFixed::data() --> double *", pybind11::return_value_policy::automatic); -- cl.def("__call__", (double & (mrpt::math::CMatrixFixed::*)(int, int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int, int) --> double &", pybind11::return_value_policy::automatic, pybind11::arg("row"), pybind11::arg("col")); -- cl.def("__call__", (double & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int) --> double &", pybind11::return_value_policy::automatic, pybind11::arg("i")); -- cl.def("__getitem__", (double & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator[], "C++: mrpt::math::CMatrixFixed::operator[](int) --> double &", pybind11::return_value_policy::automatic, pybind11::arg("i")); -+ cl.def("__call__", (double & (mrpt::math::CMatrixFixed::*)(int, int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int, int) --> double &", pybind11::return_value_policy::reference, pybind11::arg("row"), pybind11::arg("col")); -+ cl.def("__call__", (double & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int) --> double &", pybind11::return_value_policy::reference, pybind11::arg("i")); -+ cl.def("__getitem__", (double & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator[], "C++: mrpt::math::CMatrixFixed::operator[](int) --> double &", pybind11::return_value_policy::reference, pybind11::arg("i")); - cl.def("sum_At", (void (mrpt::math::CMatrixFixed::*)(const class mrpt::math::CMatrixFixed &)) &mrpt::math::CMatrixFixed::sum_At, "C++: mrpt::math::CMatrixFixed::sum_At(const class mrpt::math::CMatrixFixed &) --> void", pybind11::arg("A")); - } - { // mrpt::math::CMatrixFixed file:mrpt/math/CMatrixFixed.h line:34 -@@ -64,9 +64,9 @@ void bind_mrpt_math_CMatrixFixed_4(std::function< pybind11::module &(std::string - cl.def("rows", (int (mrpt::math::CMatrixFixed::*)() const) &mrpt::math::CMatrixFixed::rows, "C++: mrpt::math::CMatrixFixed::rows() const --> int"); - cl.def("cols", (int (mrpt::math::CMatrixFixed::*)() const) &mrpt::math::CMatrixFixed::cols, "C++: mrpt::math::CMatrixFixed::cols() const --> int"); - cl.def("data", (float * (mrpt::math::CMatrixFixed::*)()) &mrpt::math::CMatrixFixed::data, "C++: mrpt::math::CMatrixFixed::data() --> float *", pybind11::return_value_policy::automatic); -- cl.def("__call__", (float & (mrpt::math::CMatrixFixed::*)(int, int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int, int) --> float &", pybind11::return_value_policy::automatic, pybind11::arg("row"), pybind11::arg("col")); -- cl.def("__call__", (float & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int) --> float &", pybind11::return_value_policy::automatic, pybind11::arg("i")); -- cl.def("__getitem__", (float & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator[], "C++: mrpt::math::CMatrixFixed::operator[](int) --> float &", pybind11::return_value_policy::automatic, pybind11::arg("i")); -+ cl.def("__call__", (float & (mrpt::math::CMatrixFixed::*)(int, int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int, int) --> float &", pybind11::return_value_policy::reference, pybind11::arg("row"), pybind11::arg("col")); -+ cl.def("__call__", (float & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int) --> float &", pybind11::return_value_policy::reference, pybind11::arg("i")); -+ cl.def("__getitem__", (float & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator[], "C++: mrpt::math::CMatrixFixed::operator[](int) --> float &", pybind11::return_value_policy::reference, pybind11::arg("i")); - cl.def("cast_float", (class mrpt::math::CMatrixFixed (mrpt::math::CMatrixFixed::*)() const) &mrpt::math::CMatrixFixed::cast_float, "C++: mrpt::math::CMatrixFixed::cast_float() const --> class mrpt::math::CMatrixFixed"); - cl.def("sum_At", (void (mrpt::math::CMatrixFixed::*)(const class mrpt::math::CMatrixFixed &)) &mrpt::math::CMatrixFixed::sum_At, "C++: mrpt::math::CMatrixFixed::sum_At(const class mrpt::math::CMatrixFixed &) --> void", pybind11::arg("A")); - cl.def("assign", (class mrpt::math::CMatrixFixed & (mrpt::math::CMatrixFixed::*)(const class mrpt::math::CMatrixFixed &)) &mrpt::math::CMatrixFixed::operator=, "C++: mrpt::math::CMatrixFixed::operator=(const class mrpt::math::CMatrixFixed &) --> class mrpt::math::CMatrixFixed &", pybind11::return_value_policy::automatic, pybind11::arg("")); -diff --git a/python/src/mrpt/math/CVectorDynamic.cpp b/python/src/mrpt/math/CVectorDynamic.cpp -index 780fbaa83..b9075ff96 100644 ---- a/python/src/mrpt/math/CVectorDynamic.cpp -+++ b/python/src/mrpt/math/CVectorDynamic.cpp -@@ -46,8 +46,8 @@ void bind_mrpt_math_CVectorDynamic(std::function< pybind11::module &(std::string - cl.def("resize", (void (mrpt::math::CVectorDynamic::*)(std::size_t, bool)) &mrpt::math::CVectorDynamic::resize, "C++: mrpt::math::CVectorDynamic::resize(std::size_t, bool) --> void", pybind11::arg("N"), pybind11::arg("zeroNewElements")); - cl.def("push_back", (void (mrpt::math::CVectorDynamic::*)(const double &)) &mrpt::math::CVectorDynamic::push_back, "C++: mrpt::math::CVectorDynamic::push_back(const double &) --> void", pybind11::arg("val")); - cl.def("segmentCopy", (class mrpt::math::CVectorDynamic (mrpt::math::CVectorDynamic::*)(int, int) const) &mrpt::math::CVectorDynamic::segmentCopy, "C++: mrpt::math::CVectorDynamic::segmentCopy(int, int) const --> class mrpt::math::CVectorDynamic", pybind11::arg("start"), pybind11::arg("LEN")); -- cl.def("__call__", (double & (mrpt::math::CVectorDynamic::*)(size_t, size_t)) &mrpt::math::CVectorDynamic::operator(), "C++: mrpt::math::CVectorDynamic::operator()(size_t, size_t) --> double &", pybind11::return_value_policy::automatic, pybind11::arg("row"), pybind11::arg("col")); -- cl.def("__getitem__", (double & (mrpt::math::CVectorDynamic::*)(size_t)) &mrpt::math::CVectorDynamic::operator[], "C++: mrpt::math::CVectorDynamic::operator[](size_t) --> double &", pybind11::return_value_policy::automatic, pybind11::arg("ith")); -+ cl.def("__call__", (double & (mrpt::math::CVectorDynamic::*)(size_t, size_t)) &mrpt::math::CVectorDynamic::operator(), "C++: mrpt::math::CVectorDynamic::operator()(size_t, size_t) --> double &", pybind11::return_value_policy::reference, pybind11::arg("row"), pybind11::arg("col")); -+ cl.def("__getitem__", (double & (mrpt::math::CVectorDynamic::*)(size_t)) &mrpt::math::CVectorDynamic::operator[], "C++: mrpt::math::CVectorDynamic::operator[](size_t) --> double &", pybind11::return_value_policy::reference, pybind11::arg("ith")); - cl.def("assign", (class mrpt::math::CVectorDynamic & (mrpt::math::CVectorDynamic::*)(const class mrpt::math::CVectorDynamic &)) &mrpt::math::CVectorDynamic::operator=, "C++: mrpt::math::CVectorDynamic::operator=(const class mrpt::math::CVectorDynamic &) --> class mrpt::math::CVectorDynamic &", pybind11::return_value_policy::automatic, pybind11::arg("")); - } - { // mrpt::math::CVectorDynamic file:mrpt/math/CVectorDynamic.h line:32 -@@ -70,8 +70,8 @@ void bind_mrpt_math_CVectorDynamic(std::function< pybind11::module &(std::string - cl.def("resize", (void (mrpt::math::CVectorDynamic::*)(std::size_t, bool)) &mrpt::math::CVectorDynamic::resize, "C++: mrpt::math::CVectorDynamic::resize(std::size_t, bool) --> void", pybind11::arg("N"), pybind11::arg("zeroNewElements")); - cl.def("push_back", (void (mrpt::math::CVectorDynamic::*)(const float &)) &mrpt::math::CVectorDynamic::push_back, "C++: mrpt::math::CVectorDynamic::push_back(const float &) --> void", pybind11::arg("val")); - cl.def("segmentCopy", (class mrpt::math::CVectorDynamic (mrpt::math::CVectorDynamic::*)(int, int) const) &mrpt::math::CVectorDynamic::segmentCopy, "C++: mrpt::math::CVectorDynamic::segmentCopy(int, int) const --> class mrpt::math::CVectorDynamic", pybind11::arg("start"), pybind11::arg("LEN")); -- cl.def("__call__", (float & (mrpt::math::CVectorDynamic::*)(size_t, size_t)) &mrpt::math::CVectorDynamic::operator(), "C++: mrpt::math::CVectorDynamic::operator()(size_t, size_t) --> float &", pybind11::return_value_policy::automatic, pybind11::arg("row"), pybind11::arg("col")); -- cl.def("__getitem__", (float & (mrpt::math::CVectorDynamic::*)(size_t)) &mrpt::math::CVectorDynamic::operator[], "C++: mrpt::math::CVectorDynamic::operator[](size_t) --> float &", pybind11::return_value_policy::automatic, pybind11::arg("ith")); -+ cl.def("__call__", (float & (mrpt::math::CVectorDynamic::*)(size_t, size_t)) &mrpt::math::CVectorDynamic::operator(), "C++: mrpt::math::CVectorDynamic::operator()(size_t, size_t) --> float &", pybind11::return_value_policy::reference, pybind11::arg("row"), pybind11::arg("col")); -+ cl.def("__getitem__", (float & (mrpt::math::CVectorDynamic::*)(size_t)) &mrpt::math::CVectorDynamic::operator[], "C++: mrpt::math::CVectorDynamic::operator[](size_t) --> float &", pybind11::return_value_policy::reference, pybind11::arg("ith")); - cl.def("assign", (class mrpt::math::CVectorDynamic & (mrpt::math::CVectorDynamic::*)(const class mrpt::math::CVectorDynamic &)) &mrpt::math::CVectorDynamic::operator=, "C++: mrpt::math::CVectorDynamic::operator=(const class mrpt::math::CVectorDynamic &) --> class mrpt::math::CVectorDynamic &", pybind11::return_value_policy::automatic, pybind11::arg("")); - } - } diff --git a/python/src/mrpt/math/TPoint2D.cpp b/python/src/mrpt/math/TPoint2D.cpp index 80c7704f4..d137dc43c 100644 --- a/python/src/mrpt/math/TPoint2D.cpp diff --git a/python/patch-004.diff b/python/patch-004.diff index 70ce801a27..e0acd99abe 100644 --- a/python/patch-004.diff +++ b/python/patch-004.diff @@ -1,12 +1,14 @@ diff --git a/python/src/mrpt/math/CMatrixDynamic.cpp b/python/src/mrpt/math/CMatrixDynamic.cpp -index edd9586d4..1b600737a 100644 +index 43b379213..1b600737a 100644 --- a/python/src/mrpt/math/CMatrixDynamic.cpp +++ b/python/src/mrpt/math/CMatrixDynamic.cpp -@@ -43,11 +43,23 @@ void bind_mrpt_math_CMatrixDynamic(std::function< pybind11::module &(std::string +@@ -42,12 +42,24 @@ void bind_mrpt_math_CMatrixDynamic(std::function< pybind11::module &(std::string + cl.def("derived", (class mrpt::math::CMatrixDynamic & (mrpt::math::CMatrixDynamic::*)()) &mrpt::math::CMatrixDynamic::derived, "C++: mrpt::math::CMatrixDynamic::derived() --> class mrpt::math::CMatrixDynamic &", pybind11::return_value_policy::automatic); cl.def("conservativeResize", (void (mrpt::math::CMatrixDynamic::*)(size_t, size_t)) &mrpt::math::CMatrixDynamic::conservativeResize, "C++: mrpt::math::CMatrixDynamic::conservativeResize(size_t, size_t) --> void", pybind11::arg("row"), pybind11::arg("col")); cl.def("data", (float * (mrpt::math::CMatrixDynamic::*)()) &mrpt::math::CMatrixDynamic::data, "C++: mrpt::math::CMatrixDynamic::data() --> float *", pybind11::return_value_policy::automatic); - cl.def("__call__", (float & (mrpt::math::CMatrixDynamic::*)(size_t, size_t)) &mrpt::math::CMatrixDynamic::operator(), "C++: mrpt::math::CMatrixDynamic::operator()(size_t, size_t) --> float &", pybind11::return_value_policy::reference, pybind11::arg("row"), pybind11::arg("col")); -- cl.def("__getitem__", (float & (mrpt::math::CMatrixDynamic::*)(size_t)) &mrpt::math::CMatrixDynamic::operator[], "C++: mrpt::math::CMatrixDynamic::operator[](size_t) --> float &", pybind11::return_value_policy::reference, pybind11::arg("ith")); +- cl.def("__call__", (float & (mrpt::math::CMatrixDynamic::*)(size_t, size_t)) &mrpt::math::CMatrixDynamic::operator(), "C++: mrpt::math::CMatrixDynamic::operator()(size_t, size_t) --> float &", pybind11::return_value_policy::automatic, pybind11::arg("row"), pybind11::arg("col")); +- cl.def("__getitem__", (float & (mrpt::math::CMatrixDynamic::*)(size_t)) &mrpt::math::CMatrixDynamic::operator[], "C++: mrpt::math::CMatrixDynamic::operator[](size_t) --> float &", pybind11::return_value_policy::automatic, pybind11::arg("ith")); ++ cl.def("__call__", (float & (mrpt::math::CMatrixDynamic::*)(size_t, size_t)) &mrpt::math::CMatrixDynamic::operator(), "C++: mrpt::math::CMatrixDynamic::operator()(size_t, size_t) --> float &", pybind11::return_value_policy::reference, pybind11::arg("row"), pybind11::arg("col")); cl.def("cast_float", (class mrpt::math::CMatrixDynamic (mrpt::math::CMatrixDynamic::*)() const) &mrpt::math::CMatrixDynamic::cast_float, "C++: mrpt::math::CMatrixDynamic::cast_float() const --> class mrpt::math::CMatrixDynamic"); cl.def("cast_double", (class mrpt::math::CMatrixDynamic (mrpt::math::CMatrixDynamic::*)() const) &mrpt::math::CMatrixDynamic::cast_double, "C++: mrpt::math::CMatrixDynamic::cast_double() const --> class mrpt::math::CMatrixDynamic"); cl.def("llt_solve", (class mrpt::math::CVectorDynamic (mrpt::math::CMatrixDynamic::*)(const class mrpt::math::CVectorDynamic &) const) &mrpt::math::CMatrixDynamic::llt_solve, "C++: mrpt::math::CMatrixDynamic::llt_solve(const class mrpt::math::CVectorDynamic &) const --> class mrpt::math::CVectorDynamic", pybind11::arg("b")); @@ -27,15 +29,93 @@ index edd9586d4..1b600737a 100644 } { // mrpt::math::CMatrixDynamic file:mrpt/math/CMatrixDynamic.h line:41 pybind11::class_, std::shared_ptr>> cl(M("mrpt::math"), "CMatrixDynamic_unsigned_char_t", ""); +@@ -70,8 +82,8 @@ void bind_mrpt_math_CMatrixDynamic(std::function< pybind11::module &(std::string + cl.def("derived", (class mrpt::math::CMatrixDynamic & (mrpt::math::CMatrixDynamic::*)()) &mrpt::math::CMatrixDynamic::derived, "C++: mrpt::math::CMatrixDynamic::derived() --> class mrpt::math::CMatrixDynamic &", pybind11::return_value_policy::automatic); + cl.def("conservativeResize", (void (mrpt::math::CMatrixDynamic::*)(size_t, size_t)) &mrpt::math::CMatrixDynamic::conservativeResize, "C++: mrpt::math::CMatrixDynamic::conservativeResize(size_t, size_t) --> void", pybind11::arg("row"), pybind11::arg("col")); + cl.def("data", (unsigned char * (mrpt::math::CMatrixDynamic::*)()) &mrpt::math::CMatrixDynamic::data, "C++: mrpt::math::CMatrixDynamic::data() --> unsigned char *", pybind11::return_value_policy::automatic); +- cl.def("__call__", (unsigned char & (mrpt::math::CMatrixDynamic::*)(size_t, size_t)) &mrpt::math::CMatrixDynamic::operator(), "C++: mrpt::math::CMatrixDynamic::operator()(size_t, size_t) --> unsigned char &", pybind11::return_value_policy::automatic, pybind11::arg("row"), pybind11::arg("col")); +- cl.def("__getitem__", (unsigned char & (mrpt::math::CMatrixDynamic::*)(size_t)) &mrpt::math::CMatrixDynamic::operator[], "C++: mrpt::math::CMatrixDynamic::operator[](size_t) --> unsigned char &", pybind11::return_value_policy::automatic, pybind11::arg("ith")); ++ cl.def("__call__", (unsigned char & (mrpt::math::CMatrixDynamic::*)(size_t, size_t)) &mrpt::math::CMatrixDynamic::operator(), "C++: mrpt::math::CMatrixDynamic::operator()(size_t, size_t) --> unsigned char &", pybind11::return_value_policy::reference, pybind11::arg("row"), pybind11::arg("col")); ++ cl.def("__getitem__", (unsigned char & (mrpt::math::CMatrixDynamic::*)(size_t)) &mrpt::math::CMatrixDynamic::operator[], "C++: mrpt::math::CMatrixDynamic::operator[](size_t) --> unsigned char &", pybind11::return_value_policy::reference, pybind11::arg("ith")); + } + { // mrpt::math::CMatrixDynamic file:mrpt/math/CMatrixDynamic.h line:41 + pybind11::class_, std::shared_ptr>> cl(M("mrpt::math"), "CMatrixDynamic_unsigned_short_t", ""); +@@ -94,7 +106,7 @@ void bind_mrpt_math_CMatrixDynamic(std::function< pybind11::module &(std::string + cl.def("derived", (class mrpt::math::CMatrixDynamic & (mrpt::math::CMatrixDynamic::*)()) &mrpt::math::CMatrixDynamic::derived, "C++: mrpt::math::CMatrixDynamic::derived() --> class mrpt::math::CMatrixDynamic &", pybind11::return_value_policy::automatic); + cl.def("conservativeResize", (void (mrpt::math::CMatrixDynamic::*)(size_t, size_t)) &mrpt::math::CMatrixDynamic::conservativeResize, "C++: mrpt::math::CMatrixDynamic::conservativeResize(size_t, size_t) --> void", pybind11::arg("row"), pybind11::arg("col")); + cl.def("data", (unsigned short * (mrpt::math::CMatrixDynamic::*)()) &mrpt::math::CMatrixDynamic::data, "C++: mrpt::math::CMatrixDynamic::data() --> unsigned short *", pybind11::return_value_policy::automatic); +- cl.def("__call__", (unsigned short & (mrpt::math::CMatrixDynamic::*)(size_t, size_t)) &mrpt::math::CMatrixDynamic::operator(), "C++: mrpt::math::CMatrixDynamic::operator()(size_t, size_t) --> unsigned short &", pybind11::return_value_policy::automatic, pybind11::arg("row"), pybind11::arg("col")); +- cl.def("__getitem__", (unsigned short & (mrpt::math::CMatrixDynamic::*)(size_t)) &mrpt::math::CMatrixDynamic::operator[], "C++: mrpt::math::CMatrixDynamic::operator[](size_t) --> unsigned short &", pybind11::return_value_policy::automatic, pybind11::arg("ith")); ++ cl.def("__call__", (unsigned short & (mrpt::math::CMatrixDynamic::*)(size_t, size_t)) &mrpt::math::CMatrixDynamic::operator(), "C++: mrpt::math::CMatrixDynamic::operator()(size_t, size_t) --> unsigned short &", pybind11::return_value_policy::reference, pybind11::arg("row"), pybind11::arg("col")); ++ cl.def("__getitem__", (unsigned short & (mrpt::math::CMatrixDynamic::*)(size_t)) &mrpt::math::CMatrixDynamic::operator[], "C++: mrpt::math::CMatrixDynamic::operator[](size_t) --> unsigned short &", pybind11::return_value_policy::reference, pybind11::arg("ith")); + } + } diff --git a/python/src/mrpt/math/CMatrixDynamic_1.cpp b/python/src/mrpt/math/CMatrixDynamic_1.cpp -index 7eae41c0a..70f933be5 100644 +index 5e303af0c..be42731ed 100644 --- a/python/src/mrpt/math/CMatrixDynamic_1.cpp +++ b/python/src/mrpt/math/CMatrixDynamic_1.cpp -@@ -128,11 +128,23 @@ void bind_mrpt_math_CMatrixDynamic_1(std::function< pybind11::module &(std::stri +@@ -48,8 +48,8 @@ void bind_mrpt_math_CMatrixDynamic_1(std::function< pybind11::module &(std::stri + cl.def("derived", (class mrpt::math::CMatrixDynamic > & (mrpt::math::CMatrixDynamic>::*)()) &mrpt::math::CMatrixDynamic>::derived, "C++: mrpt::math::CMatrixDynamic>::derived() --> class mrpt::math::CMatrixDynamic > &", pybind11::return_value_policy::automatic); + cl.def("conservativeResize", (void (mrpt::math::CMatrixDynamic>::*)(size_t, size_t)) &mrpt::math::CMatrixDynamic>::conservativeResize, "C++: mrpt::math::CMatrixDynamic>::conservativeResize(size_t, size_t) --> void", pybind11::arg("row"), pybind11::arg("col")); + cl.def("data", (struct mrpt::math::TPoint3D_ * (mrpt::math::CMatrixDynamic>::*)()) &mrpt::math::CMatrixDynamic>::data, "C++: mrpt::math::CMatrixDynamic>::data() --> struct mrpt::math::TPoint3D_ *", pybind11::return_value_policy::automatic); +- cl.def("__call__", (struct mrpt::math::TPoint3D_ & (mrpt::math::CMatrixDynamic>::*)(size_t, size_t)) &mrpt::math::CMatrixDynamic>::operator(), "C++: mrpt::math::CMatrixDynamic>::operator()(size_t, size_t) --> struct mrpt::math::TPoint3D_ &", pybind11::return_value_policy::automatic, pybind11::arg("row"), pybind11::arg("col")); +- cl.def("__getitem__", (struct mrpt::math::TPoint3D_ & (mrpt::math::CMatrixDynamic>::*)(size_t)) &mrpt::math::CMatrixDynamic>::operator[], "C++: mrpt::math::CMatrixDynamic>::operator[](size_t) --> struct mrpt::math::TPoint3D_ &", pybind11::return_value_policy::automatic, pybind11::arg("ith")); ++ cl.def("__call__", (struct mrpt::math::TPoint3D_ & (mrpt::math::CMatrixDynamic>::*)(size_t, size_t)) &mrpt::math::CMatrixDynamic>::operator(), "C++: mrpt::math::CMatrixDynamic>::operator()(size_t, size_t) --> struct mrpt::math::TPoint3D_ &", pybind11::return_value_policy::reference, pybind11::arg("row"), pybind11::arg("col")); ++ cl.def("__getitem__", (struct mrpt::math::TPoint3D_ & (mrpt::math::CMatrixDynamic>::*)(size_t)) &mrpt::math::CMatrixDynamic>::operator[], "C++: mrpt::math::CMatrixDynamic>::operator[](size_t) --> struct mrpt::math::TPoint3D_ &", pybind11::return_value_policy::reference, pybind11::arg("ith")); + cl.def("cast_float", (class mrpt::math::CMatrixDynamic (mrpt::math::CMatrixDynamic>::*)() const) &mrpt::math::CMatrixDynamic>::cast_float, "C++: mrpt::math::CMatrixDynamic>::cast_float() const --> class mrpt::math::CMatrixDynamic"); + cl.def("cast_double", (class mrpt::math::CMatrixDynamic (mrpt::math::CMatrixDynamic>::*)() const) &mrpt::math::CMatrixDynamic>::cast_double, "C++: mrpt::math::CMatrixDynamic>::cast_double() const --> class mrpt::math::CMatrixDynamic"); + } +@@ -73,9 +73,9 @@ void bind_mrpt_math_CMatrixDynamic_1(std::function< pybind11::module &(std::stri + cl.def("rows", (int (mrpt::math::CMatrixFixed::*)() const) &mrpt::math::CMatrixFixed::rows, "C++: mrpt::math::CMatrixFixed::rows() const --> int"); + cl.def("cols", (int (mrpt::math::CMatrixFixed::*)() const) &mrpt::math::CMatrixFixed::cols, "C++: mrpt::math::CMatrixFixed::cols() const --> int"); + cl.def("data", (double * (mrpt::math::CMatrixFixed::*)()) &mrpt::math::CMatrixFixed::data, "C++: mrpt::math::CMatrixFixed::data() --> double *", pybind11::return_value_policy::automatic); +- cl.def("__call__", (double & (mrpt::math::CMatrixFixed::*)(int, int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int, int) --> double &", pybind11::return_value_policy::automatic, pybind11::arg("row"), pybind11::arg("col")); +- cl.def("__call__", (double & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int) --> double &", pybind11::return_value_policy::automatic, pybind11::arg("i")); +- cl.def("__getitem__", (double & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator[], "C++: mrpt::math::CMatrixFixed::operator[](int) --> double &", pybind11::return_value_policy::automatic, pybind11::arg("i")); ++ cl.def("__call__", (double & (mrpt::math::CMatrixFixed::*)(int, int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int, int) --> double &", pybind11::return_value_policy::reference, pybind11::arg("row"), pybind11::arg("col")); ++ cl.def("__call__", (double & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int) --> double &", pybind11::return_value_policy::reference, pybind11::arg("i")); ++ cl.def("__getitem__", (double & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator[], "C++: mrpt::math::CMatrixFixed::operator[](int) --> double &", pybind11::return_value_policy::reference, pybind11::arg("i")); + cl.def("sum_At", (void (mrpt::math::CMatrixFixed::*)(const class mrpt::math::CMatrixFixed &)) &mrpt::math::CMatrixFixed::sum_At, "C++: mrpt::math::CMatrixFixed::sum_At(const class mrpt::math::CMatrixFixed &) --> void", pybind11::arg("A")); + cl.def("assign", (class mrpt::math::CMatrixFixed & (mrpt::math::CMatrixFixed::*)(const class mrpt::math::CMatrixFixed &)) &mrpt::math::CMatrixFixed::operator=, "C++: mrpt::math::CMatrixFixed::operator=(const class mrpt::math::CMatrixFixed &) --> class mrpt::math::CMatrixFixed &", pybind11::return_value_policy::automatic, pybind11::arg("")); + } +@@ -99,11 +99,23 @@ void bind_mrpt_math_CMatrixDynamic_1(std::function< pybind11::module &(std::stri + cl.def("rows", (int (mrpt::math::CMatrixFixed::*)() const) &mrpt::math::CMatrixFixed::rows, "C++: mrpt::math::CMatrixFixed::rows() const --> int"); + cl.def("cols", (int (mrpt::math::CMatrixFixed::*)() const) &mrpt::math::CMatrixFixed::cols, "C++: mrpt::math::CMatrixFixed::cols() const --> int"); + cl.def("data", (double * (mrpt::math::CMatrixFixed::*)()) &mrpt::math::CMatrixFixed::data, "C++: mrpt::math::CMatrixFixed::data() --> double *", pybind11::return_value_policy::automatic); +- cl.def("__call__", (double & (mrpt::math::CMatrixFixed::*)(int, int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int, int) --> double &", pybind11::return_value_policy::automatic, pybind11::arg("row"), pybind11::arg("col")); +- cl.def("__call__", (double & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int) --> double &", pybind11::return_value_policy::automatic, pybind11::arg("i")); +- cl.def("__getitem__", (double & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator[], "C++: mrpt::math::CMatrixFixed::operator[](int) --> double &", pybind11::return_value_policy::automatic, pybind11::arg("i")); ++ cl.def("__call__", (double & (mrpt::math::CMatrixFixed::*)(int, int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int, int) --> double &", pybind11::return_value_policy::reference, pybind11::arg("row"), pybind11::arg("col")); ++ cl.def("__call__", (double & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int) --> double &", pybind11::return_value_policy::reference, pybind11::arg("i")); + cl.def("cast_float", (class mrpt::math::CMatrixFixed (mrpt::math::CMatrixFixed::*)() const) &mrpt::math::CMatrixFixed::cast_float, "C++: mrpt::math::CMatrixFixed::cast_float() const --> class mrpt::math::CMatrixFixed"); + cl.def("sum_At", (void (mrpt::math::CMatrixFixed::*)(const class mrpt::math::CMatrixFixed &)) &mrpt::math::CMatrixFixed::sum_At, "C++: mrpt::math::CMatrixFixed::sum_At(const class mrpt::math::CMatrixFixed &) --> void", pybind11::arg("A")); + cl.def("assign", (class mrpt::math::CMatrixFixed & (mrpt::math::CMatrixFixed::*)(const class mrpt::math::CMatrixFixed &)) &mrpt::math::CMatrixFixed::operator=, "C++: mrpt::math::CMatrixFixed::operator=(const class mrpt::math::CMatrixFixed &) --> class mrpt::math::CMatrixFixed &", pybind11::return_value_policy::automatic, pybind11::arg("")); ++ ++ // Manually-added matrix methods: ++ using dat_t = double; ++ using mat_t = mrpt::math::CMatrixFixed; ++ cl.def("__getitem__", [](const mat_t&self, pybind11::tuple coord) -> dat_t { if (coord.size()==2) return self.coeff(coord[0].cast(), coord[1].cast()); else if (coord.size()==1) return self[coord[0].cast()]; else throw std::invalid_argument("Access with [idx] or [row,col]"); }); ++ cl.def("__setitem__", [](mat_t&self, pybind11::tuple coord, dat_t val) { if (coord.size()==2) self.coeffRef(coord[0].cast(), coord[1].cast())=val; else if (coord.size()==1) self[coord[0].cast()]=val; else throw std::invalid_argument("Access with [idx] or [row,col]"); }); ++ cl.def("__str__", [](const mat_t& o) -> std::string { return o.asString(); } ); ++ cl.def("inMatlabFormat", [](const mat_t& o) -> std::string { return o.inMatlabFormat(); } ); ++ cl.def("size", [](const mat_t&self) -> pybind11::tuple { return pybind11::make_tuple(self.cols(),self.rows()); }); ++ cl.def_static("Identity", []() -> mat_t { return mat_t::Identity(); }, "Returns the NxN identity matrix"); ++ cl.def_static("Zero", []() -> mat_t { return mat_t::Zero(); }, "Returns a matrix with zeroes"); ++ cl.def(pybind11::init( [](pybind11::list vals){ auto m = new mat_t(); const auto nR = vals.size(); if (!nR) return m; const auto nC = vals[0].cast().size(); m->setSize(nR,nC); for (size_t r=0;r(); for (size_t c=0;ccoeffRef(r,c) = row[c].cast(); } return m; })); ++ cl.def("to_list", [](const mat_t&self) -> pybind11::list { auto l = pybind11::list(); const auto nR = self.rows(), nC = self.cols(); for (size_t r=0;r & (mrpt::math::CMatrixDynamic::*)()) &mrpt::math::CMatrixDynamic::derived, "C++: mrpt::math::CMatrixDynamic::derived() --> class mrpt::math::CMatrixDynamic &", pybind11::return_value_policy::automatic); cl.def("conservativeResize", (void (mrpt::math::CMatrixDynamic::*)(size_t, size_t)) &mrpt::math::CMatrixDynamic::conservativeResize, "C++: mrpt::math::CMatrixDynamic::conservativeResize(size_t, size_t) --> void", pybind11::arg("row"), pybind11::arg("col")); cl.def("data", (double * (mrpt::math::CMatrixDynamic::*)()) &mrpt::math::CMatrixDynamic::data, "C++: mrpt::math::CMatrixDynamic::data() --> double *", pybind11::return_value_policy::automatic); - cl.def("__call__", (double & (mrpt::math::CMatrixDynamic::*)(size_t, size_t)) &mrpt::math::CMatrixDynamic::operator(), "C++: mrpt::math::CMatrixDynamic::operator()(size_t, size_t) --> double &", pybind11::return_value_policy::reference, pybind11::arg("row"), pybind11::arg("col")); -- cl.def("__getitem__", (double & (mrpt::math::CMatrixDynamic::*)(size_t)) &mrpt::math::CMatrixDynamic::operator[], "C++: mrpt::math::CMatrixDynamic::operator[](size_t) --> double &", pybind11::return_value_policy::reference, pybind11::arg("ith")); +- cl.def("__call__", (double & (mrpt::math::CMatrixDynamic::*)(size_t, size_t)) &mrpt::math::CMatrixDynamic::operator(), "C++: mrpt::math::CMatrixDynamic::operator()(size_t, size_t) --> double &", pybind11::return_value_policy::automatic, pybind11::arg("row"), pybind11::arg("col")); +- cl.def("__getitem__", (double & (mrpt::math::CMatrixDynamic::*)(size_t)) &mrpt::math::CMatrixDynamic::operator[], "C++: mrpt::math::CMatrixDynamic::operator[](size_t) --> double &", pybind11::return_value_policy::automatic, pybind11::arg("ith")); ++ cl.def("__call__", (double & (mrpt::math::CMatrixDynamic::*)(size_t, size_t)) &mrpt::math::CMatrixDynamic::operator(), "C++: mrpt::math::CMatrixDynamic::operator()(size_t, size_t) --> double &", pybind11::return_value_policy::reference, pybind11::arg("row"), pybind11::arg("col")); cl.def("cast_float", (class mrpt::math::CMatrixDynamic (mrpt::math::CMatrixDynamic::*)() const) &mrpt::math::CMatrixDynamic::cast_float, "C++: mrpt::math::CMatrixDynamic::cast_float() const --> class mrpt::math::CMatrixDynamic"); cl.def("cast_double", (class mrpt::math::CMatrixDynamic (mrpt::math::CMatrixDynamic::*)() const) &mrpt::math::CMatrixDynamic::cast_double, "C++: mrpt::math::CMatrixDynamic::cast_double() const --> class mrpt::math::CMatrixDynamic"); cl.def("llt_solve", (class mrpt::math::CVectorDynamic (mrpt::math::CMatrixDynamic::*)(const class mrpt::math::CVectorDynamic &) const) &mrpt::math::CMatrixDynamic::llt_solve, "C++: mrpt::math::CMatrixDynamic::llt_solve(const class mrpt::math::CVectorDynamic &) const --> class mrpt::math::CVectorDynamic", pybind11::arg("b")); @@ -54,41 +134,21 @@ index 7eae41c0a..70f933be5 100644 + cl.def(pybind11::init( [](pybind11::list vals){ auto m = new mat_t(); const auto nR = vals.size(); if (!nR) return m; const auto nC = vals[0].cast().size(); m->setSize(nR,nC); for (size_t r=0;r(); for (size_t c=0;ccoeffRef(r,c) = row[c].cast(); } return m; })); + cl.def("to_list", [](const mat_t&self) -> pybind11::list { auto l = pybind11::list(); const auto nR = self.rows(), nC = self.cols(); for (size_t r=0;r>, std::shared_ptr>>, mrpt::math::MatrixBase,mrpt::math::CMatrixDynamic >>> cl(M("mrpt::math"), "CMatrixDynamic_mrpt_math_TPoint3D_float_t", ""); + { // mrpt::math::CMatrixD file:mrpt/math/CMatrixD.h line:23 + pybind11::class_, PyCallBack_mrpt_math_CMatrixD, mrpt::serialization::CSerializable, mrpt::math::CMatrixDynamic> cl(M("mrpt::math"), "CMatrixD", "This class is a \"CSerializable\" wrapper for\n \"CMatrixDynamic\".\n \n\n For a complete introduction to Matrices and vectors in MRPT, see:\n https://www.mrpt.org/Matrices_vectors_arrays_and_Linear_Algebra_MRPT_and_Eigen_classes\n \n\n\n "); diff --git a/python/src/mrpt/math/CMatrixFixed.cpp b/python/src/mrpt/math/CMatrixFixed.cpp -index 342ed0569..877ac0cb4 100644 +index a9ec794ef..2168c4bf9 100644 --- a/python/src/mrpt/math/CMatrixFixed.cpp +++ b/python/src/mrpt/math/CMatrixFixed.cpp -@@ -66,10 +66,22 @@ void bind_mrpt_math_CMatrixFixed(std::function< pybind11::module &(std::string c - cl.def("data", (double * (mrpt::math::CMatrixFixed::*)()) &mrpt::math::CMatrixFixed::data, "C++: mrpt::math::CMatrixFixed::data() --> double *", pybind11::return_value_policy::automatic); - cl.def("__call__", (double & (mrpt::math::CMatrixFixed::*)(int, int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int, int) --> double &", pybind11::return_value_policy::reference, pybind11::arg("row"), pybind11::arg("col")); - cl.def("__call__", (double & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int) --> double &", pybind11::return_value_policy::reference, pybind11::arg("i")); -- cl.def("__getitem__", (double & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator[], "C++: mrpt::math::CMatrixFixed::operator[](int) --> double &", pybind11::return_value_policy::reference, pybind11::arg("i")); - cl.def("cast_float", (class mrpt::math::CMatrixFixed (mrpt::math::CMatrixFixed::*)() const) &mrpt::math::CMatrixFixed::cast_float, "C++: mrpt::math::CMatrixFixed::cast_float() const --> class mrpt::math::CMatrixFixed"); - cl.def("sum_At", (void (mrpt::math::CMatrixFixed::*)(const class mrpt::math::CMatrixFixed &)) &mrpt::math::CMatrixFixed::sum_At, "C++: mrpt::math::CMatrixFixed::sum_At(const class mrpt::math::CMatrixFixed &) --> void", pybind11::arg("A")); - cl.def("assign", (class mrpt::math::CMatrixFixed & (mrpt::math::CMatrixFixed::*)(const class mrpt::math::CMatrixFixed &)) &mrpt::math::CMatrixFixed::operator=, "C++: mrpt::math::CMatrixFixed::operator=(const class mrpt::math::CMatrixFixed &) --> class mrpt::math::CMatrixFixed &", pybind11::return_value_policy::automatic, pybind11::arg("")); -+ -+ // Manually-added matrix methods: -+ using dat_t = double; -+ using mat_t = mrpt::math::CMatrixFixed; -+ cl.def("__getitem__", [](const mat_t&self, pybind11::tuple coord) -> dat_t { if (coord.size()==2) return self.coeff(coord[0].cast(), coord[1].cast()); else if (coord.size()==1) return self[coord[0].cast()]; else throw std::invalid_argument("Access with [idx] or [row,col]"); }); -+ cl.def("__setitem__", [](mat_t&self, pybind11::tuple coord, dat_t val) { if (coord.size()==2) self.coeffRef(coord[0].cast(), coord[1].cast())=val; else if (coord.size()==1) self[coord[0].cast()]=val; else throw std::invalid_argument("Access with [idx] or [row,col]"); }); -+ cl.def("__str__", [](const mat_t& o) -> std::string { return o.asString(); } ); -+ cl.def("inMatlabFormat", [](const mat_t& o) -> std::string { return o.inMatlabFormat(); } ); -+ cl.def("size", [](const mat_t&self) -> pybind11::tuple { return pybind11::make_tuple(self.cols(),self.rows()); }); -+ cl.def_static("Identity", []() -> mat_t { return mat_t::Identity(); }, "Returns the NxN identity matrix"); -+ cl.def_static("Zero", []() -> mat_t { return mat_t::Zero(); }, "Returns a matrix with zeroes"); -+ cl.def(pybind11::init( [](pybind11::list vals){ auto m = new mat_t(); const auto nR = vals.size(); if (!nR) return m; const auto nC = vals[0].cast().size(); m->setSize(nR,nC); for (size_t r=0;r(); for (size_t c=0;ccoeffRef(r,c) = row[c].cast(); } return m; })); -+ cl.def("to_list", [](const mat_t&self) -> pybind11::list { auto l = pybind11::list(); const auto nR = self.rows(), nC = self.cols(); for (size_t r=0;r, std::shared_ptr>> cl(M("mrpt::math"), "CMatrixFixed_double_4UL_4UL_t", ""); -@@ -93,10 +105,22 @@ void bind_mrpt_math_CMatrixFixed(std::function< pybind11::module &(std::string c +@@ -38,12 +38,24 @@ void bind_mrpt_math_CMatrixFixed(std::function< pybind11::module &(std::string c + cl.def("rows", (int (mrpt::math::CMatrixFixed::*)() const) &mrpt::math::CMatrixFixed::rows, "C++: mrpt::math::CMatrixFixed::rows() const --> int"); + cl.def("cols", (int (mrpt::math::CMatrixFixed::*)() const) &mrpt::math::CMatrixFixed::cols, "C++: mrpt::math::CMatrixFixed::cols() const --> int"); cl.def("data", (double * (mrpt::math::CMatrixFixed::*)()) &mrpt::math::CMatrixFixed::data, "C++: mrpt::math::CMatrixFixed::data() --> double *", pybind11::return_value_policy::automatic); - cl.def("__call__", (double & (mrpt::math::CMatrixFixed::*)(int, int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int, int) --> double &", pybind11::return_value_policy::reference, pybind11::arg("row"), pybind11::arg("col")); - cl.def("__call__", (double & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int) --> double &", pybind11::return_value_policy::reference, pybind11::arg("i")); -- cl.def("__getitem__", (double & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator[], "C++: mrpt::math::CMatrixFixed::operator[](int) --> double &", pybind11::return_value_policy::reference, pybind11::arg("i")); +- cl.def("__call__", (double & (mrpt::math::CMatrixFixed::*)(int, int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int, int) --> double &", pybind11::return_value_policy::automatic, pybind11::arg("row"), pybind11::arg("col")); +- cl.def("__call__", (double & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int) --> double &", pybind11::return_value_policy::automatic, pybind11::arg("i")); +- cl.def("__getitem__", (double & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator[], "C++: mrpt::math::CMatrixFixed::operator[](int) --> double &", pybind11::return_value_policy::automatic, pybind11::arg("i")); ++ cl.def("__call__", (double & (mrpt::math::CMatrixFixed::*)(int, int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int, int) --> double &", pybind11::return_value_policy::reference, pybind11::arg("row"), pybind11::arg("col")); ++ cl.def("__call__", (double & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int) --> double &", pybind11::return_value_policy::reference, pybind11::arg("i")); cl.def("cast_float", (class mrpt::math::CMatrixFixed (mrpt::math::CMatrixFixed::*)() const) &mrpt::math::CMatrixFixed::cast_float, "C++: mrpt::math::CMatrixFixed::cast_float() const --> class mrpt::math::CMatrixFixed"); cl.def("sum_At", (void (mrpt::math::CMatrixFixed::*)(const class mrpt::math::CMatrixFixed &)) &mrpt::math::CMatrixFixed::sum_At, "C++: mrpt::math::CMatrixFixed::sum_At(const class mrpt::math::CMatrixFixed &) --> void", pybind11::arg("A")); cl.def("assign", (class mrpt::math::CMatrixFixed & (mrpt::math::CMatrixFixed::*)(const class mrpt::math::CMatrixFixed &)) &mrpt::math::CMatrixFixed::operator=, "C++: mrpt::math::CMatrixFixed::operator=(const class mrpt::math::CMatrixFixed &) --> class mrpt::math::CMatrixFixed &", pybind11::return_value_policy::automatic, pybind11::arg("")); @@ -108,11 +168,15 @@ index 342ed0569..877ac0cb4 100644 } { // mrpt::math::CMatrixFixed file:mrpt/math/CMatrixFixed.h line:34 pybind11::class_, std::shared_ptr>> cl(M("mrpt::math"), "CMatrixFixed_double_6UL_6UL_t", ""); -@@ -120,8 +144,21 @@ void bind_mrpt_math_CMatrixFixed(std::function< pybind11::module &(std::string c +@@ -65,11 +77,23 @@ void bind_mrpt_math_CMatrixFixed(std::function< pybind11::module &(std::string c + cl.def("rows", (int (mrpt::math::CMatrixFixed::*)() const) &mrpt::math::CMatrixFixed::rows, "C++: mrpt::math::CMatrixFixed::rows() const --> int"); + cl.def("cols", (int (mrpt::math::CMatrixFixed::*)() const) &mrpt::math::CMatrixFixed::cols, "C++: mrpt::math::CMatrixFixed::cols() const --> int"); cl.def("data", (double * (mrpt::math::CMatrixFixed::*)()) &mrpt::math::CMatrixFixed::data, "C++: mrpt::math::CMatrixFixed::data() --> double *", pybind11::return_value_policy::automatic); - cl.def("__call__", (double & (mrpt::math::CMatrixFixed::*)(int, int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int, int) --> double &", pybind11::return_value_policy::reference, pybind11::arg("row"), pybind11::arg("col")); - cl.def("__call__", (double & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int) --> double &", pybind11::return_value_policy::reference, pybind11::arg("i")); -- cl.def("__getitem__", (double & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator[], "C++: mrpt::math::CMatrixFixed::operator[](int) --> double &", pybind11::return_value_policy::reference, pybind11::arg("i")); +- cl.def("__call__", (double & (mrpt::math::CMatrixFixed::*)(int, int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int, int) --> double &", pybind11::return_value_policy::automatic, pybind11::arg("row"), pybind11::arg("col")); +- cl.def("__call__", (double & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int) --> double &", pybind11::return_value_policy::automatic, pybind11::arg("i")); +- cl.def("__getitem__", (double & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator[], "C++: mrpt::math::CMatrixFixed::operator[](int) --> double &", pybind11::return_value_policy::automatic, pybind11::arg("i")); ++ cl.def("__call__", (double & (mrpt::math::CMatrixFixed::*)(int, int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int, int) --> double &", pybind11::return_value_policy::reference, pybind11::arg("row"), pybind11::arg("col")); ++ cl.def("__call__", (double & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int) --> double &", pybind11::return_value_policy::reference, pybind11::arg("i")); cl.def("sum_At", (void (mrpt::math::CMatrixFixed::*)(const class mrpt::math::CMatrixFixed &)) &mrpt::math::CMatrixFixed::sum_At, "C++: mrpt::math::CMatrixFixed::sum_At(const class mrpt::math::CMatrixFixed &) --> void", pybind11::arg("A")); cl.def("assign", (class mrpt::math::CMatrixFixed & (mrpt::math::CMatrixFixed::*)(const class mrpt::math::CMatrixFixed &)) &mrpt::math::CMatrixFixed::operator=, "C++: mrpt::math::CMatrixFixed::operator=(const class mrpt::math::CMatrixFixed &) --> class mrpt::math::CMatrixFixed &", pybind11::return_value_policy::automatic, pybind11::arg("")); + @@ -128,18 +192,31 @@ index 342ed0569..877ac0cb4 100644 + cl.def_static("Zero", []() -> mat_t { return mat_t::Zero(); }, "Returns a matrix with zeroes"); + cl.def(pybind11::init( [](pybind11::list vals){ auto m = new mat_t(); const auto nR = vals.size(); if (!nR) return m; const auto nC = vals[0].cast().size(); m->setSize(nR,nC); for (size_t r=0;r(); for (size_t c=0;ccoeffRef(r,c) = row[c].cast(); } return m; })); + cl.def("to_list", [](const mat_t&self) -> pybind11::list { auto l = pybind11::list(); const auto nR = self.rows(), nC = self.cols(); for (size_t r=0;r, std::shared_ptr>> cl(M("mrpt::math"), "CMatrixFixed_double_7UL_7UL_t", ""); +@@ -91,9 +115,9 @@ void bind_mrpt_math_CMatrixFixed(std::function< pybind11::module &(std::string c + cl.def("rows", (int (mrpt::math::CMatrixFixed::*)() const) &mrpt::math::CMatrixFixed::rows, "C++: mrpt::math::CMatrixFixed::rows() const --> int"); + cl.def("cols", (int (mrpt::math::CMatrixFixed::*)() const) &mrpt::math::CMatrixFixed::cols, "C++: mrpt::math::CMatrixFixed::cols() const --> int"); + cl.def("data", (double * (mrpt::math::CMatrixFixed::*)()) &mrpt::math::CMatrixFixed::data, "C++: mrpt::math::CMatrixFixed::data() --> double *", pybind11::return_value_policy::automatic); +- cl.def("__call__", (double & (mrpt::math::CMatrixFixed::*)(int, int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int, int) --> double &", pybind11::return_value_policy::automatic, pybind11::arg("row"), pybind11::arg("col")); +- cl.def("__call__", (double & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int) --> double &", pybind11::return_value_policy::automatic, pybind11::arg("i")); +- cl.def("__getitem__", (double & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator[], "C++: mrpt::math::CMatrixFixed::operator[](int) --> double &", pybind11::return_value_policy::automatic, pybind11::arg("i")); ++ cl.def("__call__", (double & (mrpt::math::CMatrixFixed::*)(int, int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int, int) --> double &", pybind11::return_value_policy::reference, pybind11::arg("row"), pybind11::arg("col")); ++ cl.def("__call__", (double & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int) --> double &", pybind11::return_value_policy::reference, pybind11::arg("i")); ++ cl.def("__getitem__", (double & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator[], "C++: mrpt::math::CMatrixFixed::operator[](int) --> double &", pybind11::return_value_policy::reference, pybind11::arg("i")); + cl.def("sum_At", (void (mrpt::math::CMatrixFixed::*)(const class mrpt::math::CMatrixFixed &)) &mrpt::math::CMatrixFixed::sum_At, "C++: mrpt::math::CMatrixFixed::sum_At(const class mrpt::math::CMatrixFixed &) --> void", pybind11::arg("A")); + cl.def("assign", (class mrpt::math::CMatrixFixed & (mrpt::math::CMatrixFixed::*)(const class mrpt::math::CMatrixFixed &)) &mrpt::math::CMatrixFixed::operator=, "C++: mrpt::math::CMatrixFixed::operator=(const class mrpt::math::CMatrixFixed &) --> class mrpt::math::CMatrixFixed &", pybind11::return_value_policy::automatic, pybind11::arg("")); + } +@@ -117,11 +141,22 @@ void bind_mrpt_math_CMatrixFixed(std::function< pybind11::module &(std::string c + cl.def("rows", (int (mrpt::math::CMatrixFixed::*)() const) &mrpt::math::CMatrixFixed::rows, "C++: mrpt::math::CMatrixFixed::rows() const --> int"); + cl.def("cols", (int (mrpt::math::CMatrixFixed::*)() const) &mrpt::math::CMatrixFixed::cols, "C++: mrpt::math::CMatrixFixed::cols() const --> int"); cl.def("data", (double * (mrpt::math::CMatrixFixed::*)()) &mrpt::math::CMatrixFixed::data, "C++: mrpt::math::CMatrixFixed::data() --> double *", pybind11::return_value_policy::automatic); - cl.def("__call__", (double & (mrpt::math::CMatrixFixed::*)(int, int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int, int) --> double &", pybind11::return_value_policy::reference, pybind11::arg("row"), pybind11::arg("col")); - cl.def("__call__", (double & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int) --> double &", pybind11::return_value_policy::reference, pybind11::arg("i")); -- cl.def("__getitem__", (double & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator[], "C++: mrpt::math::CMatrixFixed::operator[](int) --> double &", pybind11::return_value_policy::reference, pybind11::arg("i")); +- cl.def("__call__", (double & (mrpt::math::CMatrixFixed::*)(int, int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int, int) --> double &", pybind11::return_value_policy::automatic, pybind11::arg("row"), pybind11::arg("col")); +- cl.def("__call__", (double & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int) --> double &", pybind11::return_value_policy::automatic, pybind11::arg("i")); +- cl.def("__getitem__", (double & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator[], "C++: mrpt::math::CMatrixFixed::operator[](int) --> double &", pybind11::return_value_policy::automatic, pybind11::arg("i")); ++ cl.def("__call__", (double & (mrpt::math::CMatrixFixed::*)(int, int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int, int) --> double &", pybind11::return_value_policy::reference, pybind11::arg("row"), pybind11::arg("col")); ++ cl.def("__call__", (double & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int) --> double &", pybind11::return_value_policy::reference, pybind11::arg("i")); cl.def("cast_float", (class mrpt::math::CMatrixFixed (mrpt::math::CMatrixFixed::*)() const) &mrpt::math::CMatrixFixed::cast_float, "C++: mrpt::math::CMatrixFixed::cast_float() const --> class mrpt::math::CMatrixFixed"); cl.def("sum_At", (void (mrpt::math::CMatrixFixed::*)(const class mrpt::math::CMatrixFixed &)) &mrpt::math::CMatrixFixed::sum_At, "C++: mrpt::math::CMatrixFixed::sum_At(const class mrpt::math::CMatrixFixed &) --> void", pybind11::arg("A")); cl.def("assign", (class mrpt::math::CMatrixFixed & (mrpt::math::CMatrixFixed::*)(const class mrpt::math::CMatrixFixed &)) &mrpt::math::CMatrixFixed::operator=, "C++: mrpt::math::CMatrixFixed::operator=(const class mrpt::math::CMatrixFixed &) --> class mrpt::math::CMatrixFixed &", pybind11::return_value_policy::automatic, pybind11::arg("")); @@ -156,17 +233,89 @@ index c0eee45ec..9e7db6b2b 100644 + cl.def(pybind11::init( [](pybind11::list vals){ auto m = new mat_t(); const auto nR = vals.size(); if (!nR) return m; const auto nC = vals[0].cast().size(); m->setSize(nR,nC); for (size_t r=0;r(); for (size_t c=0;ccoeffRef(r,c) = row[c].cast(); } return m; })); + cl.def("to_list", [](const mat_t&self) -> pybind11::list { auto l = pybind11::list(); const auto nR = self.rows(), nC = self.cols(); for (size_t r=0;r::*)() const) &mrpt::math::CMatrixFixed::rows, "C++: mrpt::math::CMatrixFixed::rows() const --> int"); + cl.def("cols", (int (mrpt::math::CMatrixFixed::*)() const) &mrpt::math::CMatrixFixed::cols, "C++: mrpt::math::CMatrixFixed::cols() const --> int"); + cl.def("data", (double * (mrpt::math::CMatrixFixed::*)()) &mrpt::math::CMatrixFixed::data, "C++: mrpt::math::CMatrixFixed::data() --> double *", pybind11::return_value_policy::automatic); +- cl.def("__call__", (double & (mrpt::math::CMatrixFixed::*)(int, int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int, int) --> double &", pybind11::return_value_policy::automatic, pybind11::arg("row"), pybind11::arg("col")); +- cl.def("__call__", (double & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int) --> double &", pybind11::return_value_policy::automatic, pybind11::arg("i")); +- cl.def("__getitem__", (double & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator[], "C++: mrpt::math::CMatrixFixed::operator[](int) --> double &", pybind11::return_value_policy::automatic, pybind11::arg("i")); ++ cl.def("__call__", (double & (mrpt::math::CMatrixFixed::*)(int, int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int, int) --> double &", pybind11::return_value_policy::reference, pybind11::arg("row"), pybind11::arg("col")); ++ cl.def("__call__", (double & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int) --> double &", pybind11::return_value_policy::reference, pybind11::arg("i")); ++ cl.def("__getitem__", (double & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator[], "C++: mrpt::math::CMatrixFixed::operator[](int) --> double &", pybind11::return_value_policy::reference, pybind11::arg("i")); + cl.def("sum_At", (void (mrpt::math::CMatrixFixed::*)(const class mrpt::math::CMatrixFixed &)) &mrpt::math::CMatrixFixed::sum_At, "C++: mrpt::math::CMatrixFixed::sum_At(const class mrpt::math::CMatrixFixed &) --> void", pybind11::arg("A")); + } + { // mrpt::math::CMatrixFixed file:mrpt/math/CMatrixFixed.h line:34 +@@ -63,9 +63,9 @@ void bind_mrpt_math_CMatrixFixed_1(std::function< pybind11::module &(std::string + cl.def("rows", (int (mrpt::math::CMatrixFixed::*)() const) &mrpt::math::CMatrixFixed::rows, "C++: mrpt::math::CMatrixFixed::rows() const --> int"); + cl.def("cols", (int (mrpt::math::CMatrixFixed::*)() const) &mrpt::math::CMatrixFixed::cols, "C++: mrpt::math::CMatrixFixed::cols() const --> int"); + cl.def("data", (double * (mrpt::math::CMatrixFixed::*)()) &mrpt::math::CMatrixFixed::data, "C++: mrpt::math::CMatrixFixed::data() --> double *", pybind11::return_value_policy::automatic); +- cl.def("__call__", (double & (mrpt::math::CMatrixFixed::*)(int, int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int, int) --> double &", pybind11::return_value_policy::automatic, pybind11::arg("row"), pybind11::arg("col")); +- cl.def("__call__", (double & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int) --> double &", pybind11::return_value_policy::automatic, pybind11::arg("i")); +- cl.def("__getitem__", (double & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator[], "C++: mrpt::math::CMatrixFixed::operator[](int) --> double &", pybind11::return_value_policy::automatic, pybind11::arg("i")); ++ cl.def("__call__", (double & (mrpt::math::CMatrixFixed::*)(int, int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int, int) --> double &", pybind11::return_value_policy::reference, pybind11::arg("row"), pybind11::arg("col")); ++ cl.def("__call__", (double & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int) --> double &", pybind11::return_value_policy::reference, pybind11::arg("i")); ++ cl.def("__getitem__", (double & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator[], "C++: mrpt::math::CMatrixFixed::operator[](int) --> double &", pybind11::return_value_policy::reference, pybind11::arg("i")); + cl.def("sum_At", (void (mrpt::math::CMatrixFixed::*)(const class mrpt::math::CMatrixFixed &)) &mrpt::math::CMatrixFixed::sum_At, "C++: mrpt::math::CMatrixFixed::sum_At(const class mrpt::math::CMatrixFixed &) --> void", pybind11::arg("A")); + } { // mrpt::math::CMatrixFixed file:mrpt/math/CMatrixFixed.h line:34 - pybind11::class_, std::shared_ptr>> cl(M("mrpt::math"), "CMatrixFixed_double_3UL_4UL_t", ""); +@@ -88,9 +88,9 @@ void bind_mrpt_math_CMatrixFixed_1(std::function< pybind11::module &(std::string + cl.def("rows", (int (mrpt::math::CMatrixFixed::*)() const) &mrpt::math::CMatrixFixed::rows, "C++: mrpt::math::CMatrixFixed::rows() const --> int"); + cl.def("cols", (int (mrpt::math::CMatrixFixed::*)() const) &mrpt::math::CMatrixFixed::cols, "C++: mrpt::math::CMatrixFixed::cols() const --> int"); + cl.def("data", (double * (mrpt::math::CMatrixFixed::*)()) &mrpt::math::CMatrixFixed::data, "C++: mrpt::math::CMatrixFixed::data() --> double *", pybind11::return_value_policy::automatic); +- cl.def("__call__", (double & (mrpt::math::CMatrixFixed::*)(int, int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int, int) --> double &", pybind11::return_value_policy::automatic, pybind11::arg("row"), pybind11::arg("col")); +- cl.def("__call__", (double & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int) --> double &", pybind11::return_value_policy::automatic, pybind11::arg("i")); +- cl.def("__getitem__", (double & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator[], "C++: mrpt::math::CMatrixFixed::operator[](int) --> double &", pybind11::return_value_policy::automatic, pybind11::arg("i")); ++ cl.def("__call__", (double & (mrpt::math::CMatrixFixed::*)(int, int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int, int) --> double &", pybind11::return_value_policy::reference, pybind11::arg("row"), pybind11::arg("col")); ++ cl.def("__call__", (double & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int) --> double &", pybind11::return_value_policy::reference, pybind11::arg("i")); ++ cl.def("__getitem__", (double & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator[], "C++: mrpt::math::CMatrixFixed::operator[](int) --> double &", pybind11::return_value_policy::reference, pybind11::arg("i")); + cl.def("sum_At", (void (mrpt::math::CMatrixFixed::*)(const class mrpt::math::CMatrixFixed &)) &mrpt::math::CMatrixFixed::sum_At, "C++: mrpt::math::CMatrixFixed::sum_At(const class mrpt::math::CMatrixFixed &) --> void", pybind11::arg("A")); + cl.def("assign", (class mrpt::math::CMatrixFixed & (mrpt::math::CMatrixFixed::*)(const class mrpt::math::CMatrixFixed &)) &mrpt::math::CMatrixFixed::operator=, "C++: mrpt::math::CMatrixFixed::operator=(const class mrpt::math::CMatrixFixed &) --> class mrpt::math::CMatrixFixed &", pybind11::return_value_policy::automatic, pybind11::arg("")); + } +@@ -114,9 +114,9 @@ void bind_mrpt_math_CMatrixFixed_1(std::function< pybind11::module &(std::string + cl.def("rows", (int (mrpt::math::CMatrixFixed::*)() const) &mrpt::math::CMatrixFixed::rows, "C++: mrpt::math::CMatrixFixed::rows() const --> int"); + cl.def("cols", (int (mrpt::math::CMatrixFixed::*)() const) &mrpt::math::CMatrixFixed::cols, "C++: mrpt::math::CMatrixFixed::cols() const --> int"); + cl.def("data", (double * (mrpt::math::CMatrixFixed::*)()) &mrpt::math::CMatrixFixed::data, "C++: mrpt::math::CMatrixFixed::data() --> double *", pybind11::return_value_policy::automatic); +- cl.def("__call__", (double & (mrpt::math::CMatrixFixed::*)(int, int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int, int) --> double &", pybind11::return_value_policy::automatic, pybind11::arg("row"), pybind11::arg("col")); +- cl.def("__call__", (double & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int) --> double &", pybind11::return_value_policy::automatic, pybind11::arg("i")); +- cl.def("__getitem__", (double & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator[], "C++: mrpt::math::CMatrixFixed::operator[](int) --> double &", pybind11::return_value_policy::automatic, pybind11::arg("i")); ++ cl.def("__call__", (double & (mrpt::math::CMatrixFixed::*)(int, int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int, int) --> double &", pybind11::return_value_policy::reference, pybind11::arg("row"), pybind11::arg("col")); ++ cl.def("__call__", (double & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int) --> double &", pybind11::return_value_policy::reference, pybind11::arg("i")); ++ cl.def("__getitem__", (double & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator[], "C++: mrpt::math::CMatrixFixed::operator[](int) --> double &", pybind11::return_value_policy::reference, pybind11::arg("i")); + cl.def("sum_At", (void (mrpt::math::CMatrixFixed::*)(const class mrpt::math::CMatrixFixed &)) &mrpt::math::CMatrixFixed::sum_At, "C++: mrpt::math::CMatrixFixed::sum_At(const class mrpt::math::CMatrixFixed &) --> void", pybind11::arg("A")); + } + } diff --git a/python/src/mrpt/math/CMatrixFixed_2.cpp b/python/src/mrpt/math/CMatrixFixed_2.cpp -index f8bc51568..88d8935ca 100644 +index 4cfc7c55d..2f75fb4ea 100644 --- a/python/src/mrpt/math/CMatrixFixed_2.cpp +++ b/python/src/mrpt/math/CMatrixFixed_2.cpp -@@ -116,9 +116,20 @@ void bind_mrpt_math_CMatrixFixed_2(std::function< pybind11::module &(std::string +@@ -38,9 +38,9 @@ void bind_mrpt_math_CMatrixFixed_2(std::function< pybind11::module &(std::string + cl.def("rows", (int (mrpt::math::CMatrixFixed::*)() const) &mrpt::math::CMatrixFixed::rows, "C++: mrpt::math::CMatrixFixed::rows() const --> int"); + cl.def("cols", (int (mrpt::math::CMatrixFixed::*)() const) &mrpt::math::CMatrixFixed::cols, "C++: mrpt::math::CMatrixFixed::cols() const --> int"); + cl.def("data", (double * (mrpt::math::CMatrixFixed::*)()) &mrpt::math::CMatrixFixed::data, "C++: mrpt::math::CMatrixFixed::data() --> double *", pybind11::return_value_policy::automatic); +- cl.def("__call__", (double & (mrpt::math::CMatrixFixed::*)(int, int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int, int) --> double &", pybind11::return_value_policy::automatic, pybind11::arg("row"), pybind11::arg("col")); +- cl.def("__call__", (double & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int) --> double &", pybind11::return_value_policy::automatic, pybind11::arg("i")); +- cl.def("__getitem__", (double & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator[], "C++: mrpt::math::CMatrixFixed::operator[](int) --> double &", pybind11::return_value_policy::automatic, pybind11::arg("i")); ++ cl.def("__call__", (double & (mrpt::math::CMatrixFixed::*)(int, int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int, int) --> double &", pybind11::return_value_policy::reference, pybind11::arg("row"), pybind11::arg("col")); ++ cl.def("__call__", (double & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int) --> double &", pybind11::return_value_policy::reference, pybind11::arg("i")); ++ cl.def("__getitem__", (double & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator[], "C++: mrpt::math::CMatrixFixed::operator[](int) --> double &", pybind11::return_value_policy::reference, pybind11::arg("i")); + cl.def("sum_At", (void (mrpt::math::CMatrixFixed::*)(const class mrpt::math::CMatrixFixed &)) &mrpt::math::CMatrixFixed::sum_At, "C++: mrpt::math::CMatrixFixed::sum_At(const class mrpt::math::CMatrixFixed &) --> void", pybind11::arg("A")); + } + { // mrpt::math::CMatrixFixed file:mrpt/math/CMatrixFixed.h line:34 +@@ -63,12 +63,23 @@ void bind_mrpt_math_CMatrixFixed_2(std::function< pybind11::module &(std::string + cl.def("rows", (int (mrpt::math::CMatrixFixed::*)() const) &mrpt::math::CMatrixFixed::rows, "C++: mrpt::math::CMatrixFixed::rows() const --> int"); + cl.def("cols", (int (mrpt::math::CMatrixFixed::*)() const) &mrpt::math::CMatrixFixed::cols, "C++: mrpt::math::CMatrixFixed::cols() const --> int"); cl.def("data", (double * (mrpt::math::CMatrixFixed::*)()) &mrpt::math::CMatrixFixed::data, "C++: mrpt::math::CMatrixFixed::data() --> double *", pybind11::return_value_policy::automatic); - cl.def("__call__", (double & (mrpt::math::CMatrixFixed::*)(int, int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int, int) --> double &", pybind11::return_value_policy::reference, pybind11::arg("row"), pybind11::arg("col")); - cl.def("__call__", (double & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int) --> double &", pybind11::return_value_policy::reference, pybind11::arg("i")); -- cl.def("__getitem__", (double & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator[], "C++: mrpt::math::CMatrixFixed::operator[](int) --> double &", pybind11::return_value_policy::reference, pybind11::arg("i")); +- cl.def("__call__", (double & (mrpt::math::CMatrixFixed::*)(int, int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int, int) --> double &", pybind11::return_value_policy::automatic, pybind11::arg("row"), pybind11::arg("col")); +- cl.def("__call__", (double & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int) --> double &", pybind11::return_value_policy::automatic, pybind11::arg("i")); +- cl.def("__getitem__", (double & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator[], "C++: mrpt::math::CMatrixFixed::operator[](int) --> double &", pybind11::return_value_policy::automatic, pybind11::arg("i")); ++ cl.def("__call__", (double & (mrpt::math::CMatrixFixed::*)(int, int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int, int) --> double &", pybind11::return_value_policy::reference, pybind11::arg("row"), pybind11::arg("col")); ++ cl.def("__call__", (double & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int) --> double &", pybind11::return_value_policy::reference, pybind11::arg("i")); cl.def("cast_float", (class mrpt::math::CMatrixFixed (mrpt::math::CMatrixFixed::*)() const) &mrpt::math::CMatrixFixed::cast_float, "C++: mrpt::math::CMatrixFixed::cast_float() const --> class mrpt::math::CMatrixFixed"); cl.def("sum_At", (void (mrpt::math::CMatrixFixed::*)(const class mrpt::math::CMatrixFixed &)) &mrpt::math::CMatrixFixed::sum_At, "C++: mrpt::math::CMatrixFixed::sum_At(const class mrpt::math::CMatrixFixed &) --> void", pybind11::arg("A")); cl.def("assign", (class mrpt::math::CMatrixFixed & (mrpt::math::CMatrixFixed::*)(const class mrpt::math::CMatrixFixed &)) &mrpt::math::CMatrixFixed::operator=, "C++: mrpt::math::CMatrixFixed::operator=(const class mrpt::math::CMatrixFixed &) --> class mrpt::math::CMatrixFixed &", pybind11::return_value_policy::automatic, pybind11::arg("")); @@ -183,16 +332,30 @@ index f8bc51568..88d8935ca 100644 + cl.def(pybind11::init( [](pybind11::list vals){ auto m = new mat_t(); const auto nR = vals.size(); if (!nR) return m; const auto nC = vals[0].cast().size(); m->setSize(nR,nC); for (size_t r=0;r(); for (size_t c=0;ccoeffRef(r,c) = row[c].cast(); } return m; })); + cl.def("to_list", [](const mat_t&self) -> pybind11::list { auto l = pybind11::list(); const auto nR = self.rows(), nC = self.cols(); for (size_t r=0;r, std::shared_ptr>> cl(M("mrpt::math"), "CMatrixFixed_double_4UL_3UL_t", ""); +@@ -90,9 +101,9 @@ void bind_mrpt_math_CMatrixFixed_2(std::function< pybind11::module &(std::string + cl.def("rows", (int (mrpt::math::CMatrixFixed::*)() const) &mrpt::math::CMatrixFixed::rows, "C++: mrpt::math::CMatrixFixed::rows() const --> int"); + cl.def("cols", (int (mrpt::math::CMatrixFixed::*)() const) &mrpt::math::CMatrixFixed::cols, "C++: mrpt::math::CMatrixFixed::cols() const --> int"); + cl.def("data", (double * (mrpt::math::CMatrixFixed::*)()) &mrpt::math::CMatrixFixed::data, "C++: mrpt::math::CMatrixFixed::data() --> double *", pybind11::return_value_policy::automatic); +- cl.def("__call__", (double & (mrpt::math::CMatrixFixed::*)(int, int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int, int) --> double &", pybind11::return_value_policy::automatic, pybind11::arg("row"), pybind11::arg("col")); +- cl.def("__call__", (double & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int) --> double &", pybind11::return_value_policy::automatic, pybind11::arg("i")); +- cl.def("__getitem__", (double & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator[], "C++: mrpt::math::CMatrixFixed::operator[](int) --> double &", pybind11::return_value_policy::automatic, pybind11::arg("i")); ++ cl.def("__call__", (double & (mrpt::math::CMatrixFixed::*)(int, int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int, int) --> double &", pybind11::return_value_policy::reference, pybind11::arg("row"), pybind11::arg("col")); ++ cl.def("__call__", (double & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int) --> double &", pybind11::return_value_policy::reference, pybind11::arg("i")); ++ cl.def("__getitem__", (double & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator[], "C++: mrpt::math::CMatrixFixed::operator[](int) --> double &", pybind11::return_value_policy::reference, pybind11::arg("i")); + cl.def("sum_At", (void (mrpt::math::CMatrixFixed::*)(const class mrpt::math::CMatrixFixed &)) &mrpt::math::CMatrixFixed::sum_At, "C++: mrpt::math::CMatrixFixed::sum_At(const class mrpt::math::CMatrixFixed &) --> void", pybind11::arg("A")); + } + { // mrpt::math::CMatrixFixed file:mrpt/math/CMatrixFixed.h line:34 +@@ -114,10 +125,22 @@ void bind_mrpt_math_CMatrixFixed_2(std::function< pybind11::module &(std::string + cl.def("rows", (int (mrpt::math::CMatrixFixed::*)() const) &mrpt::math::CMatrixFixed::rows, "C++: mrpt::math::CMatrixFixed::rows() const --> int"); + cl.def("cols", (int (mrpt::math::CMatrixFixed::*)() const) &mrpt::math::CMatrixFixed::cols, "C++: mrpt::math::CMatrixFixed::cols() const --> int"); cl.def("data", (float * (mrpt::math::CMatrixFixed::*)()) &mrpt::math::CMatrixFixed::data, "C++: mrpt::math::CMatrixFixed::data() --> float *", pybind11::return_value_policy::automatic); - cl.def("__call__", (float & (mrpt::math::CMatrixFixed::*)(int, int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int, int) --> float &", pybind11::return_value_policy::reference, pybind11::arg("row"), pybind11::arg("col")); - cl.def("__call__", (float & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int) --> float &", pybind11::return_value_policy::reference, pybind11::arg("i")); -- cl.def("__getitem__", (float & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator[], "C++: mrpt::math::CMatrixFixed::operator[](int) --> float &", pybind11::return_value_policy::reference, pybind11::arg("i")); +- cl.def("__call__", (float & (mrpt::math::CMatrixFixed::*)(int, int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int, int) --> float &", pybind11::return_value_policy::automatic, pybind11::arg("row"), pybind11::arg("col")); +- cl.def("__call__", (float & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int) --> float &", pybind11::return_value_policy::automatic, pybind11::arg("i")); +- cl.def("__getitem__", (float & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator[], "C++: mrpt::math::CMatrixFixed::operator[](int) --> float &", pybind11::return_value_policy::automatic, pybind11::arg("i")); ++ cl.def("__call__", (float & (mrpt::math::CMatrixFixed::*)(int, int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int, int) --> float &", pybind11::return_value_policy::reference, pybind11::arg("row"), pybind11::arg("col")); ++ cl.def("__call__", (float & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int) --> float &", pybind11::return_value_policy::reference, pybind11::arg("i")); cl.def("cast_float", (class mrpt::math::CMatrixFixed (mrpt::math::CMatrixFixed::*)() const) &mrpt::math::CMatrixFixed::cast_float, "C++: mrpt::math::CMatrixFixed::cast_float() const --> class mrpt::math::CMatrixFixed"); cl.def("sum_At", (void (mrpt::math::CMatrixFixed::*)(const class mrpt::math::CMatrixFixed &)) &mrpt::math::CMatrixFixed::sum_At, "C++: mrpt::math::CMatrixFixed::sum_At(const class mrpt::math::CMatrixFixed &) --> void", pybind11::arg("A")); + @@ -209,13 +372,20 @@ index 2eb493a48..916e0bad4 100644 + cl.def(pybind11::init( [](pybind11::list vals){ auto m = new mat_t(); const auto nR = vals.size(); if (!nR) return m; const auto nC = vals[0].cast().size(); m->setSize(nR,nC); for (size_t r=0;r(); for (size_t c=0;ccoeffRef(r,c) = row[c].cast(); } return m; })); + cl.def("to_list", [](const mat_t&self) -> pybind11::list { auto l = pybind11::list(); const auto nR = self.rows(), nC = self.cols(); for (size_t r=0;r, std::shared_ptr>> cl(M("mrpt::math"), "CMatrixFixed_float_4UL_4UL_t", ""); -@@ -90,10 +102,22 @@ void bind_mrpt_math_CMatrixFixed_3(std::function< pybind11::module &(std::string + } +diff --git a/python/src/mrpt/math/CMatrixFixed_3.cpp b/python/src/mrpt/math/CMatrixFixed_3.cpp +index 9f57fa132..0192960f3 100644 +--- a/python/src/mrpt/math/CMatrixFixed_3.cpp ++++ b/python/src/mrpt/math/CMatrixFixed_3.cpp +@@ -38,12 +38,24 @@ void bind_mrpt_math_CMatrixFixed_3(std::function< pybind11::module &(std::string + cl.def("rows", (int (mrpt::math::CMatrixFixed::*)() const) &mrpt::math::CMatrixFixed::rows, "C++: mrpt::math::CMatrixFixed::rows() const --> int"); + cl.def("cols", (int (mrpt::math::CMatrixFixed::*)() const) &mrpt::math::CMatrixFixed::cols, "C++: mrpt::math::CMatrixFixed::cols() const --> int"); cl.def("data", (float * (mrpt::math::CMatrixFixed::*)()) &mrpt::math::CMatrixFixed::data, "C++: mrpt::math::CMatrixFixed::data() --> float *", pybind11::return_value_policy::automatic); - cl.def("__call__", (float & (mrpt::math::CMatrixFixed::*)(int, int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int, int) --> float &", pybind11::return_value_policy::reference, pybind11::arg("row"), pybind11::arg("col")); - cl.def("__call__", (float & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int) --> float &", pybind11::return_value_policy::reference, pybind11::arg("i")); -- cl.def("__getitem__", (float & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator[], "C++: mrpt::math::CMatrixFixed::operator[](int) --> float &", pybind11::return_value_policy::reference, pybind11::arg("i")); +- cl.def("__call__", (float & (mrpt::math::CMatrixFixed::*)(int, int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int, int) --> float &", pybind11::return_value_policy::automatic, pybind11::arg("row"), pybind11::arg("col")); +- cl.def("__call__", (float & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int) --> float &", pybind11::return_value_policy::automatic, pybind11::arg("i")); +- cl.def("__getitem__", (float & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator[], "C++: mrpt::math::CMatrixFixed::operator[](int) --> float &", pybind11::return_value_policy::automatic, pybind11::arg("i")); ++ cl.def("__call__", (float & (mrpt::math::CMatrixFixed::*)(int, int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int, int) --> float &", pybind11::return_value_policy::reference, pybind11::arg("row"), pybind11::arg("col")); ++ cl.def("__call__", (float & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int) --> float &", pybind11::return_value_policy::reference, pybind11::arg("i")); cl.def("cast_float", (class mrpt::math::CMatrixFixed (mrpt::math::CMatrixFixed::*)() const) &mrpt::math::CMatrixFixed::cast_float, "C++: mrpt::math::CMatrixFixed::cast_float() const --> class mrpt::math::CMatrixFixed"); cl.def("sum_At", (void (mrpt::math::CMatrixFixed::*)(const class mrpt::math::CMatrixFixed &)) &mrpt::math::CMatrixFixed::sum_At, "C++: mrpt::math::CMatrixFixed::sum_At(const class mrpt::math::CMatrixFixed &) --> void", pybind11::arg("A")); cl.def("assign", (class mrpt::math::CMatrixFixed & (mrpt::math::CMatrixFixed::*)(const class mrpt::math::CMatrixFixed &)) &mrpt::math::CMatrixFixed::operator=, "C++: mrpt::math::CMatrixFixed::operator=(const class mrpt::math::CMatrixFixed &) --> class mrpt::math::CMatrixFixed &", pybind11::return_value_policy::automatic, pybind11::arg("")); @@ -235,7 +405,15 @@ index 2eb493a48..916e0bad4 100644 } { // mrpt::math::CMatrixFixed file:mrpt/math/CMatrixFixed.h line:34 pybind11::class_, std::shared_ptr>> cl(M("mrpt::math"), "CMatrixFixed_float_3UL_1UL_t", ""); -@@ -121,5 +145,18 @@ void bind_mrpt_math_CMatrixFixed_3(std::function< pybind11::module &(std::string +@@ -65,12 +77,23 @@ void bind_mrpt_math_CMatrixFixed_3(std::function< pybind11::module &(std::string + cl.def("rows", (int (mrpt::math::CMatrixFixed::*)() const) &mrpt::math::CMatrixFixed::rows, "C++: mrpt::math::CMatrixFixed::rows() const --> int"); + cl.def("cols", (int (mrpt::math::CMatrixFixed::*)() const) &mrpt::math::CMatrixFixed::cols, "C++: mrpt::math::CMatrixFixed::cols() const --> int"); + cl.def("data", (float * (mrpt::math::CMatrixFixed::*)()) &mrpt::math::CMatrixFixed::data, "C++: mrpt::math::CMatrixFixed::data() --> float *", pybind11::return_value_policy::automatic); +- cl.def("__call__", (float & (mrpt::math::CMatrixFixed::*)(int, int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int, int) --> float &", pybind11::return_value_policy::automatic, pybind11::arg("row"), pybind11::arg("col")); +- cl.def("__call__", (float & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int) --> float &", pybind11::return_value_policy::automatic, pybind11::arg("i")); +- cl.def("__getitem__", (float & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator[], "C++: mrpt::math::CMatrixFixed::operator[](int) --> float &", pybind11::return_value_policy::automatic, pybind11::arg("i")); ++ cl.def("__call__", (float & (mrpt::math::CMatrixFixed::*)(int, int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int, int) --> float &", pybind11::return_value_policy::reference, pybind11::arg("row"), pybind11::arg("col")); ++ cl.def("__call__", (float & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int) --> float &", pybind11::return_value_policy::reference, pybind11::arg("i")); cl.def("cast_float", (class mrpt::math::CMatrixFixed (mrpt::math::CMatrixFixed::*)() const) &mrpt::math::CMatrixFixed::cast_float, "C++: mrpt::math::CMatrixFixed::cast_float() const --> class mrpt::math::CMatrixFixed"); cl.def("sum_At", (void (mrpt::math::CMatrixFixed::*)(const class mrpt::math::CMatrixFixed &)) &mrpt::math::CMatrixFixed::sum_At, "C++: mrpt::math::CMatrixFixed::sum_At(const class mrpt::math::CMatrixFixed &) --> void", pybind11::arg("A")); cl.def("assign", (class mrpt::math::CMatrixFixed & (mrpt::math::CMatrixFixed::*)(const class mrpt::math::CMatrixFixed &)) &mrpt::math::CMatrixFixed::operator=, "C++: mrpt::math::CMatrixFixed::operator=(const class mrpt::math::CMatrixFixed &) --> class mrpt::math::CMatrixFixed &", pybind11::return_value_policy::automatic, pybind11::arg("")); @@ -251,18 +429,31 @@ index 2eb493a48..916e0bad4 100644 + cl.def_static("Zero", []() -> mat_t { return mat_t::Zero(); }, "Returns a matrix with zeroes"); + cl.def(pybind11::init( [](pybind11::list vals){ auto m = new mat_t(); const auto nR = vals.size(); if (!nR) return m; const auto nC = vals[0].cast().size(); m->setSize(nR,nC); for (size_t r=0;r(); for (size_t c=0;ccoeffRef(r,c) = row[c].cast(); } return m; })); + cl.def("to_list", [](const mat_t&self) -> pybind11::list { auto l = pybind11::list(); const auto nR = self.rows(), nC = self.cols(); for (size_t r=0;r, std::shared_ptr>> cl(M("mrpt::math"), "CMatrixFixed_double_12UL_1UL_t", ""); +@@ -92,9 +115,9 @@ void bind_mrpt_math_CMatrixFixed_3(std::function< pybind11::module &(std::string + cl.def("rows", (int (mrpt::math::CMatrixFixed::*)() const) &mrpt::math::CMatrixFixed::rows, "C++: mrpt::math::CMatrixFixed::rows() const --> int"); + cl.def("cols", (int (mrpt::math::CMatrixFixed::*)() const) &mrpt::math::CMatrixFixed::cols, "C++: mrpt::math::CMatrixFixed::cols() const --> int"); + cl.def("data", (double * (mrpt::math::CMatrixFixed::*)()) &mrpt::math::CMatrixFixed::data, "C++: mrpt::math::CMatrixFixed::data() --> double *", pybind11::return_value_policy::automatic); +- cl.def("__call__", (double & (mrpt::math::CMatrixFixed::*)(int, int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int, int) --> double &", pybind11::return_value_policy::automatic, pybind11::arg("row"), pybind11::arg("col")); +- cl.def("__call__", (double & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int) --> double &", pybind11::return_value_policy::automatic, pybind11::arg("i")); +- cl.def("__getitem__", (double & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator[], "C++: mrpt::math::CMatrixFixed::operator[](int) --> double &", pybind11::return_value_policy::automatic, pybind11::arg("i")); ++ cl.def("__call__", (double & (mrpt::math::CMatrixFixed::*)(int, int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int, int) --> double &", pybind11::return_value_policy::reference, pybind11::arg("row"), pybind11::arg("col")); ++ cl.def("__call__", (double & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int) --> double &", pybind11::return_value_policy::reference, pybind11::arg("i")); ++ cl.def("__getitem__", (double & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator[], "C++: mrpt::math::CMatrixFixed::operator[](int) --> double &", pybind11::return_value_policy::reference, pybind11::arg("i")); + cl.def("sum_At", (void (mrpt::math::CMatrixFixed::*)(const class mrpt::math::CMatrixFixed &)) &mrpt::math::CMatrixFixed::sum_At, "C++: mrpt::math::CMatrixFixed::sum_At(const class mrpt::math::CMatrixFixed &) --> void", pybind11::arg("A")); + } + { // mrpt::math::CMatrixFixed file:mrpt/math/CMatrixFixed.h line:34 +@@ -117,11 +140,22 @@ void bind_mrpt_math_CMatrixFixed_3(std::function< pybind11::module &(std::string + cl.def("rows", (int (mrpt::math::CMatrixFixed::*)() const) &mrpt::math::CMatrixFixed::rows, "C++: mrpt::math::CMatrixFixed::rows() const --> int"); + cl.def("cols", (int (mrpt::math::CMatrixFixed::*)() const) &mrpt::math::CMatrixFixed::cols, "C++: mrpt::math::CMatrixFixed::cols() const --> int"); cl.def("data", (float * (mrpt::math::CMatrixFixed::*)()) &mrpt::math::CMatrixFixed::data, "C++: mrpt::math::CMatrixFixed::data() --> float *", pybind11::return_value_policy::automatic); - cl.def("__call__", (float & (mrpt::math::CMatrixFixed::*)(int, int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int, int) --> float &", pybind11::return_value_policy::reference, pybind11::arg("row"), pybind11::arg("col")); - cl.def("__call__", (float & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int) --> float &", pybind11::return_value_policy::reference, pybind11::arg("i")); -- cl.def("__getitem__", (float & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator[], "C++: mrpt::math::CMatrixFixed::operator[](int) --> float &", pybind11::return_value_policy::reference, pybind11::arg("i")); +- cl.def("__call__", (float & (mrpt::math::CMatrixFixed::*)(int, int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int, int) --> float &", pybind11::return_value_policy::automatic, pybind11::arg("row"), pybind11::arg("col")); +- cl.def("__call__", (float & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int) --> float &", pybind11::return_value_policy::automatic, pybind11::arg("i")); +- cl.def("__getitem__", (float & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator[], "C++: mrpt::math::CMatrixFixed::operator[](int) --> float &", pybind11::return_value_policy::automatic, pybind11::arg("i")); ++ cl.def("__call__", (float & (mrpt::math::CMatrixFixed::*)(int, int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int, int) --> float &", pybind11::return_value_policy::reference, pybind11::arg("row"), pybind11::arg("col")); ++ cl.def("__call__", (float & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int) --> float &", pybind11::return_value_policy::reference, pybind11::arg("i")); cl.def("cast_float", (class mrpt::math::CMatrixFixed (mrpt::math::CMatrixFixed::*)() const) &mrpt::math::CMatrixFixed::cast_float, "C++: mrpt::math::CMatrixFixed::cast_float() const --> class mrpt::math::CMatrixFixed"); cl.def("sum_At", (void (mrpt::math::CMatrixFixed::*)(const class mrpt::math::CMatrixFixed &)) &mrpt::math::CMatrixFixed::sum_At, "C++: mrpt::math::CMatrixFixed::sum_At(const class mrpt::math::CMatrixFixed &) --> void", pybind11::arg("A")); cl.def("assign", (class mrpt::math::CMatrixFixed & (mrpt::math::CMatrixFixed::*)(const class mrpt::math::CMatrixFixed &)) &mrpt::math::CMatrixFixed::operator=, "C++: mrpt::math::CMatrixFixed::operator=(const class mrpt::math::CMatrixFixed &) --> class mrpt::math::CMatrixFixed &", pybind11::return_value_policy::automatic, pybind11::arg("")); @@ -279,5 +470,30 @@ index 5307d0b77..1fef0199e 100644 + cl.def(pybind11::init( [](pybind11::list vals){ auto m = new mat_t(); const auto nR = vals.size(); if (!nR) return m; const auto nC = vals[0].cast().size(); m->setSize(nR,nC); for (size_t r=0;r(); for (size_t c=0;ccoeffRef(r,c) = row[c].cast(); } return m; })); + cl.def("to_list", [](const mat_t&self) -> pybind11::list { auto l = pybind11::list(); const auto nR = self.rows(), nC = self.cols(); for (size_t r=0;r(M("mrpt::math"), "TMatrixTextFileFormat", pybind11::arithmetic(), "Selection of the number format in MatrixVectorBase::saveToTextFile()\n \n") + } +diff --git a/python/src/mrpt/math/CVectorDynamic.cpp b/python/src/mrpt/math/CVectorDynamic.cpp +index 780fbaa83..b9075ff96 100644 +--- a/python/src/mrpt/math/CVectorDynamic.cpp ++++ b/python/src/mrpt/math/CVectorDynamic.cpp +@@ -46,8 +46,8 @@ void bind_mrpt_math_CVectorDynamic(std::function< pybind11::module &(std::string + cl.def("resize", (void (mrpt::math::CVectorDynamic::*)(std::size_t, bool)) &mrpt::math::CVectorDynamic::resize, "C++: mrpt::math::CVectorDynamic::resize(std::size_t, bool) --> void", pybind11::arg("N"), pybind11::arg("zeroNewElements")); + cl.def("push_back", (void (mrpt::math::CVectorDynamic::*)(const double &)) &mrpt::math::CVectorDynamic::push_back, "C++: mrpt::math::CVectorDynamic::push_back(const double &) --> void", pybind11::arg("val")); + cl.def("segmentCopy", (class mrpt::math::CVectorDynamic (mrpt::math::CVectorDynamic::*)(int, int) const) &mrpt::math::CVectorDynamic::segmentCopy, "C++: mrpt::math::CVectorDynamic::segmentCopy(int, int) const --> class mrpt::math::CVectorDynamic", pybind11::arg("start"), pybind11::arg("LEN")); +- cl.def("__call__", (double & (mrpt::math::CVectorDynamic::*)(size_t, size_t)) &mrpt::math::CVectorDynamic::operator(), "C++: mrpt::math::CVectorDynamic::operator()(size_t, size_t) --> double &", pybind11::return_value_policy::automatic, pybind11::arg("row"), pybind11::arg("col")); +- cl.def("__getitem__", (double & (mrpt::math::CVectorDynamic::*)(size_t)) &mrpt::math::CVectorDynamic::operator[], "C++: mrpt::math::CVectorDynamic::operator[](size_t) --> double &", pybind11::return_value_policy::automatic, pybind11::arg("ith")); ++ cl.def("__call__", (double & (mrpt::math::CVectorDynamic::*)(size_t, size_t)) &mrpt::math::CVectorDynamic::operator(), "C++: mrpt::math::CVectorDynamic::operator()(size_t, size_t) --> double &", pybind11::return_value_policy::reference, pybind11::arg("row"), pybind11::arg("col")); ++ cl.def("__getitem__", (double & (mrpt::math::CVectorDynamic::*)(size_t)) &mrpt::math::CVectorDynamic::operator[], "C++: mrpt::math::CVectorDynamic::operator[](size_t) --> double &", pybind11::return_value_policy::reference, pybind11::arg("ith")); + cl.def("assign", (class mrpt::math::CVectorDynamic & (mrpt::math::CVectorDynamic::*)(const class mrpt::math::CVectorDynamic &)) &mrpt::math::CVectorDynamic::operator=, "C++: mrpt::math::CVectorDynamic::operator=(const class mrpt::math::CVectorDynamic &) --> class mrpt::math::CVectorDynamic &", pybind11::return_value_policy::automatic, pybind11::arg("")); + } + { // mrpt::math::CVectorDynamic file:mrpt/math/CVectorDynamic.h line:32 +@@ -70,8 +70,8 @@ void bind_mrpt_math_CVectorDynamic(std::function< pybind11::module &(std::string + cl.def("resize", (void (mrpt::math::CVectorDynamic::*)(std::size_t, bool)) &mrpt::math::CVectorDynamic::resize, "C++: mrpt::math::CVectorDynamic::resize(std::size_t, bool) --> void", pybind11::arg("N"), pybind11::arg("zeroNewElements")); + cl.def("push_back", (void (mrpt::math::CVectorDynamic::*)(const float &)) &mrpt::math::CVectorDynamic::push_back, "C++: mrpt::math::CVectorDynamic::push_back(const float &) --> void", pybind11::arg("val")); + cl.def("segmentCopy", (class mrpt::math::CVectorDynamic (mrpt::math::CVectorDynamic::*)(int, int) const) &mrpt::math::CVectorDynamic::segmentCopy, "C++: mrpt::math::CVectorDynamic::segmentCopy(int, int) const --> class mrpt::math::CVectorDynamic", pybind11::arg("start"), pybind11::arg("LEN")); +- cl.def("__call__", (float & (mrpt::math::CVectorDynamic::*)(size_t, size_t)) &mrpt::math::CVectorDynamic::operator(), "C++: mrpt::math::CVectorDynamic::operator()(size_t, size_t) --> float &", pybind11::return_value_policy::automatic, pybind11::arg("row"), pybind11::arg("col")); +- cl.def("__getitem__", (float & (mrpt::math::CVectorDynamic::*)(size_t)) &mrpt::math::CVectorDynamic::operator[], "C++: mrpt::math::CVectorDynamic::operator[](size_t) --> float &", pybind11::return_value_policy::automatic, pybind11::arg("ith")); ++ cl.def("__call__", (float & (mrpt::math::CVectorDynamic::*)(size_t, size_t)) &mrpt::math::CVectorDynamic::operator(), "C++: mrpt::math::CVectorDynamic::operator()(size_t, size_t) --> float &", pybind11::return_value_policy::reference, pybind11::arg("row"), pybind11::arg("col")); ++ cl.def("__getitem__", (float & (mrpt::math::CVectorDynamic::*)(size_t)) &mrpt::math::CVectorDynamic::operator[], "C++: mrpt::math::CVectorDynamic::operator[](size_t) --> float &", pybind11::return_value_policy::reference, pybind11::arg("ith")); + cl.def("assign", (class mrpt::math::CVectorDynamic & (mrpt::math::CVectorDynamic::*)(const class mrpt::math::CVectorDynamic &)) &mrpt::math::CVectorDynamic::operator=, "C++: mrpt::math::CVectorDynamic::operator=(const class mrpt::math::CVectorDynamic &) --> class mrpt::math::CVectorDynamic &", pybind11::return_value_policy::automatic, pybind11::arg("")); + } + } diff --git a/python/patch-012.diff b/python/patch-012.diff index 8b8494e627..e780aa47c4 100644 --- a/python/patch-012.diff +++ b/python/patch-012.diff @@ -1,65 +1,13 @@ diff --git a/python/src/mrpt/math/CMatrixDynamic_1.cpp b/python/src/mrpt/math/CMatrixDynamic_1.cpp -index dfdf72e93..889abe4da 100644 +index be42731ed..4d90b28d6 100644 --- a/python/src/mrpt/math/CMatrixDynamic_1.cpp +++ b/python/src/mrpt/math/CMatrixDynamic_1.cpp -@@ -95,60 +95,21 @@ void bind_mrpt_math_CMatrixDynamic_1(std::function< pybind11::module &(std::stri +@@ -50,8 +50,6 @@ void bind_mrpt_math_CMatrixDynamic_1(std::function< pybind11::module &(std::stri cl.def("data", (struct mrpt::math::TPoint3D_ * (mrpt::math::CMatrixDynamic>::*)()) &mrpt::math::CMatrixDynamic>::data, "C++: mrpt::math::CMatrixDynamic>::data() --> struct mrpt::math::TPoint3D_ *", pybind11::return_value_policy::automatic); - cl.def("__call__", (struct mrpt::math::TPoint3D_ & (mrpt::math::CMatrixDynamic>::*)(size_t, size_t)) &mrpt::math::CMatrixDynamic>::operator(), "C++: mrpt::math::CMatrixDynamic>::operator()(size_t, size_t) --> struct mrpt::math::TPoint3D_ &", pybind11::return_value_policy::automatic, pybind11::arg("row"), pybind11::arg("col")); - cl.def("__getitem__", (struct mrpt::math::TPoint3D_ & (mrpt::math::CMatrixDynamic>::*)(size_t)) &mrpt::math::CMatrixDynamic>::operator[], "C++: mrpt::math::CMatrixDynamic>::operator[](size_t) --> struct mrpt::math::TPoint3D_ &", pybind11::return_value_policy::automatic, pybind11::arg("ith")); + cl.def("__call__", (struct mrpt::math::TPoint3D_ & (mrpt::math::CMatrixDynamic>::*)(size_t, size_t)) &mrpt::math::CMatrixDynamic>::operator(), "C++: mrpt::math::CMatrixDynamic>::operator()(size_t, size_t) --> struct mrpt::math::TPoint3D_ &", pybind11::return_value_policy::reference, pybind11::arg("row"), pybind11::arg("col")); + cl.def("__getitem__", (struct mrpt::math::TPoint3D_ & (mrpt::math::CMatrixDynamic>::*)(size_t)) &mrpt::math::CMatrixDynamic>::operator[], "C++: mrpt::math::CMatrixDynamic>::operator[](size_t) --> struct mrpt::math::TPoint3D_ &", pybind11::return_value_policy::reference, pybind11::arg("ith")); - cl.def("cast_float", (class mrpt::math::CMatrixDynamic (mrpt::math::CMatrixDynamic>::*)() const) &mrpt::math::CMatrixDynamic>::cast_float, "C++: mrpt::math::CMatrixDynamic>::cast_float() const --> class mrpt::math::CMatrixDynamic"); - cl.def("cast_double", (class mrpt::math::CMatrixDynamic (mrpt::math::CMatrixDynamic>::*)() const) &mrpt::math::CMatrixDynamic>::cast_double, "C++: mrpt::math::CMatrixDynamic>::cast_double() const --> class mrpt::math::CMatrixDynamic"); - cl.def("mbDerived", (class mrpt::math::CMatrixDynamic > & (mrpt::math::MatrixBase,mrpt::math::CMatrixDynamic >>::*)()) &mrpt::math::MatrixBase, mrpt::math::CMatrixDynamic>>::mbDerived, "C++: mrpt::math::MatrixBase, mrpt::math::CMatrixDynamic>>::mbDerived() --> class mrpt::math::CMatrixDynamic > &", pybind11::return_value_policy::automatic); -- cl.def("setDiagonal", (void (mrpt::math::MatrixBase,mrpt::math::CMatrixDynamic >>::*)(const unsigned long, const struct mrpt::math::TPoint3D_)) &mrpt::math::MatrixBase, mrpt::math::CMatrixDynamic>>::setDiagonal, "C++: mrpt::math::MatrixBase, mrpt::math::CMatrixDynamic>>::setDiagonal(const unsigned long, const struct mrpt::math::TPoint3D_) --> void", pybind11::arg("N"), pybind11::arg("value")); -- cl.def("setDiagonal", (void (mrpt::math::MatrixBase,mrpt::math::CMatrixDynamic >>::*)(const struct mrpt::math::TPoint3D_)) &mrpt::math::MatrixBase, mrpt::math::CMatrixDynamic>>::setDiagonal, "C++: mrpt::math::MatrixBase, mrpt::math::CMatrixDynamic>>::setDiagonal(const struct mrpt::math::TPoint3D_) --> void", pybind11::arg("value")); -- cl.def("setIdentity", (void (mrpt::math::MatrixBase,mrpt::math::CMatrixDynamic >>::*)()) &mrpt::math::MatrixBase, mrpt::math::CMatrixDynamic>>::setIdentity, "C++: mrpt::math::MatrixBase, mrpt::math::CMatrixDynamic>>::setIdentity() --> void"); -- cl.def("setIdentity", (void (mrpt::math::MatrixBase,mrpt::math::CMatrixDynamic >>::*)(const unsigned long)) &mrpt::math::MatrixBase, mrpt::math::CMatrixDynamic>>::setIdentity, "C++: mrpt::math::MatrixBase, mrpt::math::CMatrixDynamic>>::setIdentity(const unsigned long) --> void", pybind11::arg("N")); -- cl.def_static("Identity", (class mrpt::math::CMatrixDynamic > (*)()) &mrpt::math::MatrixBase, mrpt::math::CMatrixDynamic>>::Identity, "C++: mrpt::math::MatrixBase, mrpt::math::CMatrixDynamic>>::Identity() --> class mrpt::math::CMatrixDynamic >"); -- cl.def_static("Identity", (class mrpt::math::CMatrixDynamic > (*)(const unsigned long)) &mrpt::math::MatrixBase, mrpt::math::CMatrixDynamic>>::Identity, "C++: mrpt::math::MatrixBase, mrpt::math::CMatrixDynamic>>::Identity(const unsigned long) --> class mrpt::math::CMatrixDynamic >", pybind11::arg("N")); -- cl.def("matProductOf_AB", (void (mrpt::math::MatrixBase,mrpt::math::CMatrixDynamic >>::*)(const class mrpt::math::CMatrixDynamic > &, const class mrpt::math::CMatrixDynamic > &)) &mrpt::math::MatrixBase, mrpt::math::CMatrixDynamic>>::matProductOf_AB, "C++: mrpt::math::MatrixBase, mrpt::math::CMatrixDynamic>>::matProductOf_AB(const class mrpt::math::CMatrixDynamic > &, const class mrpt::math::CMatrixDynamic > &) --> void", pybind11::arg("A"), pybind11::arg("B")); -- cl.def("det", (struct mrpt::math::TPoint3D_ (mrpt::math::MatrixBase,mrpt::math::CMatrixDynamic >>::*)() const) &mrpt::math::MatrixBase, mrpt::math::CMatrixDynamic>>::det, "C++: mrpt::math::MatrixBase, mrpt::math::CMatrixDynamic>>::det() const --> struct mrpt::math::TPoint3D_"); -- cl.def("inverse", (class mrpt::math::CMatrixDynamic > (mrpt::math::MatrixBase,mrpt::math::CMatrixDynamic >>::*)() const) &mrpt::math::MatrixBase, mrpt::math::CMatrixDynamic>>::inverse, "C++: mrpt::math::MatrixBase, mrpt::math::CMatrixDynamic>>::inverse() const --> class mrpt::math::CMatrixDynamic >"); -- cl.def("inverse_LLt", (class mrpt::math::CMatrixDynamic > (mrpt::math::MatrixBase,mrpt::math::CMatrixDynamic >>::*)() const) &mrpt::math::MatrixBase, mrpt::math::CMatrixDynamic>>::inverse_LLt, "C++: mrpt::math::MatrixBase, mrpt::math::CMatrixDynamic>>::inverse_LLt() const --> class mrpt::math::CMatrixDynamic >"); -- cl.def("rank", [](mrpt::math::MatrixBase,mrpt::math::CMatrixDynamic >> const &o) -> int { return o.rank(); }, ""); -- cl.def("rank", (int (mrpt::math::MatrixBase,mrpt::math::CMatrixDynamic >>::*)(struct mrpt::math::TPoint3D_) const) &mrpt::math::MatrixBase, mrpt::math::CMatrixDynamic>>::rank, "C++: mrpt::math::MatrixBase, mrpt::math::CMatrixDynamic>>::rank(struct mrpt::math::TPoint3D_) const --> int", pybind11::arg("threshold")); -- cl.def("chol", (bool (mrpt::math::MatrixBase,mrpt::math::CMatrixDynamic >>::*)(class mrpt::math::CMatrixDynamic > &) const) &mrpt::math::MatrixBase, mrpt::math::CMatrixDynamic>>::chol, "C++: mrpt::math::MatrixBase, mrpt::math::CMatrixDynamic>>::chol(class mrpt::math::CMatrixDynamic > &) const --> bool", pybind11::arg("U")); -- cl.def("maximumDiagonal", (struct mrpt::math::TPoint3D_ (mrpt::math::MatrixBase,mrpt::math::CMatrixDynamic >>::*)() const) &mrpt::math::MatrixBase, mrpt::math::CMatrixDynamic>>::maximumDiagonal, "C++: mrpt::math::MatrixBase, mrpt::math::CMatrixDynamic>>::maximumDiagonal() const --> struct mrpt::math::TPoint3D_"); -- cl.def("minimumDiagonal", (struct mrpt::math::TPoint3D_ (mrpt::math::MatrixBase,mrpt::math::CMatrixDynamic >>::*)() const) &mrpt::math::MatrixBase, mrpt::math::CMatrixDynamic>>::minimumDiagonal, "C++: mrpt::math::MatrixBase, mrpt::math::CMatrixDynamic>>::minimumDiagonal() const --> struct mrpt::math::TPoint3D_"); -- cl.def("trace", (struct mrpt::math::TPoint3D_ (mrpt::math::MatrixBase,mrpt::math::CMatrixDynamic >>::*)() const) &mrpt::math::MatrixBase, mrpt::math::CMatrixDynamic>>::trace, "C++: mrpt::math::MatrixBase, mrpt::math::CMatrixDynamic>>::trace() const --> struct mrpt::math::TPoint3D_"); - cl.def("assign", (class mrpt::math::MatrixBase, class mrpt::math::CMatrixDynamic > > & (mrpt::math::MatrixBase,mrpt::math::CMatrixDynamic >>::*)(const class mrpt::math::MatrixBase, class mrpt::math::CMatrixDynamic > > &)) &mrpt::math::MatrixBase, mrpt::math::CMatrixDynamic>>::operator=, "C++: mrpt::math::MatrixBase, mrpt::math::CMatrixDynamic>>::operator=(const class mrpt::math::MatrixBase, class mrpt::math::CMatrixDynamic > > &) --> class mrpt::math::MatrixBase, class mrpt::math::CMatrixDynamic > > &", pybind11::return_value_policy::automatic, pybind11::arg("")); -- cl.def("fill", (void (mrpt::math::MatrixVectorBase,mrpt::math::CMatrixDynamic >>::*)(const struct mrpt::math::TPoint3D_ &)) &mrpt::math::MatrixVectorBase, mrpt::math::CMatrixDynamic>>::fill, "C++: mrpt::math::MatrixVectorBase, mrpt::math::CMatrixDynamic>>::fill(const struct mrpt::math::TPoint3D_ &) --> void", pybind11::arg("val")); - cl.def("setConstant", (void (mrpt::math::MatrixVectorBase,mrpt::math::CMatrixDynamic >>::*)(const struct mrpt::math::TPoint3D_)) &mrpt::math::MatrixVectorBase, mrpt::math::CMatrixDynamic>>::setConstant, "C++: mrpt::math::MatrixVectorBase, mrpt::math::CMatrixDynamic>>::setConstant(const struct mrpt::math::TPoint3D_) --> void", pybind11::arg("value")); - cl.def("setConstant", (void (mrpt::math::MatrixVectorBase,mrpt::math::CMatrixDynamic >>::*)(size_t, size_t, const struct mrpt::math::TPoint3D_)) &mrpt::math::MatrixVectorBase, mrpt::math::CMatrixDynamic>>::setConstant, "C++: mrpt::math::MatrixVectorBase, mrpt::math::CMatrixDynamic>>::setConstant(size_t, size_t, const struct mrpt::math::TPoint3D_) --> void", pybind11::arg("nrows"), pybind11::arg("ncols"), pybind11::arg("value")); - cl.def("setConstant", (void (mrpt::math::MatrixVectorBase,mrpt::math::CMatrixDynamic >>::*)(size_t, const struct mrpt::math::TPoint3D_)) &mrpt::math::MatrixVectorBase, mrpt::math::CMatrixDynamic>>::setConstant, "C++: mrpt::math::MatrixVectorBase, mrpt::math::CMatrixDynamic>>::setConstant(size_t, const struct mrpt::math::TPoint3D_) --> void", pybind11::arg("nrows"), pybind11::arg("value")); - cl.def_static("Constant", (class mrpt::math::CMatrixDynamic > (*)(const struct mrpt::math::TPoint3D_)) &mrpt::math::MatrixVectorBase, mrpt::math::CMatrixDynamic>>::Constant, "C++: mrpt::math::MatrixVectorBase, mrpt::math::CMatrixDynamic>>::Constant(const struct mrpt::math::TPoint3D_) --> class mrpt::math::CMatrixDynamic >", pybind11::arg("value")); - cl.def_static("Constant", (class mrpt::math::CMatrixDynamic > (*)(size_t, size_t, const struct mrpt::math::TPoint3D_)) &mrpt::math::MatrixVectorBase, mrpt::math::CMatrixDynamic>>::Constant, "C++: mrpt::math::MatrixVectorBase, mrpt::math::CMatrixDynamic>>::Constant(size_t, size_t, const struct mrpt::math::TPoint3D_) --> class mrpt::math::CMatrixDynamic >", pybind11::arg("nrows"), pybind11::arg("ncols"), pybind11::arg("value")); - cl.def("assign", (void (mrpt::math::MatrixVectorBase,mrpt::math::CMatrixDynamic >>::*)(const unsigned long, const struct mrpt::math::TPoint3D_)) &mrpt::math::MatrixVectorBase, mrpt::math::CMatrixDynamic>>::assign, "C++: mrpt::math::MatrixVectorBase, mrpt::math::CMatrixDynamic>>::assign(const unsigned long, const struct mrpt::math::TPoint3D_) --> void", pybind11::arg("N"), pybind11::arg("value")); -- cl.def("setZero", (void (mrpt::math::MatrixVectorBase,mrpt::math::CMatrixDynamic >>::*)()) &mrpt::math::MatrixVectorBase, mrpt::math::CMatrixDynamic>>::setZero, "C++: mrpt::math::MatrixVectorBase, mrpt::math::CMatrixDynamic>>::setZero() --> void"); -- cl.def("setZero", (void (mrpt::math::MatrixVectorBase,mrpt::math::CMatrixDynamic >>::*)(size_t, size_t)) &mrpt::math::MatrixVectorBase, mrpt::math::CMatrixDynamic>>::setZero, "C++: mrpt::math::MatrixVectorBase, mrpt::math::CMatrixDynamic>>::setZero(size_t, size_t) --> void", pybind11::arg("nrows"), pybind11::arg("ncols")); -- cl.def("setZero", (void (mrpt::math::MatrixVectorBase,mrpt::math::CMatrixDynamic >>::*)(size_t)) &mrpt::math::MatrixVectorBase, mrpt::math::CMatrixDynamic>>::setZero, "C++: mrpt::math::MatrixVectorBase, mrpt::math::CMatrixDynamic>>::setZero(size_t) --> void", pybind11::arg("nrows")); -- cl.def_static("Zero", (class mrpt::math::CMatrixDynamic > (*)()) &mrpt::math::MatrixVectorBase, mrpt::math::CMatrixDynamic>>::Zero, "C++: mrpt::math::MatrixVectorBase, mrpt::math::CMatrixDynamic>>::Zero() --> class mrpt::math::CMatrixDynamic >"); -- cl.def_static("Zero", (class mrpt::math::CMatrixDynamic > (*)(size_t, size_t)) &mrpt::math::MatrixVectorBase, mrpt::math::CMatrixDynamic>>::Zero, "C++: mrpt::math::MatrixVectorBase, mrpt::math::CMatrixDynamic>>::Zero(size_t, size_t) --> class mrpt::math::CMatrixDynamic >", pybind11::arg("nrows"), pybind11::arg("ncols")); - cl.def("coeffRef", (struct mrpt::math::TPoint3D_ & (mrpt::math::MatrixVectorBase,mrpt::math::CMatrixDynamic >>::*)(int, int)) &mrpt::math::MatrixVectorBase, mrpt::math::CMatrixDynamic>>::coeffRef, "C++: mrpt::math::MatrixVectorBase, mrpt::math::CMatrixDynamic>>::coeffRef(int, int) --> struct mrpt::math::TPoint3D_ &", pybind11::return_value_policy::automatic, pybind11::arg("r"), pybind11::arg("c")); - cl.def("coeff", (const struct mrpt::math::TPoint3D_ & (mrpt::math::MatrixVectorBase,mrpt::math::CMatrixDynamic >>::*)(int, int) const) &mrpt::math::MatrixVectorBase, mrpt::math::CMatrixDynamic>>::coeff, "C++: mrpt::math::MatrixVectorBase, mrpt::math::CMatrixDynamic>>::coeff(int, int) const --> const struct mrpt::math::TPoint3D_ &", pybind11::return_value_policy::automatic, pybind11::arg("r"), pybind11::arg("c")); - cl.def("isSquare", (bool (mrpt::math::MatrixVectorBase,mrpt::math::CMatrixDynamic >>::*)() const) &mrpt::math::MatrixVectorBase, mrpt::math::CMatrixDynamic>>::isSquare, "C++: mrpt::math::MatrixVectorBase, mrpt::math::CMatrixDynamic>>::isSquare() const --> bool"); - cl.def("empty", (bool (mrpt::math::MatrixVectorBase,mrpt::math::CMatrixDynamic >>::*)() const) &mrpt::math::MatrixVectorBase, mrpt::math::CMatrixDynamic>>::empty, "C++: mrpt::math::MatrixVectorBase, mrpt::math::CMatrixDynamic>>::empty() const --> bool"); - cl.def("norm_inf", (struct mrpt::math::TPoint3D_ (mrpt::math::MatrixVectorBase,mrpt::math::CMatrixDynamic >>::*)() const) &mrpt::math::MatrixVectorBase, mrpt::math::CMatrixDynamic>>::norm_inf, "C++: mrpt::math::MatrixVectorBase, mrpt::math::CMatrixDynamic>>::norm_inf() const --> struct mrpt::math::TPoint3D_"); - cl.def("norm", (struct mrpt::math::TPoint3D_ (mrpt::math::MatrixVectorBase,mrpt::math::CMatrixDynamic >>::*)() const) &mrpt::math::MatrixVectorBase, mrpt::math::CMatrixDynamic>>::norm, "C++: mrpt::math::MatrixVectorBase, mrpt::math::CMatrixDynamic>>::norm() const --> struct mrpt::math::TPoint3D_"); -- cl.def("__iadd__", (void (mrpt::math::MatrixVectorBase,mrpt::math::CMatrixDynamic >>::*)(struct mrpt::math::TPoint3D_)) &mrpt::math::MatrixVectorBase, mrpt::math::CMatrixDynamic>>::operator+=, "C++: mrpt::math::MatrixVectorBase, mrpt::math::CMatrixDynamic>>::operator+=(struct mrpt::math::TPoint3D_) --> void", pybind11::arg("s")); -- cl.def("__isub__", (void (mrpt::math::MatrixVectorBase,mrpt::math::CMatrixDynamic >>::*)(struct mrpt::math::TPoint3D_)) &mrpt::math::MatrixVectorBase, mrpt::math::CMatrixDynamic>>::operator-=, "C++: mrpt::math::MatrixVectorBase, mrpt::math::CMatrixDynamic>>::operator-=(struct mrpt::math::TPoint3D_) --> void", pybind11::arg("s")); -- cl.def("__imul__", (void (mrpt::math::MatrixVectorBase,mrpt::math::CMatrixDynamic >>::*)(struct mrpt::math::TPoint3D_)) &mrpt::math::MatrixVectorBase, mrpt::math::CMatrixDynamic>>::operator*=, "C++: mrpt::math::MatrixVectorBase, mrpt::math::CMatrixDynamic>>::operator*=(struct mrpt::math::TPoint3D_) --> void", pybind11::arg("s")); -- cl.def("__add__", (class mrpt::math::CMatrixDynamic > (mrpt::math::MatrixVectorBase,mrpt::math::CMatrixDynamic >>::*)(const class mrpt::math::CMatrixDynamic > &) const) &mrpt::math::MatrixVectorBase, mrpt::math::CMatrixDynamic>>::operator+, "C++: mrpt::math::MatrixVectorBase, mrpt::math::CMatrixDynamic>>::operator+(const class mrpt::math::CMatrixDynamic > &) const --> class mrpt::math::CMatrixDynamic >", pybind11::arg("m2")); -- cl.def("__iadd__", (void (mrpt::math::MatrixVectorBase,mrpt::math::CMatrixDynamic >>::*)(const class mrpt::math::CMatrixDynamic > &)) &mrpt::math::MatrixVectorBase, mrpt::math::CMatrixDynamic>>::operator+=, "C++: mrpt::math::MatrixVectorBase, mrpt::math::CMatrixDynamic>>::operator+=(const class mrpt::math::CMatrixDynamic > &) --> void", pybind11::arg("m2")); -- cl.def("__isub__", (void (mrpt::math::MatrixVectorBase,mrpt::math::CMatrixDynamic >>::*)(const class mrpt::math::CMatrixDynamic > &)) &mrpt::math::MatrixVectorBase, mrpt::math::CMatrixDynamic>>::operator-=, "C++: mrpt::math::MatrixVectorBase, mrpt::math::CMatrixDynamic>>::operator-=(const class mrpt::math::CMatrixDynamic > &) --> void", pybind11::arg("m2")); -- cl.def("sum", (struct mrpt::math::TPoint3D_ (mrpt::math::MatrixVectorBase,mrpt::math::CMatrixDynamic >>::*)() const) &mrpt::math::MatrixVectorBase, mrpt::math::CMatrixDynamic>>::sum, "C++: mrpt::math::MatrixVectorBase, mrpt::math::CMatrixDynamic>>::sum() const --> struct mrpt::math::TPoint3D_"); -- cl.def("sum_abs", (struct mrpt::math::TPoint3D_ (mrpt::math::MatrixVectorBase,mrpt::math::CMatrixDynamic >>::*)() const) &mrpt::math::MatrixVectorBase, mrpt::math::CMatrixDynamic>>::sum_abs, "C++: mrpt::math::MatrixVectorBase, mrpt::math::CMatrixDynamic>>::sum_abs() const --> struct mrpt::math::TPoint3D_"); - cl.def("asString", (std::string (mrpt::math::MatrixVectorBase,mrpt::math::CMatrixDynamic >>::*)() const) &mrpt::math::MatrixVectorBase, mrpt::math::CMatrixDynamic>>::asString, "C++: mrpt::math::MatrixVectorBase, mrpt::math::CMatrixDynamic>>::asString() const --> std::string"); -- cl.def("inMatlabFormat", [](mrpt::math::MatrixVectorBase,mrpt::math::CMatrixDynamic >> const &o) -> std::string { return o.inMatlabFormat(); }, ""); -- cl.def("inMatlabFormat", (std::string (mrpt::math::MatrixVectorBase,mrpt::math::CMatrixDynamic >>::*)(const unsigned long) const) &mrpt::math::MatrixVectorBase, mrpt::math::CMatrixDynamic>>::inMatlabFormat, "C++: mrpt::math::MatrixVectorBase, mrpt::math::CMatrixDynamic>>::inMatlabFormat(const unsigned long) const --> std::string", pybind11::arg("decimal_digits")); -- cl.def("saveToTextFile", [](mrpt::math::MatrixVectorBase,mrpt::math::CMatrixDynamic >> const &o, const std::string & a0) -> void { return o.saveToTextFile(a0); }, "", pybind11::arg("file")); -- cl.def("saveToTextFile", [](mrpt::math::MatrixVectorBase,mrpt::math::CMatrixDynamic >> const &o, const std::string & a0, enum mrpt::math::TMatrixTextFileFormat const & a1) -> void { return o.saveToTextFile(a0, a1); }, "", pybind11::arg("file"), pybind11::arg("fileFormat")); -- cl.def("saveToTextFile", [](mrpt::math::MatrixVectorBase,mrpt::math::CMatrixDynamic >> const &o, const std::string & a0, enum mrpt::math::TMatrixTextFileFormat const & a1, bool const & a2) -> void { return o.saveToTextFile(a0, a1, a2); }, "", pybind11::arg("file"), pybind11::arg("fileFormat"), pybind11::arg("appendMRPTHeader")); -- cl.def("saveToTextFile", (void (mrpt::math::MatrixVectorBase,mrpt::math::CMatrixDynamic >>::*)(const std::string &, enum mrpt::math::TMatrixTextFileFormat, bool, const std::string &) const) &mrpt::math::MatrixVectorBase, mrpt::math::CMatrixDynamic>>::saveToTextFile, "C++: mrpt::math::MatrixVectorBase, mrpt::math::CMatrixDynamic>>::saveToTextFile(const std::string &, enum mrpt::math::TMatrixTextFileFormat, bool, const std::string &) const --> void", pybind11::arg("file"), pybind11::arg("fileFormat"), pybind11::arg("appendMRPTHeader"), pybind11::arg("userHeader")); -- cl.def("loadFromTextFile", (void (mrpt::math::MatrixVectorBase,mrpt::math::CMatrixDynamic >>::*)(const std::string &)) &mrpt::math::MatrixVectorBase, mrpt::math::CMatrixDynamic>>::loadFromTextFile, "C++: mrpt::math::MatrixVectorBase, mrpt::math::CMatrixDynamic>>::loadFromTextFile(const std::string &) --> void", pybind11::arg("file")); - cl.def("assign", (class mrpt::math::MatrixVectorBase, class mrpt::math::CMatrixDynamic > > & (mrpt::math::MatrixVectorBase,mrpt::math::CMatrixDynamic >>::*)(const class mrpt::math::MatrixVectorBase, class mrpt::math::CMatrixDynamic > > &)) &mrpt::math::MatrixVectorBase, mrpt::math::CMatrixDynamic>>::operator=, "C++: mrpt::math::MatrixVectorBase, mrpt::math::CMatrixDynamic>>::operator=(const class mrpt::math::MatrixVectorBase, class mrpt::math::CMatrixDynamic > > &) --> class mrpt::math::MatrixVectorBase, class mrpt::math::CMatrixDynamic > > &", pybind11::return_value_policy::automatic, pybind11::arg("")); } - } + { // mrpt::math::CMatrixFixed file:mrpt/math/CMatrixFixed.h line:34 + pybind11::class_, std::shared_ptr>> cl(M("mrpt::math"), "CMatrixFixed_double_2UL_2UL_t", ""); diff --git a/python/python.conf b/python/python.conf index 3050455b82..7d7545f687 100644 --- a/python/python.conf +++ b/python/python.conf @@ -213,6 +213,7 @@ -class mrpt::math::MatrixBase> -class mrpt::math::MatrixBase> -class mrpt::math::MatrixBase> +-class mrpt::math::MatrixBase,mrpt::math::CMatrixDynamic >> -class mrpt::math::MatrixBase> -class mrpt::math::MatrixBase> -class mrpt::math::MatrixBase> @@ -232,6 +233,7 @@ -class mrpt::math::MatrixVectorBase> -class mrpt::math::MatrixVectorBase> -class mrpt::math::MatrixVectorBase> +-class mrpt::math::MatrixVectorBase,mrpt::math::CMatrixDynamic >> -class mrpt::math::MatrixVectorBase> -class mrpt::math::MatrixVectorBase> -class mrpt::math::MatrixVectorBase> diff --git a/python/src/mrpt/math/CMatrixDynamic_1.cpp b/python/src/mrpt/math/CMatrixDynamic_1.cpp index 889abe4da9..4d90b28d64 100644 --- a/python/src/mrpt/math/CMatrixDynamic_1.cpp +++ b/python/src/mrpt/math/CMatrixDynamic_1.cpp @@ -3,7 +3,6 @@ #include #include #include -#include #include #include #include @@ -29,51 +28,7 @@ void bind_mrpt_math_CMatrixDynamic_1(std::function< pybind11::module &(std::string const &namespace_) > &M) { { // mrpt::math::CMatrixDynamic file:mrpt/math/CMatrixDynamic.h line:41 - pybind11::class_, std::shared_ptr>> cl(M("mrpt::math"), "CMatrixDynamic_double_t", ""); - cl.def( pybind11::init( [](mrpt::math::CMatrixDynamic const &o){ return new mrpt::math::CMatrixDynamic(o); } ) ); - cl.def( pybind11::init( [](){ return new mrpt::math::CMatrixDynamic(); } ), "doc" ); - cl.def( pybind11::init( [](size_t const & a0){ return new mrpt::math::CMatrixDynamic(a0); } ), "doc" , pybind11::arg("row")); - cl.def( pybind11::init(), pybind11::arg("row"), pybind11::arg("col") ); - - cl.def( pybind11::init &, size_t, size_t>(), pybind11::arg("m"), pybind11::arg("cropRowCount"), pybind11::arg("cropColCount") ); - - cl.def("setFromMatrixLike", (void (mrpt::math::CMatrixDynamic::*)(const class mrpt::math::CMatrixDynamic &)) &mrpt::math::CMatrixDynamic::setFromMatrixLike>, "C++: mrpt::math::CMatrixDynamic::setFromMatrixLike(const class mrpt::math::CMatrixDynamic &) --> void", pybind11::arg("m")); - cl.def("setFromMatrixLike", (void (mrpt::math::CMatrixDynamic::*)(const class mrpt::math::CMatrixFixed &)) &mrpt::math::CMatrixDynamic::setFromMatrixLike>, "C++: mrpt::math::CMatrixDynamic::setFromMatrixLike(const class mrpt::math::CMatrixFixed &) --> void", pybind11::arg("m")); - cl.def("assign", (class mrpt::math::CMatrixDynamic & (mrpt::math::CMatrixDynamic::*)(const class mrpt::math::CMatrixDynamic &)) &mrpt::math::CMatrixDynamic::operator=, "C++: mrpt::math::CMatrixDynamic::operator=(const class mrpt::math::CMatrixDynamic &) --> class mrpt::math::CMatrixDynamic &", pybind11::return_value_policy::automatic, pybind11::arg("m")); - cl.def("assign", (class mrpt::math::CMatrixDynamic & (mrpt::math::CMatrixDynamic::*)(const class mrpt::math::CMatrixDynamic &)) &mrpt::math::CMatrixDynamic::operator=, "C++: mrpt::math::CMatrixDynamic::operator=(const class mrpt::math::CMatrixDynamic &) --> class mrpt::math::CMatrixDynamic &", pybind11::return_value_policy::automatic, pybind11::arg("m")); - cl.def("assign", (class mrpt::math::CMatrixDynamic & (mrpt::math::CMatrixDynamic::*)(const class mrpt::math::CMatrixFixed &)) &mrpt::math::CMatrixDynamic::operator=<3UL,3UL>, "C++: mrpt::math::CMatrixDynamic::operator=(const class mrpt::math::CMatrixFixed &) --> class mrpt::math::CMatrixDynamic &", pybind11::return_value_policy::automatic, pybind11::arg("m")); - cl.def("swap", (void (mrpt::math::CMatrixDynamic::*)(class mrpt::math::CMatrixDynamic &)) &mrpt::math::CMatrixDynamic::swap, "C++: mrpt::math::CMatrixDynamic::swap(class mrpt::math::CMatrixDynamic &) --> void", pybind11::arg("o")); - cl.def("assign", (class mrpt::math::CMatrixDynamic & (mrpt::math::CMatrixDynamic::*)(const class mrpt::math::CMatrixDynamic &)) &mrpt::math::CMatrixDynamic::operator=, "C++: mrpt::math::CMatrixDynamic::operator=(const class mrpt::math::CMatrixDynamic &) --> class mrpt::math::CMatrixDynamic &", pybind11::return_value_policy::automatic, pybind11::arg("m")); - cl.def("rows", (int (mrpt::math::CMatrixDynamic::*)() const) &mrpt::math::CMatrixDynamic::rows, "C++: mrpt::math::CMatrixDynamic::rows() const --> int"); - cl.def("cols", (int (mrpt::math::CMatrixDynamic::*)() const) &mrpt::math::CMatrixDynamic::cols, "C++: mrpt::math::CMatrixDynamic::cols() const --> int"); - cl.def("setSize", [](mrpt::math::CMatrixDynamic &o, size_t const & a0, size_t const & a1) -> void { return o.setSize(a0, a1); }, "", pybind11::arg("row"), pybind11::arg("col")); - cl.def("setSize", (void (mrpt::math::CMatrixDynamic::*)(size_t, size_t, bool)) &mrpt::math::CMatrixDynamic::setSize, "C++: mrpt::math::CMatrixDynamic::setSize(size_t, size_t, bool) --> void", pybind11::arg("row"), pybind11::arg("col"), pybind11::arg("zeroNewElements")); - cl.def("resize", (void (mrpt::math::CMatrixDynamic::*)(size_t, size_t)) &mrpt::math::CMatrixDynamic::resize, "C++: mrpt::math::CMatrixDynamic::resize(size_t, size_t) --> void", pybind11::arg("row"), pybind11::arg("col")); - cl.def("resize", (void (mrpt::math::CMatrixDynamic::*)(size_t)) &mrpt::math::CMatrixDynamic::resize, "C++: mrpt::math::CMatrixDynamic::resize(size_t) --> void", pybind11::arg("vectorLen")); - cl.def("derived", (class mrpt::math::CMatrixDynamic & (mrpt::math::CMatrixDynamic::*)()) &mrpt::math::CMatrixDynamic::derived, "C++: mrpt::math::CMatrixDynamic::derived() --> class mrpt::math::CMatrixDynamic &", pybind11::return_value_policy::automatic); - cl.def("conservativeResize", (void (mrpt::math::CMatrixDynamic::*)(size_t, size_t)) &mrpt::math::CMatrixDynamic::conservativeResize, "C++: mrpt::math::CMatrixDynamic::conservativeResize(size_t, size_t) --> void", pybind11::arg("row"), pybind11::arg("col")); - cl.def("data", (double * (mrpt::math::CMatrixDynamic::*)()) &mrpt::math::CMatrixDynamic::data, "C++: mrpt::math::CMatrixDynamic::data() --> double *", pybind11::return_value_policy::automatic); - cl.def("__call__", (double & (mrpt::math::CMatrixDynamic::*)(size_t, size_t)) &mrpt::math::CMatrixDynamic::operator(), "C++: mrpt::math::CMatrixDynamic::operator()(size_t, size_t) --> double &", pybind11::return_value_policy::reference, pybind11::arg("row"), pybind11::arg("col")); - cl.def("cast_float", (class mrpt::math::CMatrixDynamic (mrpt::math::CMatrixDynamic::*)() const) &mrpt::math::CMatrixDynamic::cast_float, "C++: mrpt::math::CMatrixDynamic::cast_float() const --> class mrpt::math::CMatrixDynamic"); - cl.def("cast_double", (class mrpt::math::CMatrixDynamic (mrpt::math::CMatrixDynamic::*)() const) &mrpt::math::CMatrixDynamic::cast_double, "C++: mrpt::math::CMatrixDynamic::cast_double() const --> class mrpt::math::CMatrixDynamic"); - cl.def("llt_solve", (class mrpt::math::CVectorDynamic (mrpt::math::CMatrixDynamic::*)(const class mrpt::math::CVectorDynamic &) const) &mrpt::math::CMatrixDynamic::llt_solve, "C++: mrpt::math::CMatrixDynamic::llt_solve(const class mrpt::math::CVectorDynamic &) const --> class mrpt::math::CVectorDynamic", pybind11::arg("b")); - cl.def("lu_solve", (class mrpt::math::CVectorDynamic (mrpt::math::CMatrixDynamic::*)(const class mrpt::math::CVectorDynamic &) const) &mrpt::math::CMatrixDynamic::lu_solve, "C++: mrpt::math::CMatrixDynamic::lu_solve(const class mrpt::math::CVectorDynamic &) const --> class mrpt::math::CVectorDynamic", pybind11::arg("b")); - - // Manually-added matrix methods: - using dat_t = double; - using mat_t = mrpt::math::CMatrixDynamic; - cl.def("__getitem__", [](const mat_t&self, pybind11::tuple coord) -> dat_t { if (coord.size()==2) return self.coeff(coord[0].cast(), coord[1].cast()); else if (coord.size()==1) return self[coord[0].cast()]; else throw std::invalid_argument("Access with [idx] or [row,col]"); }); - cl.def("__setitem__", [](mat_t&self, pybind11::tuple coord, dat_t val) { if (coord.size()==2) self.coeffRef(coord[0].cast(), coord[1].cast())=val; else if (coord.size()==1) self[coord[0].cast()]=val; else throw std::invalid_argument("Access with [idx] or [row,col]"); }); - cl.def("__str__", [](const mat_t& o) -> std::string { return o.asString(); } ); - cl.def("inMatlabFormat", [](const mat_t& o) -> std::string { return o.inMatlabFormat(); } ); - cl.def("size", [](const mat_t&self) -> pybind11::tuple { return pybind11::make_tuple(self.cols(),self.rows()); }); - cl.def_static("Identity", [](const size_t N) -> mat_t { return mat_t::Identity(N); }, "Returns the NxN identity matrix"); - cl.def_static("Zero", [](const size_t nRows, const size_t nCols) -> mat_t { return mat_t::Zero(nRows,nCols); }, "Returns a matrix with zeroes"); - cl.def(pybind11::init( [](pybind11::list vals){ auto m = new mat_t(); const auto nR = vals.size(); if (!nR) return m; const auto nC = vals[0].cast().size(); m->setSize(nR,nC); for (size_t r=0;r(); for (size_t c=0;ccoeffRef(r,c) = row[c].cast(); } return m; })); - cl.def("to_list", [](const mat_t&self) -> pybind11::list { auto l = pybind11::list(); const auto nR = self.rows(), nC = self.cols(); for (size_t r=0;r>, std::shared_ptr>>, mrpt::math::MatrixBase,mrpt::math::CMatrixDynamic >>> cl(M("mrpt::math"), "CMatrixDynamic_mrpt_math_TPoint3D_float_t", ""); + pybind11::class_>, std::shared_ptr>>> cl(M("mrpt::math"), "CMatrixDynamic_mrpt_math_TPoint3D_float_t", ""); cl.def( pybind11::init( [](mrpt::math::CMatrixDynamic> const &o){ return new mrpt::math::CMatrixDynamic>(o); } ) ); cl.def( pybind11::init( [](){ return new mrpt::math::CMatrixDynamic>(); } ), "doc" ); cl.def( pybind11::init( [](size_t const & a0){ return new mrpt::math::CMatrixDynamic>(a0); } ), "doc" , pybind11::arg("row")); @@ -93,23 +48,72 @@ void bind_mrpt_math_CMatrixDynamic_1(std::function< pybind11::module &(std::stri cl.def("derived", (class mrpt::math::CMatrixDynamic > & (mrpt::math::CMatrixDynamic>::*)()) &mrpt::math::CMatrixDynamic>::derived, "C++: mrpt::math::CMatrixDynamic>::derived() --> class mrpt::math::CMatrixDynamic > &", pybind11::return_value_policy::automatic); cl.def("conservativeResize", (void (mrpt::math::CMatrixDynamic>::*)(size_t, size_t)) &mrpt::math::CMatrixDynamic>::conservativeResize, "C++: mrpt::math::CMatrixDynamic>::conservativeResize(size_t, size_t) --> void", pybind11::arg("row"), pybind11::arg("col")); cl.def("data", (struct mrpt::math::TPoint3D_ * (mrpt::math::CMatrixDynamic>::*)()) &mrpt::math::CMatrixDynamic>::data, "C++: mrpt::math::CMatrixDynamic>::data() --> struct mrpt::math::TPoint3D_ *", pybind11::return_value_policy::automatic); - cl.def("__call__", (struct mrpt::math::TPoint3D_ & (mrpt::math::CMatrixDynamic>::*)(size_t, size_t)) &mrpt::math::CMatrixDynamic>::operator(), "C++: mrpt::math::CMatrixDynamic>::operator()(size_t, size_t) --> struct mrpt::math::TPoint3D_ &", pybind11::return_value_policy::automatic, pybind11::arg("row"), pybind11::arg("col")); - cl.def("__getitem__", (struct mrpt::math::TPoint3D_ & (mrpt::math::CMatrixDynamic>::*)(size_t)) &mrpt::math::CMatrixDynamic>::operator[], "C++: mrpt::math::CMatrixDynamic>::operator[](size_t) --> struct mrpt::math::TPoint3D_ &", pybind11::return_value_policy::automatic, pybind11::arg("ith")); - cl.def("mbDerived", (class mrpt::math::CMatrixDynamic > & (mrpt::math::MatrixBase,mrpt::math::CMatrixDynamic >>::*)()) &mrpt::math::MatrixBase, mrpt::math::CMatrixDynamic>>::mbDerived, "C++: mrpt::math::MatrixBase, mrpt::math::CMatrixDynamic>>::mbDerived() --> class mrpt::math::CMatrixDynamic > &", pybind11::return_value_policy::automatic); - cl.def("assign", (class mrpt::math::MatrixBase, class mrpt::math::CMatrixDynamic > > & (mrpt::math::MatrixBase,mrpt::math::CMatrixDynamic >>::*)(const class mrpt::math::MatrixBase, class mrpt::math::CMatrixDynamic > > &)) &mrpt::math::MatrixBase, mrpt::math::CMatrixDynamic>>::operator=, "C++: mrpt::math::MatrixBase, mrpt::math::CMatrixDynamic>>::operator=(const class mrpt::math::MatrixBase, class mrpt::math::CMatrixDynamic > > &) --> class mrpt::math::MatrixBase, class mrpt::math::CMatrixDynamic > > &", pybind11::return_value_policy::automatic, pybind11::arg("")); - cl.def("setConstant", (void (mrpt::math::MatrixVectorBase,mrpt::math::CMatrixDynamic >>::*)(const struct mrpt::math::TPoint3D_)) &mrpt::math::MatrixVectorBase, mrpt::math::CMatrixDynamic>>::setConstant, "C++: mrpt::math::MatrixVectorBase, mrpt::math::CMatrixDynamic>>::setConstant(const struct mrpt::math::TPoint3D_) --> void", pybind11::arg("value")); - cl.def("setConstant", (void (mrpt::math::MatrixVectorBase,mrpt::math::CMatrixDynamic >>::*)(size_t, size_t, const struct mrpt::math::TPoint3D_)) &mrpt::math::MatrixVectorBase, mrpt::math::CMatrixDynamic>>::setConstant, "C++: mrpt::math::MatrixVectorBase, mrpt::math::CMatrixDynamic>>::setConstant(size_t, size_t, const struct mrpt::math::TPoint3D_) --> void", pybind11::arg("nrows"), pybind11::arg("ncols"), pybind11::arg("value")); - cl.def("setConstant", (void (mrpt::math::MatrixVectorBase,mrpt::math::CMatrixDynamic >>::*)(size_t, const struct mrpt::math::TPoint3D_)) &mrpt::math::MatrixVectorBase, mrpt::math::CMatrixDynamic>>::setConstant, "C++: mrpt::math::MatrixVectorBase, mrpt::math::CMatrixDynamic>>::setConstant(size_t, const struct mrpt::math::TPoint3D_) --> void", pybind11::arg("nrows"), pybind11::arg("value")); - cl.def_static("Constant", (class mrpt::math::CMatrixDynamic > (*)(const struct mrpt::math::TPoint3D_)) &mrpt::math::MatrixVectorBase, mrpt::math::CMatrixDynamic>>::Constant, "C++: mrpt::math::MatrixVectorBase, mrpt::math::CMatrixDynamic>>::Constant(const struct mrpt::math::TPoint3D_) --> class mrpt::math::CMatrixDynamic >", pybind11::arg("value")); - cl.def_static("Constant", (class mrpt::math::CMatrixDynamic > (*)(size_t, size_t, const struct mrpt::math::TPoint3D_)) &mrpt::math::MatrixVectorBase, mrpt::math::CMatrixDynamic>>::Constant, "C++: mrpt::math::MatrixVectorBase, mrpt::math::CMatrixDynamic>>::Constant(size_t, size_t, const struct mrpt::math::TPoint3D_) --> class mrpt::math::CMatrixDynamic >", pybind11::arg("nrows"), pybind11::arg("ncols"), pybind11::arg("value")); - cl.def("assign", (void (mrpt::math::MatrixVectorBase,mrpt::math::CMatrixDynamic >>::*)(const unsigned long, const struct mrpt::math::TPoint3D_)) &mrpt::math::MatrixVectorBase, mrpt::math::CMatrixDynamic>>::assign, "C++: mrpt::math::MatrixVectorBase, mrpt::math::CMatrixDynamic>>::assign(const unsigned long, const struct mrpt::math::TPoint3D_) --> void", pybind11::arg("N"), pybind11::arg("value")); - cl.def("coeffRef", (struct mrpt::math::TPoint3D_ & (mrpt::math::MatrixVectorBase,mrpt::math::CMatrixDynamic >>::*)(int, int)) &mrpt::math::MatrixVectorBase, mrpt::math::CMatrixDynamic>>::coeffRef, "C++: mrpt::math::MatrixVectorBase, mrpt::math::CMatrixDynamic>>::coeffRef(int, int) --> struct mrpt::math::TPoint3D_ &", pybind11::return_value_policy::automatic, pybind11::arg("r"), pybind11::arg("c")); - cl.def("coeff", (const struct mrpt::math::TPoint3D_ & (mrpt::math::MatrixVectorBase,mrpt::math::CMatrixDynamic >>::*)(int, int) const) &mrpt::math::MatrixVectorBase, mrpt::math::CMatrixDynamic>>::coeff, "C++: mrpt::math::MatrixVectorBase, mrpt::math::CMatrixDynamic>>::coeff(int, int) const --> const struct mrpt::math::TPoint3D_ &", pybind11::return_value_policy::automatic, pybind11::arg("r"), pybind11::arg("c")); - cl.def("isSquare", (bool (mrpt::math::MatrixVectorBase,mrpt::math::CMatrixDynamic >>::*)() const) &mrpt::math::MatrixVectorBase, mrpt::math::CMatrixDynamic>>::isSquare, "C++: mrpt::math::MatrixVectorBase, mrpt::math::CMatrixDynamic>>::isSquare() const --> bool"); - cl.def("empty", (bool (mrpt::math::MatrixVectorBase,mrpt::math::CMatrixDynamic >>::*)() const) &mrpt::math::MatrixVectorBase, mrpt::math::CMatrixDynamic>>::empty, "C++: mrpt::math::MatrixVectorBase, mrpt::math::CMatrixDynamic>>::empty() const --> bool"); - cl.def("norm_inf", (struct mrpt::math::TPoint3D_ (mrpt::math::MatrixVectorBase,mrpt::math::CMatrixDynamic >>::*)() const) &mrpt::math::MatrixVectorBase, mrpt::math::CMatrixDynamic>>::norm_inf, "C++: mrpt::math::MatrixVectorBase, mrpt::math::CMatrixDynamic>>::norm_inf() const --> struct mrpt::math::TPoint3D_"); - cl.def("norm", (struct mrpt::math::TPoint3D_ (mrpt::math::MatrixVectorBase,mrpt::math::CMatrixDynamic >>::*)() const) &mrpt::math::MatrixVectorBase, mrpt::math::CMatrixDynamic>>::norm, "C++: mrpt::math::MatrixVectorBase, mrpt::math::CMatrixDynamic>>::norm() const --> struct mrpt::math::TPoint3D_"); - cl.def("asString", (std::string (mrpt::math::MatrixVectorBase,mrpt::math::CMatrixDynamic >>::*)() const) &mrpt::math::MatrixVectorBase, mrpt::math::CMatrixDynamic>>::asString, "C++: mrpt::math::MatrixVectorBase, mrpt::math::CMatrixDynamic>>::asString() const --> std::string"); - cl.def("assign", (class mrpt::math::MatrixVectorBase, class mrpt::math::CMatrixDynamic > > & (mrpt::math::MatrixVectorBase,mrpt::math::CMatrixDynamic >>::*)(const class mrpt::math::MatrixVectorBase, class mrpt::math::CMatrixDynamic > > &)) &mrpt::math::MatrixVectorBase, mrpt::math::CMatrixDynamic>>::operator=, "C++: mrpt::math::MatrixVectorBase, mrpt::math::CMatrixDynamic>>::operator=(const class mrpt::math::MatrixVectorBase, class mrpt::math::CMatrixDynamic > > &) --> class mrpt::math::MatrixVectorBase, class mrpt::math::CMatrixDynamic > > &", pybind11::return_value_policy::automatic, pybind11::arg("")); + cl.def("__call__", (struct mrpt::math::TPoint3D_ & (mrpt::math::CMatrixDynamic>::*)(size_t, size_t)) &mrpt::math::CMatrixDynamic>::operator(), "C++: mrpt::math::CMatrixDynamic>::operator()(size_t, size_t) --> struct mrpt::math::TPoint3D_ &", pybind11::return_value_policy::reference, pybind11::arg("row"), pybind11::arg("col")); + cl.def("__getitem__", (struct mrpt::math::TPoint3D_ & (mrpt::math::CMatrixDynamic>::*)(size_t)) &mrpt::math::CMatrixDynamic>::operator[], "C++: mrpt::math::CMatrixDynamic>::operator[](size_t) --> struct mrpt::math::TPoint3D_ &", pybind11::return_value_policy::reference, pybind11::arg("ith")); + } + { // mrpt::math::CMatrixFixed file:mrpt/math/CMatrixFixed.h line:34 + pybind11::class_, std::shared_ptr>> cl(M("mrpt::math"), "CMatrixFixed_double_2UL_2UL_t", ""); + cl.def( pybind11::init( [](){ return new mrpt::math::CMatrixFixed(); } ) ); + cl.def( pybind11::init(), pybind11::arg("") ); + + cl.def( pybind11::init(), pybind11::arg("data") ); + + cl.def( pybind11::init(), pybind11::arg("rows"), pybind11::arg("cols") ); + + cl.def( pybind11::init( [](mrpt::math::CMatrixFixed const &o){ return new mrpt::math::CMatrixFixed(o); } ) ); + cl.def("loadFromRawPointer", (void (mrpt::math::CMatrixFixed::*)(const double *)) &mrpt::math::CMatrixFixed::loadFromRawPointer, "C++: mrpt::math::CMatrixFixed::loadFromRawPointer(const double *) --> void", pybind11::arg("data")); + cl.def("setSize", [](mrpt::math::CMatrixFixed &o, size_t const & a0, size_t const & a1) -> void { return o.setSize(a0, a1); }, "", pybind11::arg("row"), pybind11::arg("col")); + cl.def("setSize", (void (mrpt::math::CMatrixFixed::*)(size_t, size_t, bool)) &mrpt::math::CMatrixFixed::setSize, "C++: mrpt::math::CMatrixFixed::setSize(size_t, size_t, bool) --> void", pybind11::arg("row"), pybind11::arg("col"), pybind11::arg("zeroNewElements")); + cl.def("swap", (void (mrpt::math::CMatrixFixed::*)(class mrpt::math::CMatrixFixed &)) &mrpt::math::CMatrixFixed::swap, "C++: mrpt::math::CMatrixFixed::swap(class mrpt::math::CMatrixFixed &) --> void", pybind11::arg("o")); + cl.def("conservativeResize", (void (mrpt::math::CMatrixFixed::*)(size_t, size_t)) &mrpt::math::CMatrixFixed::conservativeResize, "C++: mrpt::math::CMatrixFixed::conservativeResize(size_t, size_t) --> void", pybind11::arg("row"), pybind11::arg("col")); + cl.def("resize", (void (mrpt::math::CMatrixFixed::*)(size_t)) &mrpt::math::CMatrixFixed::resize, "C++: mrpt::math::CMatrixFixed::resize(size_t) --> void", pybind11::arg("n")); + cl.def("resize", (void (mrpt::math::CMatrixFixed::*)(size_t, size_t)) &mrpt::math::CMatrixFixed::resize, "C++: mrpt::math::CMatrixFixed::resize(size_t, size_t) --> void", pybind11::arg("row"), pybind11::arg("col")); + cl.def("rows", (int (mrpt::math::CMatrixFixed::*)() const) &mrpt::math::CMatrixFixed::rows, "C++: mrpt::math::CMatrixFixed::rows() const --> int"); + cl.def("cols", (int (mrpt::math::CMatrixFixed::*)() const) &mrpt::math::CMatrixFixed::cols, "C++: mrpt::math::CMatrixFixed::cols() const --> int"); + cl.def("data", (double * (mrpt::math::CMatrixFixed::*)()) &mrpt::math::CMatrixFixed::data, "C++: mrpt::math::CMatrixFixed::data() --> double *", pybind11::return_value_policy::automatic); + cl.def("__call__", (double & (mrpt::math::CMatrixFixed::*)(int, int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int, int) --> double &", pybind11::return_value_policy::reference, pybind11::arg("row"), pybind11::arg("col")); + cl.def("__call__", (double & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int) --> double &", pybind11::return_value_policy::reference, pybind11::arg("i")); + cl.def("__getitem__", (double & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator[], "C++: mrpt::math::CMatrixFixed::operator[](int) --> double &", pybind11::return_value_policy::reference, pybind11::arg("i")); + cl.def("sum_At", (void (mrpt::math::CMatrixFixed::*)(const class mrpt::math::CMatrixFixed &)) &mrpt::math::CMatrixFixed::sum_At, "C++: mrpt::math::CMatrixFixed::sum_At(const class mrpt::math::CMatrixFixed &) --> void", pybind11::arg("A")); + cl.def("assign", (class mrpt::math::CMatrixFixed & (mrpt::math::CMatrixFixed::*)(const class mrpt::math::CMatrixFixed &)) &mrpt::math::CMatrixFixed::operator=, "C++: mrpt::math::CMatrixFixed::operator=(const class mrpt::math::CMatrixFixed &) --> class mrpt::math::CMatrixFixed &", pybind11::return_value_policy::automatic, pybind11::arg("")); + } + { // mrpt::math::CMatrixFixed file:mrpt/math/CMatrixFixed.h line:34 + pybind11::class_, std::shared_ptr>> cl(M("mrpt::math"), "CMatrixFixed_double_3UL_3UL_t", ""); + cl.def( pybind11::init( [](){ return new mrpt::math::CMatrixFixed(); } ) ); + cl.def( pybind11::init(), pybind11::arg("") ); + + cl.def( pybind11::init(), pybind11::arg("data") ); + + cl.def( pybind11::init(), pybind11::arg("rows"), pybind11::arg("cols") ); + + cl.def( pybind11::init( [](mrpt::math::CMatrixFixed const &o){ return new mrpt::math::CMatrixFixed(o); } ) ); + cl.def("loadFromRawPointer", (void (mrpt::math::CMatrixFixed::*)(const double *)) &mrpt::math::CMatrixFixed::loadFromRawPointer, "C++: mrpt::math::CMatrixFixed::loadFromRawPointer(const double *) --> void", pybind11::arg("data")); + cl.def("setSize", [](mrpt::math::CMatrixFixed &o, size_t const & a0, size_t const & a1) -> void { return o.setSize(a0, a1); }, "", pybind11::arg("row"), pybind11::arg("col")); + cl.def("setSize", (void (mrpt::math::CMatrixFixed::*)(size_t, size_t, bool)) &mrpt::math::CMatrixFixed::setSize, "C++: mrpt::math::CMatrixFixed::setSize(size_t, size_t, bool) --> void", pybind11::arg("row"), pybind11::arg("col"), pybind11::arg("zeroNewElements")); + cl.def("swap", (void (mrpt::math::CMatrixFixed::*)(class mrpt::math::CMatrixFixed &)) &mrpt::math::CMatrixFixed::swap, "C++: mrpt::math::CMatrixFixed::swap(class mrpt::math::CMatrixFixed &) --> void", pybind11::arg("o")); + cl.def("conservativeResize", (void (mrpt::math::CMatrixFixed::*)(size_t, size_t)) &mrpt::math::CMatrixFixed::conservativeResize, "C++: mrpt::math::CMatrixFixed::conservativeResize(size_t, size_t) --> void", pybind11::arg("row"), pybind11::arg("col")); + cl.def("resize", (void (mrpt::math::CMatrixFixed::*)(size_t)) &mrpt::math::CMatrixFixed::resize, "C++: mrpt::math::CMatrixFixed::resize(size_t) --> void", pybind11::arg("n")); + cl.def("resize", (void (mrpt::math::CMatrixFixed::*)(size_t, size_t)) &mrpt::math::CMatrixFixed::resize, "C++: mrpt::math::CMatrixFixed::resize(size_t, size_t) --> void", pybind11::arg("row"), pybind11::arg("col")); + cl.def("rows", (int (mrpt::math::CMatrixFixed::*)() const) &mrpt::math::CMatrixFixed::rows, "C++: mrpt::math::CMatrixFixed::rows() const --> int"); + cl.def("cols", (int (mrpt::math::CMatrixFixed::*)() const) &mrpt::math::CMatrixFixed::cols, "C++: mrpt::math::CMatrixFixed::cols() const --> int"); + cl.def("data", (double * (mrpt::math::CMatrixFixed::*)()) &mrpt::math::CMatrixFixed::data, "C++: mrpt::math::CMatrixFixed::data() --> double *", pybind11::return_value_policy::automatic); + cl.def("__call__", (double & (mrpt::math::CMatrixFixed::*)(int, int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int, int) --> double &", pybind11::return_value_policy::reference, pybind11::arg("row"), pybind11::arg("col")); + cl.def("__call__", (double & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int) --> double &", pybind11::return_value_policy::reference, pybind11::arg("i")); + cl.def("cast_float", (class mrpt::math::CMatrixFixed (mrpt::math::CMatrixFixed::*)() const) &mrpt::math::CMatrixFixed::cast_float, "C++: mrpt::math::CMatrixFixed::cast_float() const --> class mrpt::math::CMatrixFixed"); + cl.def("sum_At", (void (mrpt::math::CMatrixFixed::*)(const class mrpt::math::CMatrixFixed &)) &mrpt::math::CMatrixFixed::sum_At, "C++: mrpt::math::CMatrixFixed::sum_At(const class mrpt::math::CMatrixFixed &) --> void", pybind11::arg("A")); + cl.def("assign", (class mrpt::math::CMatrixFixed & (mrpt::math::CMatrixFixed::*)(const class mrpt::math::CMatrixFixed &)) &mrpt::math::CMatrixFixed::operator=, "C++: mrpt::math::CMatrixFixed::operator=(const class mrpt::math::CMatrixFixed &) --> class mrpt::math::CMatrixFixed &", pybind11::return_value_policy::automatic, pybind11::arg("")); + + // Manually-added matrix methods: + using dat_t = double; + using mat_t = mrpt::math::CMatrixFixed; + cl.def("__getitem__", [](const mat_t&self, pybind11::tuple coord) -> dat_t { if (coord.size()==2) return self.coeff(coord[0].cast(), coord[1].cast()); else if (coord.size()==1) return self[coord[0].cast()]; else throw std::invalid_argument("Access with [idx] or [row,col]"); }); + cl.def("__setitem__", [](mat_t&self, pybind11::tuple coord, dat_t val) { if (coord.size()==2) self.coeffRef(coord[0].cast(), coord[1].cast())=val; else if (coord.size()==1) self[coord[0].cast()]=val; else throw std::invalid_argument("Access with [idx] or [row,col]"); }); + cl.def("__str__", [](const mat_t& o) -> std::string { return o.asString(); } ); + cl.def("inMatlabFormat", [](const mat_t& o) -> std::string { return o.inMatlabFormat(); } ); + cl.def("size", [](const mat_t&self) -> pybind11::tuple { return pybind11::make_tuple(self.cols(),self.rows()); }); + cl.def_static("Identity", []() -> mat_t { return mat_t::Identity(); }, "Returns the NxN identity matrix"); + cl.def_static("Zero", []() -> mat_t { return mat_t::Zero(); }, "Returns a matrix with zeroes"); + cl.def(pybind11::init( [](pybind11::list vals){ auto m = new mat_t(); const auto nR = vals.size(); if (!nR) return m; const auto nC = vals[0].cast().size(); m->setSize(nR,nC); for (size_t r=0;r(); for (size_t c=0;ccoeffRef(r,c) = row[c].cast(); } return m; })); + cl.def("to_list", [](const mat_t&self) -> pybind11::list { auto l = pybind11::list(); const auto nR = self.rows(), nC = self.cols(); for (size_t r=0;r +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include // __str__ +#include +#include + +#include +#include +#include +#include + + +#ifndef BINDER_PYBIND11_TYPE_CASTER + #define BINDER_PYBIND11_TYPE_CASTER + PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr) + PYBIND11_DECLARE_HOLDER_TYPE(T, T*) + PYBIND11_MAKE_OPAQUE(std::shared_ptr) +#endif + +// mrpt::math::CMatrixD file:mrpt/math/CMatrixD.h line:23 +struct PyCallBack_mrpt_math_CMatrixD : public mrpt::math::CMatrixD { + using mrpt::math::CMatrixD::CMatrixD; + + const struct mrpt::rtti::TRuntimeClassId * GetRuntimeClass() const override { + pybind11::gil_scoped_acquire gil; + pybind11::function overload = pybind11::get_overload(static_cast(this), "GetRuntimeClass"); + if (overload) { + auto o = overload.operator()(); + if (pybind11::detail::cast_is_temporary_value_reference::value) { + static pybind11::detail::override_caster_t caster; + return pybind11::detail::cast_ref(std::move(o), caster); + } + else return pybind11::detail::cast_safe(std::move(o)); + } + return CMatrixD::GetRuntimeClass(); + } + class mrpt::rtti::CObject * clone() const override { + pybind11::gil_scoped_acquire gil; + pybind11::function overload = pybind11::get_overload(static_cast(this), "clone"); + if (overload) { + auto o = overload.operator()(); + if (pybind11::detail::cast_is_temporary_value_reference::value) { + static pybind11::detail::override_caster_t caster; + return pybind11::detail::cast_ref(std::move(o), caster); + } + else return pybind11::detail::cast_safe(std::move(o)); + } + return CMatrixD::clone(); + } + uint8_t serializeGetVersion() const override { + pybind11::gil_scoped_acquire gil; + pybind11::function overload = pybind11::get_overload(static_cast(this), "serializeGetVersion"); + if (overload) { + auto o = overload.operator()(); + if (pybind11::detail::cast_is_temporary_value_reference::value) { + static pybind11::detail::override_caster_t caster; + return pybind11::detail::cast_ref(std::move(o), caster); + } + else return pybind11::detail::cast_safe(std::move(o)); + } + return CMatrixD::serializeGetVersion(); + } + void serializeTo(class mrpt::serialization::CArchive & a0) const override { + pybind11::gil_scoped_acquire gil; + pybind11::function overload = pybind11::get_overload(static_cast(this), "serializeTo"); + if (overload) { + auto o = overload.operator()(a0); + if (pybind11::detail::cast_is_temporary_value_reference::value) { + static pybind11::detail::override_caster_t caster; + return pybind11::detail::cast_ref(std::move(o), caster); + } + else return pybind11::detail::cast_safe(std::move(o)); + } + return CMatrixD::serializeTo(a0); + } + void serializeFrom(class mrpt::serialization::CArchive & a0, uint8_t a1) override { + pybind11::gil_scoped_acquire gil; + pybind11::function overload = pybind11::get_overload(static_cast(this), "serializeFrom"); + if (overload) { + auto o = overload.operator()(a0, a1); + if (pybind11::detail::cast_is_temporary_value_reference::value) { + static pybind11::detail::override_caster_t caster; + return pybind11::detail::cast_ref(std::move(o), caster); + } + else return pybind11::detail::cast_safe(std::move(o)); + } + return CMatrixD::serializeFrom(a0, a1); + } +}; + +void bind_mrpt_math_CMatrixDynamic_2(std::function< pybind11::module &(std::string const &namespace_) > &M) +{ + { // mrpt::math::CMatrixDynamic file:mrpt/math/CMatrixDynamic.h line:41 + pybind11::class_, std::shared_ptr>> cl(M("mrpt::math"), "CMatrixDynamic_double_t", ""); + cl.def( pybind11::init( [](mrpt::math::CMatrixDynamic const &o){ return new mrpt::math::CMatrixDynamic(o); } ) ); + cl.def( pybind11::init( [](){ return new mrpt::math::CMatrixDynamic(); } ), "doc" ); + cl.def( pybind11::init( [](size_t const & a0){ return new mrpt::math::CMatrixDynamic(a0); } ), "doc" , pybind11::arg("row")); + cl.def( pybind11::init(), pybind11::arg("row"), pybind11::arg("col") ); + + cl.def( pybind11::init &, size_t, size_t>(), pybind11::arg("m"), pybind11::arg("cropRowCount"), pybind11::arg("cropColCount") ); + + cl.def("setFromMatrixLike", (void (mrpt::math::CMatrixDynamic::*)(const class mrpt::math::CMatrixDynamic &)) &mrpt::math::CMatrixDynamic::setFromMatrixLike>, "C++: mrpt::math::CMatrixDynamic::setFromMatrixLike(const class mrpt::math::CMatrixDynamic &) --> void", pybind11::arg("m")); + cl.def("setFromMatrixLike", (void (mrpt::math::CMatrixDynamic::*)(const class mrpt::math::CMatrixFixed &)) &mrpt::math::CMatrixDynamic::setFromMatrixLike>, "C++: mrpt::math::CMatrixDynamic::setFromMatrixLike(const class mrpt::math::CMatrixFixed &) --> void", pybind11::arg("m")); + cl.def("assign", (class mrpt::math::CMatrixDynamic & (mrpt::math::CMatrixDynamic::*)(const class mrpt::math::CMatrixDynamic &)) &mrpt::math::CMatrixDynamic::operator=, "C++: mrpt::math::CMatrixDynamic::operator=(const class mrpt::math::CMatrixDynamic &) --> class mrpt::math::CMatrixDynamic &", pybind11::return_value_policy::automatic, pybind11::arg("m")); + cl.def("assign", (class mrpt::math::CMatrixDynamic & (mrpt::math::CMatrixDynamic::*)(const class mrpt::math::CMatrixDynamic &)) &mrpt::math::CMatrixDynamic::operator=, "C++: mrpt::math::CMatrixDynamic::operator=(const class mrpt::math::CMatrixDynamic &) --> class mrpt::math::CMatrixDynamic &", pybind11::return_value_policy::automatic, pybind11::arg("m")); + cl.def("assign", (class mrpt::math::CMatrixDynamic & (mrpt::math::CMatrixDynamic::*)(const class mrpt::math::CMatrixFixed &)) &mrpt::math::CMatrixDynamic::operator=<3UL,3UL>, "C++: mrpt::math::CMatrixDynamic::operator=(const class mrpt::math::CMatrixFixed &) --> class mrpt::math::CMatrixDynamic &", pybind11::return_value_policy::automatic, pybind11::arg("m")); + cl.def("swap", (void (mrpt::math::CMatrixDynamic::*)(class mrpt::math::CMatrixDynamic &)) &mrpt::math::CMatrixDynamic::swap, "C++: mrpt::math::CMatrixDynamic::swap(class mrpt::math::CMatrixDynamic &) --> void", pybind11::arg("o")); + cl.def("assign", (class mrpt::math::CMatrixDynamic & (mrpt::math::CMatrixDynamic::*)(const class mrpt::math::CMatrixDynamic &)) &mrpt::math::CMatrixDynamic::operator=, "C++: mrpt::math::CMatrixDynamic::operator=(const class mrpt::math::CMatrixDynamic &) --> class mrpt::math::CMatrixDynamic &", pybind11::return_value_policy::automatic, pybind11::arg("m")); + cl.def("rows", (int (mrpt::math::CMatrixDynamic::*)() const) &mrpt::math::CMatrixDynamic::rows, "C++: mrpt::math::CMatrixDynamic::rows() const --> int"); + cl.def("cols", (int (mrpt::math::CMatrixDynamic::*)() const) &mrpt::math::CMatrixDynamic::cols, "C++: mrpt::math::CMatrixDynamic::cols() const --> int"); + cl.def("setSize", [](mrpt::math::CMatrixDynamic &o, size_t const & a0, size_t const & a1) -> void { return o.setSize(a0, a1); }, "", pybind11::arg("row"), pybind11::arg("col")); + cl.def("setSize", (void (mrpt::math::CMatrixDynamic::*)(size_t, size_t, bool)) &mrpt::math::CMatrixDynamic::setSize, "C++: mrpt::math::CMatrixDynamic::setSize(size_t, size_t, bool) --> void", pybind11::arg("row"), pybind11::arg("col"), pybind11::arg("zeroNewElements")); + cl.def("resize", (void (mrpt::math::CMatrixDynamic::*)(size_t, size_t)) &mrpt::math::CMatrixDynamic::resize, "C++: mrpt::math::CMatrixDynamic::resize(size_t, size_t) --> void", pybind11::arg("row"), pybind11::arg("col")); + cl.def("resize", (void (mrpt::math::CMatrixDynamic::*)(size_t)) &mrpt::math::CMatrixDynamic::resize, "C++: mrpt::math::CMatrixDynamic::resize(size_t) --> void", pybind11::arg("vectorLen")); + cl.def("derived", (class mrpt::math::CMatrixDynamic & (mrpt::math::CMatrixDynamic::*)()) &mrpt::math::CMatrixDynamic::derived, "C++: mrpt::math::CMatrixDynamic::derived() --> class mrpt::math::CMatrixDynamic &", pybind11::return_value_policy::automatic); + cl.def("conservativeResize", (void (mrpt::math::CMatrixDynamic::*)(size_t, size_t)) &mrpt::math::CMatrixDynamic::conservativeResize, "C++: mrpt::math::CMatrixDynamic::conservativeResize(size_t, size_t) --> void", pybind11::arg("row"), pybind11::arg("col")); + cl.def("data", (double * (mrpt::math::CMatrixDynamic::*)()) &mrpt::math::CMatrixDynamic::data, "C++: mrpt::math::CMatrixDynamic::data() --> double *", pybind11::return_value_policy::automatic); + cl.def("__call__", (double & (mrpt::math::CMatrixDynamic::*)(size_t, size_t)) &mrpt::math::CMatrixDynamic::operator(), "C++: mrpt::math::CMatrixDynamic::operator()(size_t, size_t) --> double &", pybind11::return_value_policy::reference, pybind11::arg("row"), pybind11::arg("col")); + cl.def("cast_float", (class mrpt::math::CMatrixDynamic (mrpt::math::CMatrixDynamic::*)() const) &mrpt::math::CMatrixDynamic::cast_float, "C++: mrpt::math::CMatrixDynamic::cast_float() const --> class mrpt::math::CMatrixDynamic"); + cl.def("cast_double", (class mrpt::math::CMatrixDynamic (mrpt::math::CMatrixDynamic::*)() const) &mrpt::math::CMatrixDynamic::cast_double, "C++: mrpt::math::CMatrixDynamic::cast_double() const --> class mrpt::math::CMatrixDynamic"); + cl.def("llt_solve", (class mrpt::math::CVectorDynamic (mrpt::math::CMatrixDynamic::*)(const class mrpt::math::CVectorDynamic &) const) &mrpt::math::CMatrixDynamic::llt_solve, "C++: mrpt::math::CMatrixDynamic::llt_solve(const class mrpt::math::CVectorDynamic &) const --> class mrpt::math::CVectorDynamic", pybind11::arg("b")); + cl.def("lu_solve", (class mrpt::math::CVectorDynamic (mrpt::math::CMatrixDynamic::*)(const class mrpt::math::CVectorDynamic &) const) &mrpt::math::CMatrixDynamic::lu_solve, "C++: mrpt::math::CMatrixDynamic::lu_solve(const class mrpt::math::CVectorDynamic &) const --> class mrpt::math::CVectorDynamic", pybind11::arg("b")); + + // Manually-added matrix methods: + using dat_t = double; + using mat_t = mrpt::math::CMatrixDynamic; + cl.def("__getitem__", [](const mat_t&self, pybind11::tuple coord) -> dat_t { if (coord.size()==2) return self.coeff(coord[0].cast(), coord[1].cast()); else if (coord.size()==1) return self[coord[0].cast()]; else throw std::invalid_argument("Access with [idx] or [row,col]"); }); + cl.def("__setitem__", [](mat_t&self, pybind11::tuple coord, dat_t val) { if (coord.size()==2) self.coeffRef(coord[0].cast(), coord[1].cast())=val; else if (coord.size()==1) self[coord[0].cast()]=val; else throw std::invalid_argument("Access with [idx] or [row,col]"); }); + cl.def("__str__", [](const mat_t& o) -> std::string { return o.asString(); } ); + cl.def("inMatlabFormat", [](const mat_t& o) -> std::string { return o.inMatlabFormat(); } ); + cl.def("size", [](const mat_t&self) -> pybind11::tuple { return pybind11::make_tuple(self.cols(),self.rows()); }); + cl.def_static("Identity", [](const size_t N) -> mat_t { return mat_t::Identity(N); }, "Returns the NxN identity matrix"); + cl.def_static("Zero", [](const size_t nRows, const size_t nCols) -> mat_t { return mat_t::Zero(nRows,nCols); }, "Returns a matrix with zeroes"); + cl.def(pybind11::init( [](pybind11::list vals){ auto m = new mat_t(); const auto nR = vals.size(); if (!nR) return m; const auto nC = vals[0].cast().size(); m->setSize(nR,nC); for (size_t r=0;r(); for (size_t c=0;ccoeffRef(r,c) = row[c].cast(); } return m; })); + cl.def("to_list", [](const mat_t&self) -> pybind11::list { auto l = pybind11::list(); const auto nR = self.rows(), nC = self.cols(); for (size_t r=0;r, PyCallBack_mrpt_math_CMatrixD, mrpt::serialization::CSerializable, mrpt::math::CMatrixDynamic> cl(M("mrpt::math"), "CMatrixD", "This class is a \"CSerializable\" wrapper for\n \"CMatrixDynamic\".\n \n\n For a complete introduction to Matrices and vectors in MRPT, see:\n https://www.mrpt.org/Matrices_vectors_arrays_and_Linear_Algebra_MRPT_and_Eigen_classes\n \n\n\n "); + cl.def( pybind11::init( [](){ return new mrpt::math::CMatrixD(); }, [](){ return new PyCallBack_mrpt_math_CMatrixD(); } ) ); + cl.def( pybind11::init(), pybind11::arg("row"), pybind11::arg("col") ); + + cl.def( pybind11::init &>(), pybind11::arg("m") ); + + cl.def( pybind11::init &>(), pybind11::arg("m") ); + + cl.def( pybind11::init( [](PyCallBack_mrpt_math_CMatrixD const &o){ return new PyCallBack_mrpt_math_CMatrixD(o); } ) ); + cl.def( pybind11::init( [](mrpt::math::CMatrixD const &o){ return new mrpt::math::CMatrixD(o); } ) ); + cl.def("assign", (class mrpt::math::CMatrixD & (mrpt::math::CMatrixD::*)(const class mrpt::math::CMatrixDynamic &)) &mrpt::math::CMatrixD::operator=>, "C++: mrpt::math::CMatrixD::operator=(const class mrpt::math::CMatrixDynamic &) --> class mrpt::math::CMatrixD &", pybind11::return_value_policy::automatic, pybind11::arg("other")); + cl.def("assign", (class mrpt::math::CMatrixD & (mrpt::math::CMatrixD::*)(const class mrpt::math::CMatrixD &)) &mrpt::math::CMatrixD::operator=, "C++: mrpt::math::CMatrixD::operator=(const class mrpt::math::CMatrixD &) --> class mrpt::math::CMatrixD &", pybind11::return_value_policy::automatic, pybind11::arg("other")); + cl.def_static("GetRuntimeClassIdStatic", (const struct mrpt::rtti::TRuntimeClassId & (*)()) &mrpt::math::CMatrixD::GetRuntimeClassIdStatic, "C++: mrpt::math::CMatrixD::GetRuntimeClassIdStatic() --> const struct mrpt::rtti::TRuntimeClassId &", pybind11::return_value_policy::automatic); + cl.def("GetRuntimeClass", (const struct mrpt::rtti::TRuntimeClassId * (mrpt::math::CMatrixD::*)() const) &mrpt::math::CMatrixD::GetRuntimeClass, "C++: mrpt::math::CMatrixD::GetRuntimeClass() const --> const struct mrpt::rtti::TRuntimeClassId *", pybind11::return_value_policy::automatic); + cl.def("clone", (class mrpt::rtti::CObject * (mrpt::math::CMatrixD::*)() const) &mrpt::math::CMatrixD::clone, "C++: mrpt::math::CMatrixD::clone() const --> class mrpt::rtti::CObject *", pybind11::return_value_policy::automatic); + cl.def_static("CreateObject", (class std::shared_ptr (*)()) &mrpt::math::CMatrixD::CreateObject, "C++: mrpt::math::CMatrixD::CreateObject() --> class std::shared_ptr"); + cl.def("assign", (class mrpt::math::CMatrixD & (mrpt::math::CMatrixD::*)(const class mrpt::math::CMatrixD &)) &mrpt::math::CMatrixD::operator=, "C++: mrpt::math::CMatrixD::operator=(const class mrpt::math::CMatrixD &) --> class mrpt::math::CMatrixD &", pybind11::return_value_policy::automatic, pybind11::arg("")); + } +} diff --git a/python/src/mrpt/math/CMatrixFixed.cpp b/python/src/mrpt/math/CMatrixFixed.cpp index 877ac0cb49..2168c4bf9e 100644 --- a/python/src/mrpt/math/CMatrixFixed.cpp +++ b/python/src/mrpt/math/CMatrixFixed.cpp @@ -18,71 +18,6 @@ void bind_mrpt_math_CMatrixFixed(std::function< pybind11::module &(std::string const &namespace_) > &M) { - { // mrpt::math::CMatrixFixed file:mrpt/math/CMatrixFixed.h line:34 - pybind11::class_, std::shared_ptr>> cl(M("mrpt::math"), "CMatrixFixed_double_2UL_2UL_t", ""); - cl.def( pybind11::init( [](){ return new mrpt::math::CMatrixFixed(); } ) ); - cl.def( pybind11::init(), pybind11::arg("") ); - - cl.def( pybind11::init(), pybind11::arg("data") ); - - cl.def( pybind11::init(), pybind11::arg("rows"), pybind11::arg("cols") ); - - cl.def( pybind11::init( [](mrpt::math::CMatrixFixed const &o){ return new mrpt::math::CMatrixFixed(o); } ) ); - cl.def("loadFromRawPointer", (void (mrpt::math::CMatrixFixed::*)(const double *)) &mrpt::math::CMatrixFixed::loadFromRawPointer, "C++: mrpt::math::CMatrixFixed::loadFromRawPointer(const double *) --> void", pybind11::arg("data")); - cl.def("setSize", [](mrpt::math::CMatrixFixed &o, size_t const & a0, size_t const & a1) -> void { return o.setSize(a0, a1); }, "", pybind11::arg("row"), pybind11::arg("col")); - cl.def("setSize", (void (mrpt::math::CMatrixFixed::*)(size_t, size_t, bool)) &mrpt::math::CMatrixFixed::setSize, "C++: mrpt::math::CMatrixFixed::setSize(size_t, size_t, bool) --> void", pybind11::arg("row"), pybind11::arg("col"), pybind11::arg("zeroNewElements")); - cl.def("swap", (void (mrpt::math::CMatrixFixed::*)(class mrpt::math::CMatrixFixed &)) &mrpt::math::CMatrixFixed::swap, "C++: mrpt::math::CMatrixFixed::swap(class mrpt::math::CMatrixFixed &) --> void", pybind11::arg("o")); - cl.def("conservativeResize", (void (mrpt::math::CMatrixFixed::*)(size_t, size_t)) &mrpt::math::CMatrixFixed::conservativeResize, "C++: mrpt::math::CMatrixFixed::conservativeResize(size_t, size_t) --> void", pybind11::arg("row"), pybind11::arg("col")); - cl.def("resize", (void (mrpt::math::CMatrixFixed::*)(size_t)) &mrpt::math::CMatrixFixed::resize, "C++: mrpt::math::CMatrixFixed::resize(size_t) --> void", pybind11::arg("n")); - cl.def("resize", (void (mrpt::math::CMatrixFixed::*)(size_t, size_t)) &mrpt::math::CMatrixFixed::resize, "C++: mrpt::math::CMatrixFixed::resize(size_t, size_t) --> void", pybind11::arg("row"), pybind11::arg("col")); - cl.def("rows", (int (mrpt::math::CMatrixFixed::*)() const) &mrpt::math::CMatrixFixed::rows, "C++: mrpt::math::CMatrixFixed::rows() const --> int"); - cl.def("cols", (int (mrpt::math::CMatrixFixed::*)() const) &mrpt::math::CMatrixFixed::cols, "C++: mrpt::math::CMatrixFixed::cols() const --> int"); - cl.def("data", (double * (mrpt::math::CMatrixFixed::*)()) &mrpt::math::CMatrixFixed::data, "C++: mrpt::math::CMatrixFixed::data() --> double *", pybind11::return_value_policy::automatic); - cl.def("__call__", (double & (mrpt::math::CMatrixFixed::*)(int, int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int, int) --> double &", pybind11::return_value_policy::reference, pybind11::arg("row"), pybind11::arg("col")); - cl.def("__call__", (double & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int) --> double &", pybind11::return_value_policy::reference, pybind11::arg("i")); - cl.def("__getitem__", (double & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator[], "C++: mrpt::math::CMatrixFixed::operator[](int) --> double &", pybind11::return_value_policy::reference, pybind11::arg("i")); - cl.def("sum_At", (void (mrpt::math::CMatrixFixed::*)(const class mrpt::math::CMatrixFixed &)) &mrpt::math::CMatrixFixed::sum_At, "C++: mrpt::math::CMatrixFixed::sum_At(const class mrpt::math::CMatrixFixed &) --> void", pybind11::arg("A")); - cl.def("assign", (class mrpt::math::CMatrixFixed & (mrpt::math::CMatrixFixed::*)(const class mrpt::math::CMatrixFixed &)) &mrpt::math::CMatrixFixed::operator=, "C++: mrpt::math::CMatrixFixed::operator=(const class mrpt::math::CMatrixFixed &) --> class mrpt::math::CMatrixFixed &", pybind11::return_value_policy::automatic, pybind11::arg("")); - } - { // mrpt::math::CMatrixFixed file:mrpt/math/CMatrixFixed.h line:34 - pybind11::class_, std::shared_ptr>> cl(M("mrpt::math"), "CMatrixFixed_double_3UL_3UL_t", ""); - cl.def( pybind11::init( [](){ return new mrpt::math::CMatrixFixed(); } ) ); - cl.def( pybind11::init(), pybind11::arg("") ); - - cl.def( pybind11::init(), pybind11::arg("data") ); - - cl.def( pybind11::init(), pybind11::arg("rows"), pybind11::arg("cols") ); - - cl.def( pybind11::init( [](mrpt::math::CMatrixFixed const &o){ return new mrpt::math::CMatrixFixed(o); } ) ); - cl.def("loadFromRawPointer", (void (mrpt::math::CMatrixFixed::*)(const double *)) &mrpt::math::CMatrixFixed::loadFromRawPointer, "C++: mrpt::math::CMatrixFixed::loadFromRawPointer(const double *) --> void", pybind11::arg("data")); - cl.def("setSize", [](mrpt::math::CMatrixFixed &o, size_t const & a0, size_t const & a1) -> void { return o.setSize(a0, a1); }, "", pybind11::arg("row"), pybind11::arg("col")); - cl.def("setSize", (void (mrpt::math::CMatrixFixed::*)(size_t, size_t, bool)) &mrpt::math::CMatrixFixed::setSize, "C++: mrpt::math::CMatrixFixed::setSize(size_t, size_t, bool) --> void", pybind11::arg("row"), pybind11::arg("col"), pybind11::arg("zeroNewElements")); - cl.def("swap", (void (mrpt::math::CMatrixFixed::*)(class mrpt::math::CMatrixFixed &)) &mrpt::math::CMatrixFixed::swap, "C++: mrpt::math::CMatrixFixed::swap(class mrpt::math::CMatrixFixed &) --> void", pybind11::arg("o")); - cl.def("conservativeResize", (void (mrpt::math::CMatrixFixed::*)(size_t, size_t)) &mrpt::math::CMatrixFixed::conservativeResize, "C++: mrpt::math::CMatrixFixed::conservativeResize(size_t, size_t) --> void", pybind11::arg("row"), pybind11::arg("col")); - cl.def("resize", (void (mrpt::math::CMatrixFixed::*)(size_t)) &mrpt::math::CMatrixFixed::resize, "C++: mrpt::math::CMatrixFixed::resize(size_t) --> void", pybind11::arg("n")); - cl.def("resize", (void (mrpt::math::CMatrixFixed::*)(size_t, size_t)) &mrpt::math::CMatrixFixed::resize, "C++: mrpt::math::CMatrixFixed::resize(size_t, size_t) --> void", pybind11::arg("row"), pybind11::arg("col")); - cl.def("rows", (int (mrpt::math::CMatrixFixed::*)() const) &mrpt::math::CMatrixFixed::rows, "C++: mrpt::math::CMatrixFixed::rows() const --> int"); - cl.def("cols", (int (mrpt::math::CMatrixFixed::*)() const) &mrpt::math::CMatrixFixed::cols, "C++: mrpt::math::CMatrixFixed::cols() const --> int"); - cl.def("data", (double * (mrpt::math::CMatrixFixed::*)()) &mrpt::math::CMatrixFixed::data, "C++: mrpt::math::CMatrixFixed::data() --> double *", pybind11::return_value_policy::automatic); - cl.def("__call__", (double & (mrpt::math::CMatrixFixed::*)(int, int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int, int) --> double &", pybind11::return_value_policy::reference, pybind11::arg("row"), pybind11::arg("col")); - cl.def("__call__", (double & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int) --> double &", pybind11::return_value_policy::reference, pybind11::arg("i")); - cl.def("cast_float", (class mrpt::math::CMatrixFixed (mrpt::math::CMatrixFixed::*)() const) &mrpt::math::CMatrixFixed::cast_float, "C++: mrpt::math::CMatrixFixed::cast_float() const --> class mrpt::math::CMatrixFixed"); - cl.def("sum_At", (void (mrpt::math::CMatrixFixed::*)(const class mrpt::math::CMatrixFixed &)) &mrpt::math::CMatrixFixed::sum_At, "C++: mrpt::math::CMatrixFixed::sum_At(const class mrpt::math::CMatrixFixed &) --> void", pybind11::arg("A")); - cl.def("assign", (class mrpt::math::CMatrixFixed & (mrpt::math::CMatrixFixed::*)(const class mrpt::math::CMatrixFixed &)) &mrpt::math::CMatrixFixed::operator=, "C++: mrpt::math::CMatrixFixed::operator=(const class mrpt::math::CMatrixFixed &) --> class mrpt::math::CMatrixFixed &", pybind11::return_value_policy::automatic, pybind11::arg("")); - - // Manually-added matrix methods: - using dat_t = double; - using mat_t = mrpt::math::CMatrixFixed; - cl.def("__getitem__", [](const mat_t&self, pybind11::tuple coord) -> dat_t { if (coord.size()==2) return self.coeff(coord[0].cast(), coord[1].cast()); else if (coord.size()==1) return self[coord[0].cast()]; else throw std::invalid_argument("Access with [idx] or [row,col]"); }); - cl.def("__setitem__", [](mat_t&self, pybind11::tuple coord, dat_t val) { if (coord.size()==2) self.coeffRef(coord[0].cast(), coord[1].cast())=val; else if (coord.size()==1) self[coord[0].cast()]=val; else throw std::invalid_argument("Access with [idx] or [row,col]"); }); - cl.def("__str__", [](const mat_t& o) -> std::string { return o.asString(); } ); - cl.def("inMatlabFormat", [](const mat_t& o) -> std::string { return o.inMatlabFormat(); } ); - cl.def("size", [](const mat_t&self) -> pybind11::tuple { return pybind11::make_tuple(self.cols(),self.rows()); }); - cl.def_static("Identity", []() -> mat_t { return mat_t::Identity(); }, "Returns the NxN identity matrix"); - cl.def_static("Zero", []() -> mat_t { return mat_t::Zero(); }, "Returns a matrix with zeroes"); - cl.def(pybind11::init( [](pybind11::list vals){ auto m = new mat_t(); const auto nR = vals.size(); if (!nR) return m; const auto nC = vals[0].cast().size(); m->setSize(nR,nC); for (size_t r=0;r(); for (size_t c=0;ccoeffRef(r,c) = row[c].cast(); } return m; })); - cl.def("to_list", [](const mat_t&self) -> pybind11::list { auto l = pybind11::list(); const auto nR = self.rows(), nC = self.cols(); for (size_t r=0;r, std::shared_ptr>> cl(M("mrpt::math"), "CMatrixFixed_double_4UL_4UL_t", ""); cl.def( pybind11::init( [](){ return new mrpt::math::CMatrixFixed(); } ) ); @@ -159,6 +94,69 @@ void bind_mrpt_math_CMatrixFixed(std::function< pybind11::module &(std::string c cl.def_static("Zero", []() -> mat_t { return mat_t::Zero(); }, "Returns a matrix with zeroes"); cl.def(pybind11::init( [](pybind11::list vals){ auto m = new mat_t(); const auto nR = vals.size(); if (!nR) return m; const auto nC = vals[0].cast().size(); m->setSize(nR,nC); for (size_t r=0;r(); for (size_t c=0;ccoeffRef(r,c) = row[c].cast(); } return m; })); cl.def("to_list", [](const mat_t&self) -> pybind11::list { auto l = pybind11::list(); const auto nR = self.rows(), nC = self.cols(); for (size_t r=0;r, std::shared_ptr>> cl(M("mrpt::math"), "CMatrixFixed_double_7UL_7UL_t", ""); + cl.def( pybind11::init( [](){ return new mrpt::math::CMatrixFixed(); } ) ); + cl.def( pybind11::init(), pybind11::arg("") ); + + cl.def( pybind11::init(), pybind11::arg("data") ); + + cl.def( pybind11::init(), pybind11::arg("rows"), pybind11::arg("cols") ); + + cl.def( pybind11::init( [](mrpt::math::CMatrixFixed const &o){ return new mrpt::math::CMatrixFixed(o); } ) ); + cl.def("loadFromRawPointer", (void (mrpt::math::CMatrixFixed::*)(const double *)) &mrpt::math::CMatrixFixed::loadFromRawPointer, "C++: mrpt::math::CMatrixFixed::loadFromRawPointer(const double *) --> void", pybind11::arg("data")); + cl.def("setSize", [](mrpt::math::CMatrixFixed &o, size_t const & a0, size_t const & a1) -> void { return o.setSize(a0, a1); }, "", pybind11::arg("row"), pybind11::arg("col")); + cl.def("setSize", (void (mrpt::math::CMatrixFixed::*)(size_t, size_t, bool)) &mrpt::math::CMatrixFixed::setSize, "C++: mrpt::math::CMatrixFixed::setSize(size_t, size_t, bool) --> void", pybind11::arg("row"), pybind11::arg("col"), pybind11::arg("zeroNewElements")); + cl.def("swap", (void (mrpt::math::CMatrixFixed::*)(class mrpt::math::CMatrixFixed &)) &mrpt::math::CMatrixFixed::swap, "C++: mrpt::math::CMatrixFixed::swap(class mrpt::math::CMatrixFixed &) --> void", pybind11::arg("o")); + cl.def("conservativeResize", (void (mrpt::math::CMatrixFixed::*)(size_t, size_t)) &mrpt::math::CMatrixFixed::conservativeResize, "C++: mrpt::math::CMatrixFixed::conservativeResize(size_t, size_t) --> void", pybind11::arg("row"), pybind11::arg("col")); + cl.def("resize", (void (mrpt::math::CMatrixFixed::*)(size_t)) &mrpt::math::CMatrixFixed::resize, "C++: mrpt::math::CMatrixFixed::resize(size_t) --> void", pybind11::arg("n")); + cl.def("resize", (void (mrpt::math::CMatrixFixed::*)(size_t, size_t)) &mrpt::math::CMatrixFixed::resize, "C++: mrpt::math::CMatrixFixed::resize(size_t, size_t) --> void", pybind11::arg("row"), pybind11::arg("col")); + cl.def("rows", (int (mrpt::math::CMatrixFixed::*)() const) &mrpt::math::CMatrixFixed::rows, "C++: mrpt::math::CMatrixFixed::rows() const --> int"); + cl.def("cols", (int (mrpt::math::CMatrixFixed::*)() const) &mrpt::math::CMatrixFixed::cols, "C++: mrpt::math::CMatrixFixed::cols() const --> int"); + cl.def("data", (double * (mrpt::math::CMatrixFixed::*)()) &mrpt::math::CMatrixFixed::data, "C++: mrpt::math::CMatrixFixed::data() --> double *", pybind11::return_value_policy::automatic); + cl.def("__call__", (double & (mrpt::math::CMatrixFixed::*)(int, int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int, int) --> double &", pybind11::return_value_policy::reference, pybind11::arg("row"), pybind11::arg("col")); + cl.def("__call__", (double & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int) --> double &", pybind11::return_value_policy::reference, pybind11::arg("i")); + cl.def("__getitem__", (double & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator[], "C++: mrpt::math::CMatrixFixed::operator[](int) --> double &", pybind11::return_value_policy::reference, pybind11::arg("i")); + cl.def("sum_At", (void (mrpt::math::CMatrixFixed::*)(const class mrpt::math::CMatrixFixed &)) &mrpt::math::CMatrixFixed::sum_At, "C++: mrpt::math::CMatrixFixed::sum_At(const class mrpt::math::CMatrixFixed &) --> void", pybind11::arg("A")); + cl.def("assign", (class mrpt::math::CMatrixFixed & (mrpt::math::CMatrixFixed::*)(const class mrpt::math::CMatrixFixed &)) &mrpt::math::CMatrixFixed::operator=, "C++: mrpt::math::CMatrixFixed::operator=(const class mrpt::math::CMatrixFixed &) --> class mrpt::math::CMatrixFixed &", pybind11::return_value_policy::automatic, pybind11::arg("")); + } + { // mrpt::math::CMatrixFixed file:mrpt/math/CMatrixFixed.h line:34 + pybind11::class_, std::shared_ptr>> cl(M("mrpt::math"), "CMatrixFixed_double_3UL_1UL_t", ""); + cl.def( pybind11::init( [](){ return new mrpt::math::CMatrixFixed(); } ) ); + cl.def( pybind11::init(), pybind11::arg("") ); + + cl.def( pybind11::init(), pybind11::arg("data") ); + cl.def( pybind11::init(), pybind11::arg("rows"), pybind11::arg("cols") ); + + cl.def( pybind11::init( [](mrpt::math::CMatrixFixed const &o){ return new mrpt::math::CMatrixFixed(o); } ) ); + cl.def("loadFromRawPointer", (void (mrpt::math::CMatrixFixed::*)(const double *)) &mrpt::math::CMatrixFixed::loadFromRawPointer, "C++: mrpt::math::CMatrixFixed::loadFromRawPointer(const double *) --> void", pybind11::arg("data")); + cl.def("setSize", [](mrpt::math::CMatrixFixed &o, size_t const & a0, size_t const & a1) -> void { return o.setSize(a0, a1); }, "", pybind11::arg("row"), pybind11::arg("col")); + cl.def("setSize", (void (mrpt::math::CMatrixFixed::*)(size_t, size_t, bool)) &mrpt::math::CMatrixFixed::setSize, "C++: mrpt::math::CMatrixFixed::setSize(size_t, size_t, bool) --> void", pybind11::arg("row"), pybind11::arg("col"), pybind11::arg("zeroNewElements")); + cl.def("swap", (void (mrpt::math::CMatrixFixed::*)(class mrpt::math::CMatrixFixed &)) &mrpt::math::CMatrixFixed::swap, "C++: mrpt::math::CMatrixFixed::swap(class mrpt::math::CMatrixFixed &) --> void", pybind11::arg("o")); + cl.def("conservativeResize", (void (mrpt::math::CMatrixFixed::*)(size_t, size_t)) &mrpt::math::CMatrixFixed::conservativeResize, "C++: mrpt::math::CMatrixFixed::conservativeResize(size_t, size_t) --> void", pybind11::arg("row"), pybind11::arg("col")); + cl.def("resize", (void (mrpt::math::CMatrixFixed::*)(size_t)) &mrpt::math::CMatrixFixed::resize, "C++: mrpt::math::CMatrixFixed::resize(size_t) --> void", pybind11::arg("n")); + cl.def("resize", (void (mrpt::math::CMatrixFixed::*)(size_t, size_t)) &mrpt::math::CMatrixFixed::resize, "C++: mrpt::math::CMatrixFixed::resize(size_t, size_t) --> void", pybind11::arg("row"), pybind11::arg("col")); + cl.def("rows", (int (mrpt::math::CMatrixFixed::*)() const) &mrpt::math::CMatrixFixed::rows, "C++: mrpt::math::CMatrixFixed::rows() const --> int"); + cl.def("cols", (int (mrpt::math::CMatrixFixed::*)() const) &mrpt::math::CMatrixFixed::cols, "C++: mrpt::math::CMatrixFixed::cols() const --> int"); + cl.def("data", (double * (mrpt::math::CMatrixFixed::*)()) &mrpt::math::CMatrixFixed::data, "C++: mrpt::math::CMatrixFixed::data() --> double *", pybind11::return_value_policy::automatic); + cl.def("__call__", (double & (mrpt::math::CMatrixFixed::*)(int, int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int, int) --> double &", pybind11::return_value_policy::reference, pybind11::arg("row"), pybind11::arg("col")); + cl.def("__call__", (double & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int) --> double &", pybind11::return_value_policy::reference, pybind11::arg("i")); + cl.def("cast_float", (class mrpt::math::CMatrixFixed (mrpt::math::CMatrixFixed::*)() const) &mrpt::math::CMatrixFixed::cast_float, "C++: mrpt::math::CMatrixFixed::cast_float() const --> class mrpt::math::CMatrixFixed"); + cl.def("sum_At", (void (mrpt::math::CMatrixFixed::*)(const class mrpt::math::CMatrixFixed &)) &mrpt::math::CMatrixFixed::sum_At, "C++: mrpt::math::CMatrixFixed::sum_At(const class mrpt::math::CMatrixFixed &) --> void", pybind11::arg("A")); + cl.def("assign", (class mrpt::math::CMatrixFixed & (mrpt::math::CMatrixFixed::*)(const class mrpt::math::CMatrixFixed &)) &mrpt::math::CMatrixFixed::operator=, "C++: mrpt::math::CMatrixFixed::operator=(const class mrpt::math::CMatrixFixed &) --> class mrpt::math::CMatrixFixed &", pybind11::return_value_policy::automatic, pybind11::arg("")); + + // Manually-added matrix methods: + using dat_t = double; + using mat_t = mrpt::math::CMatrixFixed; + cl.def("__getitem__", [](const mat_t&self, pybind11::tuple coord) -> dat_t { if (coord.size()==2) return self.coeff(coord[0].cast(), coord[1].cast()); else if (coord.size()==1) return self[coord[0].cast()]; else throw std::invalid_argument("Access with [idx] or [row,col]"); }); + cl.def("__setitem__", [](mat_t&self, pybind11::tuple coord, dat_t val) { if (coord.size()==2) self.coeffRef(coord[0].cast(), coord[1].cast())=val; else if (coord.size()==1) self[coord[0].cast()]=val; else throw std::invalid_argument("Access with [idx] or [row,col]"); }); + cl.def("__str__", [](const mat_t& o) -> std::string { return o.asString(); } ); + cl.def("inMatlabFormat", [](const mat_t& o) -> std::string { return o.inMatlabFormat(); } ); + cl.def("size", [](const mat_t&self) -> pybind11::tuple { return pybind11::make_tuple(self.cols(),self.rows()); }); + cl.def_static("Zero", []() -> mat_t { return mat_t::Zero(); }, "Returns a matrix with zeroes"); + cl.def(pybind11::init( [](pybind11::list vals){ auto m = new mat_t(); const auto nR = vals.size(); if (!nR) return m; const auto nC = vals[0].cast().size(); m->setSize(nR,nC); for (size_t r=0;r(); for (size_t c=0;ccoeffRef(r,c) = row[c].cast(); } return m; })); + cl.def("to_list", [](const mat_t&self) -> pybind11::list { auto l = pybind11::list(); const auto nR = self.rows(), nC = self.cols(); for (size_t r=0;r &M) { - { // mrpt::math::CMatrixFixed file:mrpt/math/CMatrixFixed.h line:34 - pybind11::class_, std::shared_ptr>> cl(M("mrpt::math"), "CMatrixFixed_double_7UL_7UL_t", ""); - cl.def( pybind11::init( [](){ return new mrpt::math::CMatrixFixed(); } ) ); - cl.def( pybind11::init(), pybind11::arg("") ); - - cl.def( pybind11::init(), pybind11::arg("data") ); - - cl.def( pybind11::init(), pybind11::arg("rows"), pybind11::arg("cols") ); - - cl.def( pybind11::init( [](mrpt::math::CMatrixFixed const &o){ return new mrpt::math::CMatrixFixed(o); } ) ); - cl.def("loadFromRawPointer", (void (mrpt::math::CMatrixFixed::*)(const double *)) &mrpt::math::CMatrixFixed::loadFromRawPointer, "C++: mrpt::math::CMatrixFixed::loadFromRawPointer(const double *) --> void", pybind11::arg("data")); - cl.def("setSize", [](mrpt::math::CMatrixFixed &o, size_t const & a0, size_t const & a1) -> void { return o.setSize(a0, a1); }, "", pybind11::arg("row"), pybind11::arg("col")); - cl.def("setSize", (void (mrpt::math::CMatrixFixed::*)(size_t, size_t, bool)) &mrpt::math::CMatrixFixed::setSize, "C++: mrpt::math::CMatrixFixed::setSize(size_t, size_t, bool) --> void", pybind11::arg("row"), pybind11::arg("col"), pybind11::arg("zeroNewElements")); - cl.def("swap", (void (mrpt::math::CMatrixFixed::*)(class mrpt::math::CMatrixFixed &)) &mrpt::math::CMatrixFixed::swap, "C++: mrpt::math::CMatrixFixed::swap(class mrpt::math::CMatrixFixed &) --> void", pybind11::arg("o")); - cl.def("conservativeResize", (void (mrpt::math::CMatrixFixed::*)(size_t, size_t)) &mrpt::math::CMatrixFixed::conservativeResize, "C++: mrpt::math::CMatrixFixed::conservativeResize(size_t, size_t) --> void", pybind11::arg("row"), pybind11::arg("col")); - cl.def("resize", (void (mrpt::math::CMatrixFixed::*)(size_t)) &mrpt::math::CMatrixFixed::resize, "C++: mrpt::math::CMatrixFixed::resize(size_t) --> void", pybind11::arg("n")); - cl.def("resize", (void (mrpt::math::CMatrixFixed::*)(size_t, size_t)) &mrpt::math::CMatrixFixed::resize, "C++: mrpt::math::CMatrixFixed::resize(size_t, size_t) --> void", pybind11::arg("row"), pybind11::arg("col")); - cl.def("rows", (int (mrpt::math::CMatrixFixed::*)() const) &mrpt::math::CMatrixFixed::rows, "C++: mrpt::math::CMatrixFixed::rows() const --> int"); - cl.def("cols", (int (mrpt::math::CMatrixFixed::*)() const) &mrpt::math::CMatrixFixed::cols, "C++: mrpt::math::CMatrixFixed::cols() const --> int"); - cl.def("data", (double * (mrpt::math::CMatrixFixed::*)()) &mrpt::math::CMatrixFixed::data, "C++: mrpt::math::CMatrixFixed::data() --> double *", pybind11::return_value_policy::automatic); - cl.def("__call__", (double & (mrpt::math::CMatrixFixed::*)(int, int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int, int) --> double &", pybind11::return_value_policy::reference, pybind11::arg("row"), pybind11::arg("col")); - cl.def("__call__", (double & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int) --> double &", pybind11::return_value_policy::reference, pybind11::arg("i")); - cl.def("__getitem__", (double & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator[], "C++: mrpt::math::CMatrixFixed::operator[](int) --> double &", pybind11::return_value_policy::reference, pybind11::arg("i")); - cl.def("sum_At", (void (mrpt::math::CMatrixFixed::*)(const class mrpt::math::CMatrixFixed &)) &mrpt::math::CMatrixFixed::sum_At, "C++: mrpt::math::CMatrixFixed::sum_At(const class mrpt::math::CMatrixFixed &) --> void", pybind11::arg("A")); - cl.def("assign", (class mrpt::math::CMatrixFixed & (mrpt::math::CMatrixFixed::*)(const class mrpt::math::CMatrixFixed &)) &mrpt::math::CMatrixFixed::operator=, "C++: mrpt::math::CMatrixFixed::operator=(const class mrpt::math::CMatrixFixed &) --> class mrpt::math::CMatrixFixed &", pybind11::return_value_policy::automatic, pybind11::arg("")); - } - { // mrpt::math::CMatrixFixed file:mrpt/math/CMatrixFixed.h line:34 - pybind11::class_, std::shared_ptr>> cl(M("mrpt::math"), "CMatrixFixed_double_3UL_1UL_t", ""); - cl.def( pybind11::init( [](){ return new mrpt::math::CMatrixFixed(); } ) ); - cl.def( pybind11::init(), pybind11::arg("") ); - - cl.def( pybind11::init(), pybind11::arg("data") ); - - cl.def( pybind11::init(), pybind11::arg("rows"), pybind11::arg("cols") ); - - cl.def( pybind11::init( [](mrpt::math::CMatrixFixed const &o){ return new mrpt::math::CMatrixFixed(o); } ) ); - cl.def("loadFromRawPointer", (void (mrpt::math::CMatrixFixed::*)(const double *)) &mrpt::math::CMatrixFixed::loadFromRawPointer, "C++: mrpt::math::CMatrixFixed::loadFromRawPointer(const double *) --> void", pybind11::arg("data")); - cl.def("setSize", [](mrpt::math::CMatrixFixed &o, size_t const & a0, size_t const & a1) -> void { return o.setSize(a0, a1); }, "", pybind11::arg("row"), pybind11::arg("col")); - cl.def("setSize", (void (mrpt::math::CMatrixFixed::*)(size_t, size_t, bool)) &mrpt::math::CMatrixFixed::setSize, "C++: mrpt::math::CMatrixFixed::setSize(size_t, size_t, bool) --> void", pybind11::arg("row"), pybind11::arg("col"), pybind11::arg("zeroNewElements")); - cl.def("swap", (void (mrpt::math::CMatrixFixed::*)(class mrpt::math::CMatrixFixed &)) &mrpt::math::CMatrixFixed::swap, "C++: mrpt::math::CMatrixFixed::swap(class mrpt::math::CMatrixFixed &) --> void", pybind11::arg("o")); - cl.def("conservativeResize", (void (mrpt::math::CMatrixFixed::*)(size_t, size_t)) &mrpt::math::CMatrixFixed::conservativeResize, "C++: mrpt::math::CMatrixFixed::conservativeResize(size_t, size_t) --> void", pybind11::arg("row"), pybind11::arg("col")); - cl.def("resize", (void (mrpt::math::CMatrixFixed::*)(size_t)) &mrpt::math::CMatrixFixed::resize, "C++: mrpt::math::CMatrixFixed::resize(size_t) --> void", pybind11::arg("n")); - cl.def("resize", (void (mrpt::math::CMatrixFixed::*)(size_t, size_t)) &mrpt::math::CMatrixFixed::resize, "C++: mrpt::math::CMatrixFixed::resize(size_t, size_t) --> void", pybind11::arg("row"), pybind11::arg("col")); - cl.def("rows", (int (mrpt::math::CMatrixFixed::*)() const) &mrpt::math::CMatrixFixed::rows, "C++: mrpt::math::CMatrixFixed::rows() const --> int"); - cl.def("cols", (int (mrpt::math::CMatrixFixed::*)() const) &mrpt::math::CMatrixFixed::cols, "C++: mrpt::math::CMatrixFixed::cols() const --> int"); - cl.def("data", (double * (mrpt::math::CMatrixFixed::*)()) &mrpt::math::CMatrixFixed::data, "C++: mrpt::math::CMatrixFixed::data() --> double *", pybind11::return_value_policy::automatic); - cl.def("__call__", (double & (mrpt::math::CMatrixFixed::*)(int, int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int, int) --> double &", pybind11::return_value_policy::reference, pybind11::arg("row"), pybind11::arg("col")); - cl.def("__call__", (double & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int) --> double &", pybind11::return_value_policy::reference, pybind11::arg("i")); - cl.def("cast_float", (class mrpt::math::CMatrixFixed (mrpt::math::CMatrixFixed::*)() const) &mrpt::math::CMatrixFixed::cast_float, "C++: mrpt::math::CMatrixFixed::cast_float() const --> class mrpt::math::CMatrixFixed"); - cl.def("sum_At", (void (mrpt::math::CMatrixFixed::*)(const class mrpt::math::CMatrixFixed &)) &mrpt::math::CMatrixFixed::sum_At, "C++: mrpt::math::CMatrixFixed::sum_At(const class mrpt::math::CMatrixFixed &) --> void", pybind11::arg("A")); - cl.def("assign", (class mrpt::math::CMatrixFixed & (mrpt::math::CMatrixFixed::*)(const class mrpt::math::CMatrixFixed &)) &mrpt::math::CMatrixFixed::operator=, "C++: mrpt::math::CMatrixFixed::operator=(const class mrpt::math::CMatrixFixed &) --> class mrpt::math::CMatrixFixed &", pybind11::return_value_policy::automatic, pybind11::arg("")); - - // Manually-added matrix methods: - using dat_t = double; - using mat_t = mrpt::math::CMatrixFixed; - cl.def("__getitem__", [](const mat_t&self, pybind11::tuple coord) -> dat_t { if (coord.size()==2) return self.coeff(coord[0].cast(), coord[1].cast()); else if (coord.size()==1) return self[coord[0].cast()]; else throw std::invalid_argument("Access with [idx] or [row,col]"); }); - cl.def("__setitem__", [](mat_t&self, pybind11::tuple coord, dat_t val) { if (coord.size()==2) self.coeffRef(coord[0].cast(), coord[1].cast())=val; else if (coord.size()==1) self[coord[0].cast()]=val; else throw std::invalid_argument("Access with [idx] or [row,col]"); }); - cl.def("__str__", [](const mat_t& o) -> std::string { return o.asString(); } ); - cl.def("inMatlabFormat", [](const mat_t& o) -> std::string { return o.inMatlabFormat(); } ); - cl.def("size", [](const mat_t&self) -> pybind11::tuple { return pybind11::make_tuple(self.cols(),self.rows()); }); - cl.def_static("Zero", []() -> mat_t { return mat_t::Zero(); }, "Returns a matrix with zeroes"); - cl.def(pybind11::init( [](pybind11::list vals){ auto m = new mat_t(); const auto nR = vals.size(); if (!nR) return m; const auto nC = vals[0].cast().size(); m->setSize(nR,nC); for (size_t r=0;r(); for (size_t c=0;ccoeffRef(r,c) = row[c].cast(); } return m; })); - cl.def("to_list", [](const mat_t&self) -> pybind11::list { auto l = pybind11::list(); const auto nR = self.rows(), nC = self.cols(); for (size_t r=0;r, std::shared_ptr>> cl(M("mrpt::math"), "CMatrixFixed_double_3UL_4UL_t", ""); cl.def( pybind11::init( [](){ return new mrpt::math::CMatrixFixed(); } ) ); @@ -132,4 +68,55 @@ void bind_mrpt_math_CMatrixFixed_1(std::function< pybind11::module &(std::string cl.def("__getitem__", (double & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator[], "C++: mrpt::math::CMatrixFixed::operator[](int) --> double &", pybind11::return_value_policy::reference, pybind11::arg("i")); cl.def("sum_At", (void (mrpt::math::CMatrixFixed::*)(const class mrpt::math::CMatrixFixed &)) &mrpt::math::CMatrixFixed::sum_At, "C++: mrpt::math::CMatrixFixed::sum_At(const class mrpt::math::CMatrixFixed &) --> void", pybind11::arg("A")); } + { // mrpt::math::CMatrixFixed file:mrpt/math/CMatrixFixed.h line:34 + pybind11::class_, std::shared_ptr>> cl(M("mrpt::math"), "CMatrixFixed_double_2UL_1UL_t", ""); + cl.def( pybind11::init( [](){ return new mrpt::math::CMatrixFixed(); } ) ); + cl.def( pybind11::init(), pybind11::arg("") ); + + cl.def( pybind11::init(), pybind11::arg("data") ); + + cl.def( pybind11::init(), pybind11::arg("rows"), pybind11::arg("cols") ); + + cl.def( pybind11::init( [](mrpt::math::CMatrixFixed const &o){ return new mrpt::math::CMatrixFixed(o); } ) ); + cl.def("loadFromRawPointer", (void (mrpt::math::CMatrixFixed::*)(const double *)) &mrpt::math::CMatrixFixed::loadFromRawPointer, "C++: mrpt::math::CMatrixFixed::loadFromRawPointer(const double *) --> void", pybind11::arg("data")); + cl.def("setSize", [](mrpt::math::CMatrixFixed &o, size_t const & a0, size_t const & a1) -> void { return o.setSize(a0, a1); }, "", pybind11::arg("row"), pybind11::arg("col")); + cl.def("setSize", (void (mrpt::math::CMatrixFixed::*)(size_t, size_t, bool)) &mrpt::math::CMatrixFixed::setSize, "C++: mrpt::math::CMatrixFixed::setSize(size_t, size_t, bool) --> void", pybind11::arg("row"), pybind11::arg("col"), pybind11::arg("zeroNewElements")); + cl.def("swap", (void (mrpt::math::CMatrixFixed::*)(class mrpt::math::CMatrixFixed &)) &mrpt::math::CMatrixFixed::swap, "C++: mrpt::math::CMatrixFixed::swap(class mrpt::math::CMatrixFixed &) --> void", pybind11::arg("o")); + cl.def("conservativeResize", (void (mrpt::math::CMatrixFixed::*)(size_t, size_t)) &mrpt::math::CMatrixFixed::conservativeResize, "C++: mrpt::math::CMatrixFixed::conservativeResize(size_t, size_t) --> void", pybind11::arg("row"), pybind11::arg("col")); + cl.def("resize", (void (mrpt::math::CMatrixFixed::*)(size_t)) &mrpt::math::CMatrixFixed::resize, "C++: mrpt::math::CMatrixFixed::resize(size_t) --> void", pybind11::arg("n")); + cl.def("resize", (void (mrpt::math::CMatrixFixed::*)(size_t, size_t)) &mrpt::math::CMatrixFixed::resize, "C++: mrpt::math::CMatrixFixed::resize(size_t, size_t) --> void", pybind11::arg("row"), pybind11::arg("col")); + cl.def("rows", (int (mrpt::math::CMatrixFixed::*)() const) &mrpt::math::CMatrixFixed::rows, "C++: mrpt::math::CMatrixFixed::rows() const --> int"); + cl.def("cols", (int (mrpt::math::CMatrixFixed::*)() const) &mrpt::math::CMatrixFixed::cols, "C++: mrpt::math::CMatrixFixed::cols() const --> int"); + cl.def("data", (double * (mrpt::math::CMatrixFixed::*)()) &mrpt::math::CMatrixFixed::data, "C++: mrpt::math::CMatrixFixed::data() --> double *", pybind11::return_value_policy::automatic); + cl.def("__call__", (double & (mrpt::math::CMatrixFixed::*)(int, int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int, int) --> double &", pybind11::return_value_policy::reference, pybind11::arg("row"), pybind11::arg("col")); + cl.def("__call__", (double & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int) --> double &", pybind11::return_value_policy::reference, pybind11::arg("i")); + cl.def("__getitem__", (double & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator[], "C++: mrpt::math::CMatrixFixed::operator[](int) --> double &", pybind11::return_value_policy::reference, pybind11::arg("i")); + cl.def("sum_At", (void (mrpt::math::CMatrixFixed::*)(const class mrpt::math::CMatrixFixed &)) &mrpt::math::CMatrixFixed::sum_At, "C++: mrpt::math::CMatrixFixed::sum_At(const class mrpt::math::CMatrixFixed &) --> void", pybind11::arg("A")); + cl.def("assign", (class mrpt::math::CMatrixFixed & (mrpt::math::CMatrixFixed::*)(const class mrpt::math::CMatrixFixed &)) &mrpt::math::CMatrixFixed::operator=, "C++: mrpt::math::CMatrixFixed::operator=(const class mrpt::math::CMatrixFixed &) --> class mrpt::math::CMatrixFixed &", pybind11::return_value_policy::automatic, pybind11::arg("")); + } + { // mrpt::math::CMatrixFixed file:mrpt/math/CMatrixFixed.h line:34 + pybind11::class_, std::shared_ptr>> cl(M("mrpt::math"), "CMatrixFixed_double_6UL_1UL_t", ""); + cl.def( pybind11::init( [](){ return new mrpt::math::CMatrixFixed(); } ) ); + cl.def( pybind11::init(), pybind11::arg("") ); + + cl.def( pybind11::init(), pybind11::arg("data") ); + + cl.def( pybind11::init(), pybind11::arg("rows"), pybind11::arg("cols") ); + + cl.def( pybind11::init( [](mrpt::math::CMatrixFixed const &o){ return new mrpt::math::CMatrixFixed(o); } ) ); + cl.def("loadFromRawPointer", (void (mrpt::math::CMatrixFixed::*)(const double *)) &mrpt::math::CMatrixFixed::loadFromRawPointer, "C++: mrpt::math::CMatrixFixed::loadFromRawPointer(const double *) --> void", pybind11::arg("data")); + cl.def("setSize", [](mrpt::math::CMatrixFixed &o, size_t const & a0, size_t const & a1) -> void { return o.setSize(a0, a1); }, "", pybind11::arg("row"), pybind11::arg("col")); + cl.def("setSize", (void (mrpt::math::CMatrixFixed::*)(size_t, size_t, bool)) &mrpt::math::CMatrixFixed::setSize, "C++: mrpt::math::CMatrixFixed::setSize(size_t, size_t, bool) --> void", pybind11::arg("row"), pybind11::arg("col"), pybind11::arg("zeroNewElements")); + cl.def("swap", (void (mrpt::math::CMatrixFixed::*)(class mrpt::math::CMatrixFixed &)) &mrpt::math::CMatrixFixed::swap, "C++: mrpt::math::CMatrixFixed::swap(class mrpt::math::CMatrixFixed &) --> void", pybind11::arg("o")); + cl.def("conservativeResize", (void (mrpt::math::CMatrixFixed::*)(size_t, size_t)) &mrpt::math::CMatrixFixed::conservativeResize, "C++: mrpt::math::CMatrixFixed::conservativeResize(size_t, size_t) --> void", pybind11::arg("row"), pybind11::arg("col")); + cl.def("resize", (void (mrpt::math::CMatrixFixed::*)(size_t)) &mrpt::math::CMatrixFixed::resize, "C++: mrpt::math::CMatrixFixed::resize(size_t) --> void", pybind11::arg("n")); + cl.def("resize", (void (mrpt::math::CMatrixFixed::*)(size_t, size_t)) &mrpt::math::CMatrixFixed::resize, "C++: mrpt::math::CMatrixFixed::resize(size_t, size_t) --> void", pybind11::arg("row"), pybind11::arg("col")); + cl.def("rows", (int (mrpt::math::CMatrixFixed::*)() const) &mrpt::math::CMatrixFixed::rows, "C++: mrpt::math::CMatrixFixed::rows() const --> int"); + cl.def("cols", (int (mrpt::math::CMatrixFixed::*)() const) &mrpt::math::CMatrixFixed::cols, "C++: mrpt::math::CMatrixFixed::cols() const --> int"); + cl.def("data", (double * (mrpt::math::CMatrixFixed::*)()) &mrpt::math::CMatrixFixed::data, "C++: mrpt::math::CMatrixFixed::data() --> double *", pybind11::return_value_policy::automatic); + cl.def("__call__", (double & (mrpt::math::CMatrixFixed::*)(int, int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int, int) --> double &", pybind11::return_value_policy::reference, pybind11::arg("row"), pybind11::arg("col")); + cl.def("__call__", (double & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int) --> double &", pybind11::return_value_policy::reference, pybind11::arg("i")); + cl.def("__getitem__", (double & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator[], "C++: mrpt::math::CMatrixFixed::operator[](int) --> double &", pybind11::return_value_policy::reference, pybind11::arg("i")); + cl.def("sum_At", (void (mrpt::math::CMatrixFixed::*)(const class mrpt::math::CMatrixFixed &)) &mrpt::math::CMatrixFixed::sum_At, "C++: mrpt::math::CMatrixFixed::sum_At(const class mrpt::math::CMatrixFixed &) --> void", pybind11::arg("A")); + } } diff --git a/python/src/mrpt/math/CMatrixFixed_2.cpp b/python/src/mrpt/math/CMatrixFixed_2.cpp index 88d8935ca9..2f75fb4ea9 100644 --- a/python/src/mrpt/math/CMatrixFixed_2.cpp +++ b/python/src/mrpt/math/CMatrixFixed_2.cpp @@ -18,57 +18,6 @@ void bind_mrpt_math_CMatrixFixed_2(std::function< pybind11::module &(std::string const &namespace_) > &M) { - { // mrpt::math::CMatrixFixed file:mrpt/math/CMatrixFixed.h line:34 - pybind11::class_, std::shared_ptr>> cl(M("mrpt::math"), "CMatrixFixed_double_2UL_1UL_t", ""); - cl.def( pybind11::init( [](){ return new mrpt::math::CMatrixFixed(); } ) ); - cl.def( pybind11::init(), pybind11::arg("") ); - - cl.def( pybind11::init(), pybind11::arg("data") ); - - cl.def( pybind11::init(), pybind11::arg("rows"), pybind11::arg("cols") ); - - cl.def( pybind11::init( [](mrpt::math::CMatrixFixed const &o){ return new mrpt::math::CMatrixFixed(o); } ) ); - cl.def("loadFromRawPointer", (void (mrpt::math::CMatrixFixed::*)(const double *)) &mrpt::math::CMatrixFixed::loadFromRawPointer, "C++: mrpt::math::CMatrixFixed::loadFromRawPointer(const double *) --> void", pybind11::arg("data")); - cl.def("setSize", [](mrpt::math::CMatrixFixed &o, size_t const & a0, size_t const & a1) -> void { return o.setSize(a0, a1); }, "", pybind11::arg("row"), pybind11::arg("col")); - cl.def("setSize", (void (mrpt::math::CMatrixFixed::*)(size_t, size_t, bool)) &mrpt::math::CMatrixFixed::setSize, "C++: mrpt::math::CMatrixFixed::setSize(size_t, size_t, bool) --> void", pybind11::arg("row"), pybind11::arg("col"), pybind11::arg("zeroNewElements")); - cl.def("swap", (void (mrpt::math::CMatrixFixed::*)(class mrpt::math::CMatrixFixed &)) &mrpt::math::CMatrixFixed::swap, "C++: mrpt::math::CMatrixFixed::swap(class mrpt::math::CMatrixFixed &) --> void", pybind11::arg("o")); - cl.def("conservativeResize", (void (mrpt::math::CMatrixFixed::*)(size_t, size_t)) &mrpt::math::CMatrixFixed::conservativeResize, "C++: mrpt::math::CMatrixFixed::conservativeResize(size_t, size_t) --> void", pybind11::arg("row"), pybind11::arg("col")); - cl.def("resize", (void (mrpt::math::CMatrixFixed::*)(size_t)) &mrpt::math::CMatrixFixed::resize, "C++: mrpt::math::CMatrixFixed::resize(size_t) --> void", pybind11::arg("n")); - cl.def("resize", (void (mrpt::math::CMatrixFixed::*)(size_t, size_t)) &mrpt::math::CMatrixFixed::resize, "C++: mrpt::math::CMatrixFixed::resize(size_t, size_t) --> void", pybind11::arg("row"), pybind11::arg("col")); - cl.def("rows", (int (mrpt::math::CMatrixFixed::*)() const) &mrpt::math::CMatrixFixed::rows, "C++: mrpt::math::CMatrixFixed::rows() const --> int"); - cl.def("cols", (int (mrpt::math::CMatrixFixed::*)() const) &mrpt::math::CMatrixFixed::cols, "C++: mrpt::math::CMatrixFixed::cols() const --> int"); - cl.def("data", (double * (mrpt::math::CMatrixFixed::*)()) &mrpt::math::CMatrixFixed::data, "C++: mrpt::math::CMatrixFixed::data() --> double *", pybind11::return_value_policy::automatic); - cl.def("__call__", (double & (mrpt::math::CMatrixFixed::*)(int, int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int, int) --> double &", pybind11::return_value_policy::reference, pybind11::arg("row"), pybind11::arg("col")); - cl.def("__call__", (double & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int) --> double &", pybind11::return_value_policy::reference, pybind11::arg("i")); - cl.def("__getitem__", (double & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator[], "C++: mrpt::math::CMatrixFixed::operator[](int) --> double &", pybind11::return_value_policy::reference, pybind11::arg("i")); - cl.def("sum_At", (void (mrpt::math::CMatrixFixed::*)(const class mrpt::math::CMatrixFixed &)) &mrpt::math::CMatrixFixed::sum_At, "C++: mrpt::math::CMatrixFixed::sum_At(const class mrpt::math::CMatrixFixed &) --> void", pybind11::arg("A")); - cl.def("assign", (class mrpt::math::CMatrixFixed & (mrpt::math::CMatrixFixed::*)(const class mrpt::math::CMatrixFixed &)) &mrpt::math::CMatrixFixed::operator=, "C++: mrpt::math::CMatrixFixed::operator=(const class mrpt::math::CMatrixFixed &) --> class mrpt::math::CMatrixFixed &", pybind11::return_value_policy::automatic, pybind11::arg("")); - } - { // mrpt::math::CMatrixFixed file:mrpt/math/CMatrixFixed.h line:34 - pybind11::class_, std::shared_ptr>> cl(M("mrpt::math"), "CMatrixFixed_double_6UL_1UL_t", ""); - cl.def( pybind11::init( [](){ return new mrpt::math::CMatrixFixed(); } ) ); - cl.def( pybind11::init(), pybind11::arg("") ); - - cl.def( pybind11::init(), pybind11::arg("data") ); - - cl.def( pybind11::init(), pybind11::arg("rows"), pybind11::arg("cols") ); - - cl.def( pybind11::init( [](mrpt::math::CMatrixFixed const &o){ return new mrpt::math::CMatrixFixed(o); } ) ); - cl.def("loadFromRawPointer", (void (mrpt::math::CMatrixFixed::*)(const double *)) &mrpt::math::CMatrixFixed::loadFromRawPointer, "C++: mrpt::math::CMatrixFixed::loadFromRawPointer(const double *) --> void", pybind11::arg("data")); - cl.def("setSize", [](mrpt::math::CMatrixFixed &o, size_t const & a0, size_t const & a1) -> void { return o.setSize(a0, a1); }, "", pybind11::arg("row"), pybind11::arg("col")); - cl.def("setSize", (void (mrpt::math::CMatrixFixed::*)(size_t, size_t, bool)) &mrpt::math::CMatrixFixed::setSize, "C++: mrpt::math::CMatrixFixed::setSize(size_t, size_t, bool) --> void", pybind11::arg("row"), pybind11::arg("col"), pybind11::arg("zeroNewElements")); - cl.def("swap", (void (mrpt::math::CMatrixFixed::*)(class mrpt::math::CMatrixFixed &)) &mrpt::math::CMatrixFixed::swap, "C++: mrpt::math::CMatrixFixed::swap(class mrpt::math::CMatrixFixed &) --> void", pybind11::arg("o")); - cl.def("conservativeResize", (void (mrpt::math::CMatrixFixed::*)(size_t, size_t)) &mrpt::math::CMatrixFixed::conservativeResize, "C++: mrpt::math::CMatrixFixed::conservativeResize(size_t, size_t) --> void", pybind11::arg("row"), pybind11::arg("col")); - cl.def("resize", (void (mrpt::math::CMatrixFixed::*)(size_t)) &mrpt::math::CMatrixFixed::resize, "C++: mrpt::math::CMatrixFixed::resize(size_t) --> void", pybind11::arg("n")); - cl.def("resize", (void (mrpt::math::CMatrixFixed::*)(size_t, size_t)) &mrpt::math::CMatrixFixed::resize, "C++: mrpt::math::CMatrixFixed::resize(size_t, size_t) --> void", pybind11::arg("row"), pybind11::arg("col")); - cl.def("rows", (int (mrpt::math::CMatrixFixed::*)() const) &mrpt::math::CMatrixFixed::rows, "C++: mrpt::math::CMatrixFixed::rows() const --> int"); - cl.def("cols", (int (mrpt::math::CMatrixFixed::*)() const) &mrpt::math::CMatrixFixed::cols, "C++: mrpt::math::CMatrixFixed::cols() const --> int"); - cl.def("data", (double * (mrpt::math::CMatrixFixed::*)()) &mrpt::math::CMatrixFixed::data, "C++: mrpt::math::CMatrixFixed::data() --> double *", pybind11::return_value_policy::automatic); - cl.def("__call__", (double & (mrpt::math::CMatrixFixed::*)(int, int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int, int) --> double &", pybind11::return_value_policy::reference, pybind11::arg("row"), pybind11::arg("col")); - cl.def("__call__", (double & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int) --> double &", pybind11::return_value_policy::reference, pybind11::arg("i")); - cl.def("__getitem__", (double & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator[], "C++: mrpt::math::CMatrixFixed::operator[](int) --> double &", pybind11::return_value_policy::reference, pybind11::arg("i")); - cl.def("sum_At", (void (mrpt::math::CMatrixFixed::*)(const class mrpt::math::CMatrixFixed &)) &mrpt::math::CMatrixFixed::sum_At, "C++: mrpt::math::CMatrixFixed::sum_At(const class mrpt::math::CMatrixFixed &) --> void", pybind11::arg("A")); - } { // mrpt::math::CMatrixFixed file:mrpt/math/CMatrixFixed.h line:34 pybind11::class_, std::shared_ptr>> cl(M("mrpt::math"), "CMatrixFixed_double_7UL_1UL_t", ""); cl.def( pybind11::init( [](){ return new mrpt::math::CMatrixFixed(); } ) ); @@ -132,4 +81,66 @@ void bind_mrpt_math_CMatrixFixed_2(std::function< pybind11::module &(std::string cl.def(pybind11::init( [](pybind11::list vals){ auto m = new mat_t(); const auto nR = vals.size(); if (!nR) return m; const auto nC = vals[0].cast().size(); m->setSize(nR,nC); for (size_t r=0;r(); for (size_t c=0;ccoeffRef(r,c) = row[c].cast(); } return m; })); cl.def("to_list", [](const mat_t&self) -> pybind11::list { auto l = pybind11::list(); const auto nR = self.rows(), nC = self.cols(); for (size_t r=0;r, std::shared_ptr>> cl(M("mrpt::math"), "CMatrixFixed_double_4UL_3UL_t", ""); + cl.def( pybind11::init( [](){ return new mrpt::math::CMatrixFixed(); } ) ); + cl.def( pybind11::init(), pybind11::arg("") ); + + cl.def( pybind11::init(), pybind11::arg("data") ); + + cl.def( pybind11::init(), pybind11::arg("rows"), pybind11::arg("cols") ); + + cl.def( pybind11::init( [](mrpt::math::CMatrixFixed const &o){ return new mrpt::math::CMatrixFixed(o); } ) ); + cl.def("loadFromRawPointer", (void (mrpt::math::CMatrixFixed::*)(const double *)) &mrpt::math::CMatrixFixed::loadFromRawPointer, "C++: mrpt::math::CMatrixFixed::loadFromRawPointer(const double *) --> void", pybind11::arg("data")); + cl.def("setSize", [](mrpt::math::CMatrixFixed &o, size_t const & a0, size_t const & a1) -> void { return o.setSize(a0, a1); }, "", pybind11::arg("row"), pybind11::arg("col")); + cl.def("setSize", (void (mrpt::math::CMatrixFixed::*)(size_t, size_t, bool)) &mrpt::math::CMatrixFixed::setSize, "C++: mrpt::math::CMatrixFixed::setSize(size_t, size_t, bool) --> void", pybind11::arg("row"), pybind11::arg("col"), pybind11::arg("zeroNewElements")); + cl.def("swap", (void (mrpt::math::CMatrixFixed::*)(class mrpt::math::CMatrixFixed &)) &mrpt::math::CMatrixFixed::swap, "C++: mrpt::math::CMatrixFixed::swap(class mrpt::math::CMatrixFixed &) --> void", pybind11::arg("o")); + cl.def("conservativeResize", (void (mrpt::math::CMatrixFixed::*)(size_t, size_t)) &mrpt::math::CMatrixFixed::conservativeResize, "C++: mrpt::math::CMatrixFixed::conservativeResize(size_t, size_t) --> void", pybind11::arg("row"), pybind11::arg("col")); + cl.def("resize", (void (mrpt::math::CMatrixFixed::*)(size_t)) &mrpt::math::CMatrixFixed::resize, "C++: mrpt::math::CMatrixFixed::resize(size_t) --> void", pybind11::arg("n")); + cl.def("resize", (void (mrpt::math::CMatrixFixed::*)(size_t, size_t)) &mrpt::math::CMatrixFixed::resize, "C++: mrpt::math::CMatrixFixed::resize(size_t, size_t) --> void", pybind11::arg("row"), pybind11::arg("col")); + cl.def("rows", (int (mrpt::math::CMatrixFixed::*)() const) &mrpt::math::CMatrixFixed::rows, "C++: mrpt::math::CMatrixFixed::rows() const --> int"); + cl.def("cols", (int (mrpt::math::CMatrixFixed::*)() const) &mrpt::math::CMatrixFixed::cols, "C++: mrpt::math::CMatrixFixed::cols() const --> int"); + cl.def("data", (double * (mrpt::math::CMatrixFixed::*)()) &mrpt::math::CMatrixFixed::data, "C++: mrpt::math::CMatrixFixed::data() --> double *", pybind11::return_value_policy::automatic); + cl.def("__call__", (double & (mrpt::math::CMatrixFixed::*)(int, int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int, int) --> double &", pybind11::return_value_policy::reference, pybind11::arg("row"), pybind11::arg("col")); + cl.def("__call__", (double & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int) --> double &", pybind11::return_value_policy::reference, pybind11::arg("i")); + cl.def("__getitem__", (double & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator[], "C++: mrpt::math::CMatrixFixed::operator[](int) --> double &", pybind11::return_value_policy::reference, pybind11::arg("i")); + cl.def("sum_At", (void (mrpt::math::CMatrixFixed::*)(const class mrpt::math::CMatrixFixed &)) &mrpt::math::CMatrixFixed::sum_At, "C++: mrpt::math::CMatrixFixed::sum_At(const class mrpt::math::CMatrixFixed &) --> void", pybind11::arg("A")); + } + { // mrpt::math::CMatrixFixed file:mrpt/math/CMatrixFixed.h line:34 + pybind11::class_, std::shared_ptr>> cl(M("mrpt::math"), "CMatrixFixed_float_3UL_3UL_t", ""); + cl.def( pybind11::init( [](){ return new mrpt::math::CMatrixFixed(); } ) ); + cl.def( pybind11::init(), pybind11::arg("") ); + + cl.def( pybind11::init(), pybind11::arg("data") ); + + cl.def( pybind11::init(), pybind11::arg("rows"), pybind11::arg("cols") ); + + cl.def("loadFromRawPointer", (void (mrpt::math::CMatrixFixed::*)(const float *)) &mrpt::math::CMatrixFixed::loadFromRawPointer, "C++: mrpt::math::CMatrixFixed::loadFromRawPointer(const float *) --> void", pybind11::arg("data")); + cl.def("setSize", [](mrpt::math::CMatrixFixed &o, size_t const & a0, size_t const & a1) -> void { return o.setSize(a0, a1); }, "", pybind11::arg("row"), pybind11::arg("col")); + cl.def("setSize", (void (mrpt::math::CMatrixFixed::*)(size_t, size_t, bool)) &mrpt::math::CMatrixFixed::setSize, "C++: mrpt::math::CMatrixFixed::setSize(size_t, size_t, bool) --> void", pybind11::arg("row"), pybind11::arg("col"), pybind11::arg("zeroNewElements")); + cl.def("swap", (void (mrpt::math::CMatrixFixed::*)(class mrpt::math::CMatrixFixed &)) &mrpt::math::CMatrixFixed::swap, "C++: mrpt::math::CMatrixFixed::swap(class mrpt::math::CMatrixFixed &) --> void", pybind11::arg("o")); + cl.def("conservativeResize", (void (mrpt::math::CMatrixFixed::*)(size_t, size_t)) &mrpt::math::CMatrixFixed::conservativeResize, "C++: mrpt::math::CMatrixFixed::conservativeResize(size_t, size_t) --> void", pybind11::arg("row"), pybind11::arg("col")); + cl.def("resize", (void (mrpt::math::CMatrixFixed::*)(size_t)) &mrpt::math::CMatrixFixed::resize, "C++: mrpt::math::CMatrixFixed::resize(size_t) --> void", pybind11::arg("n")); + cl.def("resize", (void (mrpt::math::CMatrixFixed::*)(size_t, size_t)) &mrpt::math::CMatrixFixed::resize, "C++: mrpt::math::CMatrixFixed::resize(size_t, size_t) --> void", pybind11::arg("row"), pybind11::arg("col")); + cl.def("rows", (int (mrpt::math::CMatrixFixed::*)() const) &mrpt::math::CMatrixFixed::rows, "C++: mrpt::math::CMatrixFixed::rows() const --> int"); + cl.def("cols", (int (mrpt::math::CMatrixFixed::*)() const) &mrpt::math::CMatrixFixed::cols, "C++: mrpt::math::CMatrixFixed::cols() const --> int"); + cl.def("data", (float * (mrpt::math::CMatrixFixed::*)()) &mrpt::math::CMatrixFixed::data, "C++: mrpt::math::CMatrixFixed::data() --> float *", pybind11::return_value_policy::automatic); + cl.def("__call__", (float & (mrpt::math::CMatrixFixed::*)(int, int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int, int) --> float &", pybind11::return_value_policy::reference, pybind11::arg("row"), pybind11::arg("col")); + cl.def("__call__", (float & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int) --> float &", pybind11::return_value_policy::reference, pybind11::arg("i")); + cl.def("cast_float", (class mrpt::math::CMatrixFixed (mrpt::math::CMatrixFixed::*)() const) &mrpt::math::CMatrixFixed::cast_float, "C++: mrpt::math::CMatrixFixed::cast_float() const --> class mrpt::math::CMatrixFixed"); + cl.def("sum_At", (void (mrpt::math::CMatrixFixed::*)(const class mrpt::math::CMatrixFixed &)) &mrpt::math::CMatrixFixed::sum_At, "C++: mrpt::math::CMatrixFixed::sum_At(const class mrpt::math::CMatrixFixed &) --> void", pybind11::arg("A")); + + // Manually-added matrix methods: + using dat_t = float; + using mat_t = mrpt::math::CMatrixFixed; + cl.def("__getitem__", [](const mat_t&self, pybind11::tuple coord) -> dat_t { if (coord.size()==2) return self.coeff(coord[0].cast(), coord[1].cast()); else if (coord.size()==1) return self[coord[0].cast()]; else throw std::invalid_argument("Access with [idx] or [row,col]"); }); + cl.def("__setitem__", [](mat_t&self, pybind11::tuple coord, dat_t val) { if (coord.size()==2) self.coeffRef(coord[0].cast(), coord[1].cast())=val; else if (coord.size()==1) self[coord[0].cast()]=val; else throw std::invalid_argument("Access with [idx] or [row,col]"); }); + cl.def("__str__", [](const mat_t& o) -> std::string { return o.asString(); } ); + cl.def("inMatlabFormat", [](const mat_t& o) -> std::string { return o.inMatlabFormat(); } ); + cl.def("size", [](const mat_t&self) -> pybind11::tuple { return pybind11::make_tuple(self.cols(),self.rows()); }); + cl.def_static("Identity", []() -> mat_t { return mat_t::Identity(); }, "Returns the NxN identity matrix"); + cl.def_static("Zero", []() -> mat_t { return mat_t::Zero(); }, "Returns a matrix with zeroes"); + cl.def(pybind11::init( [](pybind11::list vals){ auto m = new mat_t(); const auto nR = vals.size(); if (!nR) return m; const auto nC = vals[0].cast().size(); m->setSize(nR,nC); for (size_t r=0;r(); for (size_t c=0;ccoeffRef(r,c) = row[c].cast(); } return m; })); + cl.def("to_list", [](const mat_t&self) -> pybind11::list { auto l = pybind11::list(); const auto nR = self.rows(), nC = self.cols(); for (size_t r=0;r &M) { - { // mrpt::math::CMatrixFixed file:mrpt/math/CMatrixFixed.h line:34 - pybind11::class_, std::shared_ptr>> cl(M("mrpt::math"), "CMatrixFixed_double_4UL_3UL_t", ""); - cl.def( pybind11::init( [](){ return new mrpt::math::CMatrixFixed(); } ) ); - cl.def( pybind11::init(), pybind11::arg("") ); - - cl.def( pybind11::init(), pybind11::arg("data") ); - - cl.def( pybind11::init(), pybind11::arg("rows"), pybind11::arg("cols") ); - - cl.def( pybind11::init( [](mrpt::math::CMatrixFixed const &o){ return new mrpt::math::CMatrixFixed(o); } ) ); - cl.def("loadFromRawPointer", (void (mrpt::math::CMatrixFixed::*)(const double *)) &mrpt::math::CMatrixFixed::loadFromRawPointer, "C++: mrpt::math::CMatrixFixed::loadFromRawPointer(const double *) --> void", pybind11::arg("data")); - cl.def("setSize", [](mrpt::math::CMatrixFixed &o, size_t const & a0, size_t const & a1) -> void { return o.setSize(a0, a1); }, "", pybind11::arg("row"), pybind11::arg("col")); - cl.def("setSize", (void (mrpt::math::CMatrixFixed::*)(size_t, size_t, bool)) &mrpt::math::CMatrixFixed::setSize, "C++: mrpt::math::CMatrixFixed::setSize(size_t, size_t, bool) --> void", pybind11::arg("row"), pybind11::arg("col"), pybind11::arg("zeroNewElements")); - cl.def("swap", (void (mrpt::math::CMatrixFixed::*)(class mrpt::math::CMatrixFixed &)) &mrpt::math::CMatrixFixed::swap, "C++: mrpt::math::CMatrixFixed::swap(class mrpt::math::CMatrixFixed &) --> void", pybind11::arg("o")); - cl.def("conservativeResize", (void (mrpt::math::CMatrixFixed::*)(size_t, size_t)) &mrpt::math::CMatrixFixed::conservativeResize, "C++: mrpt::math::CMatrixFixed::conservativeResize(size_t, size_t) --> void", pybind11::arg("row"), pybind11::arg("col")); - cl.def("resize", (void (mrpt::math::CMatrixFixed::*)(size_t)) &mrpt::math::CMatrixFixed::resize, "C++: mrpt::math::CMatrixFixed::resize(size_t) --> void", pybind11::arg("n")); - cl.def("resize", (void (mrpt::math::CMatrixFixed::*)(size_t, size_t)) &mrpt::math::CMatrixFixed::resize, "C++: mrpt::math::CMatrixFixed::resize(size_t, size_t) --> void", pybind11::arg("row"), pybind11::arg("col")); - cl.def("rows", (int (mrpt::math::CMatrixFixed::*)() const) &mrpt::math::CMatrixFixed::rows, "C++: mrpt::math::CMatrixFixed::rows() const --> int"); - cl.def("cols", (int (mrpt::math::CMatrixFixed::*)() const) &mrpt::math::CMatrixFixed::cols, "C++: mrpt::math::CMatrixFixed::cols() const --> int"); - cl.def("data", (double * (mrpt::math::CMatrixFixed::*)()) &mrpt::math::CMatrixFixed::data, "C++: mrpt::math::CMatrixFixed::data() --> double *", pybind11::return_value_policy::automatic); - cl.def("__call__", (double & (mrpt::math::CMatrixFixed::*)(int, int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int, int) --> double &", pybind11::return_value_policy::reference, pybind11::arg("row"), pybind11::arg("col")); - cl.def("__call__", (double & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int) --> double &", pybind11::return_value_policy::reference, pybind11::arg("i")); - cl.def("__getitem__", (double & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator[], "C++: mrpt::math::CMatrixFixed::operator[](int) --> double &", pybind11::return_value_policy::reference, pybind11::arg("i")); - cl.def("sum_At", (void (mrpt::math::CMatrixFixed::*)(const class mrpt::math::CMatrixFixed &)) &mrpt::math::CMatrixFixed::sum_At, "C++: mrpt::math::CMatrixFixed::sum_At(const class mrpt::math::CMatrixFixed &) --> void", pybind11::arg("A")); - } - { // mrpt::math::CMatrixFixed file:mrpt/math/CMatrixFixed.h line:34 - pybind11::class_, std::shared_ptr>> cl(M("mrpt::math"), "CMatrixFixed_float_3UL_3UL_t", ""); - cl.def( pybind11::init( [](){ return new mrpt::math::CMatrixFixed(); } ) ); - cl.def( pybind11::init(), pybind11::arg("") ); - - cl.def( pybind11::init(), pybind11::arg("data") ); - - cl.def( pybind11::init(), pybind11::arg("rows"), pybind11::arg("cols") ); - - cl.def("loadFromRawPointer", (void (mrpt::math::CMatrixFixed::*)(const float *)) &mrpt::math::CMatrixFixed::loadFromRawPointer, "C++: mrpt::math::CMatrixFixed::loadFromRawPointer(const float *) --> void", pybind11::arg("data")); - cl.def("setSize", [](mrpt::math::CMatrixFixed &o, size_t const & a0, size_t const & a1) -> void { return o.setSize(a0, a1); }, "", pybind11::arg("row"), pybind11::arg("col")); - cl.def("setSize", (void (mrpt::math::CMatrixFixed::*)(size_t, size_t, bool)) &mrpt::math::CMatrixFixed::setSize, "C++: mrpt::math::CMatrixFixed::setSize(size_t, size_t, bool) --> void", pybind11::arg("row"), pybind11::arg("col"), pybind11::arg("zeroNewElements")); - cl.def("swap", (void (mrpt::math::CMatrixFixed::*)(class mrpt::math::CMatrixFixed &)) &mrpt::math::CMatrixFixed::swap, "C++: mrpt::math::CMatrixFixed::swap(class mrpt::math::CMatrixFixed &) --> void", pybind11::arg("o")); - cl.def("conservativeResize", (void (mrpt::math::CMatrixFixed::*)(size_t, size_t)) &mrpt::math::CMatrixFixed::conservativeResize, "C++: mrpt::math::CMatrixFixed::conservativeResize(size_t, size_t) --> void", pybind11::arg("row"), pybind11::arg("col")); - cl.def("resize", (void (mrpt::math::CMatrixFixed::*)(size_t)) &mrpt::math::CMatrixFixed::resize, "C++: mrpt::math::CMatrixFixed::resize(size_t) --> void", pybind11::arg("n")); - cl.def("resize", (void (mrpt::math::CMatrixFixed::*)(size_t, size_t)) &mrpt::math::CMatrixFixed::resize, "C++: mrpt::math::CMatrixFixed::resize(size_t, size_t) --> void", pybind11::arg("row"), pybind11::arg("col")); - cl.def("rows", (int (mrpt::math::CMatrixFixed::*)() const) &mrpt::math::CMatrixFixed::rows, "C++: mrpt::math::CMatrixFixed::rows() const --> int"); - cl.def("cols", (int (mrpt::math::CMatrixFixed::*)() const) &mrpt::math::CMatrixFixed::cols, "C++: mrpt::math::CMatrixFixed::cols() const --> int"); - cl.def("data", (float * (mrpt::math::CMatrixFixed::*)()) &mrpt::math::CMatrixFixed::data, "C++: mrpt::math::CMatrixFixed::data() --> float *", pybind11::return_value_policy::automatic); - cl.def("__call__", (float & (mrpt::math::CMatrixFixed::*)(int, int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int, int) --> float &", pybind11::return_value_policy::reference, pybind11::arg("row"), pybind11::arg("col")); - cl.def("__call__", (float & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int) --> float &", pybind11::return_value_policy::reference, pybind11::arg("i")); - cl.def("cast_float", (class mrpt::math::CMatrixFixed (mrpt::math::CMatrixFixed::*)() const) &mrpt::math::CMatrixFixed::cast_float, "C++: mrpt::math::CMatrixFixed::cast_float() const --> class mrpt::math::CMatrixFixed"); - cl.def("sum_At", (void (mrpt::math::CMatrixFixed::*)(const class mrpt::math::CMatrixFixed &)) &mrpt::math::CMatrixFixed::sum_At, "C++: mrpt::math::CMatrixFixed::sum_At(const class mrpt::math::CMatrixFixed &) --> void", pybind11::arg("A")); - - // Manually-added matrix methods: - using dat_t = float; - using mat_t = mrpt::math::CMatrixFixed; - cl.def("__getitem__", [](const mat_t&self, pybind11::tuple coord) -> dat_t { if (coord.size()==2) return self.coeff(coord[0].cast(), coord[1].cast()); else if (coord.size()==1) return self[coord[0].cast()]; else throw std::invalid_argument("Access with [idx] or [row,col]"); }); - cl.def("__setitem__", [](mat_t&self, pybind11::tuple coord, dat_t val) { if (coord.size()==2) self.coeffRef(coord[0].cast(), coord[1].cast())=val; else if (coord.size()==1) self[coord[0].cast()]=val; else throw std::invalid_argument("Access with [idx] or [row,col]"); }); - cl.def("__str__", [](const mat_t& o) -> std::string { return o.asString(); } ); - cl.def("inMatlabFormat", [](const mat_t& o) -> std::string { return o.inMatlabFormat(); } ); - cl.def("size", [](const mat_t&self) -> pybind11::tuple { return pybind11::make_tuple(self.cols(),self.rows()); }); - cl.def_static("Identity", []() -> mat_t { return mat_t::Identity(); }, "Returns the NxN identity matrix"); - cl.def_static("Zero", []() -> mat_t { return mat_t::Zero(); }, "Returns a matrix with zeroes"); - cl.def(pybind11::init( [](pybind11::list vals){ auto m = new mat_t(); const auto nR = vals.size(); if (!nR) return m; const auto nC = vals[0].cast().size(); m->setSize(nR,nC); for (size_t r=0;r(); for (size_t c=0;ccoeffRef(r,c) = row[c].cast(); } return m; })); - cl.def("to_list", [](const mat_t&self) -> pybind11::list { auto l = pybind11::list(); const auto nR = self.rows(), nC = self.cols(); for (size_t r=0;r, std::shared_ptr>> cl(M("mrpt::math"), "CMatrixFixed_float_4UL_4UL_t", ""); cl.def( pybind11::init( [](){ return new mrpt::math::CMatrixFixed(); } ) ); @@ -141,7 +79,6 @@ void bind_mrpt_math_CMatrixFixed_3(std::function< pybind11::module &(std::string cl.def("data", (float * (mrpt::math::CMatrixFixed::*)()) &mrpt::math::CMatrixFixed::data, "C++: mrpt::math::CMatrixFixed::data() --> float *", pybind11::return_value_policy::automatic); cl.def("__call__", (float & (mrpt::math::CMatrixFixed::*)(int, int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int, int) --> float &", pybind11::return_value_policy::reference, pybind11::arg("row"), pybind11::arg("col")); cl.def("__call__", (float & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int) --> float &", pybind11::return_value_policy::reference, pybind11::arg("i")); - cl.def("__getitem__", (float & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator[], "C++: mrpt::math::CMatrixFixed::operator[](int) --> float &", pybind11::return_value_policy::reference, pybind11::arg("i")); cl.def("cast_float", (class mrpt::math::CMatrixFixed (mrpt::math::CMatrixFixed::*)() const) &mrpt::math::CMatrixFixed::cast_float, "C++: mrpt::math::CMatrixFixed::cast_float() const --> class mrpt::math::CMatrixFixed"); cl.def("sum_At", (void (mrpt::math::CMatrixFixed::*)(const class mrpt::math::CMatrixFixed &)) &mrpt::math::CMatrixFixed::sum_At, "C++: mrpt::math::CMatrixFixed::sum_At(const class mrpt::math::CMatrixFixed &) --> void", pybind11::arg("A")); cl.def("assign", (class mrpt::math::CMatrixFixed & (mrpt::math::CMatrixFixed::*)(const class mrpt::math::CMatrixFixed &)) &mrpt::math::CMatrixFixed::operator=, "C++: mrpt::math::CMatrixFixed::operator=(const class mrpt::math::CMatrixFixed &) --> class mrpt::math::CMatrixFixed &", pybind11::return_value_policy::automatic, pybind11::arg("")); @@ -157,6 +94,68 @@ void bind_mrpt_math_CMatrixFixed_3(std::function< pybind11::module &(std::string cl.def_static("Zero", []() -> mat_t { return mat_t::Zero(); }, "Returns a matrix with zeroes"); cl.def(pybind11::init( [](pybind11::list vals){ auto m = new mat_t(); const auto nR = vals.size(); if (!nR) return m; const auto nC = vals[0].cast().size(); m->setSize(nR,nC); for (size_t r=0;r(); for (size_t c=0;ccoeffRef(r,c) = row[c].cast(); } return m; })); cl.def("to_list", [](const mat_t&self) -> pybind11::list { auto l = pybind11::list(); const auto nR = self.rows(), nC = self.cols(); for (size_t r=0;r, std::shared_ptr>> cl(M("mrpt::math"), "CMatrixFixed_double_12UL_1UL_t", ""); + cl.def( pybind11::init( [](){ return new mrpt::math::CMatrixFixed(); } ) ); + cl.def( pybind11::init(), pybind11::arg("") ); + + cl.def( pybind11::init(), pybind11::arg("data") ); + + cl.def( pybind11::init(), pybind11::arg("rows"), pybind11::arg("cols") ); + + cl.def( pybind11::init( [](mrpt::math::CMatrixFixed const &o){ return new mrpt::math::CMatrixFixed(o); } ) ); + cl.def("loadFromRawPointer", (void (mrpt::math::CMatrixFixed::*)(const double *)) &mrpt::math::CMatrixFixed::loadFromRawPointer, "C++: mrpt::math::CMatrixFixed::loadFromRawPointer(const double *) --> void", pybind11::arg("data")); + cl.def("setSize", [](mrpt::math::CMatrixFixed &o, size_t const & a0, size_t const & a1) -> void { return o.setSize(a0, a1); }, "", pybind11::arg("row"), pybind11::arg("col")); + cl.def("setSize", (void (mrpt::math::CMatrixFixed::*)(size_t, size_t, bool)) &mrpt::math::CMatrixFixed::setSize, "C++: mrpt::math::CMatrixFixed::setSize(size_t, size_t, bool) --> void", pybind11::arg("row"), pybind11::arg("col"), pybind11::arg("zeroNewElements")); + cl.def("swap", (void (mrpt::math::CMatrixFixed::*)(class mrpt::math::CMatrixFixed &)) &mrpt::math::CMatrixFixed::swap, "C++: mrpt::math::CMatrixFixed::swap(class mrpt::math::CMatrixFixed &) --> void", pybind11::arg("o")); + cl.def("conservativeResize", (void (mrpt::math::CMatrixFixed::*)(size_t, size_t)) &mrpt::math::CMatrixFixed::conservativeResize, "C++: mrpt::math::CMatrixFixed::conservativeResize(size_t, size_t) --> void", pybind11::arg("row"), pybind11::arg("col")); + cl.def("resize", (void (mrpt::math::CMatrixFixed::*)(size_t)) &mrpt::math::CMatrixFixed::resize, "C++: mrpt::math::CMatrixFixed::resize(size_t) --> void", pybind11::arg("n")); + cl.def("resize", (void (mrpt::math::CMatrixFixed::*)(size_t, size_t)) &mrpt::math::CMatrixFixed::resize, "C++: mrpt::math::CMatrixFixed::resize(size_t, size_t) --> void", pybind11::arg("row"), pybind11::arg("col")); + cl.def("rows", (int (mrpt::math::CMatrixFixed::*)() const) &mrpt::math::CMatrixFixed::rows, "C++: mrpt::math::CMatrixFixed::rows() const --> int"); + cl.def("cols", (int (mrpt::math::CMatrixFixed::*)() const) &mrpt::math::CMatrixFixed::cols, "C++: mrpt::math::CMatrixFixed::cols() const --> int"); + cl.def("data", (double * (mrpt::math::CMatrixFixed::*)()) &mrpt::math::CMatrixFixed::data, "C++: mrpt::math::CMatrixFixed::data() --> double *", pybind11::return_value_policy::automatic); + cl.def("__call__", (double & (mrpt::math::CMatrixFixed::*)(int, int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int, int) --> double &", pybind11::return_value_policy::reference, pybind11::arg("row"), pybind11::arg("col")); + cl.def("__call__", (double & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int) --> double &", pybind11::return_value_policy::reference, pybind11::arg("i")); + cl.def("__getitem__", (double & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator[], "C++: mrpt::math::CMatrixFixed::operator[](int) --> double &", pybind11::return_value_policy::reference, pybind11::arg("i")); + cl.def("sum_At", (void (mrpt::math::CMatrixFixed::*)(const class mrpt::math::CMatrixFixed &)) &mrpt::math::CMatrixFixed::sum_At, "C++: mrpt::math::CMatrixFixed::sum_At(const class mrpt::math::CMatrixFixed &) --> void", pybind11::arg("A")); + } + { // mrpt::math::CMatrixFixed file:mrpt/math/CMatrixFixed.h line:34 + pybind11::class_, std::shared_ptr>> cl(M("mrpt::math"), "CMatrixFixed_float_4UL_1UL_t", ""); + cl.def( pybind11::init( [](){ return new mrpt::math::CMatrixFixed(); } ) ); + cl.def( pybind11::init(), pybind11::arg("") ); + + cl.def( pybind11::init(), pybind11::arg("data") ); + cl.def( pybind11::init(), pybind11::arg("rows"), pybind11::arg("cols") ); + + cl.def( pybind11::init( [](mrpt::math::CMatrixFixed const &o){ return new mrpt::math::CMatrixFixed(o); } ) ); + cl.def("loadFromRawPointer", (void (mrpt::math::CMatrixFixed::*)(const float *)) &mrpt::math::CMatrixFixed::loadFromRawPointer, "C++: mrpt::math::CMatrixFixed::loadFromRawPointer(const float *) --> void", pybind11::arg("data")); + cl.def("setSize", [](mrpt::math::CMatrixFixed &o, size_t const & a0, size_t const & a1) -> void { return o.setSize(a0, a1); }, "", pybind11::arg("row"), pybind11::arg("col")); + cl.def("setSize", (void (mrpt::math::CMatrixFixed::*)(size_t, size_t, bool)) &mrpt::math::CMatrixFixed::setSize, "C++: mrpt::math::CMatrixFixed::setSize(size_t, size_t, bool) --> void", pybind11::arg("row"), pybind11::arg("col"), pybind11::arg("zeroNewElements")); + cl.def("swap", (void (mrpt::math::CMatrixFixed::*)(class mrpt::math::CMatrixFixed &)) &mrpt::math::CMatrixFixed::swap, "C++: mrpt::math::CMatrixFixed::swap(class mrpt::math::CMatrixFixed &) --> void", pybind11::arg("o")); + cl.def("conservativeResize", (void (mrpt::math::CMatrixFixed::*)(size_t, size_t)) &mrpt::math::CMatrixFixed::conservativeResize, "C++: mrpt::math::CMatrixFixed::conservativeResize(size_t, size_t) --> void", pybind11::arg("row"), pybind11::arg("col")); + cl.def("resize", (void (mrpt::math::CMatrixFixed::*)(size_t)) &mrpt::math::CMatrixFixed::resize, "C++: mrpt::math::CMatrixFixed::resize(size_t) --> void", pybind11::arg("n")); + cl.def("resize", (void (mrpt::math::CMatrixFixed::*)(size_t, size_t)) &mrpt::math::CMatrixFixed::resize, "C++: mrpt::math::CMatrixFixed::resize(size_t, size_t) --> void", pybind11::arg("row"), pybind11::arg("col")); + cl.def("rows", (int (mrpt::math::CMatrixFixed::*)() const) &mrpt::math::CMatrixFixed::rows, "C++: mrpt::math::CMatrixFixed::rows() const --> int"); + cl.def("cols", (int (mrpt::math::CMatrixFixed::*)() const) &mrpt::math::CMatrixFixed::cols, "C++: mrpt::math::CMatrixFixed::cols() const --> int"); + cl.def("data", (float * (mrpt::math::CMatrixFixed::*)()) &mrpt::math::CMatrixFixed::data, "C++: mrpt::math::CMatrixFixed::data() --> float *", pybind11::return_value_policy::automatic); + cl.def("__call__", (float & (mrpt::math::CMatrixFixed::*)(int, int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int, int) --> float &", pybind11::return_value_policy::reference, pybind11::arg("row"), pybind11::arg("col")); + cl.def("__call__", (float & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int) --> float &", pybind11::return_value_policy::reference, pybind11::arg("i")); + cl.def("cast_float", (class mrpt::math::CMatrixFixed (mrpt::math::CMatrixFixed::*)() const) &mrpt::math::CMatrixFixed::cast_float, "C++: mrpt::math::CMatrixFixed::cast_float() const --> class mrpt::math::CMatrixFixed"); + cl.def("sum_At", (void (mrpt::math::CMatrixFixed::*)(const class mrpt::math::CMatrixFixed &)) &mrpt::math::CMatrixFixed::sum_At, "C++: mrpt::math::CMatrixFixed::sum_At(const class mrpt::math::CMatrixFixed &) --> void", pybind11::arg("A")); + cl.def("assign", (class mrpt::math::CMatrixFixed & (mrpt::math::CMatrixFixed::*)(const class mrpt::math::CMatrixFixed &)) &mrpt::math::CMatrixFixed::operator=, "C++: mrpt::math::CMatrixFixed::operator=(const class mrpt::math::CMatrixFixed &) --> class mrpt::math::CMatrixFixed &", pybind11::return_value_policy::automatic, pybind11::arg("")); + + // Manually-added matrix methods: + using dat_t = float; + using mat_t = mrpt::math::CMatrixFixed; + cl.def("__getitem__", [](const mat_t&self, pybind11::tuple coord) -> dat_t { if (coord.size()==2) return self.coeff(coord[0].cast(), coord[1].cast()); else if (coord.size()==1) return self[coord[0].cast()]; else throw std::invalid_argument("Access with [idx] or [row,col]"); }); + cl.def("__setitem__", [](mat_t&self, pybind11::tuple coord, dat_t val) { if (coord.size()==2) self.coeffRef(coord[0].cast(), coord[1].cast())=val; else if (coord.size()==1) self[coord[0].cast()]=val; else throw std::invalid_argument("Access with [idx] or [row,col]"); }); + cl.def("__str__", [](const mat_t& o) -> std::string { return o.asString(); } ); + cl.def("inMatlabFormat", [](const mat_t& o) -> std::string { return o.inMatlabFormat(); } ); + cl.def("size", [](const mat_t&self) -> pybind11::tuple { return pybind11::make_tuple(self.cols(),self.rows()); }); + cl.def_static("Zero", []() -> mat_t { return mat_t::Zero(); }, "Returns a matrix with zeroes"); + cl.def(pybind11::init( [](pybind11::list vals){ auto m = new mat_t(); const auto nR = vals.size(); if (!nR) return m; const auto nC = vals[0].cast().size(); m->setSize(nR,nC); for (size_t r=0;r(); for (size_t c=0;ccoeffRef(r,c) = row[c].cast(); } return m; })); + cl.def("to_list", [](const mat_t&self) -> pybind11::list { auto l = pybind11::list(); const auto nR = self.rows(), nC = self.cols(); for (size_t r=0;r -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include // __str__ -#include -#include - -#include -#include -#include -#include - - -#ifndef BINDER_PYBIND11_TYPE_CASTER - #define BINDER_PYBIND11_TYPE_CASTER - PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr) - PYBIND11_DECLARE_HOLDER_TYPE(T, T*) - PYBIND11_MAKE_OPAQUE(std::shared_ptr) -#endif - -// mrpt::math::CMatrixD file:mrpt/math/CMatrixD.h line:23 -struct PyCallBack_mrpt_math_CMatrixD : public mrpt::math::CMatrixD { - using mrpt::math::CMatrixD::CMatrixD; - - const struct mrpt::rtti::TRuntimeClassId * GetRuntimeClass() const override { - pybind11::gil_scoped_acquire gil; - pybind11::function overload = pybind11::get_overload(static_cast(this), "GetRuntimeClass"); - if (overload) { - auto o = overload.operator()(); - if (pybind11::detail::cast_is_temporary_value_reference::value) { - static pybind11::detail::override_caster_t caster; - return pybind11::detail::cast_ref(std::move(o), caster); - } - else return pybind11::detail::cast_safe(std::move(o)); - } - return CMatrixD::GetRuntimeClass(); - } - class mrpt::rtti::CObject * clone() const override { - pybind11::gil_scoped_acquire gil; - pybind11::function overload = pybind11::get_overload(static_cast(this), "clone"); - if (overload) { - auto o = overload.operator()(); - if (pybind11::detail::cast_is_temporary_value_reference::value) { - static pybind11::detail::override_caster_t caster; - return pybind11::detail::cast_ref(std::move(o), caster); - } - else return pybind11::detail::cast_safe(std::move(o)); - } - return CMatrixD::clone(); - } - uint8_t serializeGetVersion() const override { - pybind11::gil_scoped_acquire gil; - pybind11::function overload = pybind11::get_overload(static_cast(this), "serializeGetVersion"); - if (overload) { - auto o = overload.operator()(); - if (pybind11::detail::cast_is_temporary_value_reference::value) { - static pybind11::detail::override_caster_t caster; - return pybind11::detail::cast_ref(std::move(o), caster); - } - else return pybind11::detail::cast_safe(std::move(o)); - } - return CMatrixD::serializeGetVersion(); - } - void serializeTo(class mrpt::serialization::CArchive & a0) const override { - pybind11::gil_scoped_acquire gil; - pybind11::function overload = pybind11::get_overload(static_cast(this), "serializeTo"); - if (overload) { - auto o = overload.operator()(a0); - if (pybind11::detail::cast_is_temporary_value_reference::value) { - static pybind11::detail::override_caster_t caster; - return pybind11::detail::cast_ref(std::move(o), caster); - } - else return pybind11::detail::cast_safe(std::move(o)); - } - return CMatrixD::serializeTo(a0); - } - void serializeFrom(class mrpt::serialization::CArchive & a0, uint8_t a1) override { - pybind11::gil_scoped_acquire gil; - pybind11::function overload = pybind11::get_overload(static_cast(this), "serializeFrom"); - if (overload) { - auto o = overload.operator()(a0, a1); - if (pybind11::detail::cast_is_temporary_value_reference::value) { - static pybind11::detail::override_caster_t caster; - return pybind11::detail::cast_ref(std::move(o), caster); - } - else return pybind11::detail::cast_safe(std::move(o)); - } - return CMatrixD::serializeFrom(a0, a1); - } -}; - -void bind_mrpt_math_CMatrixFixed_4(std::function< pybind11::module &(std::string const &namespace_) > &M) -{ - { // mrpt::math::CMatrixFixed file:mrpt/math/CMatrixFixed.h line:34 - pybind11::class_, std::shared_ptr>> cl(M("mrpt::math"), "CMatrixFixed_double_12UL_1UL_t", ""); - cl.def( pybind11::init( [](){ return new mrpt::math::CMatrixFixed(); } ) ); - cl.def( pybind11::init(), pybind11::arg("") ); - - cl.def( pybind11::init(), pybind11::arg("data") ); - - cl.def( pybind11::init(), pybind11::arg("rows"), pybind11::arg("cols") ); - - cl.def( pybind11::init( [](mrpt::math::CMatrixFixed const &o){ return new mrpt::math::CMatrixFixed(o); } ) ); - cl.def("loadFromRawPointer", (void (mrpt::math::CMatrixFixed::*)(const double *)) &mrpt::math::CMatrixFixed::loadFromRawPointer, "C++: mrpt::math::CMatrixFixed::loadFromRawPointer(const double *) --> void", pybind11::arg("data")); - cl.def("setSize", [](mrpt::math::CMatrixFixed &o, size_t const & a0, size_t const & a1) -> void { return o.setSize(a0, a1); }, "", pybind11::arg("row"), pybind11::arg("col")); - cl.def("setSize", (void (mrpt::math::CMatrixFixed::*)(size_t, size_t, bool)) &mrpt::math::CMatrixFixed::setSize, "C++: mrpt::math::CMatrixFixed::setSize(size_t, size_t, bool) --> void", pybind11::arg("row"), pybind11::arg("col"), pybind11::arg("zeroNewElements")); - cl.def("swap", (void (mrpt::math::CMatrixFixed::*)(class mrpt::math::CMatrixFixed &)) &mrpt::math::CMatrixFixed::swap, "C++: mrpt::math::CMatrixFixed::swap(class mrpt::math::CMatrixFixed &) --> void", pybind11::arg("o")); - cl.def("conservativeResize", (void (mrpt::math::CMatrixFixed::*)(size_t, size_t)) &mrpt::math::CMatrixFixed::conservativeResize, "C++: mrpt::math::CMatrixFixed::conservativeResize(size_t, size_t) --> void", pybind11::arg("row"), pybind11::arg("col")); - cl.def("resize", (void (mrpt::math::CMatrixFixed::*)(size_t)) &mrpt::math::CMatrixFixed::resize, "C++: mrpt::math::CMatrixFixed::resize(size_t) --> void", pybind11::arg("n")); - cl.def("resize", (void (mrpt::math::CMatrixFixed::*)(size_t, size_t)) &mrpt::math::CMatrixFixed::resize, "C++: mrpt::math::CMatrixFixed::resize(size_t, size_t) --> void", pybind11::arg("row"), pybind11::arg("col")); - cl.def("rows", (int (mrpt::math::CMatrixFixed::*)() const) &mrpt::math::CMatrixFixed::rows, "C++: mrpt::math::CMatrixFixed::rows() const --> int"); - cl.def("cols", (int (mrpt::math::CMatrixFixed::*)() const) &mrpt::math::CMatrixFixed::cols, "C++: mrpt::math::CMatrixFixed::cols() const --> int"); - cl.def("data", (double * (mrpt::math::CMatrixFixed::*)()) &mrpt::math::CMatrixFixed::data, "C++: mrpt::math::CMatrixFixed::data() --> double *", pybind11::return_value_policy::automatic); - cl.def("__call__", (double & (mrpt::math::CMatrixFixed::*)(int, int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int, int) --> double &", pybind11::return_value_policy::reference, pybind11::arg("row"), pybind11::arg("col")); - cl.def("__call__", (double & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int) --> double &", pybind11::return_value_policy::reference, pybind11::arg("i")); - cl.def("__getitem__", (double & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator[], "C++: mrpt::math::CMatrixFixed::operator[](int) --> double &", pybind11::return_value_policy::reference, pybind11::arg("i")); - cl.def("sum_At", (void (mrpt::math::CMatrixFixed::*)(const class mrpt::math::CMatrixFixed &)) &mrpt::math::CMatrixFixed::sum_At, "C++: mrpt::math::CMatrixFixed::sum_At(const class mrpt::math::CMatrixFixed &) --> void", pybind11::arg("A")); - } - { // mrpt::math::CMatrixFixed file:mrpt/math/CMatrixFixed.h line:34 - pybind11::class_, std::shared_ptr>> cl(M("mrpt::math"), "CMatrixFixed_float_4UL_1UL_t", ""); - cl.def( pybind11::init( [](){ return new mrpt::math::CMatrixFixed(); } ) ); - cl.def( pybind11::init(), pybind11::arg("") ); - - cl.def( pybind11::init(), pybind11::arg("data") ); - - cl.def( pybind11::init(), pybind11::arg("rows"), pybind11::arg("cols") ); - - cl.def( pybind11::init( [](mrpt::math::CMatrixFixed const &o){ return new mrpt::math::CMatrixFixed(o); } ) ); - cl.def("loadFromRawPointer", (void (mrpt::math::CMatrixFixed::*)(const float *)) &mrpt::math::CMatrixFixed::loadFromRawPointer, "C++: mrpt::math::CMatrixFixed::loadFromRawPointer(const float *) --> void", pybind11::arg("data")); - cl.def("setSize", [](mrpt::math::CMatrixFixed &o, size_t const & a0, size_t const & a1) -> void { return o.setSize(a0, a1); }, "", pybind11::arg("row"), pybind11::arg("col")); - cl.def("setSize", (void (mrpt::math::CMatrixFixed::*)(size_t, size_t, bool)) &mrpt::math::CMatrixFixed::setSize, "C++: mrpt::math::CMatrixFixed::setSize(size_t, size_t, bool) --> void", pybind11::arg("row"), pybind11::arg("col"), pybind11::arg("zeroNewElements")); - cl.def("swap", (void (mrpt::math::CMatrixFixed::*)(class mrpt::math::CMatrixFixed &)) &mrpt::math::CMatrixFixed::swap, "C++: mrpt::math::CMatrixFixed::swap(class mrpt::math::CMatrixFixed &) --> void", pybind11::arg("o")); - cl.def("conservativeResize", (void (mrpt::math::CMatrixFixed::*)(size_t, size_t)) &mrpt::math::CMatrixFixed::conservativeResize, "C++: mrpt::math::CMatrixFixed::conservativeResize(size_t, size_t) --> void", pybind11::arg("row"), pybind11::arg("col")); - cl.def("resize", (void (mrpt::math::CMatrixFixed::*)(size_t)) &mrpt::math::CMatrixFixed::resize, "C++: mrpt::math::CMatrixFixed::resize(size_t) --> void", pybind11::arg("n")); - cl.def("resize", (void (mrpt::math::CMatrixFixed::*)(size_t, size_t)) &mrpt::math::CMatrixFixed::resize, "C++: mrpt::math::CMatrixFixed::resize(size_t, size_t) --> void", pybind11::arg("row"), pybind11::arg("col")); - cl.def("rows", (int (mrpt::math::CMatrixFixed::*)() const) &mrpt::math::CMatrixFixed::rows, "C++: mrpt::math::CMatrixFixed::rows() const --> int"); - cl.def("cols", (int (mrpt::math::CMatrixFixed::*)() const) &mrpt::math::CMatrixFixed::cols, "C++: mrpt::math::CMatrixFixed::cols() const --> int"); - cl.def("data", (float * (mrpt::math::CMatrixFixed::*)()) &mrpt::math::CMatrixFixed::data, "C++: mrpt::math::CMatrixFixed::data() --> float *", pybind11::return_value_policy::automatic); - cl.def("__call__", (float & (mrpt::math::CMatrixFixed::*)(int, int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int, int) --> float &", pybind11::return_value_policy::reference, pybind11::arg("row"), pybind11::arg("col")); - cl.def("__call__", (float & (mrpt::math::CMatrixFixed::*)(int)) &mrpt::math::CMatrixFixed::operator(), "C++: mrpt::math::CMatrixFixed::operator()(int) --> float &", pybind11::return_value_policy::reference, pybind11::arg("i")); - cl.def("cast_float", (class mrpt::math::CMatrixFixed (mrpt::math::CMatrixFixed::*)() const) &mrpt::math::CMatrixFixed::cast_float, "C++: mrpt::math::CMatrixFixed::cast_float() const --> class mrpt::math::CMatrixFixed"); - cl.def("sum_At", (void (mrpt::math::CMatrixFixed::*)(const class mrpt::math::CMatrixFixed &)) &mrpt::math::CMatrixFixed::sum_At, "C++: mrpt::math::CMatrixFixed::sum_At(const class mrpt::math::CMatrixFixed &) --> void", pybind11::arg("A")); - cl.def("assign", (class mrpt::math::CMatrixFixed & (mrpt::math::CMatrixFixed::*)(const class mrpt::math::CMatrixFixed &)) &mrpt::math::CMatrixFixed::operator=, "C++: mrpt::math::CMatrixFixed::operator=(const class mrpt::math::CMatrixFixed &) --> class mrpt::math::CMatrixFixed &", pybind11::return_value_policy::automatic, pybind11::arg("")); - - // Manually-added matrix methods: - using dat_t = float; - using mat_t = mrpt::math::CMatrixFixed; - cl.def("__getitem__", [](const mat_t&self, pybind11::tuple coord) -> dat_t { if (coord.size()==2) return self.coeff(coord[0].cast(), coord[1].cast()); else if (coord.size()==1) return self[coord[0].cast()]; else throw std::invalid_argument("Access with [idx] or [row,col]"); }); - cl.def("__setitem__", [](mat_t&self, pybind11::tuple coord, dat_t val) { if (coord.size()==2) self.coeffRef(coord[0].cast(), coord[1].cast())=val; else if (coord.size()==1) self[coord[0].cast()]=val; else throw std::invalid_argument("Access with [idx] or [row,col]"); }); - cl.def("__str__", [](const mat_t& o) -> std::string { return o.asString(); } ); - cl.def("inMatlabFormat", [](const mat_t& o) -> std::string { return o.inMatlabFormat(); } ); - cl.def("size", [](const mat_t&self) -> pybind11::tuple { return pybind11::make_tuple(self.cols(),self.rows()); }); - cl.def_static("Zero", []() -> mat_t { return mat_t::Zero(); }, "Returns a matrix with zeroes"); - cl.def(pybind11::init( [](pybind11::list vals){ auto m = new mat_t(); const auto nR = vals.size(); if (!nR) return m; const auto nC = vals[0].cast().size(); m->setSize(nR,nC); for (size_t r=0;r(); for (size_t c=0;ccoeffRef(r,c) = row[c].cast(); } return m; })); - cl.def("to_list", [](const mat_t&self) -> pybind11::list { auto l = pybind11::list(); const auto nR = self.rows(), nC = self.cols(); for (size_t r=0;r(M("mrpt::math"), "TMatrixTextFileFormat", pybind11::arithmetic(), "Selection of the number format in MatrixVectorBase::saveToTextFile()\n \n") - .value("MATRIX_FORMAT_ENG", mrpt::math::MATRIX_FORMAT_ENG) - .value("MATRIX_FORMAT_FIXED", mrpt::math::MATRIX_FORMAT_FIXED) - .value("MATRIX_FORMAT_INT", mrpt::math::MATRIX_FORMAT_INT) - .export_values(); - -; - - { // mrpt::math::CMatrixD file:mrpt/math/CMatrixD.h line:23 - pybind11::class_, PyCallBack_mrpt_math_CMatrixD, mrpt::serialization::CSerializable, mrpt::math::CMatrixDynamic> cl(M("mrpt::math"), "CMatrixD", "This class is a \"CSerializable\" wrapper for\n \"CMatrixDynamic\".\n \n\n For a complete introduction to Matrices and vectors in MRPT, see:\n https://www.mrpt.org/Matrices_vectors_arrays_and_Linear_Algebra_MRPT_and_Eigen_classes\n \n\n\n "); - cl.def( pybind11::init( [](){ return new mrpt::math::CMatrixD(); }, [](){ return new PyCallBack_mrpt_math_CMatrixD(); } ) ); - cl.def( pybind11::init(), pybind11::arg("row"), pybind11::arg("col") ); - - cl.def( pybind11::init &>(), pybind11::arg("m") ); - - cl.def( pybind11::init &>(), pybind11::arg("m") ); - - cl.def( pybind11::init( [](PyCallBack_mrpt_math_CMatrixD const &o){ return new PyCallBack_mrpt_math_CMatrixD(o); } ) ); - cl.def( pybind11::init( [](mrpt::math::CMatrixD const &o){ return new mrpt::math::CMatrixD(o); } ) ); - cl.def("assign", (class mrpt::math::CMatrixD & (mrpt::math::CMatrixD::*)(const class mrpt::math::CMatrixDynamic &)) &mrpt::math::CMatrixD::operator=>, "C++: mrpt::math::CMatrixD::operator=(const class mrpt::math::CMatrixDynamic &) --> class mrpt::math::CMatrixD &", pybind11::return_value_policy::automatic, pybind11::arg("other")); - cl.def("assign", (class mrpt::math::CMatrixD & (mrpt::math::CMatrixD::*)(const class mrpt::math::CMatrixD &)) &mrpt::math::CMatrixD::operator=, "C++: mrpt::math::CMatrixD::operator=(const class mrpt::math::CMatrixD &) --> class mrpt::math::CMatrixD &", pybind11::return_value_policy::automatic, pybind11::arg("other")); - cl.def_static("GetRuntimeClassIdStatic", (const struct mrpt::rtti::TRuntimeClassId & (*)()) &mrpt::math::CMatrixD::GetRuntimeClassIdStatic, "C++: mrpt::math::CMatrixD::GetRuntimeClassIdStatic() --> const struct mrpt::rtti::TRuntimeClassId &", pybind11::return_value_policy::automatic); - cl.def("GetRuntimeClass", (const struct mrpt::rtti::TRuntimeClassId * (mrpt::math::CMatrixD::*)() const) &mrpt::math::CMatrixD::GetRuntimeClass, "C++: mrpt::math::CMatrixD::GetRuntimeClass() const --> const struct mrpt::rtti::TRuntimeClassId *", pybind11::return_value_policy::automatic); - cl.def("clone", (class mrpt::rtti::CObject * (mrpt::math::CMatrixD::*)() const) &mrpt::math::CMatrixD::clone, "C++: mrpt::math::CMatrixD::clone() const --> class mrpt::rtti::CObject *", pybind11::return_value_policy::automatic); - cl.def_static("CreateObject", (class std::shared_ptr (*)()) &mrpt::math::CMatrixD::CreateObject, "C++: mrpt::math::CMatrixD::CreateObject() --> class std::shared_ptr"); - cl.def("assign", (class mrpt::math::CMatrixD & (mrpt::math::CMatrixD::*)(const class mrpt::math::CMatrixD &)) &mrpt::math::CMatrixD::operator=, "C++: mrpt::math::CMatrixD::operator=(const class mrpt::math::CMatrixD &) --> class mrpt::math::CMatrixD &", pybind11::return_value_policy::automatic, pybind11::arg("")); - } -} diff --git a/python/src/mrpt/math/MatrixVectorBase.cpp b/python/src/mrpt/math/MatrixVectorBase.cpp index 1770d8289c..c70a428674 100644 --- a/python/src/mrpt/math/MatrixVectorBase.cpp +++ b/python/src/mrpt/math/MatrixVectorBase.cpp @@ -1,21 +1,4 @@ -#include -#include -#include -#include -#include -#include -#include #include -#include -#include -#include -#include -#include -#include -#include -#include // __str__ -#include -#include #include #include @@ -32,46 +15,13 @@ void bind_mrpt_math_MatrixVectorBase(std::function< pybind11::module &(std::string const &namespace_) > &M) { - { // mrpt::math::MatrixVectorBase file:mrpt/math/MatrixVectorBase.h line:57 - pybind11::class_,mrpt::math::CMatrixDynamic >>, std::shared_ptr,mrpt::math::CMatrixDynamic >>>> cl(M("mrpt::math"), "MatrixVectorBase_mrpt_math_TPoint3D_float_mrpt_math_CMatrixDynamic_mrpt_math_TPoint3D_float_t", ""); - cl.def( pybind11::init( [](){ return new mrpt::math::MatrixVectorBase,mrpt::math::CMatrixDynamic >>(); } ) ); - cl.def( pybind11::init( [](mrpt::math::MatrixVectorBase,mrpt::math::CMatrixDynamic >> const &o){ return new mrpt::math::MatrixVectorBase,mrpt::math::CMatrixDynamic >>(o); } ) ); - cl.def("fill", (void (mrpt::math::MatrixVectorBase,mrpt::math::CMatrixDynamic >>::*)(const struct mrpt::math::TPoint3D_ &)) &mrpt::math::MatrixVectorBase, mrpt::math::CMatrixDynamic>>::fill, "C++: mrpt::math::MatrixVectorBase, mrpt::math::CMatrixDynamic>>::fill(const struct mrpt::math::TPoint3D_ &) --> void", pybind11::arg("val")); - cl.def("setConstant", (void (mrpt::math::MatrixVectorBase,mrpt::math::CMatrixDynamic >>::*)(const struct mrpt::math::TPoint3D_)) &mrpt::math::MatrixVectorBase, mrpt::math::CMatrixDynamic>>::setConstant, "C++: mrpt::math::MatrixVectorBase, mrpt::math::CMatrixDynamic>>::setConstant(const struct mrpt::math::TPoint3D_) --> void", pybind11::arg("value")); - cl.def("setConstant", (void (mrpt::math::MatrixVectorBase,mrpt::math::CMatrixDynamic >>::*)(size_t, size_t, const struct mrpt::math::TPoint3D_)) &mrpt::math::MatrixVectorBase, mrpt::math::CMatrixDynamic>>::setConstant, "C++: mrpt::math::MatrixVectorBase, mrpt::math::CMatrixDynamic>>::setConstant(size_t, size_t, const struct mrpt::math::TPoint3D_) --> void", pybind11::arg("nrows"), pybind11::arg("ncols"), pybind11::arg("value")); - cl.def("setConstant", (void (mrpt::math::MatrixVectorBase,mrpt::math::CMatrixDynamic >>::*)(size_t, const struct mrpt::math::TPoint3D_)) &mrpt::math::MatrixVectorBase, mrpt::math::CMatrixDynamic>>::setConstant, "C++: mrpt::math::MatrixVectorBase, mrpt::math::CMatrixDynamic>>::setConstant(size_t, const struct mrpt::math::TPoint3D_) --> void", pybind11::arg("nrows"), pybind11::arg("value")); - cl.def_static("Constant", (class mrpt::math::CMatrixDynamic > (*)(const struct mrpt::math::TPoint3D_)) &mrpt::math::MatrixVectorBase, mrpt::math::CMatrixDynamic>>::Constant, "C++: mrpt::math::MatrixVectorBase, mrpt::math::CMatrixDynamic>>::Constant(const struct mrpt::math::TPoint3D_) --> class mrpt::math::CMatrixDynamic >", pybind11::arg("value")); - cl.def_static("Constant", (class mrpt::math::CMatrixDynamic > (*)(size_t, size_t, const struct mrpt::math::TPoint3D_)) &mrpt::math::MatrixVectorBase, mrpt::math::CMatrixDynamic>>::Constant, "C++: mrpt::math::MatrixVectorBase, mrpt::math::CMatrixDynamic>>::Constant(size_t, size_t, const struct mrpt::math::TPoint3D_) --> class mrpt::math::CMatrixDynamic >", pybind11::arg("nrows"), pybind11::arg("ncols"), pybind11::arg("value")); - cl.def("assign", (void (mrpt::math::MatrixVectorBase,mrpt::math::CMatrixDynamic >>::*)(const unsigned long, const struct mrpt::math::TPoint3D_)) &mrpt::math::MatrixVectorBase, mrpt::math::CMatrixDynamic>>::assign, "C++: mrpt::math::MatrixVectorBase, mrpt::math::CMatrixDynamic>>::assign(const unsigned long, const struct mrpt::math::TPoint3D_) --> void", pybind11::arg("N"), pybind11::arg("value")); - cl.def("setZero", (void (mrpt::math::MatrixVectorBase,mrpt::math::CMatrixDynamic >>::*)()) &mrpt::math::MatrixVectorBase, mrpt::math::CMatrixDynamic>>::setZero, "C++: mrpt::math::MatrixVectorBase, mrpt::math::CMatrixDynamic>>::setZero() --> void"); - cl.def("setZero", (void (mrpt::math::MatrixVectorBase,mrpt::math::CMatrixDynamic >>::*)(size_t, size_t)) &mrpt::math::MatrixVectorBase, mrpt::math::CMatrixDynamic>>::setZero, "C++: mrpt::math::MatrixVectorBase, mrpt::math::CMatrixDynamic>>::setZero(size_t, size_t) --> void", pybind11::arg("nrows"), pybind11::arg("ncols")); - cl.def("setZero", (void (mrpt::math::MatrixVectorBase,mrpt::math::CMatrixDynamic >>::*)(size_t)) &mrpt::math::MatrixVectorBase, mrpt::math::CMatrixDynamic>>::setZero, "C++: mrpt::math::MatrixVectorBase, mrpt::math::CMatrixDynamic>>::setZero(size_t) --> void", pybind11::arg("nrows")); - cl.def_static("Zero", (class mrpt::math::CMatrixDynamic > (*)()) &mrpt::math::MatrixVectorBase, mrpt::math::CMatrixDynamic>>::Zero, "C++: mrpt::math::MatrixVectorBase, mrpt::math::CMatrixDynamic>>::Zero() --> class mrpt::math::CMatrixDynamic >"); - cl.def_static("Zero", (class mrpt::math::CMatrixDynamic > (*)(size_t, size_t)) &mrpt::math::MatrixVectorBase, mrpt::math::CMatrixDynamic>>::Zero, "C++: mrpt::math::MatrixVectorBase, mrpt::math::CMatrixDynamic>>::Zero(size_t, size_t) --> class mrpt::math::CMatrixDynamic >", pybind11::arg("nrows"), pybind11::arg("ncols")); - cl.def("coeffRef", (struct mrpt::math::TPoint3D_ & (mrpt::math::MatrixVectorBase,mrpt::math::CMatrixDynamic >>::*)(int, int)) &mrpt::math::MatrixVectorBase, mrpt::math::CMatrixDynamic>>::coeffRef, "C++: mrpt::math::MatrixVectorBase, mrpt::math::CMatrixDynamic>>::coeffRef(int, int) --> struct mrpt::math::TPoint3D_ &", pybind11::return_value_policy::automatic, pybind11::arg("r"), pybind11::arg("c")); - cl.def("coeff", (const struct mrpt::math::TPoint3D_ & (mrpt::math::MatrixVectorBase,mrpt::math::CMatrixDynamic >>::*)(int, int) const) &mrpt::math::MatrixVectorBase, mrpt::math::CMatrixDynamic>>::coeff, "C++: mrpt::math::MatrixVectorBase, mrpt::math::CMatrixDynamic>>::coeff(int, int) const --> const struct mrpt::math::TPoint3D_ &", pybind11::return_value_policy::automatic, pybind11::arg("r"), pybind11::arg("c")); - cl.def("isSquare", (bool (mrpt::math::MatrixVectorBase,mrpt::math::CMatrixDynamic >>::*)() const) &mrpt::math::MatrixVectorBase, mrpt::math::CMatrixDynamic>>::isSquare, "C++: mrpt::math::MatrixVectorBase, mrpt::math::CMatrixDynamic>>::isSquare() const --> bool"); - cl.def("empty", (bool (mrpt::math::MatrixVectorBase,mrpt::math::CMatrixDynamic >>::*)() const) &mrpt::math::MatrixVectorBase, mrpt::math::CMatrixDynamic>>::empty, "C++: mrpt::math::MatrixVectorBase, mrpt::math::CMatrixDynamic>>::empty() const --> bool"); - cl.def("norm_inf", (struct mrpt::math::TPoint3D_ (mrpt::math::MatrixVectorBase,mrpt::math::CMatrixDynamic >>::*)() const) &mrpt::math::MatrixVectorBase, mrpt::math::CMatrixDynamic>>::norm_inf, "C++: mrpt::math::MatrixVectorBase, mrpt::math::CMatrixDynamic>>::norm_inf() const --> struct mrpt::math::TPoint3D_"); - cl.def("norm", (struct mrpt::math::TPoint3D_ (mrpt::math::MatrixVectorBase,mrpt::math::CMatrixDynamic >>::*)() const) &mrpt::math::MatrixVectorBase, mrpt::math::CMatrixDynamic>>::norm, "C++: mrpt::math::MatrixVectorBase, mrpt::math::CMatrixDynamic>>::norm() const --> struct mrpt::math::TPoint3D_"); - cl.def("__iadd__", (void (mrpt::math::MatrixVectorBase,mrpt::math::CMatrixDynamic >>::*)(struct mrpt::math::TPoint3D_)) &mrpt::math::MatrixVectorBase, mrpt::math::CMatrixDynamic>>::operator+=, "C++: mrpt::math::MatrixVectorBase, mrpt::math::CMatrixDynamic>>::operator+=(struct mrpt::math::TPoint3D_) --> void", pybind11::arg("s")); - cl.def("__isub__", (void (mrpt::math::MatrixVectorBase,mrpt::math::CMatrixDynamic >>::*)(struct mrpt::math::TPoint3D_)) &mrpt::math::MatrixVectorBase, mrpt::math::CMatrixDynamic>>::operator-=, "C++: mrpt::math::MatrixVectorBase, mrpt::math::CMatrixDynamic>>::operator-=(struct mrpt::math::TPoint3D_) --> void", pybind11::arg("s")); - cl.def("__imul__", (void (mrpt::math::MatrixVectorBase,mrpt::math::CMatrixDynamic >>::*)(struct mrpt::math::TPoint3D_)) &mrpt::math::MatrixVectorBase, mrpt::math::CMatrixDynamic>>::operator*=, "C++: mrpt::math::MatrixVectorBase, mrpt::math::CMatrixDynamic>>::operator*=(struct mrpt::math::TPoint3D_) --> void", pybind11::arg("s")); - cl.def("__add__", (class mrpt::math::CMatrixDynamic > (mrpt::math::MatrixVectorBase,mrpt::math::CMatrixDynamic >>::*)(const class mrpt::math::CMatrixDynamic > &) const) &mrpt::math::MatrixVectorBase, mrpt::math::CMatrixDynamic>>::operator+, "C++: mrpt::math::MatrixVectorBase, mrpt::math::CMatrixDynamic>>::operator+(const class mrpt::math::CMatrixDynamic > &) const --> class mrpt::math::CMatrixDynamic >", pybind11::arg("m2")); - cl.def("__iadd__", (void (mrpt::math::MatrixVectorBase,mrpt::math::CMatrixDynamic >>::*)(const class mrpt::math::CMatrixDynamic > &)) &mrpt::math::MatrixVectorBase, mrpt::math::CMatrixDynamic>>::operator+=, "C++: mrpt::math::MatrixVectorBase, mrpt::math::CMatrixDynamic>>::operator+=(const class mrpt::math::CMatrixDynamic > &) --> void", pybind11::arg("m2")); - cl.def("__isub__", (void (mrpt::math::MatrixVectorBase,mrpt::math::CMatrixDynamic >>::*)(const class mrpt::math::CMatrixDynamic > &)) &mrpt::math::MatrixVectorBase, mrpt::math::CMatrixDynamic>>::operator-=, "C++: mrpt::math::MatrixVectorBase, mrpt::math::CMatrixDynamic>>::operator-=(const class mrpt::math::CMatrixDynamic > &) --> void", pybind11::arg("m2")); - cl.def("sum", (struct mrpt::math::TPoint3D_ (mrpt::math::MatrixVectorBase,mrpt::math::CMatrixDynamic >>::*)() const) &mrpt::math::MatrixVectorBase, mrpt::math::CMatrixDynamic>>::sum, "C++: mrpt::math::MatrixVectorBase, mrpt::math::CMatrixDynamic>>::sum() const --> struct mrpt::math::TPoint3D_"); - cl.def("sum_abs", (struct mrpt::math::TPoint3D_ (mrpt::math::MatrixVectorBase,mrpt::math::CMatrixDynamic >>::*)() const) &mrpt::math::MatrixVectorBase, mrpt::math::CMatrixDynamic>>::sum_abs, "C++: mrpt::math::MatrixVectorBase, mrpt::math::CMatrixDynamic>>::sum_abs() const --> struct mrpt::math::TPoint3D_"); - cl.def("asString", (std::string (mrpt::math::MatrixVectorBase,mrpt::math::CMatrixDynamic >>::*)() const) &mrpt::math::MatrixVectorBase, mrpt::math::CMatrixDynamic>>::asString, "C++: mrpt::math::MatrixVectorBase, mrpt::math::CMatrixDynamic>>::asString() const --> std::string"); - cl.def("inMatlabFormat", [](mrpt::math::MatrixVectorBase,mrpt::math::CMatrixDynamic >> const &o) -> std::string { return o.inMatlabFormat(); }, ""); - cl.def("inMatlabFormat", (std::string (mrpt::math::MatrixVectorBase,mrpt::math::CMatrixDynamic >>::*)(const unsigned long) const) &mrpt::math::MatrixVectorBase, mrpt::math::CMatrixDynamic>>::inMatlabFormat, "C++: mrpt::math::MatrixVectorBase, mrpt::math::CMatrixDynamic>>::inMatlabFormat(const unsigned long) const --> std::string", pybind11::arg("decimal_digits")); - cl.def("saveToTextFile", [](mrpt::math::MatrixVectorBase,mrpt::math::CMatrixDynamic >> const &o, const std::string & a0) -> void { return o.saveToTextFile(a0); }, "", pybind11::arg("file")); - cl.def("saveToTextFile", [](mrpt::math::MatrixVectorBase,mrpt::math::CMatrixDynamic >> const &o, const std::string & a0, enum mrpt::math::TMatrixTextFileFormat const & a1) -> void { return o.saveToTextFile(a0, a1); }, "", pybind11::arg("file"), pybind11::arg("fileFormat")); - cl.def("saveToTextFile", [](mrpt::math::MatrixVectorBase,mrpt::math::CMatrixDynamic >> const &o, const std::string & a0, enum mrpt::math::TMatrixTextFileFormat const & a1, bool const & a2) -> void { return o.saveToTextFile(a0, a1, a2); }, "", pybind11::arg("file"), pybind11::arg("fileFormat"), pybind11::arg("appendMRPTHeader")); - cl.def("saveToTextFile", (void (mrpt::math::MatrixVectorBase,mrpt::math::CMatrixDynamic >>::*)(const std::string &, enum mrpt::math::TMatrixTextFileFormat, bool, const std::string &) const) &mrpt::math::MatrixVectorBase, mrpt::math::CMatrixDynamic>>::saveToTextFile, "C++: mrpt::math::MatrixVectorBase, mrpt::math::CMatrixDynamic>>::saveToTextFile(const std::string &, enum mrpt::math::TMatrixTextFileFormat, bool, const std::string &) const --> void", pybind11::arg("file"), pybind11::arg("fileFormat"), pybind11::arg("appendMRPTHeader"), pybind11::arg("userHeader")); - cl.def("loadFromTextFile", (void (mrpt::math::MatrixVectorBase,mrpt::math::CMatrixDynamic >>::*)(const std::string &)) &mrpt::math::MatrixVectorBase, mrpt::math::CMatrixDynamic>>::loadFromTextFile, "C++: mrpt::math::MatrixVectorBase, mrpt::math::CMatrixDynamic>>::loadFromTextFile(const std::string &) --> void", pybind11::arg("file")); - cl.def("assign", (class mrpt::math::MatrixVectorBase, class mrpt::math::CMatrixDynamic > > & (mrpt::math::MatrixVectorBase,mrpt::math::CMatrixDynamic >>::*)(const class mrpt::math::MatrixVectorBase, class mrpt::math::CMatrixDynamic > > &)) &mrpt::math::MatrixVectorBase, mrpt::math::CMatrixDynamic>>::operator=, "C++: mrpt::math::MatrixVectorBase, mrpt::math::CMatrixDynamic>>::operator=(const class mrpt::math::MatrixVectorBase, class mrpt::math::CMatrixDynamic > > &) --> class mrpt::math::MatrixVectorBase, class mrpt::math::CMatrixDynamic > > &", pybind11::return_value_policy::automatic, pybind11::arg("")); + // mrpt::math::TMatrixTextFileFormat file:mrpt/math/MatrixVectorBase.h line:35 + pybind11::enum_(M("mrpt::math"), "TMatrixTextFileFormat", pybind11::arithmetic(), "Selection of the number format in MatrixVectorBase::saveToTextFile()\n \n") + .value("MATRIX_FORMAT_ENG", mrpt::math::MATRIX_FORMAT_ENG) + .value("MATRIX_FORMAT_FIXED", mrpt::math::MATRIX_FORMAT_FIXED) + .value("MATRIX_FORMAT_INT", mrpt::math::MATRIX_FORMAT_INT) + .export_values(); + +; - cl.def("__str__", [](mrpt::math::MatrixVectorBase,mrpt::math::CMatrixDynamic >> const &o) -> std::string { std::ostringstream s; using namespace mrpt::math; s << o; return s.str(); } ); - } } diff --git a/python/src/pymrpt.cpp b/python/src/pymrpt.cpp index 8b8a5758a3..9bc222edb2 100644 --- a/python/src/pymrpt.cpp +++ b/python/src/pymrpt.cpp @@ -177,8 +177,12 @@ void bind_mrpt_obs_CObservationStereoImages(std::function< pybind11::module &(st void bind_mrpt_vision_CStereoRectifyMap(std::function< pybind11::module &(std::string const &namespace_) > &M); void bind_mrpt_hwdrivers_CDUO3DCamera(std::function< pybind11::module &(std::string const &namespace_) > &M); void bind_mrpt_math_CMatrixDynamic(std::function< pybind11::module &(std::string const &namespace_) > &M); +void bind_mrpt_math_CMatrixDynamic_1(std::function< pybind11::module &(std::string const &namespace_) > &M); +void bind_mrpt_math_CMatrixFixed(std::function< pybind11::module &(std::string const &namespace_) > &M); +void bind_mrpt_math_CMatrixFixed_1(std::function< pybind11::module &(std::string const &namespace_) > &M); +void bind_mrpt_math_CMatrixFixed_2(std::function< pybind11::module &(std::string const &namespace_) > &M); +void bind_mrpt_math_CMatrixFixed_3(std::function< pybind11::module &(std::string const &namespace_) > &M); void bind_mrpt_math_MatrixVectorBase(std::function< pybind11::module &(std::string const &namespace_) > &M); -void bind_mrpt_math_MatrixBase(std::function< pybind11::module &(std::string const &namespace_) > &M); void bind_mrpt_math_math_frwds(std::function< pybind11::module &(std::string const &namespace_) > &M); void bind_mrpt_bayes_CProbabilityParticle_1(std::function< pybind11::module &(std::string const &namespace_) > &M); void bind_mrpt_math_CMatrixF(std::function< pybind11::module &(std::string const &namespace_) > &M); @@ -230,12 +234,7 @@ void bind_mrpt_kinematics_CKinematicChain(std::function< pybind11::module &(std: void bind_mrpt_kinematics_CVehicleVelCmd(std::function< pybind11::module &(std::string const &namespace_) > &M); void bind_mrpt_kinematics_CVehicleVelCmd_DiffDriven(std::function< pybind11::module &(std::string const &namespace_) > &M); void bind_mrpt_poses_CPointPDF(std::function< pybind11::module &(std::string const &namespace_) > &M); -void bind_mrpt_math_CMatrixDynamic_1(std::function< pybind11::module &(std::string const &namespace_) > &M); -void bind_mrpt_math_CMatrixFixed(std::function< pybind11::module &(std::string const &namespace_) > &M); -void bind_mrpt_math_CMatrixFixed_1(std::function< pybind11::module &(std::string const &namespace_) > &M); -void bind_mrpt_math_CMatrixFixed_2(std::function< pybind11::module &(std::string const &namespace_) > &M); -void bind_mrpt_math_CMatrixFixed_3(std::function< pybind11::module &(std::string const &namespace_) > &M); -void bind_mrpt_math_CMatrixFixed_4(std::function< pybind11::module &(std::string const &namespace_) > &M); +void bind_mrpt_math_CMatrixDynamic_2(std::function< pybind11::module &(std::string const &namespace_) > &M); void bind_mrpt_poses_CPointPDFSOG(std::function< pybind11::module &(std::string const &namespace_) > &M); void bind_mrpt_maps_CBeacon(std::function< pybind11::module &(std::string const &namespace_) > &M); void bind_mrpt_opengl_COctoMapVoxels(std::function< pybind11::module &(std::string const &namespace_) > &M); @@ -608,8 +607,12 @@ PYBIND11_MODULE(pymrpt, root_module) { bind_mrpt_vision_CStereoRectifyMap(M); bind_mrpt_hwdrivers_CDUO3DCamera(M); bind_mrpt_math_CMatrixDynamic(M); + bind_mrpt_math_CMatrixDynamic_1(M); + bind_mrpt_math_CMatrixFixed(M); + bind_mrpt_math_CMatrixFixed_1(M); + bind_mrpt_math_CMatrixFixed_2(M); + bind_mrpt_math_CMatrixFixed_3(M); bind_mrpt_math_MatrixVectorBase(M); - bind_mrpt_math_MatrixBase(M); bind_mrpt_math_math_frwds(M); bind_mrpt_bayes_CProbabilityParticle_1(M); bind_mrpt_math_CMatrixF(M); @@ -661,12 +664,7 @@ PYBIND11_MODULE(pymrpt, root_module) { bind_mrpt_kinematics_CVehicleVelCmd(M); bind_mrpt_kinematics_CVehicleVelCmd_DiffDriven(M); bind_mrpt_poses_CPointPDF(M); - bind_mrpt_math_CMatrixDynamic_1(M); - bind_mrpt_math_CMatrixFixed(M); - bind_mrpt_math_CMatrixFixed_1(M); - bind_mrpt_math_CMatrixFixed_2(M); - bind_mrpt_math_CMatrixFixed_3(M); - bind_mrpt_math_CMatrixFixed_4(M); + bind_mrpt_math_CMatrixDynamic_2(M); bind_mrpt_poses_CPointPDFSOG(M); bind_mrpt_maps_CBeacon(M); bind_mrpt_opengl_COctoMapVoxels(M); diff --git a/python/src/pymrpt.sources b/python/src/pymrpt.sources index 08cd77ae2d..5015a1f833 100644 --- a/python/src/pymrpt.sources +++ b/python/src/pymrpt.sources @@ -167,8 +167,12 @@ mrpt/obs/CObservationStereoImages.cpp mrpt/vision/CStereoRectifyMap.cpp mrpt/hwdrivers/CDUO3DCamera.cpp mrpt/math/CMatrixDynamic.cpp +mrpt/math/CMatrixDynamic_1.cpp +mrpt/math/CMatrixFixed.cpp +mrpt/math/CMatrixFixed_1.cpp +mrpt/math/CMatrixFixed_2.cpp +mrpt/math/CMatrixFixed_3.cpp mrpt/math/MatrixVectorBase.cpp -mrpt/math/MatrixBase.cpp mrpt/math/math_frwds.cpp mrpt/bayes/CProbabilityParticle_1.cpp mrpt/math/CMatrixF.cpp @@ -220,12 +224,7 @@ mrpt/kinematics/CKinematicChain.cpp mrpt/kinematics/CVehicleVelCmd.cpp mrpt/kinematics/CVehicleVelCmd_DiffDriven.cpp mrpt/poses/CPointPDF.cpp -mrpt/math/CMatrixDynamic_1.cpp -mrpt/math/CMatrixFixed.cpp -mrpt/math/CMatrixFixed_1.cpp -mrpt/math/CMatrixFixed_2.cpp -mrpt/math/CMatrixFixed_3.cpp -mrpt/math/CMatrixFixed_4.cpp +mrpt/math/CMatrixDynamic_2.cpp mrpt/poses/CPointPDFSOG.cpp mrpt/maps/CBeacon.cpp mrpt/opengl/COctoMapVoxels.cpp