Skip to content

Commit e5d783c

Browse files
committed
Fix all C++ build warnings in pymrpt
1 parent 1019114 commit e5d783c

9 files changed

+30
-22
lines changed

doc/source/doxygen-docs/changelog.md

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
\page changelog Change Log
22

33
# Version 2.13.8: UNRELEASED
4+
- Build system:
5+
- Fix all C++ build warnings in pymrpt.
46
- BUG FIXES:
57
- Avoid failing KLT unit tests in the loong64 architecture.
68
- Fix tons of typos and Debian-specific spare install files (lintian --pedantic).

python/CMakeLists.txt

+6
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,12 @@ target_link_libraries(pymrpt PUBLIC
6868
mrpt::nav
6969
)
7070

71+
# Avoid warnings for pybind auto-generated code:
72+
if (MRPT_COMPILER_IS_GCC_OR_CLANG)
73+
target_compile_options(pymrpt PRIVATE -Wno-shadow)
74+
endif()
75+
76+
# Includes:
7177
target_include_directories(pymrpt PRIVATE ".")
7278

7379
#target_compile_definitions(pymrpt PRIVATE

python/patch-004.diff

+11-11
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ index 43b379213..1b600737a 100644
2525
+ cl.def_static("Identity", [](const size_t N) -> mat_t { return mat_t::Identity(N); }, "Returns the NxN identity matrix");
2626
+ 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");
2727
+ 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<pybind11::list>().size(); m->setSize(nR,nC); for (size_t r=0;r<nR;r++) { const auto row = vals[r].cast<pybind11::list>(); for (size_t c=0;c<nC;c++) m->coeffRef(r,c) = row[c].cast<dat_t>(); } return m; }));
28-
+ 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<nR;r++) { auto row = pybind11::list(); l.append(row); for (size_t c=0;c<nC;c++) row.append(self.coeff(r,c)); } return l; });
28+
+ cl.def("to_list", [](const mat_t&self) -> pybind11::list { auto l = pybind11::list(); const auto nR = self.rows(), nC = self.cols(); for (int r=0;r<nR;r++) { auto row = pybind11::list(); l.append(row); for (int c=0;c<nC;c++) row.append(self.coeff(r,c)); } return l; });
2929
}
3030
{ // mrpt::math::CMatrixDynamic file:mrpt/math/CMatrixDynamic.h line:41
3131
pybind11::class_<mrpt::math::CMatrixDynamic<unsigned char>, std::shared_ptr<mrpt::math::CMatrixDynamic<unsigned char>>> cl(M("mrpt::math"), "CMatrixDynamic_unsigned_char_t", "");
@@ -102,7 +102,7 @@ index 5e303af0c..be42731ed 100644
102102
+ cl.def_static("Identity", []() -> mat_t { return mat_t::Identity(); }, "Returns the NxN identity matrix");
103103
+ cl.def_static("Zero", []() -> mat_t { return mat_t::Zero(); }, "Returns a matrix with zeroes");
104104
+ 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<pybind11::list>().size(); m->setSize(nR,nC); for (size_t r=0;r<nR;r++) { const auto row = vals[r].cast<pybind11::list>(); for (size_t c=0;c<nC;c++) m->coeffRef(r,c) = row[c].cast<dat_t>(); } return m; }));
105-
+ 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<nR;r++) { auto row = pybind11::list(); l.append(row); for (size_t c=0;c<nC;c++) row.append(self.coeff(r,c)); } return l; });
105+
+ cl.def("to_list", [](const mat_t&self) -> pybind11::list { auto l = pybind11::list(); const auto nR = self.rows(), nC = self.cols(); for (int r=0;r<nR;r++) { auto row = pybind11::list(); l.append(row); for (int c=0;c<nC;c++) row.append(self.coeff(r,c)); } return l; });
106106
}
107107
}
108108
diff --git a/python/src/mrpt/math/CMatrixDynamic_2.cpp b/python/src/mrpt/math/CMatrixDynamic_2.cpp
@@ -132,7 +132,7 @@ index ff79a4a0a..4865de614 100644
132132
+ cl.def_static("Identity", [](const size_t N) -> mat_t { return mat_t::Identity(N); }, "Returns the NxN identity matrix");
133133
+ 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");
134134
+ 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<pybind11::list>().size(); m->setSize(nR,nC); for (size_t r=0;r<nR;r++) { const auto row = vals[r].cast<pybind11::list>(); for (size_t c=0;c<nC;c++) m->coeffRef(r,c) = row[c].cast<dat_t>(); } return m; }));
135-
+ 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<nR;r++) { auto row = pybind11::list(); l.append(row); for (size_t c=0;c<nC;c++) row.append(self.coeff(r,c)); } return l; });
135+
+ cl.def("to_list", [](const mat_t&self) -> pybind11::list { auto l = pybind11::list(); const auto nR = self.rows(), nC = self.cols(); for (int r=0;r<nR;r++) { auto row = pybind11::list(); l.append(row); for (int c=0;c<nC;c++) row.append(self.coeff(r,c)); } return l; });
136136
}
137137
{ // mrpt::math::CMatrixD file:mrpt/math/CMatrixD.h line:23
138138
pybind11::class_<mrpt::math::CMatrixD, std::shared_ptr<mrpt::math::CMatrixD>, PyCallBack_mrpt_math_CMatrixD, mrpt::serialization::CSerializable, mrpt::math::CMatrixDynamic<double>> cl(M("mrpt::math"), "CMatrixD", "This class is a \"CSerializable\" wrapper for\n \"CMatrixDynamic<double>\".\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
164164
+ cl.def_static("Identity", []() -> mat_t { return mat_t::Identity(); }, "Returns the NxN identity matrix");
165165
+ cl.def_static("Zero", []() -> mat_t { return mat_t::Zero(); }, "Returns a matrix with zeroes");
166166
+ 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<pybind11::list>().size(); m->setSize(nR,nC); for (size_t r=0;r<nR;r++) { const auto row = vals[r].cast<pybind11::list>(); for (size_t c=0;c<nC;c++) m->coeffRef(r,c) = row[c].cast<dat_t>(); } return m; }));
167-
+ 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<nR;r++) { auto row = pybind11::list(); l.append(row); for (size_t c=0;c<nC;c++) row.append(self.coeff(r,c)); } return l; });
167+
+ cl.def("to_list", [](const mat_t&self) -> pybind11::list { auto l = pybind11::list(); const auto nR = self.rows(), nC = self.cols(); for (int r=0;r<nR;r++) { auto row = pybind11::list(); l.append(row); for (int c=0;c<nC;c++) row.append(self.coeff(r,c)); } return l; });
168168
}
169169
{ // mrpt::math::CMatrixFixed file:mrpt/math/CMatrixFixed.h line:34
170170
pybind11::class_<mrpt::math::CMatrixFixed<double,6UL,6UL>, std::shared_ptr<mrpt::math::CMatrixFixed<double,6UL,6UL>>> cl(M("mrpt::math"), "CMatrixFixed_double_6UL_6UL_t", "");
@@ -191,7 +191,7 @@ index a9ec794ef..2168c4bf9 100644
191191
+ cl.def_static("Identity", []() -> mat_t { return mat_t::Identity(); }, "Returns the NxN identity matrix");
192192
+ cl.def_static("Zero", []() -> mat_t { return mat_t::Zero(); }, "Returns a matrix with zeroes");
193193
+ 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<pybind11::list>().size(); m->setSize(nR,nC); for (size_t r=0;r<nR;r++) { const auto row = vals[r].cast<pybind11::list>(); for (size_t c=0;c<nC;c++) m->coeffRef(r,c) = row[c].cast<dat_t>(); } return m; }));
194-
+ 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<nR;r++) { auto row = pybind11::list(); l.append(row); for (size_t c=0;c<nC;c++) row.append(self.coeff(r,c)); } return l; });
194+
+ cl.def("to_list", [](const mat_t&self) -> pybind11::list { auto l = pybind11::list(); const auto nR = self.rows(), nC = self.cols(); for (int r=0;r<nR;r++) { auto row = pybind11::list(); l.append(row); for (int c=0;c<nC;c++) row.append(self.coeff(r,c)); } return l; });
195195
}
196196
{ // mrpt::math::CMatrixFixed file:mrpt/math/CMatrixFixed.h line:34
197197
pybind11::class_<mrpt::math::CMatrixFixed<double,7UL,7UL>, std::shared_ptr<mrpt::math::CMatrixFixed<double,7UL,7UL>>> cl(M("mrpt::math"), "CMatrixFixed_double_7UL_7UL_t", "");
@@ -231,7 +231,7 @@ index a9ec794ef..2168c4bf9 100644
231231
+ cl.def("size", [](const mat_t&self) -> pybind11::tuple { return pybind11::make_tuple(self.cols(),self.rows()); });
232232
+ cl.def_static("Zero", []() -> mat_t { return mat_t::Zero(); }, "Returns a matrix with zeroes");
233233
+ 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<pybind11::list>().size(); m->setSize(nR,nC); for (size_t r=0;r<nR;r++) { const auto row = vals[r].cast<pybind11::list>(); for (size_t c=0;c<nC;c++) m->coeffRef(r,c) = row[c].cast<dat_t>(); } return m; }));
234-
+ 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<nR;r++) { auto row = pybind11::list(); l.append(row); for (size_t c=0;c<nC;c++) row.append(self.coeff(r,c)); } return l; });
234+
+ cl.def("to_list", [](const mat_t&self) -> pybind11::list { auto l = pybind11::list(); const auto nR = self.rows(), nC = self.cols(); for (int r=0;r<nR;r++) { auto row = pybind11::list(); l.append(row); for (int c=0;c<nC;c++) row.append(self.coeff(r,c)); } return l; });
235235
}
236236
}
237237
diff --git a/python/src/mrpt/math/CMatrixFixed_1.cpp b/python/src/mrpt/math/CMatrixFixed_1.cpp
@@ -330,7 +330,7 @@ index 4cfc7c55d..2f75fb4ea 100644
330330
+ cl.def("size", [](const mat_t&self) -> pybind11::tuple { return pybind11::make_tuple(self.cols(),self.rows()); });
331331
+ cl.def_static("Zero", []() -> mat_t { return mat_t::Zero(); }, "Returns a matrix with zeroes");
332332
+ 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<pybind11::list>().size(); m->setSize(nR,nC); for (size_t r=0;r<nR;r++) { const auto row = vals[r].cast<pybind11::list>(); for (size_t c=0;c<nC;c++) m->coeffRef(r,c) = row[c].cast<dat_t>(); } return m; }));
333-
+ 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<nR;r++) { auto row = pybind11::list(); l.append(row); for (size_t c=0;c<nC;c++) row.append(self.coeff(r,c)); } return l; });
333+
+ cl.def("to_list", [](const mat_t&self) -> pybind11::list { auto l = pybind11::list(); const auto nR = self.rows(), nC = self.cols(); for (int r=0;r<nR;r++) { auto row = pybind11::list(); l.append(row); for (int c=0;c<nC;c++) row.append(self.coeff(r,c)); } return l; });
334334
}
335335
{ // mrpt::math::CMatrixFixed file:mrpt/math/CMatrixFixed.h line:34
336336
pybind11::class_<mrpt::math::CMatrixFixed<double,4UL,3UL>, std::shared_ptr<mrpt::math::CMatrixFixed<double,4UL,3UL>>> cl(M("mrpt::math"), "CMatrixFixed_double_4UL_3UL_t", "");
@@ -370,7 +370,7 @@ index 4cfc7c55d..2f75fb4ea 100644
370370
+ cl.def_static("Identity", []() -> mat_t { return mat_t::Identity(); }, "Returns the NxN identity matrix");
371371
+ cl.def_static("Zero", []() -> mat_t { return mat_t::Zero(); }, "Returns a matrix with zeroes");
372372
+ 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<pybind11::list>().size(); m->setSize(nR,nC); for (size_t r=0;r<nR;r++) { const auto row = vals[r].cast<pybind11::list>(); for (size_t c=0;c<nC;c++) m->coeffRef(r,c) = row[c].cast<dat_t>(); } return m; }));
373-
+ 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<nR;r++) { auto row = pybind11::list(); l.append(row); for (size_t c=0;c<nC;c++) row.append(self.coeff(r,c)); } return l; });
373+
+ cl.def("to_list", [](const mat_t&self) -> pybind11::list { auto l = pybind11::list(); const auto nR = self.rows(), nC = self.cols(); for (int r=0;r<nR;r++) { auto row = pybind11::list(); l.append(row); for (int c=0;c<nC;c++) row.append(self.coeff(r,c)); } return l; });
374374
}
375375
}
376376
diff --git a/python/src/mrpt/math/CMatrixFixed_3.cpp b/python/src/mrpt/math/CMatrixFixed_3.cpp
@@ -401,7 +401,7 @@ index 9f57fa132..0192960f3 100644
401401
+ cl.def_static("Identity", []() -> mat_t { return mat_t::Identity(); }, "Returns the NxN identity matrix");
402402
+ cl.def_static("Zero", []() -> mat_t { return mat_t::Zero(); }, "Returns a matrix with zeroes");
403403
+ 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<pybind11::list>().size(); m->setSize(nR,nC); for (size_t r=0;r<nR;r++) { const auto row = vals[r].cast<pybind11::list>(); for (size_t c=0;c<nC;c++) m->coeffRef(r,c) = row[c].cast<dat_t>(); } return m; }));
404-
+ 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<nR;r++) { auto row = pybind11::list(); l.append(row); for (size_t c=0;c<nC;c++) row.append(self.coeff(r,c)); } return l; });
404+
+ cl.def("to_list", [](const mat_t&self) -> pybind11::list { auto l = pybind11::list(); const auto nR = self.rows(), nC = self.cols(); for (int r=0;r<nR;r++) { auto row = pybind11::list(); l.append(row); for (int c=0;c<nC;c++) row.append(self.coeff(r,c)); } return l; });
405405
}
406406
{ // mrpt::math::CMatrixFixed file:mrpt/math/CMatrixFixed.h line:34
407407
pybind11::class_<mrpt::math::CMatrixFixed<float,3UL,1UL>, std::shared_ptr<mrpt::math::CMatrixFixed<float,3UL,1UL>>> cl(M("mrpt::math"), "CMatrixFixed_float_3UL_1UL_t", "");
@@ -428,7 +428,7 @@ index 9f57fa132..0192960f3 100644
428428
+ cl.def("size", [](const mat_t&self) -> pybind11::tuple { return pybind11::make_tuple(self.cols(),self.rows()); });
429429
+ cl.def_static("Zero", []() -> mat_t { return mat_t::Zero(); }, "Returns a matrix with zeroes");
430430
+ 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<pybind11::list>().size(); m->setSize(nR,nC); for (size_t r=0;r<nR;r++) { const auto row = vals[r].cast<pybind11::list>(); for (size_t c=0;c<nC;c++) m->coeffRef(r,c) = row[c].cast<dat_t>(); } return m; }));
431-
+ 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<nR;r++) { auto row = pybind11::list(); l.append(row); for (size_t c=0;c<nC;c++) row.append(self.coeff(r,c)); } return l; });
431+
+ cl.def("to_list", [](const mat_t&self) -> pybind11::list { auto l = pybind11::list(); const auto nR = self.rows(), nC = self.cols(); for (int r=0;r<nR;r++) { auto row = pybind11::list(); l.append(row); for (int c=0;c<nC;c++) row.append(self.coeff(r,c)); } return l; });
432432
}
433433
{ // mrpt::math::CMatrixFixed file:mrpt/math/CMatrixFixed.h line:34
434434
pybind11::class_<mrpt::math::CMatrixFixed<double,12UL,1UL>, std::shared_ptr<mrpt::math::CMatrixFixed<double,12UL,1UL>>> cl(M("mrpt::math"), "CMatrixFixed_double_12UL_1UL_t", "");
@@ -468,7 +468,7 @@ index 9f57fa132..0192960f3 100644
468468
+ cl.def("size", [](const mat_t&self) -> pybind11::tuple { return pybind11::make_tuple(self.cols(),self.rows()); });
469469
+ cl.def_static("Zero", []() -> mat_t { return mat_t::Zero(); }, "Returns a matrix with zeroes");
470470
+ 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<pybind11::list>().size(); m->setSize(nR,nC); for (size_t r=0;r<nR;r++) { const auto row = vals[r].cast<pybind11::list>(); for (size_t c=0;c<nC;c++) m->coeffRef(r,c) = row[c].cast<dat_t>(); } return m; }));
471-
+ 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<nR;r++) { auto row = pybind11::list(); l.append(row); for (size_t c=0;c<nC;c++) row.append(self.coeff(r,c)); } return l; });
471+
+ cl.def("to_list", [](const mat_t&self) -> pybind11::list { auto l = pybind11::list(); const auto nR = self.rows(), nC = self.cols(); for (int r=0;r<nR;r++) { auto row = pybind11::list(); l.append(row); for (int c=0;c<nC;c++) row.append(self.coeff(r,c)); } return l; });
472472
}
473473
}
474474
diff --git a/python/src/mrpt/math/CVectorDynamic.cpp b/python/src/mrpt/math/CVectorDynamic.cpp

python/src/mrpt/math/CMatrixDynamic.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ void bind_mrpt_math_CMatrixDynamic(std::function< pybind11::module &(std::string
5959
cl.def_static("Identity", [](const size_t N) -> mat_t { return mat_t::Identity(N); }, "Returns the NxN identity matrix");
6060
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");
6161
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<pybind11::list>().size(); m->setSize(nR,nC); for (size_t r=0;r<nR;r++) { const auto row = vals[r].cast<pybind11::list>(); for (size_t c=0;c<nC;c++) m->coeffRef(r,c) = row[c].cast<dat_t>(); } return m; }));
62-
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<nR;r++) { auto row = pybind11::list(); l.append(row); for (size_t c=0;c<nC;c++) row.append(self.coeff(r,c)); } return l; });
62+
cl.def("to_list", [](const mat_t&self) -> pybind11::list { auto l = pybind11::list(); const auto nR = self.rows(), nC = self.cols(); for (int r=0;r<nR;r++) { auto row = pybind11::list(); l.append(row); for (int c=0;c<nC;c++) row.append(self.coeff(r,c)); } return l; });
6363
}
6464
{ // mrpt::math::CMatrixDynamic file:mrpt/math/CMatrixDynamic.h line:41
6565
pybind11::class_<mrpt::math::CMatrixDynamic<unsigned char>, std::shared_ptr<mrpt::math::CMatrixDynamic<unsigned char>>> cl(M("mrpt::math"), "CMatrixDynamic_unsigned_char_t", "");

python/src/mrpt/math/CMatrixDynamic_1.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,6 @@ void bind_mrpt_math_CMatrixDynamic_1(std::function< pybind11::module &(std::stri
114114
cl.def_static("Identity", []() -> mat_t { return mat_t::Identity(); }, "Returns the NxN identity matrix");
115115
cl.def_static("Zero", []() -> mat_t { return mat_t::Zero(); }, "Returns a matrix with zeroes");
116116
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<pybind11::list>().size(); m->setSize(nR,nC); for (size_t r=0;r<nR;r++) { const auto row = vals[r].cast<pybind11::list>(); for (size_t c=0;c<nC;c++) m->coeffRef(r,c) = row[c].cast<dat_t>(); } return m; }));
117-
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<nR;r++) { auto row = pybind11::list(); l.append(row); for (size_t c=0;c<nC;c++) row.append(self.coeff(r,c)); } return l; });
117+
cl.def("to_list", [](const mat_t&self) -> pybind11::list { auto l = pybind11::list(); const auto nR = self.rows(), nC = self.cols(); for (int r=0;r<nR;r++) { auto row = pybind11::list(); l.append(row); for (int c=0;c<nC;c++) row.append(self.coeff(r,c)); } return l; });
118118
}
119119
}

0 commit comments

Comments
 (0)