diff --git a/Advancing_front_surface_reconstruction/include/CGAL/Advancing_front_surface_reconstruction.h b/Advancing_front_surface_reconstruction/include/CGAL/Advancing_front_surface_reconstruction.h index de0f3d73ec1..b349169c6b7 100644 --- a/Advancing_front_surface_reconstruction/include/CGAL/Advancing_front_surface_reconstruction.h +++ b/Advancing_front_surface_reconstruction/include/CGAL/Advancing_front_surface_reconstruction.h @@ -148,7 +148,7 @@ namespace CGAL { if(first_vertex != S.triangulation_3().finite_vertices_end()) { pos = first_vertex; pos->set_post_mark(mark); - assert(pos->is_on_border()); + CGAL_assertion(pos->is_on_border()); } else { pos = NULL; @@ -469,7 +469,7 @@ namespace CGAL { inline void set_interior_edge(Vertex_handle w, Vertex_handle v) { if(w->m_ie_last == ie_sentinel){ // empty set - assert(w->m_ie_first == w->m_ie_last); + CGAL_assertion(w->m_ie_first == w->m_ie_last); w->m_ie_last = interior_edges.insert(w->m_ie_last, v); w->m_ie_first = w->m_ie_last; } else { @@ -477,7 +477,7 @@ namespace CGAL { e++; #ifdef DEBUG typename std::list::iterator r = std::find(w->m_ie_first, e, v); - assert(r == e); + CGAL_assertion(r == e); #endif w->m_ie_last = interior_edges.insert(e, v); } @@ -487,7 +487,7 @@ namespace CGAL { inline void remove_interior_edge(Vertex_handle w, Vertex_handle v) { if(w->m_ie_first == ie_sentinel){ - assert(w->m_ie_last == w->m_ie_first); + CGAL_assertion(w->m_ie_last == w->m_ie_first); } else if(w->m_ie_first == w->m_ie_last){ // there is only one element if(*(w->m_ie_first) == v){ interior_edges.erase(w->m_ie_first); @@ -516,7 +516,7 @@ namespace CGAL { inline void set_incidence_request(Vertex_handle w, const Incidence_request_elt& ir) { if(w->m_ir_last == sentinel ){ - assert(w->m_ir_first == w->m_ir_last); + CGAL_assertion(w->m_ir_first == w->m_ir_last); w->m_ir_last = incidence_requests.insert(w->m_ir_last, ir); w->m_ir_first = w->m_ir_last; } else { @@ -529,7 +529,7 @@ namespace CGAL { inline bool is_incidence_requested(Vertex_handle w) const { if(w->m_ir_last == sentinel ){ - assert(w->m_ir_first == sentinel ); + CGAL_assertion(w->m_ir_first == sentinel ); } return (w->m_ir_last != sentinel ); } @@ -542,7 +542,7 @@ namespace CGAL { inline Incidence_request_iterator incidence_request_end(Vertex_handle w) { if(w->m_ir_last != sentinel ){ - assert(w->m_ir_first != sentinel ); + CGAL_assertion(w->m_ir_first != sentinel ); Incidence_request_iterator it(w->m_ir_last); it++; return it; @@ -553,7 +553,7 @@ namespace CGAL { inline void erase_incidence_request(Vertex_handle w) { if(w->m_ir_last != sentinel ){ - assert(w->m_ir_first != sentinel ); + CGAL_assertion(w->m_ir_first != sentinel ); w->m_ir_last++; incidence_requests.erase(w->m_ir_first, w->m_ir_last); w->m_ir_first = sentinel ; @@ -570,7 +570,7 @@ namespace CGAL { } if(w->m_ir_first != sentinel ){ - assert(w->m_ir_last != sentinel ); + CGAL_assertion(w->m_ir_last != sentinel ); typename std::list< Incidence_request_elt >::iterator b(w->m_ir_first), e(w->m_ir_last); e++; incidence_requests.erase(b, e); @@ -627,14 +627,14 @@ namespace CGAL { w->delete_border(); } if(w->m_ir_first != sentinel ){ - assert(w->m_ir_last != sentinel ); + CGAL_assertion(w->m_ir_last != sentinel ); typename std::list< Incidence_request_elt >::iterator b(w->m_ir_first), e(w->m_ir_last); e++; incidence_requests.erase(b, e); } if(w->m_ie_first != ie_sentinel){ - assert(w->m_ie_last != ie_sentinel); + CGAL_assertion(w->m_ie_last != ie_sentinel); typename std::list::iterator b(w->m_ie_first), e(w->m_ie_last); e++; interior_edges.erase(b, e); @@ -2186,7 +2186,7 @@ namespace CGAL { { _facet_number--; - assert(c->is_selected_facet(index)); + CGAL_assertion(c->is_selected_facet(index)); unselect_facet(c, index); Facet f32 = diff --git a/Advancing_front_surface_reconstruction/include/CGAL/internal/AFSR/construct_surface_2.h b/Advancing_front_surface_reconstruction/include/CGAL/internal/AFSR/construct_surface_2.h index 47d9f179d25..4eef347b979 100644 --- a/Advancing_front_surface_reconstruction/include/CGAL/internal/AFSR/construct_surface_2.h +++ b/Advancing_front_surface_reconstruction/include/CGAL/internal/AFSR/construct_surface_2.h @@ -134,7 +134,7 @@ namespace CGAL { tds.set_adjacency(fn, 2, inf_edge_map); edge_map.erase(edge_map.begin()); } - CGAL_triangulation_assertion(inf_edge_map.empty()); + CGAL_assertion(inf_edge_map.empty()); } tds.reorient_faces(); return vinf; diff --git a/Advancing_front_surface_reconstruction/include/CGAL/internal/AFSR/orient.h b/Advancing_front_surface_reconstruction/include/CGAL/internal/AFSR/orient.h index f38b0ad9d58..09a0a0a6e75 100644 --- a/Advancing_front_surface_reconstruction/include/CGAL/internal/AFSR/orient.h +++ b/Advancing_front_surface_reconstruction/include/CGAL/internal/AFSR/orient.h @@ -122,7 +122,7 @@ namespace CGAL { tds.set_adjacency(fn, 2, inf_edge_map); edge_map.erase(edge_map.begin()); } - CGAL_triangulation_assertion(inf_edge_map.empty()); + CGAL_assertion(inf_edge_map.empty()); } diff --git a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Curve_analysis_2.h b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Curve_analysis_2.h index 945b743c907..c38eedf4317 100644 --- a/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Curve_analysis_2.h +++ b/Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Curve_analysis_2.h @@ -35,6 +35,7 @@ #include +#include #include #include #include @@ -904,7 +905,7 @@ private: break; } default:{ - assert(false); // !!! Never reached + CGAL_assertion(false); // !!! Never reached } } } diff --git a/Alpha_shapes_2/include/CGAL/internal/Lazy_alpha_nt_2.h b/Alpha_shapes_2/include/CGAL/internal/Lazy_alpha_nt_2.h index 07504bb2a2e..b5a71ff0f35 100644 --- a/Alpha_shapes_2/include/CGAL/internal/Lazy_alpha_nt_2.h +++ b/Alpha_shapes_2/include/CGAL/internal/Lazy_alpha_nt_2.h @@ -20,7 +20,7 @@ #ifndef CGAL_INTERNAL_LAZY_ALPHA_NT_2_H #define CGAL_INTERNAL_LAZY_ALPHA_NT_2_H - +#include #include #include #include @@ -139,7 +139,7 @@ public: exact_ = Exact_squared_radius()( to_exact(*data()[0]),to_exact(*data()[1]),to_exact(*data()[2]) ); break; default: - assert(false); + CGAL_assertion(false); } updated=true; } @@ -156,7 +156,7 @@ public: approx_ = Approx_squared_radius()( to_approx(*data()[0]),to_approx(*data()[1]),to_approx(*data()[2]) ); break; default: - assert(false); + CGAL_assertion(false); } } diff --git a/Alpha_shapes_3/include/CGAL/internal/Lazy_alpha_nt_3.h b/Alpha_shapes_3/include/CGAL/internal/Lazy_alpha_nt_3.h index 7ded7ec6ef0..6d4c7f20fe3 100644 --- a/Alpha_shapes_3/include/CGAL/internal/Lazy_alpha_nt_3.h +++ b/Alpha_shapes_3/include/CGAL/internal/Lazy_alpha_nt_3.h @@ -21,6 +21,7 @@ #ifndef CGAL_INTERNAL_LAZY_ALPHA_NT_3_H #define CGAL_INTERNAL_LAZY_ALPHA_NT_3_H +#include #include #include #include @@ -140,7 +141,7 @@ public: exact_ = Exact_squared_radius()( to_exact(*data()[0]),to_exact(*data()[1]),to_exact(*data()[2]),to_exact(*data()[3]) ); break; default: - assert(false); + CGAL_assertion(false); } updated=true; } @@ -160,7 +161,7 @@ public: approx_ = Approx_squared_radius()( to_approx(*data()[0]),to_approx(*data()[1]),to_approx(*data()[2]),to_approx(*data()[3]) ); break; default: - assert(false); + CGAL_assertion(false); } } diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_extended_rational_arc_traits_d_1.h b/Arrangement_on_surface_2/include/CGAL/Arr_extended_rational_arc_traits_d_1.h index 4aff08c6fd9..f2230546e63 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_extended_rational_arc_traits_d_1.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_extended_rational_arc_traits_d_1.h @@ -553,13 +553,13 @@ public: Comparison_result operator() (const Vertical_segment & cv1, const Non_vertical_x_curve_2 & cv2) const { - assert(false); + CGAL_assertion(false); return CGAL::SMALLER; } Comparison_result operator() (const Non_vertical_x_curve_2& cv1, const Vertical_segment & cv2) const { - assert(false); + CGAL_assertion(false); return CGAL::LARGER; } Comparison_result operator() (const Vertical_segment & cv1, diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_rat_arc/Rational_function_canonicalized_pair.h b/Arrangement_on_surface_2/include/CGAL/Arr_rat_arc/Rational_function_canonicalized_pair.h index 713eb92c318..e3dec644b78 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_rat_arc/Rational_function_canonicalized_pair.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_rat_arc/Rational_function_canonicalized_pair.h @@ -24,6 +24,7 @@ #include #include #include +#include namespace CGAL { namespace Arr_rational_arc { @@ -69,7 +70,7 @@ public: #if 1 solve_1(_resultant,std::back_inserter(rm_vec)); #else - assert(false); + CGAL_assertion(false); // don't use this code yet since g and resultant/g may still have a // common root if( CGAL::internal::may_have_common_factor(_f.denom(),_g.denom())){ diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_rat_arc/Singleton.h b/Arrangement_on_surface_2/include/CGAL/Arr_rat_arc/Singleton.h index 3f4148968b7..3d41d72d426 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_rat_arc/Singleton.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_rat_arc/Singleton.h @@ -20,9 +20,11 @@ -#ifndef SINGLETON_H_ +#ifndef CGAL_SINGLETON_H_ #define SINGLETON_H_ +#include + namespace CGAL { namespace Arr_rational_arc { template @@ -33,7 +35,7 @@ public: { if(!m_pInstance) m_pInstance = new T; - assert(m_pInstance !=NULL); + CGAL_assertion(m_pInstance !=NULL); return m_pInstance; } @@ -53,4 +55,4 @@ template T* Singleton::m_pInstance=NULL; } // namespace Arr_rational_arc } //namespace CGAL { -#endif // SINGLETON_H_ +#endif // CGAL_SINGLETON_H_ diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_rational_function_traits_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_rational_function_traits_2.h index 7f8a00d56b7..0ffeec96c72 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_rational_function_traits_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_rational_function_traits_2.h @@ -21,6 +21,7 @@ #ifndef CGAL_ARR_RATIONAL_ARC_TRAITS_D_1_H #define CGAL_ARR_RATIONAL_ARC_TRAITS_D_1_H +#include #include #include #include @@ -1295,7 +1296,7 @@ public: Approximate_number_type operator()(const Point_2& p, int i){ if(i==0) return approx_x(p); if(i==1) return approx_y(p); - assert(false); + CGAL_assertion(false); return Approximate_number_type(0); } }; diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_unb_planar_topology_traits_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_unb_planar_topology_traits_2.h index 7432611cb9d..71feb804a6f 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_unb_planar_topology_traits_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_unb_planar_topology_traits_2.h @@ -34,6 +34,7 @@ #include #include #include +#include namespace CGAL { @@ -507,7 +508,7 @@ public: */ const Face* reference_face() const { - assert(v_tr->halfedge()->direction() == ARR_LEFT_TO_RIGHT); + CGAL_assertion(v_tr->halfedge()->direction() == ARR_LEFT_TO_RIGHT); return v_tr->halfedge()->outer_ccb()->face(); } @@ -519,7 +520,7 @@ public: */ Face* reference_face() { - assert(v_tr->halfedge()->direction() == ARR_LEFT_TO_RIGHT); + CGAL_assertion(v_tr->halfedge()->direction() == ARR_LEFT_TO_RIGHT); return v_tr->halfedge()->outer_ccb()->face(); } diff --git a/BGL/include/CGAL/boost/graph/Euler_operations.h b/BGL/include/CGAL/boost/graph/Euler_operations.h index 664b6085755..312bad0d06e 100644 --- a/BGL/include/CGAL/boost/graph/Euler_operations.h +++ b/BGL/include/CGAL/boost/graph/Euler_operations.h @@ -1095,7 +1095,7 @@ collapse_edge(typename boost::graph_traits::edge_descriptor v0v1, remove_vertex(p,g); Halfedge_around_target_circulator beg(ppt,g), end(pqb,g); while(beg != end){ - assert(target(*beg,g) == p); + CGAL_assertion(target(*beg,g) == p); set_target(*beg,q,g); --beg; } @@ -1322,7 +1322,7 @@ flip_edge(typename boost::graph_traits::halfedge_descriptor h, vertex_descriptor s2 = target(nh,g), t2 = target(noh,g); face_descriptor fh = face(h,g), foh = face(oh,g); - assert(fh != Traits::null_face() && foh != Traits::null_face()); + CGAL_assertion(fh != Traits::null_face() && foh != Traits::null_face()); if(halfedge(s,g) == oh){ set_halfedge(s,nnh,g); diff --git a/BGL/include/CGAL/boost/graph/graph_traits_PolyMesh_ArrayKernelT.h b/BGL/include/CGAL/boost/graph/graph_traits_PolyMesh_ArrayKernelT.h index d8ceeb786d4..877e0c7f707 100644 --- a/BGL/include/CGAL/boost/graph/graph_traits_PolyMesh_ArrayKernelT.h +++ b/BGL/include/CGAL/boost/graph/graph_traits_PolyMesh_ArrayKernelT.h @@ -30,6 +30,7 @@ #include #include #include +#include #include @@ -540,7 +541,7 @@ template void clear_vertex(typename boost::graph_traits >::vertex_descriptor, OpenMesh::PolyMesh_ArrayKernelT&) { - assert(false); + CGAL_assert(false); } */ diff --git a/BGL/include/CGAL/boost/graph/graph_traits_Surface_mesh.h b/BGL/include/CGAL/boost/graph/graph_traits_Surface_mesh.h index 0ea114d9fa1..d0e3a92d9b9 100644 --- a/BGL/include/CGAL/boost/graph/graph_traits_Surface_mesh.h +++ b/BGL/include/CGAL/boost/graph/graph_traits_Surface_mesh.h @@ -29,7 +29,7 @@ #include #include - +#include namespace boost { @@ -445,7 +445,7 @@ template void clear_vertex(typename boost::graph_traits >::vertex_descriptor, CGAL::Surface_mesh

&) { - assert(false); + CGAL_assertion(false); } */ diff --git a/CGAL_Core/include/CGAL/CORE/BigFloat.h b/CGAL_Core/include/CGAL/CORE/BigFloat.h index 4cf2dedc80a..f264568bcce 100644 --- a/CGAL_Core/include/CGAL/CORE/BigFloat.h +++ b/CGAL_Core/include/CGAL/CORE/BigFloat.h @@ -36,6 +36,7 @@ #define _CORE_BIGFLOAT_H_ #include +#include namespace CORE { @@ -246,7 +247,7 @@ public: /** \note This is only the sign of the mantissa, it can be taken to be the sign of the BigFloat only if !(isZeroIn()). */ int sign() const { - assert((err() == 0 && m() == 0) || !(isZeroIn())); + CGAL_assertion((err() == 0 && m() == 0) || !(isZeroIn())); return rep->signM(); } /// check whether contains zero @@ -553,7 +554,7 @@ inline bool isDivisible(double x, double y) { // normalizing it then we get zero. inline BigFloat div_exact(const BigFloat& x, const BigFloat& y) { BigInt z; - assert (isDivisible(x,y)); + CGAL_assertion (isDivisible(x,y)); unsigned long bin_x = getBinExpo(x.m()); unsigned long bin_y = getBinExpo(y.m()); diff --git a/CGAL_Core/include/CGAL/CORE/Expr.h b/CGAL_Core/include/CGAL/CORE/Expr.h index 4a68a9d9e12..f1215cdf985 100644 --- a/CGAL_Core/include/CGAL/CORE/Expr.h +++ b/CGAL_Core/include/CGAL/CORE/Expr.h @@ -40,6 +40,7 @@ #define _CORE_EXPR_H_ #include +#include namespace CORE { @@ -534,7 +535,7 @@ inline Expr rootOf(const Polynomial& p, int x, int y) { * */ template inline Expr radical(const NT& n, int m) { - assert(n>=0 && m>=1); + CGAL_assertion(n>=0 && m>=1); if (n == 0 || n == 1 || m == 1) return Expr(n); Polynomial Q(m); diff --git a/CGAL_Core/include/CGAL/CORE/Filter.h b/CGAL_Core/include/CGAL/CORE/Filter.h index 198da10c4d0..4a8ff2dea7b 100644 --- a/CGAL_Core/include/CGAL/CORE/Filter.h +++ b/CGAL_Core/include/CGAL/CORE/Filter.h @@ -39,6 +39,7 @@ #define _CORE_FILTER_H_ #include +#include #include #include @@ -111,7 +112,7 @@ public: before call this function.) */ int sign() const { #ifdef CORE_DEBUG - assert(isOK()); + CGAL_assertion(isOK()); #endif if (fpVal == 0.0) return 0; diff --git a/CGAL_Core/include/CGAL/CORE/MemoryPool.h b/CGAL_Core/include/CGAL/CORE/MemoryPool.h index f3f4c2f3da3..dd47f53a9d9 100644 --- a/CGAL_Core/include/CGAL/CORE/MemoryPool.h +++ b/CGAL_Core/include/CGAL/CORE/MemoryPool.h @@ -36,6 +36,7 @@ #include // for placement new #include +#include namespace CORE { @@ -96,7 +97,7 @@ void* MemoryPool< T, nObjects >::allocate(std::size_t) { template< class T, int nObjects > void MemoryPool< T, nObjects >::free(void* t) { - assert(t != 0); + CGAL_assertion(t != 0); if (t == 0) return; // for safety // recycle the object memory, by putting it back into the chain diff --git a/CGAL_Core/include/CGAL/CORE/poly/Curves.tcc b/CGAL_Core/include/CGAL/CORE/poly/Curves.tcc index 45895466a0e..9e89be0322a 100644 --- a/CGAL_Core/include/CGAL/CORE/poly/Curves.tcc +++ b/CGAL_Core/include/CGAL/CORE/poly/Curves.tcc @@ -192,7 +192,7 @@ BiPoly::~BiPoly(){ //Sets the input BiPoly to X^n template void BiPoly::constructX(int n, BiPoly& P){ - assert(n>= -1); + CGAL_assertion(n>= -1); P.deleteCoeffX();//Clear the present coeffecients Polynomial q(n);//Nominal degree n q.setCoeff(n,NT(1)); @@ -807,7 +807,7 @@ BiPoly & BiPoly::differentiateX() { template BiPoly & BiPoly::differentiateXY(int m, int n) {//m times wrt X and n times wrt Y - assert(m >=0); assert(n >=0); + CGAL_assertion(m >=0); CGAL_assertion(n >=0); for(int i=1; i <=m; i++) (*this).differentiateX(); for(int i=1; i <=n; i++) @@ -1158,7 +1158,7 @@ int Curve::verticalIntersections(const BigFloat & x, BFVecInterval & vI, // This returns a NULL vI, which should be caught by caller Polynomial PY = this->yExprPolynomial(x); // should be replaced - // assert(x.isExact()); + // CGAL_assertion(x.isExact()); // Polynomial PY = yBFPolynomial(x); // unstable still d = PY.getTrueDegree(); @@ -1205,9 +1205,9 @@ int Curve::plot( BigFloat eps, BigFloat x1, const char* filename[] = {"data/input", "data/plot", "data/plot2"}; - assert(eps.isExact()); // important for plotting... - assert(x1.isExact()); - assert(y1.isExact()); + CGAL_assertion(eps.isExact()); // important for plotting... + CGAL_assertion(x1.isExact()); + CGAL_assertion(y1.isExact()); ofstream outFile; outFile.open(filename[fileNo]); // ought to check if open is successful! @@ -1230,7 +1230,7 @@ int Curve::plot( BigFloat eps, BigFloat x1, outFile << "0.99 \t 0.99 \t 0.99" << std::endl; outFile << 0 << "\t" << y1 << std::endl; outFile << 0 << "\t" << y2 << std::endl; - // assert(eps>0) + // CGAL_assertion(eps>0) int aprec = -(eps.lMSB()).toLong(); // By definition, eps.lMSB() <= lg(eps) BigFloat xCurr = x1; diff --git a/CGAL_Core/include/CGAL/CORE/poly/Poly.h b/CGAL_Core/include/CGAL/CORE/poly/Poly.h index 72a0c3fd49c..83cd7a2fe86 100644 --- a/CGAL_Core/include/CGAL/CORE/poly/Poly.h +++ b/CGAL_Core/include/CGAL/CORE/poly/Poly.h @@ -60,6 +60,7 @@ #include #include #include +#include namespace CORE { using namespace std; @@ -412,7 +413,7 @@ template < class NT > CORE_INLINE const NT& Polynomial::getCoeff(int i) const { //if (i > degree) return NULL; - assert(i <= degree); + CGAL_assertion(i <= degree); return coeff[i]; } // set functions diff --git a/CGAL_Core/include/CGAL/CORE/poly/Poly.tcc b/CGAL_Core/include/CGAL/CORE/poly/Poly.tcc index d5ccb582e5f..8112417a132 100644 --- a/CGAL_Core/include/CGAL/CORE/poly/Poly.tcc +++ b/CGAL_Core/include/CGAL/CORE/poly/Poly.tcc @@ -67,7 +67,7 @@ Polynomial::Polynomial(void) { //Creates a polynomial with nominal degree n template Polynomial::Polynomial(int n) { - assert(n>= -1); + CGAL_assertion(n>= -1); degree = n; if (n == -1) return; // return the zero polynomial! @@ -80,7 +80,7 @@ Polynomial::Polynomial(int n) { template Polynomial::Polynomial(int n, const NT * c) { - //assert("array c has n+1 elements"); + //CGAL_assertion("array c has n+1 elements"); degree = n; if (n >= 0) { coeff = new NT[n+1]; @@ -113,7 +113,7 @@ Polynomial::Polynomial(const Polynomial & p):degree(-1) { /////////////////////////////////////// template Polynomial::Polynomial(int n, const char * s[]) { - //assert("array s has n+1 elements"); + //CGAL_assertion("array s has n+1 elements"); degree = n; if (n >= 0) { coeff = new NT[n+1]; @@ -826,7 +826,7 @@ template <> CORE_INLINE BigFloat Polynomial::evalApprox(const BigFloat& /*f*/, const extLong& /*r*/, const extLong& /*a*/) const { // evaluation - assert(0); + CGAL_assertion(0); return BigFloat(0); } @@ -861,7 +861,7 @@ BigFloat Polynomial::evalApprox(const BigFloat& /*f*/, template BigFloat Polynomial::evalExactSign(const BigFloat& val, const extLong& oldMSB) const { - assert(val.isExact()); + CGAL_assertion(val.isExact()); if (getTrueDegree() == -1) return BigFloat(0); @@ -1063,7 +1063,7 @@ Polynomial & Polynomial::differentiate() { // self-differentiation // multi-differentiate template Polynomial & Polynomial::differentiate(int n) { - assert(n >= 0); + CGAL_assertion(n >= 0); for (int i=1; i<=n; i++) this->differentiate(); return *this; @@ -1128,7 +1128,7 @@ template Polynomial & Polynomial::primPart() { // ASSERT: GCD must be provided by NT int d = getTrueDegree(); - assert (d >= 0); + CGAL_assertion (d >= 0); if (d == 0) { if (coeff[0] > 0) coeff[0] = 1; else coeff[0] = -1; @@ -1371,7 +1371,7 @@ Polynomial differentiate(const Polynomial & p) { // differentiate template Polynomial differentiate(const Polynomial & p, int n) {//multi-differentiate Polynomial q(p); - assert(n >= 0); + CGAL_assertion(n >= 0); for (int i=1; i<=n; i++) q.differentiate(); return q; @@ -1491,7 +1491,7 @@ NT res(Polynomial p, Polynomial q) { template NT psc(int i,Polynomial p, Polynomial q) { - assert(i >= 0); + CGAL_assertion(i >= 0); if(i == 0) return res(p,q); diff --git a/CGAL_Core/include/CGAL/CORE/poly/Sturm.h b/CGAL_Core/include/CGAL/CORE/poly/Sturm.h index 14321f60c69..28024e99a8a 100644 --- a/CGAL_Core/include/CGAL/CORE/poly/Sturm.h +++ b/CGAL_Core/include/CGAL/CORE/poly/Sturm.h @@ -59,6 +59,7 @@ #ifndef CORE_STURM_H #define CORE_STURM_H +#include #include "CGAL/CORE/BigFloat.h" #include "CGAL/CORE/Expr.h" #include "CGAL/CORE/poly/Poly.h" @@ -205,7 +206,7 @@ public: // where sx = sign of evaluating seq[0] at x // PRE-CONDITION: sx != 0 and len > 0 int signVariations(const BigFloat & x, int sx) const { - assert((sx != 0) && (len >0)); + CGAL_assertion((sx != 0) && (len >0)); int cnt = 0; int last_sign = sx; for (int i=1; i<=len; i++) {// Chee (4/29/04): Bug fix, @@ -237,7 +238,7 @@ public: if (len <= 0) return len; int cnt = 0; int last_sign = sign(seq[0].coeff[seq[0].getTrueDegree()]); - assert(last_sign != 0); + CGAL_assertion(last_sign != 0); for (int i=1; i<=len; i++) { int sgn = sign(seq[i].coeff[seq[i].getTrueDegree()]); if (sgn*last_sign < 0) @@ -255,7 +256,7 @@ public: int last_sign = sign(seq[0].coeff[seq[0].getTrueDegree()]); if (seq[0].getTrueDegree() % 2 != 0) last_sign *= -1; - assert(last_sign != 0); + CGAL_assertion(last_sign != 0); for (int i=1; i<=len; i++) { int parity = (seq[i].getTrueDegree() % 2 == 0) ? 1 : -1; int sgn = parity * sign(seq[i].coeff[seq[i].getTrueDegree()]); @@ -275,7 +276,7 @@ public: // "x.makeExact(); y.makeExact()" before calling]. /////////////////////////////////////////// int numberOfRoots(const BigFloat &x, const BigFloat &y) const { - assert(x <= y); // we allow x=y + CGAL_assertion(x <= y); // we allow x=y if (len <= 0) return len; // return of -1 means infinity of roots! int signx = sign(seq[0].evalExactSign(x)); if (x == y) return ((signx == 0) ? 1 : 0); @@ -354,7 +355,7 @@ public: */ void isolateRoots(const BigFloat &x, const BigFloat &y, BFVecInterval &v) const { - assert(x<=y); + CGAL_assertion(x<=y); int n = numberOfRoots(x,y); if (n == 0) return; @@ -767,7 +768,7 @@ public: // says that z is a robust approximate zero). // bool smaleBoundTest(const BigFloat& z){ - assert(z.isExact()); // the bound only makes sense for exact z + CGAL_assertion(z.isExact()); // the bound only makes sense for exact z #ifdef CORE_DEBUG std::cout <<"Computing Smale's bound = " << std::endl; @@ -869,7 +870,7 @@ std::cout << "In newtonRefine, input J=" << J.first return J; } - assert( leftSign * rightSign < 0 ); + CGAL_assertion( leftSign * rightSign < 0 ); //N is number of times Newton is called without checking // whether the result is still in the interval or not @@ -1060,7 +1061,7 @@ std::cout << "In newtonRefine, input J=" << J.first << J.first.err() << " Err at end = " << J.second.err() << std::endl; #endif - assert( (seq[0].evalExactSign(J.first) * seq[0].evalExactSign(J.second) <= 0) ); + CGAL_assertion( (seq[0].evalExactSign(J.first) * seq[0].evalExactSign(J.second) <= 0) ); #ifdef CORE_DEBUG_NEWTON if (seq[0].evalExactSign(J.first) * seq[0].evalExactSign(J.second) > 0) diff --git a/CGAL_ipelets/include/CGAL/CGAL_Ipelet_base_v6.h b/CGAL_ipelets/include/CGAL/CGAL_Ipelet_base_v6.h index 3b23c8fcb97..6464f2f266a 100644 --- a/CGAL_ipelets/include/CGAL/CGAL_Ipelet_base_v6.h +++ b/CGAL_ipelets/include/CGAL/CGAL_Ipelet_base_v6.h @@ -37,6 +37,7 @@ typedef unsigned int uint; #include #include #include +#include #include @@ -538,10 +539,10 @@ public: ++next_s; if (next_s==map_theta.end()) next_s=map_theta.begin(); do{ if (current->second.first==OTRG) return; - assert(current->second.first==SRC); + CGAL_assertion(current->second.first==SRC); draw_in_ipe(Circular_arc_2(circle,*(current->second.second),*(next_s->second.second),CGAL::COUNTERCLOCKWISE)); if (next_s->second.first==OTRG) return; - assert(next_s->second.first==TRG); + CGAL_assertion(next_s->second.first==TRG); ++next_s; if (next_s==map_theta.end()) next_s=map_theta.begin(); current=next_s; ++next_s; if (next_s==map_theta.end()) next_s=map_theta.begin(); @@ -843,7 +844,7 @@ public: switch (ints.size()){ case 1: ok=CGAL::assign(tmp_pt,ints[0]); - assert(ok); + CGAL_assertion(ok); points.push_back(tmp_pt); index=points.size()-1; indices[i]=index; @@ -852,12 +853,12 @@ public: case 2: int right_ind=i<2?0:1; ok=CGAL::assign(tmp_pt,ints[right_ind]); - assert(ok); + CGAL_assertion(ok); points.push_back(tmp_pt); index=points.size()-1; indices[i]=index; ok=CGAL::assign(tmp_pt,ints[(right_ind+1)%2]); - assert(ok); + CGAL_assertion(ok); points.push_back(tmp_pt); index=points.size()-1; indices[(i+1)%4+4]=index; @@ -900,7 +901,7 @@ public: *out++=build_arc(exact_circle,points[ indices[pair[1]] ].first,points[ indices[pair[0]] ].first); return; } - assert (rem_pt==0); + CGAL_assertion (rem_pt==0); } }; diff --git a/CGAL_ipelets/include/CGAL/CGAL_Ipelet_base_v7.h b/CGAL_ipelets/include/CGAL/CGAL_Ipelet_base_v7.h index 4a2c4153bff..1006ad2843d 100644 --- a/CGAL_ipelets/include/CGAL/CGAL_Ipelet_base_v7.h +++ b/CGAL_ipelets/include/CGAL/CGAL_Ipelet_base_v7.h @@ -37,6 +37,7 @@ typedef unsigned int uint; #include #include #include +#include #include @@ -546,10 +547,10 @@ public: ++next_s; if (next_s==map_theta.end()) next_s=map_theta.begin(); do{ if (current->second.first==OTRG) return; - assert(current->second.first==SRC); + CGAL_assertion(current->second.first==SRC); draw_in_ipe(Circular_arc_2(circle,*(current->second.second),*(next_s->second.second),CGAL::COUNTERCLOCKWISE)); if (next_s->second.first==OTRG) return; - assert(next_s->second.first==TRG); + CGAL_assertion(next_s->second.first==TRG); ++next_s; if (next_s==map_theta.end()) next_s=map_theta.begin(); current=next_s; ++next_s; if (next_s==map_theta.end()) next_s=map_theta.begin(); @@ -848,7 +849,7 @@ public: switch (ints.size()){ case 1: ok=CGAL::assign(tmp_pt,ints[0]); - assert(ok); + CGAL_assertion(ok); points.push_back(tmp_pt); index=points.size()-1; indices[i]=index; @@ -857,12 +858,12 @@ public: case 2: int right_ind=i<2?0:1; ok=CGAL::assign(tmp_pt,ints[right_ind]); - assert(ok); + CGAL_assertion(ok); points.push_back(tmp_pt); index=points.size()-1; indices[i]=index; ok=CGAL::assign(tmp_pt,ints[(right_ind+1)%2]); - assert(ok); + CGAL_assertion(ok); points.push_back(tmp_pt); index=points.size()-1; indices[(i+1)%4+4]=index; @@ -905,7 +906,7 @@ public: *out++=build_arc(exact_circle,points[ indices[pair[1]] ].first,points[ indices[pair[0]] ].first); return; } - assert (rem_pt==0); + CGAL_assertion (rem_pt==0); } }; diff --git a/Convex_hull_3/include/CGAL/Convex_hull_3/dual/halfspace_intersection_with_constructions_3.h b/Convex_hull_3/include/CGAL/Convex_hull_3/dual/halfspace_intersection_with_constructions_3.h index 66110f949e8..51ab1b6094c 100644 --- a/Convex_hull_3/include/CGAL/Convex_hull_3/dual/halfspace_intersection_with_constructions_3.h +++ b/Convex_hull_3/include/CGAL/Convex_hull_3/dual/halfspace_intersection_with_constructions_3.h @@ -26,6 +26,7 @@ #include #include #include +#include // For interior_polyhedron_3 #include @@ -87,7 +88,7 @@ namespace CGAL for (Vertex_const_iterator it = _primal.vertices_begin(); it != _primal.vertices_end(); ++it) { - assert (it->is_bivalent() == false); + CGAL_assertion (it->is_bivalent() == false); typename Polyhedron::Halfedge_around_vertex_const_circulator h0 = it->vertex_begin(), hf = h0; diff --git a/Convex_hull_3/include/CGAL/Convex_hull_3/dual/interior_polyhedron_3.h b/Convex_hull_3/include/CGAL/Convex_hull_3/dual/interior_polyhedron_3.h index 3bc2c0ec36f..64f43823808 100644 --- a/Convex_hull_3/include/CGAL/Convex_hull_3/dual/interior_polyhedron_3.h +++ b/Convex_hull_3/include/CGAL/Convex_hull_3/dual/interior_polyhedron_3.h @@ -28,6 +28,7 @@ #include #include #include +#include // Description taken from http://www.qhull.org/html/qhalf.htm @@ -109,10 +110,10 @@ class Interior_polyhedron_3 { const double cj = CGAL::to_double(plane.c()); const double dj = CGAL::to_double(plane.d()); - assert(!isinf(aj)); - assert(!isinf(bj)); - assert(!isinf(cj)); - assert(!isinf(dj)); + CGAL_assertion(!isinf(aj)); + CGAL_assertion(!isinf(bj)); + CGAL_assertion(!isinf(cj)); + CGAL_assertion(!isinf(dj)); // plane defined the halfspace: aj * x1 + bj * x2 + cj * x3 + dj <= 0 // <=> - (aj * x1 + bj * x2 + cj * x3 + dj) >= 0 diff --git a/Convex_hull_3/include/CGAL/convex_hull_3.h b/Convex_hull_3/include/CGAL/convex_hull_3.h index a93bbe7f997..b828c791970 100644 --- a/Convex_hull_3/include/CGAL/convex_hull_3.h +++ b/Convex_hull_3/include/CGAL/convex_hull_3.h @@ -552,7 +552,7 @@ ch_quickhull_3_scan(TDS_2& tds, border.erase(it); while(! border.empty()){ it = border.find(e.first->vertex(TDS_2::ccw(e.second))); - assert(it != border.end()); + CGAL_ch_assertion(it != border.end()); e = it->second; e.first->info() = 0; edges.push_back(e); diff --git a/Mesh_3/include/CGAL/Implicit_to_labeling_function_wrapper.h b/Mesh_3/include/CGAL/Implicit_to_labeling_function_wrapper.h index fe93dde3bc0..eb2a9459ee1 100644 --- a/Mesh_3/include/CGAL/Implicit_to_labeling_function_wrapper.h +++ b/Mesh_3/include/CGAL/Implicit_to_labeling_function_wrapper.h @@ -173,7 +173,7 @@ public: Implicit_multi_domain_to_labeling_function_wrapper (const Function_vector& vf, const std::vector >& vps) : funcs(vf), bmasks(vps.size(), Bmask(funcs.size() * 2, false)) { - assert(funcs.size()); + CGAL_assertion(funcs.size() != 0); std::size_t mask_index = 0; for (std::vector >::const_iterator mask_iter = vps.begin(), mask_end_iter = vps.end(); @@ -181,14 +181,14 @@ public: ++mask_iter) { const std::vector& mask = *mask_iter; - assert(funcs.size() == mask.size()); + CGAL_assertion(funcs.size() == mask.size()); Bmask& bmask = bmasks[mask_index++]; typename Bmask::size_type bit_index = 0; for (std::vector::const_iterator iter = mask.begin(), endIter = mask.end(); iter != endIter; ++iter) { std::string::value_type character = *iter; - assert(character == POSITIVE || character == NEGATIVE); + CGAL_assertion(character == POSITIVE || character == NEGATIVE); bmask[bit_index] = (character == POSITIVE); ++bit_index; @@ -202,7 +202,7 @@ public: Implicit_multi_domain_to_labeling_function_wrapper (const Function_vector& vf) : funcs(vf) { - assert(funcs.size()); + CGAL_assertion(funcs.size() != 0); bmasks.reserve((1 << funcs.size()) - 1); bmasks.push_back(Bmask(std::string("10"))); @@ -228,7 +228,7 @@ public: Implicit_multi_domain_to_labeling_function_wrapper (const Function_vector& vf, const std::vector& vps) : funcs(vf), bmasks(vps.size(), Bmask(funcs.size() * 2, false)) { - assert(funcs.size()); + CGAL_assertion(funcs.size() != 0); std::size_t mask_index = 0; for (std::vector::const_iterator mask_iter = vps.begin(), mask_end_iter = vps.end(); @@ -236,14 +236,14 @@ public: ++mask_iter) { const std::string& mask_str = *mask_iter; - assert(funcs.size() == mask_str.length()); + CGAL_assertion(funcs.size() == mask_str.length()); Bmask& bmask = bmasks[mask_index++]; typename Bmask::size_type bit_index = 0; for (std::string::const_iterator iter = mask_str.begin(), endIter = mask_str.end(); iter != endIter; ++iter) { std::string::value_type character = *iter; - assert(character == '+' || character == '-'); + CGAL_assertion(character == '+' || character == '-'); bmask[bit_index] = (character == '+'); ++bit_index; diff --git a/Number_types/include/CGAL/Mpzf.h b/Number_types/include/CGAL/Mpzf.h index 661c96a78a8..eca5baf31e5 100644 --- a/Number_types/include/CGAL/Mpzf.h +++ b/Number_types/include/CGAL/Mpzf.h @@ -483,7 +483,7 @@ struct Mpzf { } #endif if(u.s.sig) size=-size; - //assert(to_double()==IA_force_to_double(d)); + //CGAL_assertion(to_double()==IA_force_to_double(d)); } #ifdef CGAL_USE_GMPXX diff --git a/Number_types/include/CGAL/Sqrt_extension/convert_to_bfi.h b/Number_types/include/CGAL/Sqrt_extension/convert_to_bfi.h index 4198c3e0986..fb48ed9e94e 100644 --- a/Number_types/include/CGAL/Sqrt_extension/convert_to_bfi.h +++ b/Number_types/include/CGAL/Sqrt_extension/convert_to_bfi.h @@ -27,6 +27,7 @@ #include #include #include +#include // Disbale SQRT_EXTENSION_TO_BFI_CACHE by default @@ -92,8 +93,8 @@ convert_to_bfi(const CGAL::Sqrt_extension& x) { }else{ result_ = convert_to_bfi(x.a0()); } - assert(lower(result) == lower(result_)); - assert(upper(result) == upper(result_)); + CGAL_assertion(lower(result) == lower(result_)); + CGAL_assertion(upper(result) == upper(result_)); #endif return result; } diff --git a/Operations_on_polyhedra/include/CGAL/intersection_of_Polyhedra_3.h b/Operations_on_polyhedra/include/CGAL/intersection_of_Polyhedra_3.h index 4f4159d4186..2d6ddeee48a 100644 --- a/Operations_on_polyhedra/include/CGAL/intersection_of_Polyhedra_3.h +++ b/Operations_on_polyhedra/include/CGAL/intersection_of_Polyhedra_3.h @@ -1396,7 +1396,7 @@ class Intersection_of_Polyhedra_3{ switch(type){ case internal_IOP::COPLNR: #ifndef DO_NOT_HANDLE_COPLANAR_FACETS - assert(!"COPLNR : this point should never be reached!"); + CGAL_assertion(!"COPLANR : this point should never be reached!"); #else //nothing need to be done, cf. comments at the beginning of the file #endif diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/connected_components.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/connected_components.h index 27b6b600af8..ac3a51b9ea3 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/connected_components.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/connected_components.h @@ -32,6 +32,7 @@ #include #include +#include #include #include #include @@ -723,7 +724,7 @@ void keep_or_remove_connected_components(PolygonMesh& pmesh } else { // no face kept - assert((is_border(h, pmesh) || !get(fcm,fh)) && (is_border(oh, pmesh) || !get(fcm,ofh))); + CGAL_assertion((is_border(h, pmesh) || !get(fcm,fh)) && (is_border(oh, pmesh) || !get(fcm,ofh))); // vertices pointing to e must change their halfedge if (halfedge(v, pmesh) == oh){ set_halfedge(v, prev(h, pmesh), pmesh); @@ -745,7 +746,7 @@ void keep_or_remove_connected_components(PolygonMesh& pmesh remove_edge(e, pmesh); } else { - assert(keep_vertex[w]); + CGAL_assertion(keep_vertex[w]); if (halfedge(w, pmesh) == h){ set_halfedge(w, prev(oh, pmesh), pmesh); } diff --git a/Surface_mesh/include/CGAL/Surface_mesh/Surface_mesh.h b/Surface_mesh/include/CGAL/Surface_mesh/Surface_mesh.h index a15b5d48104..f76330bdc7b 100644 --- a/Surface_mesh/include/CGAL/Surface_mesh/Surface_mesh.h +++ b/Surface_mesh/include/CGAL/Surface_mesh/Surface_mesh.h @@ -2516,7 +2516,7 @@ private: //------------------------------------------------------- private data int n, f, e; std::string off; is >> off; - assert(off == "OFF" || off == "COFF"); + CGAL_assertion(off == "OFF" || off == "COFF"); is >> n >> f >> e; sm.reserve(n,2*f,e); P p; diff --git a/Surface_mesh_shortest_path/include/CGAL/Surface_mesh_shortest_path/Surface_mesh_shortest_path.h b/Surface_mesh_shortest_path/include/CGAL/Surface_mesh_shortest_path/Surface_mesh_shortest_path.h index 630aa3e4126..121c7f92332 100644 --- a/Surface_mesh_shortest_path/include/CGAL/Surface_mesh_shortest_path/Surface_mesh_shortest_path.h +++ b/Surface_mesh_shortest_path/include/CGAL/Surface_mesh_shortest_path/Surface_mesh_shortest_path.h @@ -34,6 +34,7 @@ #include #include +#include #include #include @@ -608,7 +609,7 @@ private: typename Traits::Construct_vertex_2 cv2(m_traits.construct_vertex_2_object()); typename Traits::Construct_triangle_3_along_segment_2_flattening ft3as2(m_traits.construct_triangle_3_along_segment_2_flattening_object()); - assert(cone->m_pendingLeftSubtree != NULL); + CGAL_assertion(cone->m_pendingLeftSubtree != NULL); cone->m_pendingLeftSubtree = NULL; @@ -635,7 +636,7 @@ private: typename Traits::Construct_vertex_2 cv2(m_traits.construct_vertex_2_object()); typename Traits::Construct_triangle_3_along_segment_2_flattening ft3as2(m_traits.construct_triangle_3_along_segment_2_flattening_object()); - assert(cone->m_pendingRightSubtree != NULL); + CGAL_assertion(cone->m_pendingRightSubtree != NULL); cone->m_pendingRightSubtree = NULL; @@ -693,7 +694,7 @@ private: } break; default: - assert(false && "Invalid face location"); + CGAL_assertion(false && "Invalid face location"); // Perhaps hit an assertion that the type must not be external or invalid? } } @@ -1567,11 +1568,11 @@ private: LineLineIntersectResult cgalIntersection = intersect_2(construct_line_2(entrySegment), construct_line_2(rayToLocation)); - assert(cgalIntersection); + CGAL_assertion(bool(cgalIntersection)); Point_2* result = boost::get(&*cgalIntersection); - assert(result && "Error, did not get point intersection on path walk to source"); + CGAL_assertion(result && "Error, did not get point intersection on path walk to source"); FT t0 = parametric_distance_along_segment_2(construct_source_2(entrySegment), construct_target_2(entrySegment), *result); @@ -1616,7 +1617,7 @@ private: current = current->parent(); break; default: - assert(false && "Unhandled node type found in tree"); + CGAL_assertion(false && "Unhandled node type found in tree"); } } } @@ -1771,7 +1772,7 @@ private: break; default: - assert(false && "Invalid face location"); + CGAL_assertion(false && "Invalid face location"); return std::pair(); } } @@ -2044,7 +2045,7 @@ public: std::cout << "Final node count: " << m_currentNodeCount << std::endl; } return; - assert(m_currentNodeCount == 0); + CGAL_assertion(m_currentNodeCount == 0); #endif } diff --git a/Surface_mesh_shortest_path/include/CGAL/Surface_mesh_shortest_path/function_objects.h b/Surface_mesh_shortest_path/include/CGAL/Surface_mesh_shortest_path/function_objects.h index 5e49da4c8ac..c9f9eb64658 100644 --- a/Surface_mesh_shortest_path/include/CGAL/Surface_mesh_shortest_path/function_objects.h +++ b/Surface_mesh_shortest_path/include/CGAL/Surface_mesh_shortest_path/function_objects.h @@ -23,6 +23,7 @@ #include #include #include +#include #include @@ -454,7 +455,7 @@ public: LineLineIntersectResult intersectResult1(m_intersect_2(s1Line, l1)); - assert(intersectResult1); + CGAL_assertion(bool(intersectResult1)); Point_2 p1; @@ -464,19 +465,19 @@ public: { Point_2* result = boost::get(&*intersectResult1); - assert(result && "Intersection should have been a point"); + CGAL_assertion(result && "Intersection should have been a point"); if (result) { t1 = m_parametric_distance_along_segment_2(s1, *result); p1 = *result; - assert(t1 >= FT(-0.00001) && t1 <= FT(1.00001)); + CGAL_assertion(t1 >= FT(-0.00001) && t1 <= FT(1.00001)); } } LineLineIntersectResult intersectResult2 = m_intersect_2(s2Line, l2); - assert(intersectResult2); + CGAL_assertion(bool(intersectResult2)); FT t2; Point_2 p2; @@ -485,13 +486,13 @@ public: { Point_2* result = boost::get(&*intersectResult2); - assert(result && "Intersection should have been a point"); + CGAL_assertion(result && "Intersection should have been a point"); if (result) { t2 = m_parametric_distance_along_segment_2(s2, *result); p2 = *result; - assert(t2 >= FT(-0.00001) && t2 <= FT(1.00001)); + CGAL_assertion(t2 >= FT(-0.00001) && t2 <= FT(1.00001)); } } @@ -589,7 +590,7 @@ public: CGAL::Orientation baseOrientation = m_orientation_2(m_construct_vertex_2(baseFace2, 0), m_construct_vertex_2(baseFace2, 2), m_construct_vertex_2(baseFace2, 1)); - assert(baseOrientation != CGAL::COLLINEAR); + CGAL_assertion(baseOrientation != CGAL::COLLINEAR); do { diff --git a/Triangulation_2/include/CGAL/Polyline_constraint_hierarchy_2.h b/Triangulation_2/include/CGAL/Polyline_constraint_hierarchy_2.h index 5db68c71209..a65a4bd11ad 100644 --- a/Triangulation_2/include/CGAL/Polyline_constraint_hierarchy_2.h +++ b/Triangulation_2/include/CGAL/Polyline_constraint_hierarchy_2.h @@ -446,7 +446,7 @@ enclosing_constraint(T vaa, T vbb, T& va, T& vb) const va = *pos; pos = hcit->pos; ++pos; - assert(vbb == *pos); + CGAL_triangulation_assertion(vbb == *pos); while(!pos.input()){ ++pos; } diff --git a/Visibility_2/include/CGAL/Rotational_sweep_visibility_2.h b/Visibility_2/include/CGAL/Rotational_sweep_visibility_2.h index b73060ab28c..46b34a44b85 100644 --- a/Visibility_2/include/CGAL/Rotational_sweep_visibility_2.h +++ b/Visibility_2/include/CGAL/Rotational_sweep_visibility_2.h @@ -25,6 +25,7 @@ #include #include #include +#include #include #include @@ -811,7 +812,7 @@ private: Ccb_halfedge_const_circulator curr = fh->outer_ccb(); Ccb_halfedge_const_circulator circ = curr; do { - assert(curr->face() == fh); + CGAL_assertion(curr->face() == fh); input_neighbor_f(curr); } while (++curr != circ); @@ -819,7 +820,7 @@ private: for (hi = fh->holes_begin(); hi != fh->holes_end(); ++hi) { Ccb_halfedge_const_circulator curr = *hi, circ = *hi; do { - assert(curr->face() == fh); + CGAL_assertion(curr->face() == fh); input_neighbor_f(curr); } while (++curr != circ); } @@ -847,7 +848,7 @@ private: Ccb_halfedge_const_circulator curr = fh->outer_ccb(); Ccb_halfedge_const_circulator circ = curr; do { - assert(curr->face() == fh); + CGAL_assertion(curr->face() == fh); input_edge(curr, good_edges); } while (++curr != circ); @@ -855,7 +856,7 @@ private: for (hi = fh->holes_begin(); hi != fh->holes_end(); ++hi) { Ccb_halfedge_const_circulator curr = circ = *hi; do { - assert(curr->face() == fh); + CGAL_assertion(curr->face() == fh); input_edge(curr, good_edges); } while (++curr != circ); } diff --git a/Visibility_2/include/CGAL/Simple_polygon_visibility_2.h b/Visibility_2/include/CGAL/Simple_polygon_visibility_2.h index ddd229f67bb..61c8de1efbb 100644 --- a/Visibility_2/include/CGAL/Simple_polygon_visibility_2.h +++ b/Visibility_2/include/CGAL/Simple_polygon_visibility_2.h @@ -404,7 +404,7 @@ namespace CGAL { if (Object_2 result = Intersect_2()(seg, ray_origin) ) { const Point_2 * ipoint = object_cast(&result); - assert( ipoint != NULL ); + CGAL_assertion( ipoint != NULL ); s_t = *ipoint; upcase = SCANB; } @@ -487,7 +487,7 @@ namespace CGAL { Object_2 result = Intersect_2()( seg, seg2 ); if(result) { const Point_2 * ipoint = object_cast(&result); - assert( ipoint != NULL ); + CGAL_assertion( ipoint != NULL ); u = *ipoint; mode = 2; break; @@ -495,7 +495,7 @@ namespace CGAL { } } - assert( mode != 0 ); + CGAL_assertion( mode != 0 ); if ( mode == 1 ) { orient1 = traits->orientation_2_object()(q, vertices[i], vertices[i+1] ); @@ -520,7 +520,7 @@ namespace CGAL { Object_2 result = Intersect_2()( seg, ray ); const Point_2 * ipoint = object_cast(&result); - assert( ipoint != NULL ); + CGAL_assertion( ipoint != NULL ); u = *ipoint; if ( stack.top() != u ) { @@ -539,7 +539,7 @@ namespace CGAL { Object_2 result = Intersect_2()( seg, ray ); const Point_2 * ipoint = object_cast(&result); - assert( ipoint != NULL ); + CGAL_assertion( ipoint != NULL ); u = *ipoint; if ( stack.top() != u ) { @@ -670,7 +670,7 @@ namespace CGAL { } old_orient = curr_orient; } - assert( k+1( &result ); if ( ipoint ) { u = *ipoint; diff --git a/Visibility_2/include/CGAL/Triangular_expansion_visibility_2.h b/Visibility_2/include/CGAL/Triangular_expansion_visibility_2.h index 4a7ba9a9ca3..d27d21e2eaf 100644 --- a/Visibility_2/include/CGAL/Triangular_expansion_visibility_2.h +++ b/Visibility_2/include/CGAL/Triangular_expansion_visibility_2.h @@ -27,6 +27,7 @@ #include #include #include +#include namespace CGAL { @@ -216,7 +217,7 @@ public: out_arr.clear(); needles.clear(); - assert(!face->is_unbounded()); + CGAL_assertion(!face->is_unbounded()); std::vector raw_output; @@ -268,7 +269,7 @@ public: init_cdt(); } - assert(!he->face()->is_unbounded()); + CGAL_assertion(!he->face()->is_unbounded()); out_arr.clear(); needles.clear(); @@ -276,7 +277,7 @@ public: typename CDT::Locate_type location; int index; typename CDT::Face_handle fh = p_cdt->locate(q,location,index); - assert(location == CDT::EDGE || location == CDT::VERTEX); + CGAL_assertion(location == CDT::EDGE || location == CDT::VERTEX); //the following code tries to figure out which triangle one should start in. @@ -292,8 +293,8 @@ public: index = nfh->index(fh); fh = nfh; } - assert(fh->vertex(p_cdt->cw(index))->point() == he->target()->point()); - assert(!p_cdt->is_infinite(fh->vertex(index))); + CGAL_assertion(fh->vertex(p_cdt->cw(index))->point() == he->target()->point()); + CGAL_assertion(!p_cdt->is_infinite(fh->vertex(index))); // output the edge the query lies on @@ -326,10 +327,10 @@ public: //std::cout << "query on vertex" << std::endl; //bool query_point_on_vertex_is_not_working_yet = false; - //assert(query_point_on_vertex_is_not_working_yet); + //CGAL_assertion(query_point_on_vertex_is_not_working_yet); - assert(q == he->target()->point()); - assert(fh->vertex(index)->point() == he->target()->point()); + CGAL_assertion(q == he->target()->point()); + CGAL_assertion(fh->vertex(index)->point() == he->target()->point()); // push points that are seen anyway // raw_output.push_back(he->source()->point()); inserted last @@ -347,15 +348,15 @@ public: int nindex = nfh->index(fh); index = p_cdt->ccw(nindex); fh = nfh; - assert(he->target()->point() == fh->vertex(index)->point()); + CGAL_assertion(he->target()->point() == fh->vertex(index)->point()); } - assert(he->next()->source()->point() == fh->vertex(index)->point()); - assert(he->next()->target()->point() == + CGAL_assertion(he->next()->source()->point() == fh->vertex(index)->point()); + CGAL_assertion(he->next()->target()->point() == fh->vertex(p_cdt->ccw(index))->point()); - assert(!p_cdt->is_infinite(fh)); - assert(p_cdt->is_constrained(get_edge(fh,p_cdt->cw(index)))); + CGAL_assertion(!p_cdt->is_infinite(fh)); + CGAL_assertion(p_cdt->is_constrained(get_edge(fh,p_cdt->cw(index)))); while(he->source()->point() != fh->vertex(p_cdt->ccw(index))->point()){ @@ -376,7 +377,7 @@ public: int nindex = nfh->index(fh); index = p_cdt->ccw(nindex); fh = nfh; - assert(fh->vertex(index)->point() == he->target()->point()); + CGAL_assertion(fh->vertex(index)->point() == he->target()->point()); } } return output(raw_output,out_arr); @@ -397,7 +398,7 @@ private: Ray_2 ray(q,b); Segment_2 seg(s,t); - assert(typename K::Do_intersect_2()(ray,seg)); + CGAL_assertion(typename K::Do_intersect_2()(ray,seg)); CGAL::Object obj = typename K::Intersect_2()(ray,seg); Point_2 result = object_cast(obj); return result; @@ -411,11 +412,11 @@ private: const { // the expanded edge should not be constrained - assert(!p_cdt->is_constrained(get_edge(fh,index))); - assert(!p_cdt->is_infinite(fh)); + CGAL_assertion(!p_cdt->is_constrained(get_edge(fh,index))); + CGAL_assertion(!p_cdt->is_infinite(fh)); // go into the new face const typename CDT::Face_handle nfh(fh->neighbor(index)); - assert(!p_cdt->is_infinite(nfh)); + CGAL_assertion(!p_cdt->is_infinite(nfh)); // get indices of neighbors int nindex = nfh->index(fh); // index of new vertex and old face @@ -426,9 +427,9 @@ private: const typename CDT::Vertex_handle nvh(nfh->vertex(nindex)); const typename CDT::Vertex_handle rvh(nfh->vertex(p_cdt->cw (nindex))); const typename CDT::Vertex_handle lvh(nfh->vertex(p_cdt->ccw(nindex))); - assert(!p_cdt->is_infinite(nvh)); - assert(!p_cdt->is_infinite(lvh)); - assert(!p_cdt->is_infinite(rvh)); + CGAL_assertion(!p_cdt->is_infinite(nvh)); + CGAL_assertion(!p_cdt->is_infinite(lvh)); + CGAL_assertion(!p_cdt->is_infinite(rvh)); // get edges seen from entering edge typename CDT::Edge re = get_edge(nfh,p_cdt->ccw(nindex)); @@ -476,7 +477,7 @@ private: } break; default: - assert(orient == CGAL::COLLINEAR); + CGAL_assertion(orient == CGAL::COLLINEAR); // looking on nvh, so it must be reported // if it wasn't already (triangles rotate around vh) if(vh != nvh){ @@ -505,12 +506,12 @@ private: const { // the expanded edge should not be constrained - assert(!p_cdt->is_constrained(get_edge(fh,index))); - assert(!p_cdt->is_infinite(fh)); + CGAL_assertion(!p_cdt->is_constrained(get_edge(fh,index))); + CGAL_assertion(!p_cdt->is_infinite(fh)); // go into the new face const typename CDT::Face_handle nfh(fh->neighbor(index)); - assert(!p_cdt->is_infinite(nfh)); + CGAL_assertion(!p_cdt->is_infinite(nfh)); // get indices of neighbors int nindex = nfh->index(fh); // index of new vertex and old face @@ -521,9 +522,9 @@ private: const typename CDT::Vertex_handle nvh(nfh->vertex(nindex)); const typename CDT::Vertex_handle rvh(nfh->vertex(p_cdt->cw (nindex))); const typename CDT::Vertex_handle lvh(nfh->vertex(p_cdt->ccw(nindex))); - assert(!p_cdt->is_infinite(nvh)); - assert(!p_cdt->is_infinite(lvh)); - assert(!p_cdt->is_infinite(rvh)); + CGAL_assertion(!p_cdt->is_infinite(nvh)); + CGAL_assertion(!p_cdt->is_infinite(lvh)); + CGAL_assertion(!p_cdt->is_infinite(rvh)); // get edges seen from entering edge typename CDT::Edge re = get_edge(nfh,p_cdt->ccw(nindex)); @@ -535,9 +536,9 @@ private: CGAL::Orientation ro = orientation(q,right,nvh->point()); CGAL::Orientation lo = orientation(q,left ,nvh->point()); - assert(typename K::Orientation_2()(q,left ,lvh->point()) + CGAL_assertion(typename K::Orientation_2()(q,left ,lvh->point()) != CGAL::CLOCKWISE); - assert(typename K::Orientation_2()(q,right,rvh->point()) + CGAL_assertion(typename K::Orientation_2()(q,right,rvh->point()) != CGAL::COUNTERCLOCKWISE); //std::cout << (ro == CGAL::COUNTERCLOCKWISE) << " " << @@ -588,7 +589,7 @@ private: *oit++ = nvh->point(); } if(!Regularization_category::value){ - assert(!(ro == CGAL::COLLINEAR && lo == CGAL::COLLINEAR)); + CGAL_assertion(!(ro == CGAL::COLLINEAR && lo == CGAL::COLLINEAR)); // we have to check whether a needle starts here. if(p_cdt->is_constrained(le) && !p_cdt->is_constrained(re) && ro == CGAL::COLLINEAR) @@ -676,7 +677,7 @@ private: ); } - assert(out_arr.number_of_faces() == 2); + CGAL_assertion(out_arr.number_of_faces() == 2); if(out_arr.faces_begin()->is_unbounded()) return ++out_arr.faces_begin();