From a4500627cafd21a45b1d15bcb37352746482d33a Mon Sep 17 00:00:00 2001 From: lebarsfa Date: Sun, 15 Oct 2023 01:36:55 +0200 Subject: [PATCH] Corrections in union and inter for MATLAB compatibility --- python/src/core/domains/tube/codac_py_Tube.cpp | 12 ++++++------ python/src/core/domains/tube/codac_py_TubeVector.cpp | 8 ++++---- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/python/src/core/domains/tube/codac_py_Tube.cpp b/python/src/core/domains/tube/codac_py_Tube.cpp index 8892ebd9..a77f3a8d 100644 --- a/python/src/core/domains/tube/codac_py_Tube.cpp +++ b/python/src/core/domains/tube/codac_py_Tube.cpp @@ -531,13 +531,13 @@ void export_Tube(py::module& m) .def("__ror__", [](const Tube& y, double x) { return x|y; }) // For MATLAB compatibility. - .def("union", [](const Tube& y, double x) { return x|y; }) + .def("union", [](double x, const Tube& y) { return x|y; }) .def("__ror__", [](const Tube& y, const Interval& x) { return x|y; }) // For MATLAB compatibility. - .def("union", [](const Tube& y, const Interval& x) { return x|y; }) + .def("union", [](const Interval& x, const Tube& y) { return x|y; }) .def("__ror__", [](const Tube& y, const Trajectory& x) { return x|y; }) // For MATLAB compatibility. - .def("union", [](const Tube& y, const Trajectory& x) { return x|y; }) + .def("union", [](const Trajectory& x, const Tube& y) { return x|y; }) .def("__and__", [](const Tube& x, const Tube& y) { return x&y; }) // For MATLAB compatibility. @@ -554,12 +554,12 @@ void export_Tube(py::module& m) .def("__rand__", [](const Tube& y, double x) { return x&y; }) // For MATLAB compatibility. - .def("inter", [](const Tube& y, double x) { return x&y; }) + .def("inter", [](double x, const Tube& y) { return x&y; }) .def("__rand__", [](const Tube& y, const Interval& x) { return x&y; }) // For MATLAB compatibility. - .def("inter", [](const Tube& y, const Interval& x) { return x&y; }) + .def("inter", [](const Interval& x, const Tube& y) { return x&y; }) .def("__rand__", [](const Tube& y, const Trajectory& x) { return x&y; }) // For MATLAB compatibility. - .def("inter", [](const Tube& y, const Trajectory& x) { return x&y; }) + .def("inter", [](const Trajectory& x, const Tube& y) { return x&y; }) ; } \ No newline at end of file diff --git a/python/src/core/domains/tube/codac_py_TubeVector.cpp b/python/src/core/domains/tube/codac_py_TubeVector.cpp index 720237e8..06078f9a 100644 --- a/python/src/core/domains/tube/codac_py_TubeVector.cpp +++ b/python/src/core/domains/tube/codac_py_TubeVector.cpp @@ -603,10 +603,10 @@ void export_TubeVector(py::module& m) .def("__ror__", [](const TubeVector& y, const IntervalVector& x) { return x|y; }) // For MATLAB compatibility. - .def("union", [](const TubeVector& y, const IntervalVector& x) { return x|y; }) + .def("union", [](const IntervalVector& x, const TubeVector& y) { return x|y; }) .def("__ror__", [](const TubeVector& y, const TrajectoryVector& x) { return x|y; }) // For MATLAB compatibility. - .def("union", [](const TubeVector& y, const TrajectoryVector& x) { return x|y; }) + .def("union", [](const TrajectoryVector& x, const TubeVector& y) { return x|y; }) .def("__and__", [](const TubeVector& x, const TubeVector& y) { return x&y; }) // For MATLAB compatibility. @@ -620,9 +620,9 @@ void export_TubeVector(py::module& m) .def("__rand__", [](const TubeVector& y, const IntervalVector& x) { return x&y; }) // For MATLAB compatibility. - .def("inter", [](const TubeVector& y, const IntervalVector& x) { return x&y; }) + .def("inter", [](const IntervalVector& x, const TubeVector& y) { return x&y; }) .def("__rand__", [](const TubeVector& y, const TrajectoryVector& x) { return x&y; }) // For MATLAB compatibility. - .def("inter", [](const TubeVector& y, const TrajectoryVector& x) { return x&y; }) + .def("inter", [](const TrajectoryVector& x, const TubeVector& y) { return x&y; }) ; } \ No newline at end of file