From b1836a362fee6df6e7fd7383e6a3aa0aad5f6ad5 Mon Sep 17 00:00:00 2001 From: Samuel Hornus Date: Mon, 9 May 2011 20:20:22 +0000 Subject: [PATCH] fix bug: matrix should not be modified but was --- Kernel_d/include/CGAL/Filtered_kernel_d.h | 12 ++--- .../CGAL/Kernel_d/Cartesian_converter_d.h | 6 +-- .../CGAL/Kernel_d/Interval_linear_algebra.h | 4 ++ .../CGAL/Kernel_d/Linear_algebraCd_impl.h | 5 +- Kernel_d/include/CGAL/Kernel_d/PointCd.h | 4 +- .../CGAL/Kernel_d/function_objectsCd.h | 3 +- .../CGAL/Kernel_d/interface_macros_d.h | 48 +++++++++---------- Kernel_d/include/CGAL/Linear_algebraCd.h | 2 +- 8 files changed, 46 insertions(+), 38 deletions(-) diff --git a/Kernel_d/include/CGAL/Filtered_kernel_d.h b/Kernel_d/include/CGAL/Filtered_kernel_d.h index 8a8ff858b7d..9bf561a2c30 100644 --- a/Kernel_d/include/CGAL/Filtered_kernel_d.h +++ b/Kernel_d/include/CGAL/Filtered_kernel_d.h @@ -26,21 +26,21 @@ struct Filtered_kernel_d : public Cartesian_d // the corresponding exact kernel //typedef Linear_algebraCd< Exact_nt, boost::pool_allocator > Exact_linalg; typedef Linear_algebraCd< Exact_nt > Exact_linalg; - typedef Cartesian_d EK; + typedef Cartesian_d Exact_kernel; // the kernel used for filtered predicates typedef Interval_nt IA; //typedef Linear_algebraCd > Interval_linalg; - typedef Linear_algebraCd Interval_linalg; - typedef Cartesian_d FK; + typedef Linear_algebraCd Interval_linalg; + typedef Cartesian_d Approximate_kernel; // the converter - typedef Cartesian_converter_d C2E; - typedef Cartesian_converter_d C2F; + typedef Cartesian_converter_d C2E; + typedef Cartesian_converter_d C2F; // we change the predicates. #define CGAL_Kernel_pred(P, Pf) \ - typedef Filtered_predicate P; \ + typedef Filtered_predicate P; \ P Pf() const { return P(); } // we don't touch the constructions. diff --git a/Kernel_d/include/CGAL/Kernel_d/Cartesian_converter_d.h b/Kernel_d/include/CGAL/Kernel_d/Cartesian_converter_d.h index 5db508e73e2..7be84cf7637 100644 --- a/Kernel_d/include/CGAL/Kernel_d/Cartesian_converter_d.h +++ b/Kernel_d/include/CGAL/Kernel_d/Cartesian_converter_d.h @@ -44,18 +44,18 @@ namespace CGAL { // Guess which compiler needs this work around ? -namespace CGALi { +namespace internal { template < typename K1, typename K2 > struct Default_converter_d { typedef typename K1::FT FT1; typedef typename K2::FT FT2; typedef ::CGAL::NT_converter Type; }; -} // namespace CGALi +} // namespace internal template < class K1, class K2, //class Converter = NT_converter > - class Converter = typename CGALi::Default_converter_d::Type > + class Converter = typename internal::Default_converter_d::Type > class Cartesian_converter_d : public Enum_converter { typedef Enum_converter Base; diff --git a/Kernel_d/include/CGAL/Kernel_d/Interval_linear_algebra.h b/Kernel_d/include/CGAL/Kernel_d/Interval_linear_algebra.h index a680a5c502e..ce01da61c83 100644 --- a/Kernel_d/include/CGAL/Kernel_d/Interval_linear_algebra.h +++ b/Kernel_d/include/CGAL/Kernel_d/Interval_linear_algebra.h @@ -12,6 +12,10 @@ namespace internal template Sign // The matrix is row major: M[i] represents row i. +/* +FIXME : the function DOES MODIFY the matrix M, but calling functions +assume M is not modified --> BUGS. (e.g. Side_of_oriented_subsphere) +*/ sign_of_determinantDxD_with_interval_arithmetic(Matrix & M) // attempts to compute the determinant using interval arithmetic { diff --git a/Kernel_d/include/CGAL/Kernel_d/Linear_algebraCd_impl.h b/Kernel_d/include/CGAL/Kernel_d/Linear_algebraCd_impl.h index 7a4237de8fd..95f4ba8a342 100644 --- a/Kernel_d/include/CGAL/Kernel_d/Linear_algebraCd_impl.h +++ b/Kernel_d/include/CGAL/Kernel_d/Linear_algebraCd_impl.h @@ -135,7 +135,10 @@ Triangular_system_solver(const Matrix &U, const Matrix& L, const Vector &b, CGAL_KD_TRACEN("Triangular_system_solver");CGAL_KD_TRACEV(U);CGAL_KD_TRACEV(b); D = FT(1); int i; for (i = rank; i < U.row_dimension(); ++i) - if ( b[i] != FT(0) ) { x = L.row(i); return false; } + if ( b[i] != FT(0) ) { + x = L.row(i); + return false; + } x = Vector(U.column_dimension()); for (i = rank-1; i>=0; --i) { diff --git a/Kernel_d/include/CGAL/Kernel_d/PointCd.h b/Kernel_d/include/CGAL/Kernel_d/PointCd.h index 52bfd682ac7..433f14fab93 100644 --- a/Kernel_d/include/CGAL/Kernel_d/PointCd.h +++ b/Kernel_d/include/CGAL/Kernel_d/PointCd.h @@ -74,14 +74,14 @@ PointCd(int d, InputIterator first, InputIterator last) // else first specifies common denominator: CGAL_assertion_msg(FT(*first)!=FT(0), "PointCd::constructor: denominator must be nonzero."); - for (int i=0; i PointCd (int d, InputIterator first, InputIterator last, const FT& D) : Base( Tuple(d,first,last) ) { CGAL_assertion_msg(D!=FT(0),"PointCd::constructor: D must be nonzero."); - for (int i=0; i -#include +//#include #endif // CGAL_LINEAR_ALGEBRACD_H