From e5d783cec6cd65c4b5211875623cdc544b80db89 Mon Sep 17 00:00:00 2001 From: Jose Luis Blanco-Claraco Date: Fri, 30 Aug 2024 08:46:00 +0200 Subject: [PATCH] Fix all C++ build warnings in pymrpt --- doc/source/doxygen-docs/changelog.md | 2 ++ python/CMakeLists.txt | 6 ++++++ python/patch-004.diff | 22 +++++++++++----------- python/src/mrpt/math/CMatrixDynamic.cpp | 2 +- python/src/mrpt/math/CMatrixDynamic_1.cpp | 2 +- python/src/mrpt/math/CMatrixDynamic_2.cpp | 2 +- python/src/mrpt/math/CMatrixFixed.cpp | 6 +++--- python/src/mrpt/math/CMatrixFixed_2.cpp | 4 ++-- python/src/mrpt/math/CMatrixFixed_3.cpp | 6 +++--- 9 files changed, 30 insertions(+), 22 deletions(-) diff --git a/doc/source/doxygen-docs/changelog.md b/doc/source/doxygen-docs/changelog.md index d9999b760e..a78ee3d22a 100644 --- a/doc/source/doxygen-docs/changelog.md +++ b/doc/source/doxygen-docs/changelog.md @@ -1,6 +1,8 @@ \page changelog Change Log # Version 2.13.8: UNRELEASED +- Build system: + - Fix all C++ build warnings in pymrpt. - BUG FIXES: - Avoid failing KLT unit tests in the loong64 architecture. - Fix tons of typos and Debian-specific spare install files (lintian --pedantic). diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt index 512124b449..08ddd51049 100644 --- a/python/CMakeLists.txt +++ b/python/CMakeLists.txt @@ -68,6 +68,12 @@ target_link_libraries(pymrpt PUBLIC mrpt::nav ) +# Avoid warnings for pybind auto-generated code: +if (MRPT_COMPILER_IS_GCC_OR_CLANG) + target_compile_options(pymrpt PRIVATE -Wno-shadow) +endif() + +# Includes: target_include_directories(pymrpt PRIVATE ".") #target_compile_definitions(pymrpt PRIVATE diff --git a/python/patch-004.diff b/python/patch-004.diff index e0acd99abe..716f157745 100644 --- a/python/patch-004.diff +++ b/python/patch-004.diff @@ -25,7 +25,7 @@ index 43b379213..1b600737a 100644 + 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 pybind11::list { auto l = pybind11::list(); const auto nR = self.rows(), nC = self.cols(); for (int r=0;r, std::shared_ptr>> cl(M("mrpt::math"), "CMatrixDynamic_unsigned_char_t", ""); @@ -102,7 +102,7 @@ index 5e303af0c..be42731ed 100644 + 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 pybind11::list { auto l = pybind11::list(); const auto nR = self.rows(), nC = self.cols(); for (int r=0;r 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 pybind11::list { auto l = pybind11::list(); const auto nR = self.rows(), nC = self.cols(); for (int 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 "); @@ -164,7 +164,7 @@ index a9ec794ef..2168c4bf9 100644 + 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 pybind11::list { auto l = pybind11::list(); const auto nR = self.rows(), nC = self.cols(); for (int r=0;r, std::shared_ptr>> cl(M("mrpt::math"), "CMatrixFixed_double_6UL_6UL_t", ""); @@ -191,7 +191,7 @@ index a9ec794ef..2168c4bf9 100644 + 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 pybind11::list { auto l = pybind11::list(); const auto nR = self.rows(), nC = self.cols(); for (int r=0;r, std::shared_ptr>> cl(M("mrpt::math"), "CMatrixFixed_double_7UL_7UL_t", ""); @@ -231,7 +231,7 @@ index a9ec794ef..2168c4bf9 100644 + 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 pybind11::list { auto l = pybind11::list(); const auto nR = self.rows(), nC = self.cols(); for (int r=0;r 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 pybind11::list { auto l = pybind11::list(); const auto nR = self.rows(), nC = self.cols(); for (int r=0;r, std::shared_ptr>> cl(M("mrpt::math"), "CMatrixFixed_double_4UL_3UL_t", ""); @@ -370,7 +370,7 @@ index 4cfc7c55d..2f75fb4ea 100644 + 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 pybind11::list { auto l = pybind11::list(); const auto nR = self.rows(), nC = self.cols(); for (int r=0;r 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 pybind11::list { auto l = pybind11::list(); const auto nR = self.rows(), nC = self.cols(); for (int r=0;r, std::shared_ptr>> cl(M("mrpt::math"), "CMatrixFixed_float_3UL_1UL_t", ""); @@ -428,7 +428,7 @@ index 9f57fa132..0192960f3 100644 + 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 pybind11::list { auto l = pybind11::list(); const auto nR = self.rows(), nC = self.cols(); for (int r=0;r, std::shared_ptr>> cl(M("mrpt::math"), "CMatrixFixed_double_12UL_1UL_t", ""); @@ -468,7 +468,7 @@ index 9f57fa132..0192960f3 100644 + 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 pybind11::list { auto l = pybind11::list(); const auto nR = self.rows(), nC = self.cols(); for (int r=0;r 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 pybind11::list { auto l = pybind11::list(); const auto nR = self.rows(), nC = self.cols(); for (int r=0;r, std::shared_ptr>> cl(M("mrpt::math"), "CMatrixDynamic_unsigned_char_t", ""); diff --git a/python/src/mrpt/math/CMatrixDynamic_1.cpp b/python/src/mrpt/math/CMatrixDynamic_1.cpp index 4d90b28d64..850c67c4a0 100644 --- a/python/src/mrpt/math/CMatrixDynamic_1.cpp +++ b/python/src/mrpt/math/CMatrixDynamic_1.cpp @@ -114,6 +114,6 @@ void bind_mrpt_math_CMatrixDynamic_1(std::function< pybind11::module &(std::stri 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 pybind11::list { auto l = pybind11::list(); const auto nR = self.rows(), nC = self.cols(); for (int r=0;r 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 pybind11::list { auto l = pybind11::list(); const auto nR = self.rows(), nC = self.cols(); for (int 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 "); diff --git a/python/src/mrpt/math/CMatrixFixed.cpp b/python/src/mrpt/math/CMatrixFixed.cpp index 2168c4bf9e..b96e352380 100644 --- a/python/src/mrpt/math/CMatrixFixed.cpp +++ b/python/src/mrpt/math/CMatrixFixed.cpp @@ -55,7 +55,7 @@ void bind_mrpt_math_CMatrixFixed(std::function< pybind11::module &(std::string c 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 pybind11::list { auto l = pybind11::list(); const auto nR = self.rows(), nC = self.cols(); for (int r=0;r, std::shared_ptr>> cl(M("mrpt::math"), "CMatrixFixed_double_6UL_6UL_t", ""); @@ -93,7 +93,7 @@ void bind_mrpt_math_CMatrixFixed(std::function< pybind11::module &(std::string c 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 pybind11::list { auto l = pybind11::list(); const auto nR = self.rows(), nC = self.cols(); for (int r=0;r, std::shared_ptr>> cl(M("mrpt::math"), "CMatrixFixed_double_7UL_7UL_t", ""); @@ -157,6 +157,6 @@ void bind_mrpt_math_CMatrixFixed(std::function< pybind11::module &(std::string c 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 pybind11::list { auto l = pybind11::list(); const auto nR = self.rows(), nC = self.cols(); for (int r=0;r 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 pybind11::list { auto l = pybind11::list(); const auto nR = self.rows(), nC = self.cols(); for (int r=0;r, std::shared_ptr>> cl(M("mrpt::math"), "CMatrixFixed_double_4UL_3UL_t", ""); @@ -141,6 +141,6 @@ void bind_mrpt_math_CMatrixFixed_2(std::function< pybind11::module &(std::string 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 pybind11::list { auto l = pybind11::list(); const auto nR = self.rows(), nC = self.cols(); for (int r=0;r 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 pybind11::list { auto l = pybind11::list(); const auto nR = self.rows(), nC = self.cols(); for (int r=0;r, std::shared_ptr>> cl(M("mrpt::math"), "CMatrixFixed_float_3UL_1UL_t", ""); @@ -93,7 +93,7 @@ void bind_mrpt_math_CMatrixFixed_3(std::function< pybind11::module &(std::string 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 pybind11::list { auto l = pybind11::list(); const auto nR = self.rows(), nC = self.cols(); for (int r=0;r, std::shared_ptr>> cl(M("mrpt::math"), "CMatrixFixed_double_12UL_1UL_t", ""); @@ -156,6 +156,6 @@ void bind_mrpt_math_CMatrixFixed_3(std::function< pybind11::module &(std::string 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 pybind11::list { auto l = pybind11::list(); const auto nR = self.rows(), nC = self.cols(); for (int r=0;r