diff --git a/NewKernel_d/include/CGAL/NewKernel_d/LA_eigen/LA.h b/NewKernel_d/include/CGAL/NewKernel_d/LA_eigen/LA.h index f46e81a4c32..ddbdc37b8ae 100644 --- a/NewKernel_d/include/CGAL/NewKernel_d/LA_eigen/LA.h +++ b/NewKernel_d/include/CGAL/NewKernel_d/LA_eigen/LA.h @@ -135,7 +135,12 @@ template struct LA_eigen { // m*a==b template - static bool solve(DV&a, DM const&m, V const& b){ + static void solve(DV&a, DM const&m, V const& b){ + //a = m.colPivHouseholderQr().solve(b); + a = m.fullPivLu().solve(b); + } + template + static bool solve_and_check(DV&a, DM const&m, V const& b){ //a = m.colPivHouseholderQr().solve(b); a = m.fullPivLu().solve(b); return b.isApprox(m*a); diff --git a/NewKernel_d/include/CGAL/NewKernel_d/function_objects_cartesian.h b/NewKernel_d/include/CGAL/NewKernel_d/function_objects_cartesian.h index e3acecc915b..aa073d8af29 100644 --- a/NewKernel_d/include/CGAL/NewKernel_d/function_objects_cartesian.h +++ b/NewKernel_d/include/CGAL/NewKernel_d/function_objects_cartesian.h @@ -425,7 +425,11 @@ template struct Contained_in_simplex : private Store_kernel { } m(d,i)=1; } - if (!LA::solve(a,CGAL_MOVE(m),CGAL_MOVE(b))) return false; + // If the simplex has full dimension, there must be a solution, only the signs need to be checked. + if (n == d+1) + LA::solve(a,CGAL_MOVE(m),CGAL_MOVE(b)); + else if (!LA::solve_and_check(a,CGAL_MOVE(m),CGAL_MOVE(b))) + return false; for(int i=0;i struct Construct_circumcenter : Store_kernel { typedef typename LAd::Vector Vec; typename Get_functor::type sp(this->kernel()); int k=static_cast(std::distance(f,e)); - int d=pd(p0); Matrix m(k,k); Vec b(k); Vec l(k); diff --git a/Stream_support/include/CGAL/IO/io.h b/Stream_support/include/CGAL/IO/io.h index 26e2ac5e00c..9f7be26865b 100644 --- a/Stream_support/include/CGAL/IO/io.h +++ b/Stream_support/include/CGAL/IO/io.h @@ -35,6 +35,7 @@ #include #include #include +#include namespace CGAL {