extra run of the script to remove tabs and trailing whitespaces

This commit is contained in:
Sébastien Loriot 2020-03-26 19:26:10 +01:00
parent 38789af55d
commit fdb17cb3f1
10 changed files with 798 additions and 798 deletions

View File

@ -6,7 +6,7 @@
// $URL$ // $URL$
// $Id$ // $Id$
// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial // SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial
// //
// //
// Author(s) : Michael Kerber <mkerber@mpi-inf.mpg.de> // Author(s) : Michael Kerber <mkerber@mpi-inf.mpg.de>
// //
@ -17,7 +17,7 @@
namespace CGAL { namespace CGAL {
#include <CGAL/disable_warnings.h> #include <CGAL/disable_warnings.h>
#include <CGAL/basic.h> #include <CGAL/basic.h>
#include <CGAL/Arithmetic_kernel.h> #include <CGAL/Arithmetic_kernel.h>
@ -52,14 +52,14 @@ private:
Algebraic_kernel_d_1* _m_kernel; Algebraic_kernel_d_1* _m_kernel;
Algebraic_real_1 _m_alpha; Algebraic_real_1 _m_alpha;
}; };
template < typename AlgebraicKernel_1 > template < typename AlgebraicKernel_1 >
class Bitstream_coefficient_kernel_at_alpha class Bitstream_coefficient_kernel_at_alpha
: public CGAL::Handle_with_policy : public CGAL::Handle_with_policy
< CGAL::internal::Bitstream_coefficient_kernel_at_alpha_rep < CGAL::internal::Bitstream_coefficient_kernel_at_alpha_rep
<AlgebraicKernel_1 > <AlgebraicKernel_1 >
> >
{ {
@ -71,19 +71,19 @@ public:
typedef AlgebraicKernel_1 Algebraic_kernel_d_1; typedef AlgebraicKernel_1 Algebraic_kernel_d_1;
typedef typename Algebraic_kernel_d_1::Algebraic_real_1 Algebraic_real_1; typedef typename Algebraic_kernel_d_1::Algebraic_real_1 Algebraic_real_1;
typedef typename Algebraic_kernel_d_1::Polynomial_1 Polynomial_1; typedef typename Algebraic_kernel_d_1::Polynomial_1 Polynomial_1;
typedef Polynomial_1 Coefficient; typedef Polynomial_1 Coefficient;
typedef typename typedef typename
CGAL::Get_arithmetic_kernel<typename Coefficient::NT>::Arithmetic_kernel CGAL::Get_arithmetic_kernel<typename Coefficient::NT>::Arithmetic_kernel
Arithmetic_kernel; Arithmetic_kernel;
typedef typename Arithmetic_kernel::Integer Integer; typedef typename Arithmetic_kernel::Integer Integer;
typedef typename Algebraic_kernel_d_1::Bound Bound; typedef typename Algebraic_kernel_d_1::Bound Bound;
typedef typename Arithmetic_kernel::Bigfloat_interval Bigfloat_interval; typedef typename Arithmetic_kernel::Bigfloat_interval Bigfloat_interval;
typedef CGAL::internal::Bitstream_coefficient_kernel_at_alpha_rep typedef CGAL::internal::Bitstream_coefficient_kernel_at_alpha_rep
@ -99,13 +99,13 @@ public:
Bitstream_coefficient_kernel_at_alpha() : Base(Rep()) {} Bitstream_coefficient_kernel_at_alpha() : Base(Rep()) {}
#ifdef DOXYGEN_RUNNING #ifdef DOXYGEN_RUNNING
Bitstream_coefficient_kernel_at_alpha(const Self& traits) Bitstream_coefficient_kernel_at_alpha(const Self& traits)
: Base(static_cast<const Base&>(traits)) {} : Base(static_cast<const Base&>(traits)) {}
#endif #endif
Bitstream_coefficient_kernel_at_alpha(Algebraic_kernel_d_1* kernel, Bitstream_coefficient_kernel_at_alpha(Algebraic_kernel_d_1* kernel,
Algebraic_real_1 alpha) Algebraic_real_1 alpha)
: Base(kernel,alpha) {} : Base(kernel,alpha) {}
//@} //@}
@ -114,8 +114,8 @@ public:
//! @{ //! @{
struct Is_zero : public CGAL::cpp98::unary_function<Coefficient,bool> { struct Is_zero : public CGAL::cpp98::unary_function<Coefficient,bool> {
Is_zero(Algebraic_kernel_d_1* kernel,Algebraic_real_1 alpha) Is_zero(Algebraic_kernel_d_1* kernel,Algebraic_real_1 alpha)
: _m_kernel(kernel),_m_alpha(alpha) {} : _m_kernel(kernel),_m_alpha(alpha) {}
bool operator() (Coefficient f) const { bool operator() (Coefficient f) const {
@ -132,51 +132,51 @@ public:
return Is_zero(this->ptr()->_m_kernel,this->ptr()->_m_alpha); return Is_zero(this->ptr()->_m_kernel,this->ptr()->_m_alpha);
} }
struct Convert_to_bfi struct Convert_to_bfi
: public CGAL::cpp98::unary_function<Coefficient,Bigfloat_interval> { : public CGAL::cpp98::unary_function<Coefficient,Bigfloat_interval> {
Convert_to_bfi(Algebraic_kernel_d_1* kernel, Convert_to_bfi(Algebraic_kernel_d_1* kernel,
Algebraic_real_1 alpha) Algebraic_real_1 alpha)
: _m_kernel(kernel), _m_alpha(alpha) {} : _m_kernel(kernel), _m_alpha(alpha) {}
Bigfloat_interval operator() (Coefficient f) const { Bigfloat_interval operator() (Coefficient f) const {
typename CGAL::Polynomial_traits_d<Coefficient> typename CGAL::Polynomial_traits_d<Coefficient>
::template Rebind<Bigfloat_interval,1>::Other::Type f_bfi; ::template Rebind<Bigfloat_interval,1>::Other::Type f_bfi;
typename Algebraic_kernel_d_1::Approximate_relative_1 approx_alpha
=_m_kernel->approximate_relative_1_object();
typedef typename Algebraic_kernel_d_1::Bound Bound; typename Algebraic_kernel_d_1::Approximate_relative_1 approx_alpha
=_m_kernel->approximate_relative_1_object();
Bigfloat_interval alpha_bfi, f_alpha_bfi;
typedef typename Algebraic_kernel_d_1::Bound Bound;
Bigfloat_interval alpha_bfi, f_alpha_bfi;
long p = CGAL::get_precision(Bigfloat_interval()); long p = CGAL::get_precision(Bigfloat_interval());
long prec = 16; long prec = 16;
long wbit = 0; long wbit = 0;
while(true) { while(true) {
CGAL::set_precision(Bigfloat_interval(),prec); CGAL::set_precision(Bigfloat_interval(),prec);
f_bfi = this->_convert_polynomial_to_bfi(f); f_bfi = this->_convert_polynomial_to_bfi(f);
std::pair<Bound,Bound> alpha_bounds std::pair<Bound,Bound> alpha_bounds
= approx_alpha(_m_alpha,prec); = approx_alpha(_m_alpha,prec);
alpha_bfi = CGAL::hull alpha_bfi = CGAL::hull
(CGAL::convert_to_bfi(alpha_bounds.first), (CGAL::convert_to_bfi(alpha_bounds.first),
CGAL::convert_to_bfi(alpha_bounds.second)); CGAL::convert_to_bfi(alpha_bounds.second));
f_alpha_bfi = f_bfi.evaluate(alpha_bfi); f_alpha_bfi = f_bfi.evaluate(alpha_bfi);
if(!CGAL::singleton(f_alpha_bfi)) { if(!CGAL::singleton(f_alpha_bfi)) {
long ceil = CGAL::internal::ceil_log2_abs(f_alpha_bfi); long ceil = CGAL::internal::ceil_log2_abs(f_alpha_bfi);
long signi = CGAL::get_significant_bits(f_alpha_bfi); long signi = CGAL::get_significant_bits(f_alpha_bfi);
wbit = ceil - signi + p; wbit = ceil - signi + p;
} }
if(wbit<-5 || CGAL::singleton(f_alpha_bfi)) { if(wbit<-5 || CGAL::singleton(f_alpha_bfi)) {
break; break;
} else { } else {
@ -186,9 +186,9 @@ public:
CGAL::set_precision(Bigfloat_interval(),p); CGAL::set_precision(Bigfloat_interval(),p);
return f_alpha_bfi; return f_alpha_bfi;
} }
private: private:
typename CGAL::Polynomial_traits_d<Coefficient> typename CGAL::Polynomial_traits_d<Coefficient>
::template Rebind<Bigfloat_interval,1>::Other::Type ::template Rebind<Bigfloat_interval,1>::Other::Type
_convert_polynomial_to_bfi(Coefficient f) const { _convert_polynomial_to_bfi(Coefficient f) const {
@ -201,11 +201,11 @@ public:
} }
return typename CGAL::Polynomial_traits_d<Coefficient> return typename CGAL::Polynomial_traits_d<Coefficient>
::template Rebind<Bigfloat_interval,1>::Other ::template Rebind<Bigfloat_interval,1>::Other
::Construct_polynomial()(coeffs.begin(),coeffs.end()); ::Construct_polynomial()(coeffs.begin(),coeffs.end());
} }
Algebraic_kernel_d_1* _m_kernel; Algebraic_kernel_d_1* _m_kernel;
Algebraic_real_1 _m_alpha; Algebraic_real_1 _m_alpha;
}; };

View File

@ -1,16 +1,16 @@
// Copyright (c) 2000,2001 // Copyright (c) 2000,2001
// Utrecht University (The Netherlands), // Utrecht University (The Netherlands),
// ETH Zurich (Switzerland), // ETH Zurich (Switzerland),
// INRIA Sophia-Antipolis (France), // INRIA Sophia-Antipolis (France),
// Max-Planck-Institute Saarbruecken (Germany), // Max-Planck-Institute Saarbruecken (Germany),
// and Tel-Aviv University (Israel). All rights reserved. // and Tel-Aviv University (Israel). All rights reserved.
// //
// This file is part of CGAL (www.cgal.org) // This file is part of CGAL (www.cgal.org)
// //
// $URL$ // $URL$
// $Id$ // $Id$
// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial // SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial
// //
// //
// Author(s) : Bernd Gaertner, Sven Schoenherr <sven@inf.ethz.ch> // Author(s) : Bernd Gaertner, Sven Schoenherr <sven@inf.ethz.ch>
@ -48,8 +48,8 @@ class ConicCPA2
Conic_type type; Conic_type type;
CGAL::Orientation o; CGAL::Orientation o;
bool empty, trivial, degenerate; bool empty, trivial, degenerate;
void void
set_linear_combination (const FT& a1, const ConicCPA2<PT,DA>& c1, set_linear_combination (const FT& a1, const ConicCPA2<PT,DA>& c1,
const FT& a2, const ConicCPA2<PT,DA>& c2) const FT& a2, const ConicCPA2<PT,DA>& c2)
@ -61,7 +61,7 @@ class ConicCPA2
_v = a1 * c1.v() + a2 * c2.v(); _v = a1 * c1.v() + a2 * c2.v();
_w = a1 * c1.w() + a2 * c2.w(); _w = a1 * c1.w() + a2 * c2.w();
} }
static void set_two_linepairs (const PT& p1, static void set_two_linepairs (const PT& p1,
const PT& p2, const PT& p2,
const PT& p3, const PT& p3,
@ -75,7 +75,7 @@ class ConicCPA2
da.get (p2, x2, y2); da.get (p2, x2, y2);
da.get (p3, x3, y3); da.get (p3, x3, y3);
da.get (p4, x4, y4); da.get (p4, x4, y4);
CGAL::Orientation side1_24 = (CGAL::Orientation)(CGAL_NTS sign CGAL::Orientation side1_24 = (CGAL::Orientation)(CGAL_NTS sign
(-x1*y4+x2*y4 (-x1*y4+x2*y4
+x4*y1-x2*y1 +x4*y1-x2*y1
@ -104,7 +104,7 @@ class ConicCPA2
} }
} }
} }
void set_ellipse (const ConicCPA2<PT,DA>& pair1, void set_ellipse (const ConicCPA2<PT,DA>& pair1,
const ConicCPA2<PT,DA>& pair2) const ConicCPA2<PT,DA>& pair2)
{ {
@ -113,14 +113,14 @@ class ConicCPA2
set_linear_combination (pair2.det()-b, pair1, set_linear_combination (pair2.det()-b, pair1,
pair1.det()-b, pair2); pair1.det()-b, pair2);
} }
void set (const ConicCPA2<PT,DA>& c1, void set (const ConicCPA2<PT,DA>& c1,
const ConicCPA2<PT,DA>& c2, const ConicCPA2<PT,DA>& c2,
const PT& p) const PT& p)
{ {
set_linear_combination (c2.evaluate(p), c1, -c1.evaluate(p), c2); set_linear_combination (c2.evaluate(p), c1, -c1.evaluate(p), c2);
} }
CGAL::Sign vol_derivative (FT dr, FT ds, FT dt, CGAL::Sign vol_derivative (FT dr, FT ds, FT dt,
FT du, FT dv, FT dw) const FT du, FT dv, FT dw) const
{ {
@ -133,10 +133,10 @@ class ConicCPA2
b0 = (FT(4)*r()*s()-t()*t())*w() b0 = (FT(4)*r()*s()-t()*t())*w()
-u()*u()*s()-v()*v()*r()+u()*v()*t(), -u()*u()*s()-v()*v()*r()+u()*v()*t(),
c0 = -FT(2)*a0*b1 + FT(3)*a1*b0; c0 = -FT(2)*a0*b1 + FT(3)*a1*b0;
return CGAL_NTS sign ((int)-CGAL_NTS sign (c0)*o); return CGAL_NTS sign ((int)-CGAL_NTS sign (c0)*o);
} }
double vol_minimum (FT dr, FT ds, FT dt, FT du, FT dv, FT dw) const double vol_minimum (FT dr, FT ds, FT dt, FT du, FT dv, FT dw) const
{ {
FT a2 = FT(4)*dr*ds-dt*dt, FT a2 = FT(4)*dr*ds-dt*dt,
@ -156,7 +156,7 @@ class ConicCPA2
c2 = -FT(6)*a0*b3 - a1*b2 + FT(4)*a2*b1, c2 = -FT(6)*a0*b3 - a1*b2 + FT(4)*a2*b1,
c1 = -FT(4)*a0*b2 + a1*b1 + FT(6)*a2*b0, c1 = -FT(4)*a0*b2 + a1*b1 + FT(6)*a2*b0,
c0 = -FT(2)*a0*b1 + FT(3)*a1*b0; c0 = -FT(2)*a0*b1 + FT(3)*a1*b0;
double roots[3]; double roots[3];
int nr_roots = solve_cubic int nr_roots = solve_cubic
(CGAL::to_double(c3), CGAL::to_double(c2), (CGAL::to_double(c3), CGAL::to_double(c2),
@ -169,15 +169,15 @@ class ConicCPA2
CGAL::to_double(b2), CGAL::to_double(b1), CGAL::to_double(b2), CGAL::to_double(b1),
CGAL::to_double(b0)); CGAL::to_double(b0));
} }
protected: protected:
FT det () const FT det () const
{ {
return FT(4)*s()*r() - t()*t(); return FT(4)*s()*r() - t()*t();
} }
void analyse( ) void analyse( )
{ {
FT d = det(); FT d = det();
@ -189,8 +189,8 @@ class ConicCPA2
FT z_prime = d*w() - u()*u()*s() - v()*v()*r() + u()*v()*t(); FT z_prime = d*w() - u()*u()*s() - v()*v()*r() + u()*v()*t();
o = (CGAL::Orientation)(CGAL_NTS sign (z_prime)); o = (CGAL::Orientation)(CGAL_NTS sign (z_prime));
degenerate = (o == CGAL::ZERO); degenerate = (o == CGAL::ZERO);
} }
break; break;
case PARABOLA: case PARABOLA:
@ -256,8 +256,8 @@ class ConicCPA2
else else
o = CGAL::ZERO; o = CGAL::ZERO;
} }
} }
break; break;
case ELLIPSE: case ELLIPSE:
@ -272,43 +272,43 @@ class ConicCPA2
empty ? o = CGAL::NEGATIVE : o = CGAL::POSITIVE; empty ? o = CGAL::NEGATIVE : o = CGAL::POSITIVE;
} }
degenerate = empty || CGAL_NTS is_zero (z_prime); degenerate = empty || CGAL_NTS is_zero (z_prime);
} }
break; break;
} }
} }
FT evaluate (const PT& p) const FT evaluate (const PT& p) const
{ {
FT x, y; FT x, y;
dao.get (p, x, y); dao.get (p, x, y);
return r()*x*x + s()*y*y + t()*x*y + u()*x + v()*y + w(); return r()*x*x + s()*y*y + t()*x*y + u()*x + v()*y + w();
} }
public: public:
ConicCPA2 ( const DA& da = DA()) : dao( da) { } ConicCPA2 ( const DA& da = DA()) : dao( da) { }
ConicCPA2 (FT r, FT s, FT t, FT u, FT v, FT w, const DA& da = DA()) ConicCPA2 (FT r, FT s, FT t, FT u, FT v, FT w, const DA& da = DA())
: dao( da), _r(r), _s(s), _t(t), _u(u), _v(v), _w(w) : dao( da), _r(r), _s(s), _t(t), _u(u), _v(v), _w(w)
{ {
analyse(); analyse();
} }
const DA& da() const const DA& da() const
{ {
return dao; return dao;
} }
FT r() const { return _r;} FT r() const { return _r;}
FT s() const { return _s;} FT s() const { return _s;}
FT t() const { return _t;} FT t() const { return _t;}
FT u() const { return _u;} FT u() const { return _u;}
FT v() const { return _v;} FT v() const { return _v;}
FT w() const { return _w;} FT w() const { return _w;}
PT center () const PT center () const
{ {
CGAL_kernel_precondition (type != PARABOLA); CGAL_kernel_precondition (type != PARABOLA);
@ -319,22 +319,22 @@ class ConicCPA2
return PT((two*s()*u() - t()*v()) / div, return PT((two*s()*u() - t()*v()) / div,
(two*r()*v() - t()*u()) / div); (two*r()*v() - t()*u()) / div);
} }
Conic_type conic_type () const Conic_type conic_type () const
{ {
return type; return type;
} }
bool is_hyperbola () const bool is_hyperbola () const
{ {
return (type == HYPERBOLA); return (type == HYPERBOLA);
} }
bool is_parabola () const bool is_parabola () const
{ {
return (type == PARABOLA); return (type == PARABOLA);
} }
bool is_ellipse () const bool is_ellipse () const
{ {
return (type == ELLIPSE); return (type == ELLIPSE);
@ -344,53 +344,53 @@ class ConicCPA2
{ {
return (type == ELLIPSE && (r()==s()) && CGAL_NTS is_zero (t())); return (type == ELLIPSE && (r()==s()) && CGAL_NTS is_zero (t()));
} }
bool is_empty () const bool is_empty () const
{ {
return empty; return empty;
} }
bool is_trivial () const bool is_trivial () const
{ {
return trivial; return trivial;
} }
bool is_degenerate () const bool is_degenerate () const
{ {
return degenerate; return degenerate;
} }
CGAL::Orientation orientation () const CGAL::Orientation orientation () const
{ {
return o; return o;
} }
CGAL::Oriented_side oriented_side (const PT& p) const CGAL::Oriented_side oriented_side (const PT& p) const
{ {
return (CGAL::Oriented_side)(CGAL_NTS sign (evaluate (p))); return (CGAL::Oriented_side)(CGAL_NTS sign (evaluate (p)));
} }
bool has_on_positive_side (const PT& p) const bool has_on_positive_side (const PT& p) const
{ {
return (CGAL_NTS is_positive (evaluate(p))); return (CGAL_NTS is_positive (evaluate(p)));
} }
bool has_on_negative_side (const PT& p) const bool has_on_negative_side (const PT& p) const
{ {
return (CGAL_NTS is_negative (evaluate(p))); return (CGAL_NTS is_negative (evaluate(p)));
} }
bool has_on_boundary (const PT& p) const bool has_on_boundary (const PT& p) const
{ {
return (CGAL_NTS is_zero (evaluate(p))); return (CGAL_NTS is_zero (evaluate(p)));
} }
bool has_on (const PT& p) const bool has_on (const PT& p) const
{ {
return (CGAL_NTS is_zero (evaluate(p))); return (CGAL_NTS is_zero (evaluate(p)));
} }
Convex_side convex_side (const PT& p) const Convex_side convex_side (const PT& p) const
{ {
switch (o) { switch (o) {
@ -404,17 +404,17 @@ class ConicCPA2
// keeps g++ happy // keeps g++ happy
return( Convex_side( 0)); return( Convex_side( 0));
} }
bool has_on_convex_side (const PT& p) const bool has_on_convex_side (const PT& p) const
{ {
return (convex_side (p) == ON_CONVEX_SIDE); return (convex_side (p) == ON_CONVEX_SIDE);
} }
bool has_on_nonconvex_side (const PT& p) const bool has_on_nonconvex_side (const PT& p) const
{ {
return (convex_side (p) == ON_NONCONVEX_SIDE); return (convex_side (p) == ON_NONCONVEX_SIDE);
} }
bool operator == ( const ConicCPA2<_PT,_DA>& c) const bool operator == ( const ConicCPA2<_PT,_DA>& c) const
{ {
// find coefficient != 0 // find coefficient != 0
@ -426,7 +426,7 @@ class ConicCPA2
if ( ! CGAL_NTS is_zero( v())) factor1 = v(); else if ( ! CGAL_NTS is_zero( v())) factor1 = v(); else
if ( ! CGAL_NTS is_zero( w())) factor1 = w(); else if ( ! CGAL_NTS is_zero( w())) factor1 = w(); else
CGAL_kernel_assertion_msg( false, "all coefficients zero"); CGAL_kernel_assertion_msg( false, "all coefficients zero");
// find coefficient != 0 // find coefficient != 0
FT factor2(0); FT factor2(0);
if ( ! CGAL_NTS is_zero( c.r())) factor2 = c.r(); else if ( ! CGAL_NTS is_zero( c.r())) factor2 = c.r(); else
@ -436,7 +436,7 @@ class ConicCPA2
if ( ! CGAL_NTS is_zero( c.v())) factor2 = c.v(); else if ( ! CGAL_NTS is_zero( c.v())) factor2 = c.v(); else
if ( ! CGAL_NTS is_zero( c.w())) factor2 = c.w(); else if ( ! CGAL_NTS is_zero( c.w())) factor2 = c.w(); else
CGAL_kernel_assertion_msg( false, "all coefficients zero"); CGAL_kernel_assertion_msg( false, "all coefficients zero");
return( ( r()*factor2 == c.r()*factor1) return( ( r()*factor2 == c.r()*factor1)
&& ( s()*factor2 == c.s()*factor1) && ( s()*factor2 == c.s()*factor1)
&& ( t()*factor2 == c.t()*factor1) && ( t()*factor2 == c.t()*factor1)
@ -444,27 +444,27 @@ class ConicCPA2
&& ( v()*factor2 == c.v()*factor1) && ( v()*factor2 == c.v()*factor1)
&& ( w()*factor2 == c.w()*factor1)); && ( w()*factor2 == c.w()*factor1));
} }
void set (FT r_, FT s_, FT t_, FT u_, FT v_, FT w_) void set (FT r_, FT s_, FT t_, FT u_, FT v_, FT w_)
{ {
_r = r_; _s = s_; _t = t_; _u = u_; _v = v_; _w = w_; _r = r_; _s = s_; _t = t_; _u = u_; _v = v_; _w = w_;
analyse(); analyse();
} }
void set_opposite () void set_opposite ()
{ {
_r = -r(); _s = -s(); _t = -t(); _u = -u(); _v = -v(); _w = -w(); _r = -r(); _s = -s(); _t = -t(); _u = -u(); _v = -v(); _w = -w();
o = CGAL::opposite(orientation()); o = CGAL::opposite(orientation());
} }
void set_circle (const PT& p1, const PT& p2, const PT& p3) void set_circle (const PT& p1, const PT& p2, const PT& p3)
{ {
// the circle will have r = s = det, t=0 // the circle will have r = s = det, t=0
FT x1, y1, x2, y2, x3, y3; FT x1, y1, x2, y2, x3, y3;
dao.get (p1, x1, y1); dao.get (p1, x1, y1);
dao.get (p2, x2, y2); dao.get (p2, x2, y2);
dao.get (p3, x3, y3); dao.get (p3, x3, y3);
// precondition: p1, p2, p3 not collinear // precondition: p1, p2, p3 not collinear
FT det = -x3*y2+x1*y2+x2*y3-x1*y3+x3*y1-x2*y1; FT det = -x3*y2+x1*y2+x2*y3-x1*y3+x3*y1-x2*y1;
CGAL_kernel_precondition (!CGAL_NTS is_zero (det)); CGAL_kernel_precondition (!CGAL_NTS is_zero (det));
@ -480,7 +480,7 @@ class ConicCPA2
_r = det; _r = det;
_s = det; _s = det;
_t = FT(0); _t = FT(0);
analyse(); analyse();
CGAL_kernel_postcondition(is_circle()); CGAL_kernel_postcondition(is_circle());
CGAL_kernel_postcondition(has_on_boundary(p1)); CGAL_kernel_postcondition(has_on_boundary(p1));
@ -495,76 +495,76 @@ class ConicCPA2
dao.get (p2, x2, y2); dao.get (p2, x2, y2);
dao.get (p3, x3, y3); dao.get (p3, x3, y3);
dao.get (p4, x4, y4); dao.get (p4, x4, y4);
// precondition: p1 != p2, p3 != p4 // precondition: p1 != p2, p3 != p4
CGAL_kernel_precondition CGAL_kernel_precondition
( ((x1 != x2) || (y1 != y2)) && ( ((x1 != x2) || (y1 != y2)) &&
((x3 != x4) || (y3 != y4)) ); ((x3 != x4) || (y3 != y4)) );
FT x2_x1 = x2-x1; FT x2_x1 = x2-x1;
FT x4_x3 = x4-x3; FT x4_x3 = x4-x3;
FT y1_y2 = y1-y2; FT y1_y2 = y1-y2;
FT y3_y4 = y3-y4; FT y3_y4 = y3-y4;
FT x1y2_y1x2 = x1*y2-y1*x2; FT x1y2_y1x2 = x1*y2-y1*x2;
FT x3y4_y3x4 = x3*y4-y3*x4; FT x3y4_y3x4 = x3*y4-y3*x4;
_r = y1_y2 * y3_y4; _r = y1_y2 * y3_y4;
_s = x2_x1 * x4_x3; _s = x2_x1 * x4_x3;
_t = x2_x1 * y3_y4 + y1_y2 * x4_x3; _t = x2_x1 * y3_y4 + y1_y2 * x4_x3;
_u = x1y2_y1x2 * y3_y4 + y1_y2 * x3y4_y3x4; _u = x1y2_y1x2 * y3_y4 + y1_y2 * x3y4_y3x4;
_v = x1y2_y1x2 * x4_x3 + x2_x1 * x3y4_y3x4; _v = x1y2_y1x2 * x4_x3 + x2_x1 * x3y4_y3x4;
_w = x1y2_y1x2 * x3y4_y3x4; _w = x1y2_y1x2 * x3y4_y3x4;
analyse(); analyse();
} }
void set_ellipse (const PT& p1, const PT& p2, const PT& p3) void set_ellipse (const PT& p1, const PT& p2, const PT& p3)
{ {
FT x1, y1, x2, y2, x3, y3; FT x1, y1, x2, y2, x3, y3;
dao.get (p1, x1, y1); dao.get (p1, x1, y1);
dao.get (p2, x2, y2); dao.get (p2, x2, y2);
dao.get (p3, x3, y3); dao.get (p3, x3, y3);
// precondition: p1, p2, p3 not collinear // precondition: p1, p2, p3 not collinear
FT det = -x3*y2+x1*y2+x2*y3-x1*y3+x3*y1-x2*y1; FT det = -x3*y2+x1*y2+x2*y3-x1*y3+x3*y1-x2*y1;
CGAL_kernel_precondition (!CGAL_NTS is_zero (det)); CGAL_kernel_precondition (!CGAL_NTS is_zero (det));
FT x1x1 = x1*x1, y1y1 = y1*y1, FT x1x1 = x1*x1, y1y1 = y1*y1,
x2x2 = x2*x2, y2y2 = y2*y2, x2x2 = x2*x2, y2y2 = y2*y2,
x3x3 = x3*x3, y3y3 = y3*y3, // x_i^2, y_i^2 x3x3 = x3*x3, y3y3 = y3*y3, // x_i^2, y_i^2
two = FT(2); two = FT(2);
_r = y1y1 - y1*y2 - y1*y3 + _r = y1y1 - y1*y2 - y1*y3 +
y2y2 - y2*y3 + y3y3; y2y2 - y2*y3 + y3y3;
_s = x1x1 - x1*x2 - x1*x3 + _s = x1x1 - x1*x2 - x1*x3 +
x2x2 - x2*x3 + x3x3; x2x2 - x2*x3 + x3x3;
_t = -two*x1*y1 + x1*y2 + x1*y3 + _t = -two*x1*y1 + x1*y2 + x1*y3 +
y1*x2 -two*x2*y2 + x2*y3 + y1*x2 -two*x2*y2 + x2*y3 +
y1*x3 + y2*x3 -two*x3*y3; y1*x3 + y2*x3 -two*x3*y3;
_u = -(y2y2*x3 - x2*y2*y3 - y2*x3*y3 + _u = -(y2y2*x3 - x2*y2*y3 - y2*x3*y3 +
x1*y3y3 + x2*y3y3 + y1y1*x2 + x1*y3y3 + x2*y3y3 + y1y1*x2 +
y1y1*x3 - x1*y1*y2 - y1*x2*y2 - y1y1*x3 - x1*y1*y2 - y1*x2*y2 -
x1*y1*y3 - y1*x3*y3 + x1*y2y2); x1*y1*y3 - y1*x3*y3 + x1*y2y2);
_v = -(x2x2*y3 - x2*y2*x3 - x2*x3*y3 + _v = -(x2x2*y3 - x2*y2*x3 - x2*x3*y3 +
y1*x3x3 + y2*x3x3 + x1x1*y2 + y1*x3x3 + y2*x3x3 + x1x1*y2 +
x1x1*y3 - x1*y1*x2 - x1*x2*y2 - x1x1*y3 - x1*y1*x2 - x1*x2*y2 -
x1*y1*x3 - x1*x3*y3 + y1*x2x2); x1*y1*x3 - x1*x3*y3 + y1*x2x2);
_w = y1y1*x2*x3 - x1*y1*y2*x3 - y1*x2*y2*x3 + _w = y1y1*x2*x3 - x1*y1*y2*x3 - y1*x2*y2*x3 +
y1*y2*x3x3 - x1*y1*x2*y3 + y1*x2x2*y3 - y1*y2*x3x3 - x1*y1*x2*y3 + y1*x2x2*y3 -
y1*x2*x3*y3 + x1*y2y2*x3 + x1x1*y2*y3 - y1*x2*x3*y3 + x1*y2y2*x3 + x1x1*y2*y3 -
x1*x2*y2*y3 - x1*y2*x3*y3 + x1*x2*y3y3; x1*x2*y2*y3 - x1*y2*x3*y3 + x1*x2*y3y3;
type = ELLIPSE; type = ELLIPSE;
degenerate = trivial = empty = false; degenerate = trivial = empty = false;
o = CGAL::NEGATIVE; o = CGAL::NEGATIVE;
if (CGAL_NTS is_positive (det)) set_opposite(); if (CGAL_NTS is_positive (det)) set_opposite();
} }
void set_ellipse (const PT& p1, const PT& p2, void set_ellipse (const PT& p1, const PT& p2,
const PT& p3, const PT& p4, const PT& p3, const PT& p4,
CGAL::Orientation _o = POSITIVE) CGAL::Orientation _o = POSITIVE)
@ -575,7 +575,7 @@ class ConicCPA2
analyse(); analyse();
if (o != _o) set_opposite(); if (o != _o) set_opposite();
} }
void set (const PT& p1, const PT& p2, const PT& p3, const PT& p4, void set (const PT& p1, const PT& p2, const PT& p3, const PT& p4,
const PT& p5, CGAL::Orientation _o = POSITIVE) const PT& p5, CGAL::Orientation _o = POSITIVE)
{ {
@ -588,8 +588,8 @@ class ConicCPA2
CGAL_kernel_precondition (!is_trivial()); CGAL_kernel_precondition (!is_trivial());
if (o != _o) set_opposite(); if (o != _o) set_opposite();
} }
}; };

View File

@ -1,16 +1,16 @@
// Copyright (c) 2000 // Copyright (c) 2000
// Utrecht University (The Netherlands), // Utrecht University (The Netherlands),
// ETH Zurich (Switzerland), // ETH Zurich (Switzerland),
// INRIA Sophia-Antipolis (France), // INRIA Sophia-Antipolis (France),
// Max-Planck-Institute Saarbruecken (Germany), // Max-Planck-Institute Saarbruecken (Germany),
// and Tel-Aviv University (Israel). All rights reserved. // and Tel-Aviv University (Israel). All rights reserved.
// //
// This file is part of CGAL (www.cgal.org) // This file is part of CGAL (www.cgal.org)
// //
// $URL$ // $URL$
// $Id$ // $Id$
// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial // SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial
// //
// //
// Author(s) : Sven Schoenherr, Herve Bronnimann, Sylvain Pion // Author(s) : Sven Schoenherr, Herve Bronnimann, Sylvain Pion
@ -178,10 +178,10 @@ inline
void void
line_from_pointsC2(const FT &px, const FT &py, line_from_pointsC2(const FT &px, const FT &py,
const FT &qx, const FT &qy, const FT &qx, const FT &qy,
FT &a, FT &b, FT &c) FT &a, FT &b, FT &c)
{ {
// The horizontal and vertical line get a special treatment // The horizontal and vertical line get a special treatment
// in order to make the intersection code robust for doubles // in order to make the intersection code robust for doubles
if(py == qy){ if(py == qy){
a = 0 ; a = 0 ;
if(qx > px){ if(qx > px){
@ -218,7 +218,7 @@ inline
void void
line_from_point_directionC2(const FT &px, const FT &py, line_from_point_directionC2(const FT &px, const FT &py,
const FT &dx, const FT &dy, const FT &dx, const FT &dy,
FT &a, FT &b, FT &c) FT &a, FT &b, FT &c)
{ {
a = - dy; a = - dy;
b = dx; b = dx;
@ -229,8 +229,8 @@ template < class FT >
CGAL_KERNEL_INLINE CGAL_KERNEL_INLINE
void void
bisector_of_pointsC2(const FT &px, const FT &py, bisector_of_pointsC2(const FT &px, const FT &py,
const FT &qx, const FT &qy, const FT &qx, const FT &qy,
FT &a, FT &b, FT& c ) FT &a, FT &b, FT& c )
{ {
a = 2 * (px - qx); a = 2 * (px - qx);
b = 2 * (py - qy); b = 2 * (py - qy);
@ -242,8 +242,8 @@ template < class FT >
CGAL_KERNEL_INLINE CGAL_KERNEL_INLINE
void void
bisector_of_linesC2(const FT &pa, const FT &pb, const FT &pc, bisector_of_linesC2(const FT &pa, const FT &pb, const FT &pc,
const FT &qa, const FT &qb, const FT &qc, const FT &qa, const FT &qb, const FT &qc,
FT &a, FT &b, FT &c) FT &a, FT &b, FT &c)
{ {
// We normalize the equations of the 2 lines, and we then add them. // We normalize the equations of the 2 lines, and we then add them.
FT n1 = CGAL_NTS sqrt(CGAL_NTS square(pa) + CGAL_NTS square(pb)); FT n1 = CGAL_NTS sqrt(CGAL_NTS square(pa) + CGAL_NTS square(pb));
@ -268,7 +268,7 @@ line_y_at_xC2(const FT &a, const FT &b, const FT &c, const FT &x)
return (-a*x-c) / b; return (-a*x-c) / b;
} }
template < class FT > template < class FT >
inline inline
void void
line_get_pointC2(const FT &a, const FT &b, const FT &c, const FT &i, line_get_pointC2(const FT &a, const FT &b, const FT &c, const FT &i,
@ -292,12 +292,12 @@ line_get_pointC2(const FT &a, const FT &b, const FT &c, const FT &i,
} }
} }
template < class FT > template < class FT >
inline inline
void void
perpendicular_through_pointC2(const FT &la, const FT &lb, perpendicular_through_pointC2(const FT &la, const FT &lb,
const FT &px, const FT &py, const FT &px, const FT &py,
FT &a, FT &b, FT &c) FT &a, FT &b, FT &c)
{ {
a = -lb; a = -lb;
b = la; b = la;
@ -308,8 +308,8 @@ template < class FT >
CGAL_KERNEL_MEDIUM_INLINE CGAL_KERNEL_MEDIUM_INLINE
void void
line_project_pointC2(const FT &la, const FT &lb, const FT &lc, line_project_pointC2(const FT &la, const FT &lb, const FT &lc,
const FT &px, const FT &py, const FT &px, const FT &py,
FT &x, FT &y) FT &x, FT &y)
{ {
if (certainly(is_zero(la))) // horizontal line if (certainly(is_zero(la))) // horizontal line
{ {

View File

@ -24,7 +24,7 @@ typedef double RT;
int main() int main()
{ {
CGAL_KD_SETDTHREAD(11); CGAL_KD_SETDTHREAD(11);
CGAL::set_pretty_mode ( std::cerr ); CGAL::set_pretty_mode ( std::cerr );
CGAL_TEST_START; CGAL_TEST_START;
{ {
@ -36,7 +36,7 @@ int main()
typedef Convex_hull_d::Facet_handle Facet_handle; typedef Convex_hull_d::Facet_handle Facet_handle;
typedef Convex_hull_d::Vertex_handle Vertex_handle; typedef Convex_hull_d::Vertex_handle Vertex_handle;
Convex_hull_d T1(2); Convex_hull_d T1(2);
const Convex_hull_d* pT1 = &T1; const Convex_hull_d* pT1 = &T1;
Point p1(0,0,1); Point p1(0,0,1);
Point p2(1,0,1); Point p2(1,0,1);
@ -73,7 +73,7 @@ int main()
CGAL_TEST(h.has_on(pf0)&&h.has_on(pf1)); CGAL_TEST(h.has_on(pf0)&&h.has_on(pf1));
std::list<Facet_handle> G = T1.facets_visible_from(p4); std::list<Facet_handle> G = T1.facets_visible_from(p4);
CGAL_TEST(G.size()==1); CGAL_TEST(G.size()==1);
CGAL_TEST(T1.bounded_side(p4)==CGAL::ON_UNBOUNDED_SIDE && CGAL_TEST(T1.bounded_side(p4)==CGAL::ON_UNBOUNDED_SIDE &&
T1.bounded_side(Point(1,1,10))==CGAL::ON_BOUNDED_SIDE); T1.bounded_side(Point(1,1,10))==CGAL::ON_BOUNDED_SIDE);
Convex_hull_d::Point_const_iterator pit; Convex_hull_d::Point_const_iterator pit;
@ -103,17 +103,17 @@ int main()
#ifndef _MSC_VER // truncation due to name length exceeded #ifndef _MSC_VER // truncation due to name length exceeded
Convex_hull_d::Hull_vertex_iterator hvit; Convex_hull_d::Hull_vertex_iterator hvit;
int vnum(0); int vnum(0);
for (hvit = T1.hull_vertices_begin(); for (hvit = T1.hull_vertices_begin();
hvit != T1.hull_vertices_end(); ++vnum, ++hvit) *hvit; hvit != T1.hull_vertices_end(); ++vnum, ++hvit) *hvit;
CGAL_TEST(vnum==4); CGAL_TEST(vnum==4);
Convex_hull_d::Facet_const_iterator fcit; Convex_hull_d::Facet_const_iterator fcit;
for (fcit = pT1->facets_begin(); fcit != pT1->facets_end(); ++fcit) *fcit; for (fcit = pT1->facets_begin(); fcit != pT1->facets_end(); ++fcit) *fcit;
Convex_hull_d::Hull_vertex_const_iterator hvcit; Convex_hull_d::Hull_vertex_const_iterator hvcit;
for (hvcit = pT1->hull_vertices_begin(); for (hvcit = pT1->hull_vertices_begin();
hvcit != pT1->hull_vertices_end(); ++hvcit) *hvcit; hvcit != pT1->hull_vertices_end(); ++hvcit) *hvcit;
Convex_hull_d::Hull_point_const_iterator hpcit; Convex_hull_d::Hull_point_const_iterator hpcit;
for (hpcit = pT1->hull_points_begin(); for (hpcit = pT1->hull_points_begin();
hpcit != pT1->hull_points_end(); ++hpcit) *hpcit; hpcit != pT1->hull_points_end(); ++hpcit) *hpcit;
#endif #endif
} }
@ -128,7 +128,7 @@ int main()
typedef Convex_hull_d::Simplex_handle Simplex_handle; typedef Convex_hull_d::Simplex_handle Simplex_handle;
typedef Convex_hull_d::Facet_handle Facet_handle; typedef Convex_hull_d::Facet_handle Facet_handle;
typedef Convex_hull_d::Vertex_handle Vertex_handle; typedef Convex_hull_d::Vertex_handle Vertex_handle;
Convex_hull_d T2(3); Convex_hull_d T2(3);
Point p1(0,0,0,1); Point p1(0,0,0,1);
Point p2(1,0,0,1); Point p2(1,0,0,1);
Point p3(0,1,0,1); Point p3(0,1,0,1);
@ -173,7 +173,7 @@ int main()
std::list<Facet_handle> G = T2.facets_visible_from(p5); std::list<Facet_handle> G = T2.facets_visible_from(p5);
CGAL_TEST(G.size()==1); CGAL_TEST(G.size()==1);
CGAL_TEST(T2.bounded_side(p5)==CGAL::ON_UNBOUNDED_SIDE && CGAL_TEST(T2.bounded_side(p5)==CGAL::ON_UNBOUNDED_SIDE &&
T2.bounded_side(Point(1,1,1,10))==CGAL::ON_BOUNDED_SIDE); T2.bounded_side(Point(1,1,1,10))==CGAL::ON_BOUNDED_SIDE);
T2.is_valid(); T2.is_valid();
T2.clear(3); T2.clear(3);
@ -191,7 +191,7 @@ int main()
typedef Convex_hull_d::Simplex_handle Simplex_handle; typedef Convex_hull_d::Simplex_handle Simplex_handle;
typedef Convex_hull_d::Facet_handle Facet_handle; typedef Convex_hull_d::Facet_handle Facet_handle;
typedef Convex_hull_d::Vertex_handle Vertex_handle; typedef Convex_hull_d::Vertex_handle Vertex_handle;
Convex_hull_d T2(3); Convex_hull_d T2(3);
Point p1(0,0,0,1); Point p1(0,0,0,1);
Point p2(1,0,0,1); Point p2(1,0,0,1);
Point p3(0,1,0,1); Point p3(0,1,0,1);
@ -236,7 +236,7 @@ int main()
std::list<Facet_handle> G = T2.facets_visible_from(p5); std::list<Facet_handle> G = T2.facets_visible_from(p5);
CGAL_TEST(G.size()==1); CGAL_TEST(G.size()==1);
CGAL_TEST(T2.bounded_side(p5)==CGAL::ON_UNBOUNDED_SIDE && CGAL_TEST(T2.bounded_side(p5)==CGAL::ON_UNBOUNDED_SIDE &&
T2.bounded_side(Point(1,1,1,10))==CGAL::ON_BOUNDED_SIDE); T2.bounded_side(Point(1,1,1,10))==CGAL::ON_BOUNDED_SIDE);
T2.is_valid(); T2.is_valid();
T2.clear(3); T2.clear(3);
@ -251,7 +251,7 @@ int main()
typedef Convex_hull_d::Simplex_handle Simplex_handle; typedef Convex_hull_d::Simplex_handle Simplex_handle;
typedef Convex_hull_d::Facet_handle Facet_handle; typedef Convex_hull_d::Facet_handle Facet_handle;
typedef Convex_hull_d::Vertex_handle Vertex_handle; typedef Convex_hull_d::Vertex_handle Vertex_handle;
Convex_hull_d T2(3); Convex_hull_d T2(3);
Point p1(0,0,0,1); Point p1(0,0,0,1);
Point p2(1,0,0,1); Point p2(1,0,0,1);
Point p3(0,1,0,1); Point p3(0,1,0,1);
@ -296,7 +296,7 @@ int main()
std::list<Facet_handle> G = T2.facets_visible_from(p5); std::list<Facet_handle> G = T2.facets_visible_from(p5);
CGAL_TEST(G.size()==1); CGAL_TEST(G.size()==1);
CGAL_TEST(T2.bounded_side(p5)==CGAL::ON_UNBOUNDED_SIDE && CGAL_TEST(T2.bounded_side(p5)==CGAL::ON_UNBOUNDED_SIDE &&
T2.bounded_side(Point(1,1,1,10))==CGAL::ON_BOUNDED_SIDE); T2.bounded_side(Point(1,1,1,10))==CGAL::ON_BOUNDED_SIDE);
T2.is_valid(); T2.is_valid();
T2.clear(3); T2.clear(3);
@ -311,7 +311,7 @@ int main()
typedef Convex_hull_d::Simplex_handle Simplex_handle; typedef Convex_hull_d::Simplex_handle Simplex_handle;
typedef Convex_hull_d::Facet_handle Facet_handle; typedef Convex_hull_d::Facet_handle Facet_handle;
typedef Convex_hull_d::Vertex_handle Vertex_handle; typedef Convex_hull_d::Vertex_handle Vertex_handle;
Convex_hull_d T2(3); Convex_hull_d T2(3);
Point p1(0,0,0,1); Point p1(0,0,0,1);
Point p2(1,0,0,1); Point p2(1,0,0,1);
Point p3(0,1,0,1); Point p3(0,1,0,1);
@ -356,7 +356,7 @@ int main()
std::list<Facet_handle> G = T2.facets_visible_from(p5); std::list<Facet_handle> G = T2.facets_visible_from(p5);
CGAL_TEST(G.size()==1); CGAL_TEST(G.size()==1);
CGAL_TEST(T2.bounded_side(p5)==CGAL::ON_UNBOUNDED_SIDE && CGAL_TEST(T2.bounded_side(p5)==CGAL::ON_UNBOUNDED_SIDE &&
T2.bounded_side(Point(1,1,1,10))==CGAL::ON_BOUNDED_SIDE); T2.bounded_side(Point(1,1,1,10))==CGAL::ON_BOUNDED_SIDE);
T2.is_valid(); T2.is_valid();
T2.clear(3); T2.clear(3);

File diff suppressed because it is too large Load Diff

View File

@ -31,7 +31,7 @@ void test_lazy_exact_nt() {
CGAL::test_algebraic_structure<NT,Tag, Is_exact>(NT(-4),NT(6), NT(15)); CGAL::test_algebraic_structure<NT,Tag, Is_exact>(NT(-4),NT(6), NT(15));
CGAL::test_algebraic_structure<NT,Tag, Is_exact>(NT(4),NT(-6),NT(-15)); CGAL::test_algebraic_structure<NT,Tag, Is_exact>(NT(4),NT(-6),NT(-15));
CGAL::test_algebraic_structure<NT,Tag, Is_exact>(NT(-4),NT(-6),NT(-15)); CGAL::test_algebraic_structure<NT,Tag, Is_exact>(NT(-4),NT(-6),NT(-15));
CGAL::test_real_embeddable<NT>(); CGAL::test_real_embeddable<NT>();
}{ }{
typedef typename AK::Rational ET; typedef typename AK::Rational ET;
@ -50,13 +50,13 @@ void test_lazy_exact_nt() {
CGAL::test_algebraic_structure<NT,Tag, Is_exact>(NT(-4),NT(6), NT(15)); CGAL::test_algebraic_structure<NT,Tag, Is_exact>(NT(-4),NT(6), NT(15));
CGAL::test_algebraic_structure<NT,Tag, Is_exact>(NT(4),NT(-6),NT(-15)); CGAL::test_algebraic_structure<NT,Tag, Is_exact>(NT(4),NT(-6),NT(-15));
CGAL::test_algebraic_structure<NT,Tag, Is_exact>(NT(-4),NT(-6),NT(-15)); CGAL::test_algebraic_structure<NT,Tag, Is_exact>(NT(-4),NT(-6),NT(-15));
CGAL::test_real_embeddable<NT>(); CGAL::test_real_embeddable<NT>();
CGAL::test_fraction_traits<NT>(); CGAL::test_fraction_traits<NT>();
CGAL::test_rational_traits<NT>(); CGAL::test_rational_traits<NT>();
} }
{ {
typedef typename AK::Integer ET; typedef typename AK::Integer ET;
typedef CGAL::Algebraic_structure_traits< ET > AST; typedef CGAL::Algebraic_structure_traits< ET > AST;
@ -73,10 +73,10 @@ void test_lazy_exact_nt() {
CGAL::test_algebraic_structure<NT,Tag, Is_exact>(NT(-4),NT(6), NT(15)); CGAL::test_algebraic_structure<NT,Tag, Is_exact>(NT(-4),NT(6), NT(15));
CGAL::test_algebraic_structure<NT,Tag, Is_exact>(NT(4),NT(-6),NT(-15)); CGAL::test_algebraic_structure<NT,Tag, Is_exact>(NT(4),NT(-6),NT(-15));
CGAL::test_algebraic_structure<NT,Tag, Is_exact>(NT(-4),NT(-6),NT(-15)); CGAL::test_algebraic_structure<NT,Tag, Is_exact>(NT(-4),NT(-6),NT(-15));
CGAL::test_real_embeddable<NT>(); CGAL::test_real_embeddable<NT>();
} }
{ // see also Coercion_traits_test.C { // see also Coercion_traits_test.C
typedef CGAL::Lazy_exact_nt< typename AK::Integer > LI; typedef CGAL::Lazy_exact_nt< typename AK::Integer > LI;
typedef CGAL::Lazy_exact_nt< typename AK::Rational > LR; typedef CGAL::Lazy_exact_nt< typename AK::Rational > LR;
@ -84,7 +84,7 @@ void test_lazy_exact_nt() {
CGAL_static_assertion((boost::is_same< typename CT::Are_implicit_interoperable,CGAL::Tag_true>::value)); CGAL_static_assertion((boost::is_same< typename CT::Are_implicit_interoperable,CGAL::Tag_true>::value));
CGAL_static_assertion((boost::is_same< typename CT::Are_explicit_interoperable,CGAL::Tag_true>::value)); CGAL_static_assertion((boost::is_same< typename CT::Are_explicit_interoperable,CGAL::Tag_true>::value));
CGAL_static_assertion((boost::is_same< typename CT::Type,LR>::value)); CGAL_static_assertion((boost::is_same< typename CT::Type,LR>::value));
LI i(4); LI i(4);
LR r(4); LR r(4);
typename CT::Cast cast; typename CT::Cast cast;
@ -103,7 +103,7 @@ void test_lazy_exact_nt() {
CGAL_static_assertion((boost::is_same< typename CT::Are_explicit_interoperable,CGAL::Tag_false>::value)); CGAL_static_assertion((boost::is_same< typename CT::Are_explicit_interoperable,CGAL::Tag_false>::value));
#endif #endif
#endif #endif
} }
} }
int main() { int main() {

View File

@ -10,7 +10,7 @@
#include <CGAL/Bbox_2.h> #include <CGAL/Bbox_2.h>
#include <CGAL/assertions_behaviour.h> #include <CGAL/assertions_behaviour.h>
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h> #include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Timer.h> #include <CGAL/Timer.h>
#if BOOST_VERSION >= 105600 && (! defined(BOOST_GCC) || BOOST_GCC >= 40500) #if BOOST_VERSION >= 105600 && (! defined(BOOST_GCC) || BOOST_GCC >= 40500)
#include <CGAL/IO/WKT.h> #include <CGAL/IO/WKT.h>
#endif #endif
@ -22,7 +22,7 @@ bool lAppToLog = false ;
void Polyline_simplification_2_external_trace( std::string m ) void Polyline_simplification_2_external_trace( std::string m )
{ {
std::ofstream out("polysim_log.txt", ( lAppToLog ? std::ios::app | std::ios::ate : std::ios::trunc | std::ios::ate ) ); std::ofstream out("polysim_log.txt", ( lAppToLog ? std::ios::app | std::ios::ate : std::ios::trunc | std::ios::ate ) );
out << std::setprecision(19) << m << std::endl << std::flush ; out << std::setprecision(19) << m << std::endl << std::flush ;
lAppToLog = true ; lAppToLog = true ;
} }
@ -34,8 +34,8 @@ void error_handler ( char const* what, char const* expr, char const* file, int l
<< "Line: " << line << std::endl; << "Line: " << line << std::endl;
if ( msg != 0) if ( msg != 0)
std::cerr << "Explanation:" << msg << std::endl; std::cerr << "Explanation:" << msg << std::endl;
throw std::runtime_error("CGAL Error"); throw std::runtime_error("CGAL Error");
} }
@ -91,15 +91,15 @@ class MainWindow :
public Ui::Polyline_simplification_2 public Ui::Polyline_simplification_2
{ {
Q_OBJECT Q_OBJECT
private:
PCT m_pct; private:
PCT m_pct;
QGraphicsScene mScene; QGraphicsScene mScene;
CGAL::Qt::PolylineSimplificationGraphicsItem<PCT> * mGI; CGAL::Qt::PolylineSimplificationGraphicsItem<PCT> * mGI;
CGAL::Qt::GraphicsViewPolylineInput<K> * mPI; CGAL::Qt::GraphicsViewPolylineInput<K> * mPI;
private: private:
public: public:
@ -122,9 +122,9 @@ public Q_SLOTS:
void processInput(CGAL::Object o); void processInput(CGAL::Object o);
void on_actionShowTriangulation_toggled(bool checked); void on_actionShowTriangulation_toggled(bool checked);
void on_actionInsertPolyline_toggled(bool checked); void on_actionInsertPolyline_toggled(bool checked);
void on_actionClear_triggered(); void on_actionClear_triggered();
void on_actionRecenter_triggered(); void on_actionRecenter_triggered();
@ -136,7 +136,7 @@ public Q_SLOTS:
Mode getSimplificationMode() ; Mode getSimplificationMode() ;
double getThreshold() ; double getThreshold() ;
Q_SIGNALS: Q_SIGNALS:
void changed(); void changed();
}; };
@ -147,14 +147,14 @@ MainWindow::MainWindow()
{ {
CGAL::set_error_handler (error_handler); CGAL::set_error_handler (error_handler);
CGAL::set_warning_handler(error_handler); CGAL::set_warning_handler(error_handler);
setupUi(this); setupUi(this);
setAcceptDrops(true); setAcceptDrops(true);
// Add a GraphicItem for the PS triangulation // Add a GraphicItem for the PS triangulation
mGI = new CGAL::Qt::PolylineSimplificationGraphicsItem<PCT>(&m_pct); mGI = new CGAL::Qt::PolylineSimplificationGraphicsItem<PCT>(&m_pct);
QObject::connect(this, SIGNAL(changed()), mGI, SLOT(modelChanged())); QObject::connect(this, SIGNAL(changed()), mGI, SLOT(modelChanged()));
mGI->setVerticesPen(QPen(Qt::black, 2, Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin)); mGI->setVerticesPen(QPen(Qt::black, 2, Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin));
@ -162,18 +162,18 @@ MainWindow::MainWindow()
mGI->setZValue(-1); mGI->setZValue(-1);
mGI->setVisibleEdges(false); mGI->setVisibleEdges(false);
mGI->setVisibleConstraints(true); mGI->setVisibleConstraints(true);
mScene.addItem(mGI); mScene.addItem(mGI);
// Setup input handlers. They get events before the mScene gets them // Setup input handlers. They get events before the mScene gets them
// and the input they generate is passed to the triangulation with // and the input they generate is passed to the triangulation with
// the signal/slot mechanism // the signal/slot mechanism
mPI = new CGAL::Qt::GraphicsViewPolylineInput<K>(this, &mScene, 0, true); // inputs polylines which are not closed mPI = new CGAL::Qt::GraphicsViewPolylineInput<K>(this, &mScene, 0, true); // inputs polylines which are not closed
this->on_actionInsertPolyline_toggled(true); this->on_actionInsertPolyline_toggled(true);
QObject::connect(mPI, SIGNAL(generate(CGAL::Object)), this, SLOT(processInput(CGAL::Object))); QObject::connect(mPI, SIGNAL(generate(CGAL::Object)), this, SLOT(processInput(CGAL::Object)));
//
//
// Manual handling of actions // Manual handling of actions
// //
QObject::connect(this->actionQuit, SIGNAL(triggered()), this, SLOT(close())); QObject::connect(this->actionQuit, SIGNAL(triggered()), this, SLOT(close()));
@ -183,7 +183,7 @@ MainWindow::MainWindow()
// ag->addAction(this->actionInsertPolyline); // ag->addAction(this->actionInsertPolyline);
this->actionShowTriangulation->setChecked(false); this->actionShowTriangulation->setChecked(false);
// //
// Setup the mScene and the view // Setup the mScene and the view
// //
@ -194,7 +194,7 @@ MainWindow::MainWindow()
// Turn the vertical axis upside down // Turn the vertical axis upside down
this->graphicsView->scale(1, -1); this->graphicsView->scale(1, -1);
// The navigation adds zooming and translation functionality to the // The navigation adds zooming and translation functionality to the
// QGraphicsView // QGraphicsView
this->addNavigation(this->graphicsView); this->addNavigation(this->graphicsView);
@ -210,14 +210,14 @@ MainWindow::MainWindow()
} }
void void
MainWindow::dragEnterEvent(QDragEnterEvent *event) MainWindow::dragEnterEvent(QDragEnterEvent *event)
{ {
if (event->mimeData()->hasFormat("text/uri-list")) if (event->mimeData()->hasFormat("text/uri-list"))
event->acceptProposedAction(); event->acceptProposedAction();
} }
void void
MainWindow::dropEvent(QDropEvent *event) MainWindow::dropEvent(QDropEvent *event)
{ {
QString filename = event->mimeData()->urls().at(0).path(); QString filename = event->mimeData()->urls().at(0).path();
@ -231,7 +231,7 @@ MainWindow::processInput(CGAL::Object o)
std::list<Point_2> points; std::list<Point_2> points;
if(CGAL::assign(points, o)) if(CGAL::assign(points, o))
{ {
if(points.size() >= 2) if(points.size() >= 2)
{ {
m_pct.insert_constraint(points.begin(), points.end()); m_pct.insert_constraint(points.begin(), points.end());
#if 0 #if 0
@ -243,16 +243,16 @@ MainWindow::processInput(CGAL::Object o)
} }
#endif #endif
Q_EMIT( changed()); Q_EMIT( changed());
} }
} }
Q_EMIT( changed()); Q_EMIT( changed());
} }
/* /*
* Qt Automatic Connections * Qt Automatic Connections
* https://doc.qt.io/qt-5/designer-using-a-ui-file.html#automatic-connections * https://doc.qt.io/qt-5/designer-using-a-ui-file.html#automatic-connections
* *
* setupUi(this) generates connections to the slots named * setupUi(this) generates connections to the slots named
* "on_<action_name>_<signal_name>" * "on_<action_name>_<signal_name>"
*/ */
@ -303,12 +303,12 @@ void MainWindow::on_actionSimplify_triggered()
// wait cursor // wait cursor
QApplication::setOverrideCursor(Qt::WaitCursor); QApplication::setOverrideCursor(Qt::WaitCursor);
try try
{ {
switch( getSimplificationMode() ) switch( getSimplificationMode() )
{ {
case ABS_P : simplify(m_pct, PS2::Squared_distance_cost(), PS2::Stop_below_count_ratio_threshold(getThreshold()) ) ; case ABS_P : simplify(m_pct, PS2::Squared_distance_cost(), PS2::Stop_below_count_ratio_threshold(getThreshold()) ) ;
break ; break ;
case ABS_E : simplify(m_pct, PS2::Squared_distance_cost(), PS2::Stop_above_cost_threshold(getThreshold()) ) ; break ; case ABS_E : simplify(m_pct, PS2::Squared_distance_cost(), PS2::Stop_above_cost_threshold(getThreshold()) ) ; break ;
case REL_P : simplify(m_pct, PS2::Scaled_squared_distance_cost(), PS2::Stop_below_count_ratio_threshold(getThreshold()) ) ; break ; case REL_P : simplify(m_pct, PS2::Scaled_squared_distance_cost(), PS2::Stop_below_count_ratio_threshold(getThreshold()) ) ; break ;
@ -318,14 +318,14 @@ void MainWindow::on_actionSimplify_triggered()
break ; break ;
} }
statusBar()->showMessage(QString("Simplification done")); statusBar()->showMessage(QString("Simplification done"));
} }
catch(...) catch(...)
{ {
statusBar()->showMessage(QString("Exception ocurred")); statusBar()->showMessage(QString("Exception ocurred"));
} }
// default cursor // default cursor
QApplication::restoreOverrideCursor(); QApplication::restoreOverrideCursor();
mGI->modelChanged(); mGI->modelChanged();
@ -333,7 +333,7 @@ void MainWindow::on_actionSimplify_triggered()
} }
void void
MainWindow::open(QString fileName) MainWindow::open(QString fileName)
{ {
if(! fileName.isEmpty()){ if(! fileName.isEmpty()){
@ -371,11 +371,11 @@ std::string trim_right ( std::string str )
if ( pos != std::string::npos ) if ( pos != std::string::npos )
return str.substr(0,pos+1); return str.substr(0,pos+1);
} }
return std::string("") ; return std::string("") ;
} }
void MainWindow::loadWKT(QString void MainWindow::loadWKT(QString
#if BOOST_VERSION >= 105600 && (! defined(BOOST_GCC) || BOOST_GCC >= 40500) #if BOOST_VERSION >= 105600 && (! defined(BOOST_GCC) || BOOST_GCC >= 40500)
fileName fileName
#endif #endif
@ -383,14 +383,14 @@ void MainWindow::loadWKT(QString
{ {
#if BOOST_VERSION >= 105600 && (! defined(BOOST_GCC) || BOOST_GCC >= 40500) #if BOOST_VERSION >= 105600 && (! defined(BOOST_GCC) || BOOST_GCC >= 40500)
typedef std::vector<Point_2> MultiPoint; typedef std::vector<Point_2> MultiPoint;
typedef std::vector<Point_2> LineString; typedef std::vector<Point_2> LineString;
typedef std::deque<LineString> MultiLineString; typedef std::deque<LineString> MultiLineString;
typedef CGAL::Polygon_2<K> Polygon_2; typedef CGAL::Polygon_2<K> Polygon_2;
typedef CGAL::Polygon_with_holes_2<K> Polygon_with_holes_2; typedef CGAL::Polygon_with_holes_2<K> Polygon_with_holes_2;
typedef std::deque<Polygon_with_holes_2> MultiPolygon; typedef std::deque<Polygon_with_holes_2> MultiPolygon;
std::ifstream ifs(qPrintable(fileName)); std::ifstream ifs(qPrintable(fileName));
MultiPoint points; MultiPoint points;
MultiLineString polylines; MultiLineString polylines;
@ -415,9 +415,9 @@ void MainWindow::loadWKT(QString
m_pct.insert_constraint(hole); m_pct.insert_constraint(hole);
} }
} }
Q_EMIT( changed()); Q_EMIT( changed());
actionRecenter->trigger(); actionRecenter->trigger();
#endif #endif
} }
@ -431,20 +431,20 @@ void MainWindow::loadOSM(QString fileName)
try try
{ {
std::ifstream ifs(qPrintable(fileName)); std::ifstream ifs(qPrintable(fileName));
std::string line ; std::string line ;
std::vector<Point_2> poly ; std::vector<Point_2> poly ;
while ( std::getline(ifs,line) ) while ( std::getline(ifs,line) )
{ {
line = trim_right(line); line = trim_right(line);
if ( line.size() > 0 ) if ( line.size() > 0 )
{ {
if ( line.find(':') != std::string::npos ) if ( line.find(':') != std::string::npos )
{ {
if ( poly.size() > 0 ) if ( poly.size() > 0 )
{ {
if ( poly.front() == poly.back() && poly.size() >= 4 ) if ( poly.front() == poly.back() && poly.size() >= 4 )
{ {
@ -462,21 +462,21 @@ void MainWindow::loadOSM(QString fileName)
else else
{ {
double x,y ; double x,y ;
std::string::size_type pos = line.find(','); std::string::size_type pos = line.find(',');
if ( pos != std::string::npos ) if ( pos != std::string::npos )
line[pos]= ' ' ; line[pos]= ' ' ;
std::istringstream ss(line); std::istringstream ss(line);
ss >> x >> y ; ss >> x >> y ;
poly.push_back( Point_2(x,y) ); poly.push_back( Point_2(x,y) );
} }
} }
} }
if ( poly.size() > 0 ) if ( poly.size() > 0 )
{ {
if ( poly.front() == poly.back() ) if ( poly.front() == poly.back() )
{ {
@ -487,14 +487,14 @@ void MainWindow::loadOSM(QString fileName)
m_pct.insert_constraint(poly.begin(), poly.end() ) ; m_pct.insert_constraint(poly.begin(), poly.end() ) ;
} }
} }
} }
catch(...) catch(...)
{ {
statusBar()->showMessage(QString("Exception ocurred")); statusBar()->showMessage(QString("Exception ocurred"));
} }
Q_EMIT( changed()); Q_EMIT( changed());
actionRecenter->trigger(); actionRecenter->trigger();
} }
@ -502,7 +502,7 @@ void
MainWindow::on_actionRecenter_triggered() MainWindow::on_actionRecenter_triggered()
{ {
this->graphicsView->setSceneRect(mGI->boundingRect()); this->graphicsView->setSceneRect(mGI->boundingRect());
this->graphicsView->fitInView(mGI->boundingRect(), Qt::KeepAspectRatio); this->graphicsView->fitInView(mGI->boundingRect(), Qt::KeepAspectRatio);
} }
#include "Polyline_simplification_2.moc" #include "Polyline_simplification_2.moc"
@ -517,7 +517,7 @@ int main(int argc, char **argv)
// Import resources from libCGALQt5. // Import resources from libCGALQt5.
CGAL_QT_INIT_RESOURCES; CGAL_QT_INIT_RESOURCES;
MainWindow mainWindow; MainWindow mainWindow;
mainWindow.show(); mainWindow.show();
return app.exec(); return app.exec();

View File

@ -9,11 +9,11 @@
// //
// Author(s) : Dominik Huelse <dominik.huelse@gmx.de> // Author(s) : Dominik Huelse <dominik.huelse@gmx.de>
// Michael Hemmer <mhemmer@uni-mainz.de> // Michael Hemmer <mhemmer@uni-mainz.de>
// //
// ============================================================================ // ============================================================================
/*! \file CGAL/Polynomial/modular_gcd_utcf_algorithm_M.h /*! \file CGAL/Polynomial/modular_gcd_utcf_algorithm_M.h
provides gcd for Polynomials, based on Modular arithmetic. provides gcd for Polynomials, based on Modular arithmetic.
*/ */
@ -38,14 +38,14 @@ namespace internal{
template <class NT> Polynomial<NT> gcd_utcf_UFD(Polynomial<NT>,Polynomial<NT>); template <class NT> Polynomial<NT> gcd_utcf_UFD(Polynomial<NT>,Polynomial<NT>);
template <class NT> template <class NT>
Polynomial< Polynomial<NT> > modular_gcd_utcf_algorithm_M( Polynomial< Polynomial<NT> > modular_gcd_utcf_algorithm_M(
const Polynomial< Polynomial<NT> >& FF1 , const Polynomial< Polynomial<NT> >& FF1 ,
const Polynomial< Polynomial<NT> >& FF2 ){ const Polynomial< Polynomial<NT> >& FF2 ){
return gcd_utcf_UFD(FF1, FF2); return gcd_utcf_UFD(FF1, FF2);
} }
template <class NT> template <class NT>
Polynomial<NT> modular_gcd_utcf_algorithm_M( Polynomial<NT> modular_gcd_utcf_algorithm_M(
const Polynomial<NT>& FF1 , const Polynomial<NT>& FF1 ,
const Polynomial<NT>& FF2 ){ const Polynomial<NT>& FF2 ){
@ -64,16 +64,16 @@ Polynomial<NT> modular_gcd_utcf_algorithm_M(
typedef typename CGAL::Modular_traits<Poly>::Residue_type MPoly; typedef typename CGAL::Modular_traits<Poly>::Residue_type MPoly;
typedef typename CGAL::Modular_traits<Scalar>::Residue_type MScalar; typedef typename CGAL::Modular_traits<Scalar>::Residue_type MScalar;
typedef Chinese_remainder_traits<Poly> CRT; typedef Chinese_remainder_traits<Poly> CRT;
typename CRT::Chinese_remainder chinese_remainder; typename CRT::Chinese_remainder chinese_remainder;
CGAL::Real_timer timer; CGAL::Real_timer timer;
if(FF1.is_zero()){ if(FF1.is_zero()){
if(FF2.is_zero()){ if(FF2.is_zero()){
return Poly(1);// TODO: return 0 for CGAL return Poly(1);// TODO: return 0 for CGAL
} }
else{ else{
// std::cout<<"\nFF1 is zero"<<std::endl; // std::cout<<"\nFF1 is zero"<<std::endl;
@ -89,19 +89,19 @@ Polynomial<NT> modular_gcd_utcf_algorithm_M(
result = Poly(CGAL::gcd(FF1.content(),FF2.content())); result = Poly(CGAL::gcd(FF1.content(),FF2.content()));
return CGAL::canonicalize(result); return CGAL::canonicalize(result);
} }
Poly F1 = CGAL::canonicalize(FF1); Poly F1 = CGAL::canonicalize(FF1);
Poly F2 = CGAL::canonicalize(FF2); Poly F2 = CGAL::canonicalize(FF2);
Scalar f1 = scalar_factor(F1.lcoeff()); // ilcoeff(F1) Scalar f1 = scalar_factor(F1.lcoeff()); // ilcoeff(F1)
Scalar f2 = scalar_factor(F2.lcoeff()); // ilcoeff(F2) Scalar f2 = scalar_factor(F2.lcoeff()); // ilcoeff(F2)
Scalar g_ = scalar_factor(f1,f2); Scalar g_ = scalar_factor(f1,f2);
//std::cout <<" g_ : "<< g_ << std::endl; //std::cout <<" g_ : "<< g_ << std::endl;
bool solved = false; bool solved = false;
int prime_index = -1; int prime_index = -1;
int n = 0; // number of lucky primes int n = 0; // number of lucky primes
int degree_F1 = F1.degree(); int degree_F1 = F1.degree();
int degree_F2 = F2.degree(); int degree_F2 = F2.degree();
int degree_e = (std::min)(degree_F1,degree_F2); int degree_e = (std::min)(degree_F1,degree_F2);
@ -110,7 +110,7 @@ Polynomial<NT> modular_gcd_utcf_algorithm_M(
MPoly mF1,mF2,mG_; MPoly mF1,mF2,mG_;
typename CRT::Scalar_type p(0),q(0),pq,s,t; typename CRT::Scalar_type p(0),q(0),pq,s,t;
Poly Gs,H1s,H2s, Gs_old; // s =^ star Poly Gs,H1s,H2s, Gs_old; // s =^ star
#ifdef CGAL_MODULAR_GCD_TIMER #ifdef CGAL_MODULAR_GCD_TIMER
timer_init.stop(); timer_init.stop();
#endif #endif
@ -123,7 +123,7 @@ Polynomial<NT> modular_gcd_utcf_algorithm_M(
do{ do{
int current_prime = -1; int current_prime = -1;
prime_index++; prime_index++;
if(prime_index >= 2000){ if(prime_index >= 2000){
std::cerr<<"primes in the array exhausted"<<std::endl; std::cerr<<"primes in the array exhausted"<<std::endl;
current_prime = internal::get_next_lower_prime(current_prime); current_prime = internal::get_next_lower_prime(current_prime);
} }
@ -158,53 +158,53 @@ Polynomial<NT> modular_gcd_utcf_algorithm_M(
#ifdef CGAL_MODULAR_GCD_TIMER #ifdef CGAL_MODULAR_GCD_TIMER
timer_gcd.stop(); timer_gcd.stop();
#endif #endif
//mH1 = CGAL::integral_div(mF1,mG_); //mH1 = CGAL::integral_div(mF1,mG_);
//mH2 = CGAL::integral_div(mF2,mG_); //mH2 = CGAL::integral_div(mF2,mG_);
//--------------------------------------- //---------------------------------------
// return if G is constant // return if G is constant
if (mG_ == MPoly(1)) return Poly(1); if (mG_ == MPoly(1)) return Poly(1);
// -------------------------------------- // --------------------------------------
}// repeat until mG_ degree is less equal the known bound }// repeat until mG_ degree is less equal the known bound
// check prime // check prime
while( mG_.degree() > degree_e); while( mG_.degree() > degree_e);
if( mG_.degree() < degree_e ){
if( n != 0 ) std::cout << "UNLUCKY PRIME !!"<< std::endl;
// restart chinese remainder if( mG_.degree() < degree_e ){
if( n != 0 ) std::cout << "UNLUCKY PRIME !!"<< std::endl;
// restart chinese remainder
// ignore previous unlucky primes // ignore previous unlucky primes
n=1; n=1;
degree_e= mG_.degree(); degree_e= mG_.degree();
}else{ }else{
CGAL_postcondition( mG_.degree() == degree_e); CGAL_postcondition( mG_.degree() == degree_e);
n++; // increase number of lucky primes n++; // increase number of lucky primes
} }
// -------------------------------------- // --------------------------------------
// try chinese remainder // try chinese remainder
// std::cout <<" chinese remainder round :" << n << std::endl; // std::cout <<" chinese remainder round :" << n << std::endl;
typename CGAL::Modular_traits<Poly>::Modular_image_representative inv_map; typename CGAL::Modular_traits<Poly>::Modular_image_representative inv_map;
if(n == 1){ if(n == 1){
// init chinese remainder // init chinese remainder
q = CGAL::Residue::get_current_prime(); // implicit ! q = CGAL::Residue::get_current_prime(); // implicit !
Gs_old = Gs = inv_map(mG_); Gs_old = Gs = inv_map(mG_);
//H1s_old = H1s = inv_map(mH1); //H1s_old = H1s = inv_map(mH1);
//H2s_old = H2s = inv_map(mH2); //H2s_old = H2s = inv_map(mH2);
}else{ }else{
// continue chinese remainder // continue chinese remainder
p = CGAL::Residue::get_current_prime(); // implicit! p = CGAL::Residue::get_current_prime(); // implicit!
Gs_old = Gs ; Gs_old = Gs ;
//H1s_old = H1s ; //H1s_old = H1s ;
//H2s_old = H2s ; //H2s_old = H2s ;
#ifdef CGAL_MODULAR_GCD_TIMER #ifdef CGAL_MODULAR_GCD_TIMER
timer_CR.start(); timer_CR.start();
#endif #endif
// chinese_remainder(q,Gs ,p,inv_map(mG_),pq,Gs); // chinese_remainder(q,Gs ,p,inv_map(mG_),pq,Gs);
// cached_extended_euclidean_algorithm(q,p,s,t); // cached_extended_euclidean_algorithm(q,p,s,t);
internal::Cached_extended_euclidean_algorithm internal::Cached_extended_euclidean_algorithm
<typename CRT::Scalar_type, 1> ceea; <typename CRT::Scalar_type, 1> ceea;
@ -219,10 +219,10 @@ Polynomial<NT> modular_gcd_utcf_algorithm_M(
try{ try{
if( n != 1 && Gs == Gs_old ){ if( n != 1 && Gs == Gs_old ){
Poly r1,r2; Poly r1,r2;
#ifdef CGAL_MODULAR_GCD_TIMER #ifdef CGAL_MODULAR_GCD_TIMER
timer_division.start(); timer_division.start();
#endif #endif
typedef CGAL::Algebraic_structure_traits< Poly > ASTE_Poly; typedef CGAL::Algebraic_structure_traits< Poly > ASTE_Poly;
typename ASTE_Poly::Divides divides; typename ASTE_Poly::Divides divides;
@ -230,35 +230,35 @@ Polynomial<NT> modular_gcd_utcf_algorithm_M(
bool div1=divides(Gs,g_*F1,H1s); bool div1=divides(Gs,g_*F1,H1s);
bool div2=divides(Gs,g_*F2,H2s); bool div2=divides(Gs,g_*F2,H2s);
if (div1 && div2){ if (div1 && div2){
solved = true; solved = true;
} }
// this is the old code // this is the old code
// NT dummy; // NT dummy;
// Poly::euclidean_division(g_*F1,Gs,H1s,r1); // Poly::euclidean_division(g_*F1,Gs,H1s,r1);
// Poly::euclidean_division(g_*F2,Gs,H2s,r2); // Poly::euclidean_division(g_*F2,Gs,H2s,r2);
// if (r1.is_zero() && r2.is_zero()) // if (r1.is_zero() && r2.is_zero())
// solved = true; // solved = true;
#ifdef CGAL_MODULAR_GCD_TIMER #ifdef CGAL_MODULAR_GCD_TIMER
timer_division.stop(); timer_division.stop();
#endif #endif
// std::cout << "number of primes used : "<< n << std::endl; // std::cout << "number of primes used : "<< n << std::endl;
} // end while } // end while
}catch(...){} }catch(...){}
} }
//TODO CGAL: change this to multivariat content //TODO CGAL: change this to multivariat content
// Scalar scalar_content_f1 = scalar_factor(FF1); // Scalar scalar_content_f1 = scalar_factor(FF1);
// Scalar scalar_content_f2 = scalar_factor(FF2); // Scalar scalar_content_f2 = scalar_factor(FF2);
// Scalar scalar_content_gcd = CGAL::gcd(scalar_content_f1,scalar_content_f2); // Scalar scalar_content_gcd = CGAL::gcd(scalar_content_f1,scalar_content_f2);
// Poly result = CGAL::canonicalize(Gs)*Poly(scalar_content_gcd); // Poly result = CGAL::canonicalize(Gs)*Poly(scalar_content_gcd);
// return result; // return result;
return CGAL::canonicalize(Gs); return CGAL::canonicalize(Gs);
} }
} // namespace internal } // namespace internal

View File

@ -27,14 +27,14 @@ extern int scoreTime;
namespace CGAL { namespace CGAL {
namespace Shape_detection { namespace Shape_detection {
template<class Traits> template<class Traits>
class Efficient_RANSAC; class Efficient_RANSAC;
namespace internal { namespace internal {
const std::size_t size_t_max = (std::numeric_limits<std::size_t>::max)(); const std::size_t size_t_max = (std::numeric_limits<std::size_t>::max)();
template<class Sdt> template<class Sdt>
class DirectPointAccessor { class DirectPointAccessor {
public: public:
@ -43,7 +43,7 @@ namespace CGAL {
DirectPointAccessor() {} DirectPointAccessor() {}
DirectPointAccessor(const Input_iterator &begin, DirectPointAccessor(const Input_iterator &begin,
const Input_iterator &beyond, const Input_iterator &beyond,
std::size_t offset) : m_first(begin), m_offset(offset) { std::size_t offset) : m_first(begin), m_offset(offset) {
m_beyond = (beyond == begin) ? begin : beyond - 1; m_beyond = (beyond == begin) ? begin : beyond - 1;
} }
@ -221,9 +221,9 @@ namespace CGAL {
Point_3 transl(const Point_3& p, const Vector_3 &v) Point_3 transl(const Point_3& p, const Vector_3 &v)
{ return m_traits.construct_translated_point_3_object()(p, v); } { return m_traits.construct_translated_point_3_object()(p, v); }
public: public:
Octree(Sd_traits const& traits) Octree(Sd_traits const& traits)
: m_traits(traits), m_bucket_size(20), m_set_max_level(10), m_root(nullptr) {} : m_traits(traits), m_bucket_size(20), m_set_max_level(10), m_root(nullptr) {}
Octree(Sd_traits const& traits, Octree(Sd_traits const& traits,
const Input_iterator &first, const Input_iterator &first,
@ -231,7 +231,7 @@ namespace CGAL {
Point_map& point_pmap, Point_map& point_pmap,
Normal_map& normal_pmap, Normal_map& normal_pmap,
std::size_t offset = 0, std::size_t offset = 0,
std::size_t bucketSize = 20, std::size_t bucketSize = 20,
std::size_t maxLevel = 10) std::size_t maxLevel = 10)
: PointAccessor(first, beyond, offset), : PointAccessor(first, beyond, offset),
m_traits(traits), m_traits(traits),
@ -276,7 +276,7 @@ namespace CGAL {
{ {
FT bbox_diagonal = (FT) CGAL::sqrt( FT bbox_diagonal = (FT) CGAL::sqrt(
(m_bBox.xmax() - m_bBox.xmin()) * (m_bBox.xmax() - m_bBox.xmin()) (m_bBox.xmax() - m_bBox.xmin()) * (m_bBox.xmax() - m_bBox.xmin())
+ (m_bBox.ymax() - m_bBox.ymin()) * (m_bBox.ymax() - m_bBox.ymin()) + (m_bBox.ymax() - m_bBox.ymin()) * (m_bBox.ymax() - m_bBox.ymin())
+ (m_bBox.zmax() - m_bBox.zmin()) * (m_bBox.zmax() - m_bBox.zmin())); + (m_bBox.zmax() - m_bBox.zmin()) * (m_bBox.zmax() - m_bBox.zmin()));
m_set_max_level = std::size_t (std::log (bbox_diagonal m_set_max_level = std::size_t (std::log (bbox_diagonal
@ -294,7 +294,7 @@ namespace CGAL {
m_max_level = std::max<std::size_t>(m_max_level, cell->level); m_max_level = std::max<std::size_t>(m_max_level, cell->level);
if (cell->level == m_set_max_level) if (cell->level == m_set_max_level)
continue; continue;
std::size_t zLowYHighXSplit, zLowYLowXSplit, zLowYSplit; std::size_t zLowYHighXSplit, zLowYLowXSplit, zLowYSplit;
std::size_t zHighYSplit, zHighYHighXSplit, zHighYLowXSplit; std::size_t zHighYSplit, zHighYHighXSplit, zHighYLowXSplit;
@ -307,14 +307,14 @@ namespace CGAL {
zLowYLowXSplit = split(cell->first, zLowYLowXSplit = split(cell->first,
zLowYSplit, 0, get_x(cell->center)); zLowYSplit, 0, get_x(cell->center));
zLowYHighXSplit = split(zLowYSplit + 1, zLowYHighXSplit = split(zLowYSplit + 1,
zSplit, 0, get_x(cell->center)); zSplit, 0, get_x(cell->center));
} }
else { else {
zLowYLowXSplit = size_t_max; zLowYLowXSplit = size_t_max;
zLowYHighXSplit = split(cell->first, zSplit, 0, get_x(cell->center)); zLowYHighXSplit = split(cell->first, zSplit, 0, get_x(cell->center));
} }
zHighYSplit = split(zSplit + 1, cell->last, 1, get_y(cell->center)); zHighYSplit = split(zSplit + 1, cell->last, 1, get_y(cell->center));
if (zHighYSplit != size_t_max) { if (zHighYSplit != size_t_max) {
zHighYHighXSplit = split(zHighYSplit + 1, zHighYHighXSplit = split(zHighYSplit + 1,
@ -336,23 +336,23 @@ namespace CGAL {
zHighYSplit = split(cell->first, zHighYSplit = split(cell->first,
cell->last, cell->last,
1, 1,
get_y(cell->center)); get_y(cell->center));
if (zHighYSplit != size_t_max) { if (zHighYSplit != size_t_max) {
zHighYHighXSplit = split(zHighYSplit + 1, zHighYHighXSplit = split(zHighYSplit + 1,
cell->last, cell->last,
0, 0,
get_x(cell->center)); get_x(cell->center));
zHighYLowXSplit = split(cell->first, zHighYLowXSplit = split(cell->first,
zHighYSplit, zHighYSplit,
0, 0,
get_x(cell->center)); get_x(cell->center));
} }
else { else {
zHighYLowXSplit = size_t_max; zHighYLowXSplit = size_t_max;
zHighYHighXSplit = split(cell->first, zHighYHighXSplit = split(cell->first,
cell->last, cell->last,
0, 0,
get_x(cell->center)); get_x(cell->center));
} }
@ -367,7 +367,7 @@ namespace CGAL {
if (cell->first <= zLowYLowXSplit) { if (cell->first <= zLowYLowXSplit) {
//--- //---
cell->child[7] = new Cell(cell->first, cell->child[7] = new Cell(cell->first,
zLowYLowXSplit, zLowYLowXSplit,
transl(cell->center, constr_vec( transl(cell->center, constr_vec(
ORIGIN, constr_pt(-width,-width,-width))), ORIGIN, constr_pt(-width,-width,-width))),
cell->level + 1); cell->level + 1);
@ -381,7 +381,7 @@ namespace CGAL {
if (zLowYLowXSplit < zLowYSplit || zLowYLowXSplit == size_t_max) { if (zLowYLowXSplit < zLowYSplit || zLowYLowXSplit == size_t_max) {
//+-- //+--
cell->child[6] = new Cell(zLowYLowXSplit + 1, cell->child[6] = new Cell(zLowYLowXSplit + 1,
zLowYSplit, zLowYSplit,
transl(cell->center, constr_vec( transl(cell->center, constr_vec(
ORIGIN, constr_pt(width,-width,-width))), ORIGIN, constr_pt(width,-width,-width))),
cell->level + 1); cell->level + 1);
@ -396,8 +396,8 @@ namespace CGAL {
if (zLowYSplit < zLowYHighXSplit || zLowYSplit == size_t_max) { if (zLowYSplit < zLowYHighXSplit || zLowYSplit == size_t_max) {
//-+- //-+-
cell->child[5] = new Cell(zLowYSplit + 1, cell->child[5] = new Cell(zLowYSplit + 1,
zLowYHighXSplit, zLowYHighXSplit,
transl(cell->center, constr_vec( transl(cell->center, constr_vec(
ORIGIN, constr_pt(-width, width,-width))), ORIGIN, constr_pt(-width, width,-width))),
cell->level + 1); cell->level + 1);
@ -411,7 +411,7 @@ namespace CGAL {
if (zLowYHighXSplit < zSplit || zLowYHighXSplit == size_t_max) { if (zLowYHighXSplit < zSplit || zLowYHighXSplit == size_t_max) {
//++- //++-
cell->child[4] = new Cell(zLowYHighXSplit + 1, cell->child[4] = new Cell(zLowYHighXSplit + 1,
zSplit, zSplit,
transl(cell->center, constr_vec( transl(cell->center, constr_vec(
ORIGIN, constr_pt(width, width,-width))), ORIGIN, constr_pt(width, width,-width))),
cell->level + 1); cell->level + 1);
@ -442,7 +442,7 @@ namespace CGAL {
if (zHighYLowXSplit < zHighYSplit || zHighYLowXSplit == size_t_max) { if (zHighYLowXSplit < zHighYSplit || zHighYLowXSplit == size_t_max) {
//+-+ //+-+
cell->child[2] = new Cell(zHighYLowXSplit + 1, cell->child[2] = new Cell(zHighYLowXSplit + 1,
zHighYSplit, zHighYSplit,
transl(cell->center, constr_vec( transl(cell->center, constr_vec(
ORIGIN, constr_pt(width,-width, width))), ORIGIN, constr_pt(width,-width, width))),
cell->level + 1); cell->level + 1);
@ -458,9 +458,9 @@ namespace CGAL {
if (zHighYSplit < zHighYHighXSplit || zHighYSplit == size_t_max) { if (zHighYSplit < zHighYHighXSplit || zHighYSplit == size_t_max) {
//-++ //-++
cell->child[1] = new Cell(zHighYSplit + 1, cell->child[1] = new Cell(zHighYSplit + 1,
zHighYHighXSplit, zHighYHighXSplit,
transl(cell->center, constr_vec( transl(cell->center, constr_vec(
ORIGIN, constr_pt(-width, width, width))), ORIGIN, constr_pt(-width, width, width))),
cell->level + 1); cell->level + 1);
if (cell->child[1]->size() > m_bucket_size) if (cell->child[1]->size() > m_bucket_size)
@ -472,7 +472,7 @@ namespace CGAL {
if (zHighYHighXSplit <= cell->last || zHighYHighXSplit == size_t_max) { if (zHighYHighXSplit <= cell->last || zHighYHighXSplit == size_t_max) {
if (zHighYHighXSplit < cell->last || zHighYHighXSplit == size_t_max) { if (zHighYHighXSplit < cell->last || zHighYHighXSplit == size_t_max) {
//+++ //+++
cell->child[0] = new Cell(zHighYHighXSplit + 1, cell->child[0] = new Cell(zHighYHighXSplit + 1,
cell->last, cell->last,
transl(cell->center, constr_vec( transl(cell->center, constr_vec(
ORIGIN, constr_pt(width, width, width))), ORIGIN, constr_pt(width, width, width))),
@ -549,25 +549,25 @@ namespace CGAL {
std::size_t fullScore(Shape *candidate, std::size_t fullScore(Shape *candidate,
std::vector<int> &shapeIndex, std::vector<int> &shapeIndex,
FT epsilon, FT epsilon,
FT normal_threshold) { FT normal_threshold) {
std::vector<std::size_t> indices(m_root->size()); std::vector<std::size_t> indices(m_root->size());
for (std::size_t i = 0;i<m_root->size();i++) { for (std::size_t i = 0;i<m_root->size();i++) {
indices[i] = index(m_root->first + i); indices[i] = index(m_root->first + i);
} }
candidate->cost_function(this->begin() + m_root->first, candidate->cost_function(this->begin() + m_root->first,
this->begin() + m_root->last, this->begin() + m_root->last,
shapeIndex, shapeIndex,
epsilon, epsilon,
normal_threshold, normal_threshold,
indices); indices);
return candidate->m_indices.size(); return candidate->m_indices.size();
} }
std::size_t score(Shape *candidate, std::size_t score(Shape *candidate,
std::vector<int> &shapeIndex, std::vector<int> &shapeIndex,
FT epsilon, FT epsilon,
FT normal_threshold) { FT normal_threshold) {
@ -599,8 +599,8 @@ namespace CGAL {
} }
} }
candidate->cost_function(epsilon, candidate->cost_function(epsilon,
normal_threshold, normal_threshold,
indices); indices);
} }
else { else {
@ -621,7 +621,7 @@ namespace CGAL {
const Bbox_3 &boundingBox() { const Bbox_3 &boundingBox() {
return m_bBox; return m_bBox;
} }
const Bbox_3 &buildBoundingCube() { const Bbox_3 &buildBoundingCube() {
FT min[] = {std::numeric_limits<FT>::infinity(), FT min[] = {std::numeric_limits<FT>::infinity(),
std::numeric_limits<FT>::infinity(), std::numeric_limits<FT>::infinity(),
@ -642,7 +642,7 @@ namespace CGAL {
m_bBox = Bbox_3(min[0], min[1], min[2], max[0], max[1], max[2]); m_bBox = Bbox_3(min[0], min[1], min[2], max[0], max[1], max[2]);
m_width = (std::max)(max[0] - min[0], m_width = (std::max)(max[0] - min[0],
(std::max)(max[1] - min[1], max[2] - min[2])) * (FT) 0.5; (std::max)(max[1] - min[1], max[2] - min[2])) * (FT) 0.5;
m_center = constr_pt((min[0] + max[0]) * (FT) 0.5, m_center = constr_pt((min[0] + max[0]) * (FT) 0.5,
(min[1] + max[1]) * (FT) 0.5, (min[1] + max[1]) * (FT) 0.5,
@ -653,7 +653,7 @@ namespace CGAL {
// returns index of last point below threshold // returns index of last point below threshold
std::size_t split(std::size_t first, std::size_t last, std::size_t dimension, FT threshold) { std::size_t split(std::size_t first, std::size_t last, std::size_t dimension, FT threshold) {
if (last == size_t_max || first == size_t_max) if (last == size_t_max || first == size_t_max)
return size_t_max; return size_t_max;
if (first > last) if (first > last)
@ -718,7 +718,7 @@ namespace CGAL {
}; };
} }
} }
} }
#endif #endif

View File

@ -1,6 +1,6 @@
/********************************************************************* /*********************************************************************
* 25 - 02 - 97 * 25 - 02 - 97
* gestion des fichiers image ELF * gestion des fichiers image ELF
* *
*********************************************************************/ *********************************************************************/
@ -33,7 +33,7 @@ void permuteLong(char *a)
{ {
char tmp; char tmp;
#ifdef CGAL_LITTLE_ENDIAN #ifdef CGAL_LITTLE_ENDIAN
tmp=a[0]; a[0]=a[3]; a[3]=tmp; tmp=a[0]; a[0]=a[3]; a[3]=tmp;
tmp=a[1]; a[1]=a[2]; a[2]=tmp; tmp=a[1]; a[1]=a[2]; a[2]=tmp;
#endif #endif
@ -43,7 +43,7 @@ void permuteLongTab(long *a,int nb)
{ {
int i; int i;
#ifdef CGAL_LITTLE_ENDIAN #ifdef CGAL_LITTLE_ENDIAN
for(i=0;i<nb;i++) permuteLong( (char *) &a[i]); for(i=0;i<nb;i++) permuteLong( (char *) &a[i]);
#endif #endif
} }
@ -52,7 +52,7 @@ void permuteShort(char *a)
{ {
char tmp; char tmp;
#ifdef CGAL_LITTLE_ENDIAN #ifdef CGAL_LITTLE_ENDIAN
tmp=a[0]; a[0]=a[1]; a[1]=tmp; tmp=a[0]; a[0]=a[1]; a[1]=tmp;
#endif #endif
} }
@ -61,16 +61,16 @@ void permuteShortTab(short *a, int nb)
{ {
int i; int i;
#ifdef CGAL_LITTLE_ENDIAN #ifdef CGAL_LITTLE_ENDIAN
for(i=0;i<nb;i++) permuteShort( (char *) &a[i]); for(i=0;i<nb;i++) permuteShort( (char *) &a[i]);
#endif #endif
} }
void permuteFloat(char *a ) void permuteFloat(char *a )
{ {
char tmp; char tmp;
#ifdef CGAL_LITTLE_ENDIAN #ifdef CGAL_LITTLE_ENDIAN
tmp=a[0]; a[0]=a[3]; a[3]=tmp; tmp=a[0]; a[0]=a[3]; a[3]=tmp;
tmp=a[1]; a[1]=a[2]; a[2]=tmp; tmp=a[1]; a[1]=a[2]; a[2]=tmp;
#endif #endif
@ -79,9 +79,9 @@ tmp=a[1]; a[1]=a[2]; a[2]=tmp;
void permuteFloatTab(float *a, int nb) void permuteFloatTab(float *a, int nb)
{ {
int i; int i;
#ifdef CGAL_LITTLE_ENDIAN #ifdef CGAL_LITTLE_ENDIAN
for(i=0;i<nb;i++) permuteFloat((char *) &a[i]); for(i=0;i<nb;i++) permuteFloat((char *) &a[i]);
#endif #endif
} }
@ -89,9 +89,9 @@ for(i=0;i<nb;i++) permuteFloat((char *) &a[i]);
void permuteDouble(char *a ) void permuteDouble(char *a )
{ {
char tmp; char tmp;
#ifdef CGAL_LITTLE_ENDIAN #ifdef CGAL_LITTLE_ENDIAN
tmp=a[0]; a[0]=a[3]; a[3]=tmp; tmp=a[0]; a[0]=a[3]; a[3]=tmp;
tmp=a[1]; a[1]=a[2]; a[2]=tmp; tmp=a[1]; a[1]=a[2]; a[2]=tmp;
#endif #endif
@ -100,9 +100,9 @@ tmp=a[1]; a[1]=a[2]; a[2]=tmp;
void permuteDoubleTab(double *a, int nb) void permuteDoubleTab(double *a, int nb)
{ {
int i; int i;
#ifdef CGAL_LITTLE_ENDIAN #ifdef CGAL_LITTLE_ENDIAN
for(i=0;i<nb;i++) permuteDouble((char *) &a[i]); for(i=0;i<nb;i++) permuteDouble((char *) &a[i]);
#endif #endif
} }
@ -114,7 +114,7 @@ int lire_longueur_trace(const char * nomfich, long * long_trace)
int flag=0; int flag=0;
if ( internal::open_file(&fin, nomfich) ) if ( internal::open_file(&fin, nomfich) )
{ {
fseek(fin,4,0); fseek(fin,4,0);
if (fread(long_trace,4,1,fin) != 1) { if (fread(long_trace,4,1,fin) != 1) {
flag = -1; flag = -1;
@ -133,7 +133,7 @@ int lire_nb_trace(const char * nomfich, long * nb_trace)
int flag=0; int flag=0;
if ( internal::open_file(&fin, nomfich) ) if ( internal::open_file(&fin, nomfich) )
{ {
fseek(fin,8,0); fseek(fin,8,0);
if (fread(nb_trace,4,1,fin) != 1) { if (fread(nb_trace,4,1,fin) != 1) {
flag = -1; flag = -1;
@ -152,7 +152,7 @@ int lire_nb_plan(const char * nomfich, long * nb_plan)
int flag=0; int flag=0;
if ( internal::open_file(&fin, nomfich) ) if ( internal::open_file(&fin, nomfich) )
{ {
fseek(fin,12,0); fseek(fin,12,0);
if (fread(nb_plan,4,1,fin) != 1) { if (fread(nb_plan,4,1,fin) != 1) {
flag = -1; flag = -1;
@ -172,7 +172,7 @@ int lire_nb_octet(const char * nomfich, long * nb_octet)
int flag=0; int flag=0;
if ( internal::open_file(&fin, nomfich) ) if ( internal::open_file(&fin, nomfich) )
{ {
fseek(fin,36,0); fseek(fin,36,0);
if (fread(nb_octet,4,1,fin) != 1) { if (fread(nb_octet,4,1,fin) != 1) {
flag = -1; flag = -1;
@ -192,7 +192,7 @@ int lire_longueur_entete(const char * nomfich, long * long_entete)
int flag=0; int flag=0;
if ( internal::open_file(&fin, nomfich) ) if ( internal::open_file(&fin, nomfich) )
{ {
fseek(fin,72,0); fseek(fin,72,0);
if (fread(long_entete,4,1,fin) != 1) { if (fread(long_entete,4,1,fin) != 1) {
flag = -1; flag = -1;