improved stability

This commit is contained in:
Pavel Emeliyanenko 2008-09-05 13:06:42 +00:00
parent da490ca698
commit 8cf8e8d6e4
3 changed files with 16 additions and 9 deletions

View File

@ -1023,7 +1023,7 @@ void draw_lump(std::vector< Coord_2 >& rev_points, int& last_x,
pix.level = 0; pix.level = 0;
pix.sub_x = 0; pix.sub_x = 0;
pix.sub_y = 0; pix.sub_y = 0;
Gfx_OUT(witness << " " << prev_pix << std::endl); //Gfx_OUT(witness << " " << prev_pix << std::endl);
} else { } else {
ux = pix.x; ux = pix.x;
uy = pix.y; uy = pix.y;
@ -1307,8 +1307,7 @@ bool get_seed_point(const Rational& seed, Pixel_2& start, int *dir,
s_stack.push(Seed_point(start, dir[1], b_taken[1], b_coincide)); s_stack.push(Seed_point(start, dir[1], b_taken[1], b_coincide));
} }
if(b_coincide) if(b_coincide)
Gfx_DETAILED_OUT("seed point with coincide branches found" << Gfx_OUT("seed point with coincide branches found" << std::endl);
std::endl);
return true; return true;
} }
@ -1327,6 +1326,11 @@ bool test_pixel(const Pixel_2& pix, int *dir, int *b_taken, bool& b_coincide)
int n_sign = 0, i, j, n_dir = 0, shift, n_local, new_dir; int n_sign = 0, i, j, n_dir = 0, shift, n_local, new_dir;
get_polynomials(CGAL_Y_RANGE, box[0]); get_polynomials(CGAL_Y_RANGE, box[0]);
Gfx_OUT("test pixel: " << pix << "--------------------------------\n");
dump_neighbourhood(pix);
Gfx_OUT("----------------------------------------------\n\n");
b_coincide = false; b_coincide = false;
int n_corner_dir = 0, corner_dir[] = {-1, -1}; int n_corner_dir = 0, corner_dir[] = {-1, -1};
// process subsegments: left/right // process subsegments: left/right
@ -2165,7 +2169,7 @@ Lexit:
inline bool get_range_1(int var, const NT& lower, const NT& upper, inline bool get_range_1(int var, const NT& lower, const NT& upper,
const NT& key, const Poly_1& poly, int check = 1) const NT& key, const Poly_1& poly, int check = 1)
{ {
bool res = engine.get_range_AARD_1(var, lower, upper, key, poly, check); bool res = engine.get_range_QF_1(var, lower, upper, key, poly, check);
//engine.get_range_MAA_1(var, lower, upper, key, poly, check); //engine.get_range_MAA_1(var, lower, upper, key, poly, check);
return res; return res;
} }
@ -2469,7 +2473,7 @@ inline bool is_isolated_pixel(const Pixel_2& pix) {
// DEBUG ONLY // DEBUG ONLY
void dump_neighbourhood(const Pixel_2& pix) { void dump_neighbourhood(const Pixel_2& pix) {
#ifdef Gfx_USE_DETAILED_OUT #ifdef Gfx_USE_OUT
CGAL::set_mode(std::cerr, CGAL::IO::PRETTY); CGAL::set_mode(std::cerr, CGAL::IO::PRETTY);
CGAL::set_mode(std::cout, CGAL::IO::PRETTY); CGAL::set_mode(std::cout, CGAL::IO::PRETTY);
@ -2646,7 +2650,7 @@ void dump_neighbourhood(const Pixel_2& pix) {
Gfx_OUT("val = " << b << std::endl); Gfx_OUT("val = " << b << std::endl);
if(a*b < 0) if(a*b < 0)
Gfx_OUT("sign change at segment 2" << std::endl); Gfx_OUT("sign change at segment 2" << std::endl);
#endif #endif // Gfx_USE_OUT
} }
//!@} //!@}

View File

@ -625,6 +625,7 @@ bool get_range_AARD_1(int var,
} }
zero_bounds = ((eval1&eval2) == 0); zero_bounds = ((eval1&eval2) == 0);
if(eval1*eval2 < 0) { if(eval1*eval2 < 0) {
//std::cerr << "eval1 = " << low << "; eval2 = " << up << std::endl;
return true; return true;
} }
return false; return false;
@ -759,6 +760,8 @@ bool get_range_QF_1(int var, const NT& l_, const NT& r_, const NT& key,
eval1 = CGAL_SGN(low); eval1 = CGAL_SGN(low);
eval2 = CGAL_SGN(up); eval2 = CGAL_SGN(up);
} }
//if(eval1*eval2 < 0)
// std::cerr << "eval1 = " << low << "; eval2 = " << up << std::endl;
zero_bounds = ((eval1 & eval2) == 0); zero_bounds = ((eval1 & eval2) == 0);
return (eval1*eval2 < 0); return (eval1*eval2 < 0);
} }
@ -831,7 +834,7 @@ bool get_range_MAA_1(int var, const NT& l_, const NT& r_, const NT& key,
typename Renderer_traits::Extract_eval extract; typename Renderer_traits::Extract_eval extract;
unsigned index = CGAL_RECURSIVE_DER_MAX_DEGREE; unsigned index = CGAL_RECURSIVE_DER_MAX_DEGREE;
if(index >= der->size()) { if(index >= der->size()) {
low = up = extract(poly.lcoeff()) * (*der_it_2).lcoeff(); low = up = extract(poly.lcoeff()) * (der->end()-1)->lcoeff();
} else { } else {
der_it_2 = der->begin()+index; der_it_2 = der->begin()+index;
low = 1; low = 1;

View File

@ -325,7 +325,7 @@ struct Curve_renderer_traits<CGAL::Interval_nt<true>, CORE::BigRat > :
{ return (CGAL_ABS(x) <= 1e-16); } { return (CGAL_ABS(x) <= 1e-16); }
}; };
static const unsigned MAX_SUBDIVISION_LEVEL = 6; static const unsigned MAX_SUBDIVISION_LEVEL = 12;
}; };
//! Specialization for \c CORE::BigFloat //! Specialization for \c CORE::BigFloat
@ -374,7 +374,7 @@ struct Curve_renderer_traits<CORE::BigFloat, class CORE::BigRat>
{ x.makeExact(); } { x.makeExact(); }
}; };
static const unsigned MAX_SUBDIVISION_LEVEL = 6; static const unsigned MAX_SUBDIVISION_LEVEL = 12;
}; };
//! Specialization for \c CORE::BigRat //! Specialization for \c CORE::BigRat