From 258fb054f6d5a12a875ebde2acb10aa1c21798cf Mon Sep 17 00:00:00 2001 From: Vincent Nivoliers <vincent.nivoliers@gmail.com> Date: Tue, 17 May 2022 17:20:40 +0200 Subject: [PATCH] fixed permutation in initial leftmost --- Code/hull_permutation.cpp | 2 +- Code/precision.cpp | 20 +++++++++----------- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/Code/hull_permutation.cpp b/Code/hull_permutation.cpp index 83b0fe5..6f0a284 100644 --- a/Code/hull_permutation.cpp +++ b/Code/hull_permutation.cpp @@ -103,7 +103,7 @@ size_t leftmost(const std::vector<vec>& points) { size_t min = 0 ; //iterato on all the points for(size_t i = 1; i < points.size(); ++i) { - if(points[i].x < points[min].x) { + if(points[i].lexicoinf(points[min])) { //update the leftmost min = i ; } diff --git a/Code/precision.cpp b/Code/precision.cpp index 22732da..0a4f4c6 100644 --- a/Code/precision.cpp +++ b/Code/precision.cpp @@ -17,18 +17,16 @@ using MatRX = Eigen::Matrix<rational, Eigen::Dynamic, Eigen::Dynamic> ; using VecRX = Eigen::Matrix<rational, Eigen::Dynamic, 1> ; //fix problems when using intervals in Eigen -namespace Eigen { - namespace internal { - template<typename X, typename S, typename P> - struct is_convertible<X,boost::numeric::interval<S,P> > { - enum { value = is_convertible<X,S>::value }; - }; +namespace std { + template<typename X, typename S, typename P> + struct is_convertible<X,boost::numeric::interval<S,P> > { + enum { value = is_convertible<X,S>::value }; + }; - template<typename S, typename P1, typename P2> - struct is_convertible<boost::numeric::interval<S,P1>,boost::numeric::interval<S,P2> > { - enum { value = true }; - }; - } + template<typename S, typename P1, typename P2> + struct is_convertible<boost::numeric::interval<S,P1>,boost::numeric::interval<S,P2> > { + enum { value = true }; + }; } //{{{ command line -- GitLab