assert -> CGAL_assertion

This commit is contained in:
Andreas Fabri 2015-08-27 16:51:55 +02:00
parent e9df6fa6cf
commit 1e2ff1131e
39 changed files with 179 additions and 155 deletions

View File

@ -148,7 +148,7 @@ namespace CGAL {
if(first_vertex != S.triangulation_3().finite_vertices_end()) { if(first_vertex != S.triangulation_3().finite_vertices_end()) {
pos = first_vertex; pos = first_vertex;
pos->set_post_mark(mark); pos->set_post_mark(mark);
assert(pos->is_on_border()); CGAL_assertion(pos->is_on_border());
} else { } else {
pos = NULL; pos = NULL;
@ -469,7 +469,7 @@ namespace CGAL {
inline void set_interior_edge(Vertex_handle w, Vertex_handle v) inline void set_interior_edge(Vertex_handle w, Vertex_handle v)
{ {
if(w->m_ie_last == ie_sentinel){ // empty set 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_last = interior_edges.insert(w->m_ie_last, v);
w->m_ie_first = w->m_ie_last; w->m_ie_first = w->m_ie_last;
} else { } else {
@ -477,7 +477,7 @@ namespace CGAL {
e++; e++;
#ifdef DEBUG #ifdef DEBUG
typename std::list<Vertex_handle>::iterator r = std::find(w->m_ie_first, e, v); typename std::list<Vertex_handle>::iterator r = std::find(w->m_ie_first, e, v);
assert(r == e); CGAL_assertion(r == e);
#endif #endif
w->m_ie_last = interior_edges.insert(e, v); 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) inline void remove_interior_edge(Vertex_handle w, Vertex_handle v)
{ {
if(w->m_ie_first == ie_sentinel){ 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 } else if(w->m_ie_first == w->m_ie_last){ // there is only one element
if(*(w->m_ie_first) == v){ if(*(w->m_ie_first) == v){
interior_edges.erase(w->m_ie_first); 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) inline void set_incidence_request(Vertex_handle w, const Incidence_request_elt& ir)
{ {
if(w->m_ir_last == sentinel ){ 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_last = incidence_requests.insert(w->m_ir_last, ir);
w->m_ir_first = w->m_ir_last; w->m_ir_first = w->m_ir_last;
} else { } else {
@ -529,7 +529,7 @@ namespace CGAL {
inline bool is_incidence_requested(Vertex_handle w) const inline bool is_incidence_requested(Vertex_handle w) const
{ {
if(w->m_ir_last == sentinel ){ 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 ); return (w->m_ir_last != sentinel );
} }
@ -542,7 +542,7 @@ namespace CGAL {
inline Incidence_request_iterator incidence_request_end(Vertex_handle w) inline Incidence_request_iterator incidence_request_end(Vertex_handle w)
{ {
if(w->m_ir_last != sentinel ){ 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); Incidence_request_iterator it(w->m_ir_last);
it++; it++;
return it; return it;
@ -553,7 +553,7 @@ namespace CGAL {
inline void erase_incidence_request(Vertex_handle w) inline void erase_incidence_request(Vertex_handle w)
{ {
if(w->m_ir_last != sentinel ){ if(w->m_ir_last != sentinel ){
assert(w->m_ir_first != sentinel ); CGAL_assertion(w->m_ir_first != sentinel );
w->m_ir_last++; w->m_ir_last++;
incidence_requests.erase(w->m_ir_first, w->m_ir_last); incidence_requests.erase(w->m_ir_first, w->m_ir_last);
w->m_ir_first = sentinel ; w->m_ir_first = sentinel ;
@ -570,7 +570,7 @@ namespace CGAL {
} }
if(w->m_ir_first != sentinel ){ 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); typename std::list< Incidence_request_elt >::iterator b(w->m_ir_first), e(w->m_ir_last);
e++; e++;
incidence_requests.erase(b, e); incidence_requests.erase(b, e);
@ -627,14 +627,14 @@ namespace CGAL {
w->delete_border(); w->delete_border();
} }
if(w->m_ir_first != sentinel ){ 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); typename std::list< Incidence_request_elt >::iterator b(w->m_ir_first), e(w->m_ir_last);
e++; e++;
incidence_requests.erase(b, e); incidence_requests.erase(b, e);
} }
if(w->m_ie_first != ie_sentinel){ 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<Vertex_handle>::iterator b(w->m_ie_first), e(w->m_ie_last); typename std::list<Vertex_handle>::iterator b(w->m_ie_first), e(w->m_ie_last);
e++; e++;
interior_edges.erase(b, e); interior_edges.erase(b, e);
@ -2186,7 +2186,7 @@ namespace CGAL {
{ {
_facet_number--; _facet_number--;
assert(c->is_selected_facet(index)); CGAL_assertion(c->is_selected_facet(index));
unselect_facet(c, index); unselect_facet(c, index);
Facet f32 = Facet f32 =

View File

@ -134,7 +134,7 @@ namespace CGAL {
tds.set_adjacency(fn, 2, inf_edge_map); tds.set_adjacency(fn, 2, inf_edge_map);
edge_map.erase(edge_map.begin()); edge_map.erase(edge_map.begin());
} }
CGAL_triangulation_assertion(inf_edge_map.empty()); CGAL_assertion(inf_edge_map.empty());
} }
tds.reorient_faces(); tds.reorient_faces();
return vinf; return vinf;

View File

@ -122,7 +122,7 @@ namespace CGAL {
tds.set_adjacency(fn, 2, inf_edge_map); tds.set_adjacency(fn, 2, inf_edge_map);
edge_map.erase(edge_map.begin()); edge_map.erase(edge_map.begin());
} }
CGAL_triangulation_assertion(inf_edge_map.empty()); CGAL_assertion(inf_edge_map.empty());
} }

View File

@ -35,6 +35,7 @@
#include <CGAL/basic.h> #include <CGAL/basic.h>
#include <CGAL/assertions.h>
#include <CGAL/Cache.h> #include <CGAL/Cache.h>
#include <CGAL/function_objects.h> #include <CGAL/function_objects.h>
#include <CGAL/Handle_with_policy.h> #include <CGAL/Handle_with_policy.h>
@ -904,7 +905,7 @@ private:
break; break;
} }
default:{ default:{
assert(false); // !!! Never reached CGAL_assertion(false); // !!! Never reached
} }
} }
} }

View File

@ -20,7 +20,7 @@
#ifndef CGAL_INTERNAL_LAZY_ALPHA_NT_2_H #ifndef CGAL_INTERNAL_LAZY_ALPHA_NT_2_H
#define CGAL_INTERNAL_LAZY_ALPHA_NT_2_H #define CGAL_INTERNAL_LAZY_ALPHA_NT_2_H
#include <CGAL/assertions.h>
#include <CGAL/Weighted_alpha_shape_euclidean_traits_2.h> #include <CGAL/Weighted_alpha_shape_euclidean_traits_2.h>
#include <boost/shared_ptr.hpp> #include <boost/shared_ptr.hpp>
#include <boost/mpl/has_xxx.hpp> #include <boost/mpl/has_xxx.hpp>
@ -139,7 +139,7 @@ public:
exact_ = Exact_squared_radius()( to_exact(*data()[0]),to_exact(*data()[1]),to_exact(*data()[2]) ); exact_ = Exact_squared_radius()( to_exact(*data()[0]),to_exact(*data()[1]),to_exact(*data()[2]) );
break; break;
default: default:
assert(false); CGAL_assertion(false);
} }
updated=true; updated=true;
} }
@ -156,7 +156,7 @@ public:
approx_ = Approx_squared_radius()( to_approx(*data()[0]),to_approx(*data()[1]),to_approx(*data()[2]) ); approx_ = Approx_squared_radius()( to_approx(*data()[0]),to_approx(*data()[1]),to_approx(*data()[2]) );
break; break;
default: default:
assert(false); CGAL_assertion(false);
} }
} }

View File

@ -21,6 +21,7 @@
#ifndef CGAL_INTERNAL_LAZY_ALPHA_NT_3_H #ifndef CGAL_INTERNAL_LAZY_ALPHA_NT_3_H
#define CGAL_INTERNAL_LAZY_ALPHA_NT_3_H #define CGAL_INTERNAL_LAZY_ALPHA_NT_3_H
#include <CGAL/assertions.h>
#include <CGAL/Regular_triangulation_euclidean_traits_3.h> #include <CGAL/Regular_triangulation_euclidean_traits_3.h>
#include <boost/shared_ptr.hpp> #include <boost/shared_ptr.hpp>
#include <boost/type_traits.hpp> #include <boost/type_traits.hpp>
@ -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]) ); exact_ = Exact_squared_radius()( to_exact(*data()[0]),to_exact(*data()[1]),to_exact(*data()[2]),to_exact(*data()[3]) );
break; break;
default: default:
assert(false); CGAL_assertion(false);
} }
updated=true; 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]) ); approx_ = Approx_squared_radius()( to_approx(*data()[0]),to_approx(*data()[1]),to_approx(*data()[2]),to_approx(*data()[3]) );
break; break;
default: default:
assert(false); CGAL_assertion(false);
} }
} }

View File

@ -553,13 +553,13 @@ public:
Comparison_result operator() (const Vertical_segment & cv1, Comparison_result operator() (const Vertical_segment & cv1,
const Non_vertical_x_curve_2 & cv2) const const Non_vertical_x_curve_2 & cv2) const
{ {
assert(false); CGAL_assertion(false);
return CGAL::SMALLER; return CGAL::SMALLER;
} }
Comparison_result operator() (const Non_vertical_x_curve_2& cv1, Comparison_result operator() (const Non_vertical_x_curve_2& cv1,
const Vertical_segment & cv2) const const Vertical_segment & cv2) const
{ {
assert(false); CGAL_assertion(false);
return CGAL::LARGER; return CGAL::LARGER;
} }
Comparison_result operator() (const Vertical_segment & cv1, Comparison_result operator() (const Vertical_segment & cv1,

View File

@ -24,6 +24,7 @@
#include <CGAL/Arr_rat_arc/Base_rational_arc_ds_1.h> #include <CGAL/Arr_rat_arc/Base_rational_arc_ds_1.h>
#include <CGAL/Arr_rat_arc/Rational_function.h> #include <CGAL/Arr_rat_arc/Rational_function.h>
#include <CGAL/Handle_with_policy.h> #include <CGAL/Handle_with_policy.h>
#include <CGAL/assertions.h>
namespace CGAL { namespace CGAL {
namespace Arr_rational_arc { namespace Arr_rational_arc {
@ -69,7 +70,7 @@ public:
#if 1 #if 1
solve_1(_resultant,std::back_inserter(rm_vec)); solve_1(_resultant,std::back_inserter(rm_vec));
#else #else
assert(false); CGAL_assertion(false);
// don't use this code yet since g and resultant/g may still have a // don't use this code yet since g and resultant/g may still have a
// common root // common root
if( CGAL::internal::may_have_common_factor(_f.denom(),_g.denom())){ if( CGAL::internal::may_have_common_factor(_f.denom(),_g.denom())){

View File

@ -20,9 +20,11 @@
#ifndef SINGLETON_H_ #ifndef CGAL_SINGLETON_H_
#define SINGLETON_H_ #define SINGLETON_H_
#include <CGAL/assertions.h>
namespace CGAL { namespace CGAL {
namespace Arr_rational_arc { namespace Arr_rational_arc {
template <class T> template <class T>
@ -33,7 +35,7 @@ public:
{ {
if(!m_pInstance) if(!m_pInstance)
m_pInstance = new T; m_pInstance = new T;
assert(m_pInstance !=NULL); CGAL_assertion(m_pInstance !=NULL);
return m_pInstance; return m_pInstance;
} }
@ -53,4 +55,4 @@ template <class T> T* Singleton<T>::m_pInstance=NULL;
} // namespace Arr_rational_arc } // namespace Arr_rational_arc
} //namespace CGAL { } //namespace CGAL {
#endif // SINGLETON_H_ #endif // CGAL_SINGLETON_H_

View File

@ -21,6 +21,7 @@
#ifndef CGAL_ARR_RATIONAL_ARC_TRAITS_D_1_H #ifndef CGAL_ARR_RATIONAL_ARC_TRAITS_D_1_H
#define CGAL_ARR_RATIONAL_ARC_TRAITS_D_1_H #define CGAL_ARR_RATIONAL_ARC_TRAITS_D_1_H
#include <CGAL/assertions.h>
#include <CGAL/tags.h> #include <CGAL/tags.h>
#include <CGAL/Fraction_traits.h> #include <CGAL/Fraction_traits.h>
#include <CGAL/Arr_tags.h> #include <CGAL/Arr_tags.h>
@ -1295,7 +1296,7 @@ public:
Approximate_number_type operator()(const Point_2& p, int i){ Approximate_number_type operator()(const Point_2& p, int i){
if(i==0) return approx_x(p); if(i==0) return approx_x(p);
if(i==1) return approx_y(p); if(i==1) return approx_y(p);
assert(false); CGAL_assertion(false);
return Approximate_number_type(0); return Approximate_number_type(0);
} }
}; };

View File

@ -34,6 +34,7 @@
#include <CGAL/Arr_topology_traits/Arr_unb_planar_batched_pl_helper.h> #include <CGAL/Arr_topology_traits/Arr_unb_planar_batched_pl_helper.h>
#include <CGAL/Arr_topology_traits/Arr_unb_planar_vert_decomp_helper.h> #include <CGAL/Arr_topology_traits/Arr_unb_planar_vert_decomp_helper.h>
#include <CGAL/Arr_topology_traits/Arr_inc_insertion_zone_visitor.h> #include <CGAL/Arr_topology_traits/Arr_inc_insertion_zone_visitor.h>
#include <CGAL/assertions.h>
namespace CGAL { namespace CGAL {
@ -507,7 +508,7 @@ public:
*/ */
const Face* reference_face() const 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(); return v_tr->halfedge()->outer_ccb()->face();
} }
@ -519,7 +520,7 @@ public:
*/ */
Face* reference_face() 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(); return v_tr->halfedge()->outer_ccb()->face();
} }

View File

@ -1095,7 +1095,7 @@ collapse_edge(typename boost::graph_traits<Graph>::edge_descriptor v0v1,
remove_vertex(p,g); remove_vertex(p,g);
Halfedge_around_target_circulator<Graph> beg(ppt,g), end(pqb,g); Halfedge_around_target_circulator<Graph> beg(ppt,g), end(pqb,g);
while(beg != end){ while(beg != end){
assert(target(*beg,g) == p); CGAL_assertion(target(*beg,g) == p);
set_target(*beg,q,g); set_target(*beg,q,g);
--beg; --beg;
} }
@ -1322,7 +1322,7 @@ flip_edge(typename boost::graph_traits<Graph>::halfedge_descriptor h,
vertex_descriptor s2 = target(nh,g), t2 = target(noh,g); vertex_descriptor s2 = target(nh,g), t2 = target(noh,g);
face_descriptor fh = face(h,g), foh = face(oh,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){ if(halfedge(s,g) == oh){
set_halfedge(s,nnh,g); set_halfedge(s,nnh,g);

View File

@ -30,6 +30,7 @@
#include <CGAL/boost/graph/iterator.h> #include <CGAL/boost/graph/iterator.h>
#include <CGAL/Iterator_range.h> #include <CGAL/Iterator_range.h>
#include <CGAL/boost/graph/helpers.h> #include <CGAL/boost/graph/helpers.h>
#include <CGAL/assertions.h>
#include <OpenMesh/Core/Mesh/PolyMesh_ArrayKernelT.hh> #include <OpenMesh/Core/Mesh/PolyMesh_ArrayKernelT.hh>
@ -540,7 +541,7 @@ template <typename K>
void void
clear_vertex(typename boost::graph_traits<OpenMesh::PolyMesh_ArrayKernelT<K> >::vertex_descriptor, clear_vertex(typename boost::graph_traits<OpenMesh::PolyMesh_ArrayKernelT<K> >::vertex_descriptor,
OpenMesh::PolyMesh_ArrayKernelT<K>&) { OpenMesh::PolyMesh_ArrayKernelT<K>&) {
assert(false); CGAL_assert(false);
} }
*/ */

View File

@ -29,7 +29,7 @@
#include <CGAL/boost/graph/iterator.h> #include <CGAL/boost/graph/iterator.h>
#include <CGAL/Surface_mesh.h> #include <CGAL/Surface_mesh.h>
#include <CGAL/assertions.h>
namespace boost { namespace boost {
@ -445,7 +445,7 @@ template <typename P>
void void
clear_vertex(typename boost::graph_traits<CGAL::Surface_mesh<P> >::vertex_descriptor, clear_vertex(typename boost::graph_traits<CGAL::Surface_mesh<P> >::vertex_descriptor,
CGAL::Surface_mesh<P>&) { CGAL::Surface_mesh<P>&) {
assert(false); CGAL_assertion(false);
} }
*/ */

View File

@ -36,6 +36,7 @@
#define _CORE_BIGFLOAT_H_ #define _CORE_BIGFLOAT_H_
#include <CGAL/CORE/BigFloatRep.h> #include <CGAL/CORE/BigFloatRep.h>
#include <CGAL/assertions.h>
namespace CORE { namespace CORE {
@ -246,7 +247,7 @@ public:
/** \note This is only the sign of the mantissa, it can be taken to be /** \note This is only the sign of the mantissa, it can be taken to be
the sign of the BigFloat only if !(isZeroIn()). */ the sign of the BigFloat only if !(isZeroIn()). */
int sign() const { int sign() const {
assert((err() == 0 && m() == 0) || !(isZeroIn())); CGAL_assertion((err() == 0 && m() == 0) || !(isZeroIn()));
return rep->signM(); return rep->signM();
} }
/// check whether contains zero /// check whether contains zero
@ -553,7 +554,7 @@ inline bool isDivisible(double x, double y) {
// normalizing it then we get zero. // normalizing it then we get zero.
inline BigFloat div_exact(const BigFloat& x, const BigFloat& y) { inline BigFloat div_exact(const BigFloat& x, const BigFloat& y) {
BigInt z; BigInt z;
assert (isDivisible(x,y)); CGAL_assertion (isDivisible(x,y));
unsigned long bin_x = getBinExpo(x.m()); unsigned long bin_x = getBinExpo(x.m());
unsigned long bin_y = getBinExpo(y.m()); unsigned long bin_y = getBinExpo(y.m());

View File

@ -40,6 +40,7 @@
#define _CORE_EXPR_H_ #define _CORE_EXPR_H_
#include <CGAL/CORE/ExprRep.h> #include <CGAL/CORE/ExprRep.h>
#include <CGAL/assertions.h>
namespace CORE { namespace CORE {
@ -534,7 +535,7 @@ inline Expr rootOf(const Polynomial<NT>& p, int x, int y) {
* */ * */
template <class NT> template <class NT>
inline Expr radical(const NT& n, int m) { 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) if (n == 0 || n == 1 || m == 1)
return Expr(n); return Expr(n);
Polynomial<NT> Q(m); Polynomial<NT> Q(m);

View File

@ -39,6 +39,7 @@
#define _CORE_FILTER_H_ #define _CORE_FILTER_H_
#include <CGAL/config.h> #include <CGAL/config.h>
#include <CGAL/assertions.h>
#include <CGAL/CORE/Real.h> #include <CGAL/CORE/Real.h>
#include <cmath> #include <cmath>
@ -111,7 +112,7 @@ public:
before call this function.) */ before call this function.) */
int sign() const { int sign() const {
#ifdef CORE_DEBUG #ifdef CORE_DEBUG
assert(isOK()); CGAL_assertion(isOK());
#endif #endif
if (fpVal == 0.0) if (fpVal == 0.0)
return 0; return 0;

View File

@ -36,6 +36,7 @@
#include <new> // for placement new #include <new> // for placement new
#include <cassert> #include <cassert>
#include <CGAL/assertions.h>
namespace CORE { namespace CORE {
@ -96,7 +97,7 @@ void* MemoryPool< T, nObjects >::allocate(std::size_t) {
template< class T, int nObjects > template< class T, int nObjects >
void MemoryPool< T, nObjects >::free(void* t) { void MemoryPool< T, nObjects >::free(void* t) {
assert(t != 0); CGAL_assertion(t != 0);
if (t == 0) return; // for safety if (t == 0) return; // for safety
// recycle the object memory, by putting it back into the chain // recycle the object memory, by putting it back into the chain

View File

@ -192,7 +192,7 @@ BiPoly<NT>::~BiPoly(){
//Sets the input BiPoly to X^n //Sets the input BiPoly to X^n
template <class NT> template <class NT>
void BiPoly<NT>::constructX(int n, BiPoly<NT>& P){ void BiPoly<NT>::constructX(int n, BiPoly<NT>& P){
assert(n>= -1); CGAL_assertion(n>= -1);
P.deleteCoeffX();//Clear the present coeffecients P.deleteCoeffX();//Clear the present coeffecients
Polynomial<NT> q(n);//Nominal degree n Polynomial<NT> q(n);//Nominal degree n
q.setCoeff(n,NT(1)); q.setCoeff(n,NT(1));
@ -807,7 +807,7 @@ BiPoly<NT> & BiPoly<NT>::differentiateX() {
template <class NT> template <class NT>
BiPoly<NT> & BiPoly<NT>::differentiateXY(int m, int n) {//m times wrt X and n times wrt Y BiPoly<NT> & BiPoly<NT>::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++) for(int i=1; i <=m; i++)
(*this).differentiateX(); (*this).differentiateX();
for(int i=1; i <=n; i++) for(int i=1; i <=n; i++)
@ -1158,7 +1158,7 @@ int Curve<NT>::verticalIntersections(const BigFloat & x, BFVecInterval & vI,
// This returns a NULL vI, which should be caught by caller // This returns a NULL vI, which should be caught by caller
Polynomial<Expr> PY = this->yExprPolynomial(x); // should be replaced Polynomial<Expr> PY = this->yExprPolynomial(x); // should be replaced
// assert(x.isExact()); // CGAL_assertion(x.isExact());
// Polynomial<BigFloat> PY = yBFPolynomial(x); // unstable still // Polynomial<BigFloat> PY = yBFPolynomial(x); // unstable still
d = PY.getTrueDegree(); d = PY.getTrueDegree();
@ -1205,9 +1205,9 @@ int Curve<NT>::plot( BigFloat eps, BigFloat x1,
const char* filename[] = {"data/input", "data/plot", "data/plot2"}; const char* filename[] = {"data/input", "data/plot", "data/plot2"};
assert(eps.isExact()); // important for plotting... CGAL_assertion(eps.isExact()); // important for plotting...
assert(x1.isExact()); CGAL_assertion(x1.isExact());
assert(y1.isExact()); CGAL_assertion(y1.isExact());
ofstream outFile; ofstream outFile;
outFile.open(filename[fileNo]); // ought to check if open is successful! outFile.open(filename[fileNo]); // ought to check if open is successful!
@ -1230,7 +1230,7 @@ int Curve<NT>::plot( BigFloat eps, BigFloat x1,
outFile << "0.99 \t 0.99 \t 0.99" << std::endl; outFile << "0.99 \t 0.99 \t 0.99" << std::endl;
outFile << 0 << "\t" << y1 << std::endl; outFile << 0 << "\t" << y1 << std::endl;
outFile << 0 << "\t" << y2 << 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) int aprec = -(eps.lMSB()).toLong(); // By definition, eps.lMSB() <= lg(eps)
BigFloat xCurr = x1; BigFloat xCurr = x1;

View File

@ -60,6 +60,7 @@
#include <CGAL/CORE/BigFloat.h> #include <CGAL/CORE/BigFloat.h>
#include <CGAL/CORE/Promote.h> #include <CGAL/CORE/Promote.h>
#include <vector> #include <vector>
#include <CGAL/assertions.h>
namespace CORE { namespace CORE {
using namespace std; using namespace std;
@ -412,7 +413,7 @@ template < class NT >
CORE_INLINE CORE_INLINE
const NT& Polynomial<NT>::getCoeff(int i) const { const NT& Polynomial<NT>::getCoeff(int i) const {
//if (i > degree) return NULL; //if (i > degree) return NULL;
assert(i <= degree); CGAL_assertion(i <= degree);
return coeff[i]; return coeff[i];
} }
// set functions // set functions

View File

@ -67,7 +67,7 @@ Polynomial<NT>::Polynomial(void) {
//Creates a polynomial with nominal degree n //Creates a polynomial with nominal degree n
template <class NT> template <class NT>
Polynomial<NT>::Polynomial(int n) { Polynomial<NT>::Polynomial(int n) {
assert(n>= -1); CGAL_assertion(n>= -1);
degree = n; degree = n;
if (n == -1) if (n == -1)
return; // return the zero polynomial! return; // return the zero polynomial!
@ -80,7 +80,7 @@ Polynomial<NT>::Polynomial(int n) {
template <class NT> template <class NT>
Polynomial<NT>::Polynomial(int n, const NT * c) { Polynomial<NT>::Polynomial(int n, const NT * c) {
//assert("array c has n+1 elements"); //CGAL_assertion("array c has n+1 elements");
degree = n; degree = n;
if (n >= 0) { if (n >= 0) {
coeff = new NT[n+1]; coeff = new NT[n+1];
@ -113,7 +113,7 @@ Polynomial<NT>::Polynomial(const Polynomial<NT> & p):degree(-1) {
/////////////////////////////////////// ///////////////////////////////////////
template <class NT> template <class NT>
Polynomial<NT>::Polynomial(int n, const char * s[]) { Polynomial<NT>::Polynomial(int n, const char * s[]) {
//assert("array s has n+1 elements"); //CGAL_assertion("array s has n+1 elements");
degree = n; degree = n;
if (n >= 0) { if (n >= 0) {
coeff = new NT[n+1]; coeff = new NT[n+1];
@ -826,7 +826,7 @@ template <>
CORE_INLINE CORE_INLINE
BigFloat Polynomial<BigInt>::evalApprox(const BigFloat& /*f*/, BigFloat Polynomial<BigInt>::evalApprox(const BigFloat& /*f*/,
const extLong& /*r*/, const extLong& /*a*/) const { // evaluation const extLong& /*r*/, const extLong& /*a*/) const { // evaluation
assert(0); CGAL_assertion(0);
return BigFloat(0); return BigFloat(0);
} }
@ -861,7 +861,7 @@ BigFloat Polynomial<BigInt>::evalApprox(const BigFloat& /*f*/,
template <class NT> template <class NT>
BigFloat Polynomial<NT>::evalExactSign(const BigFloat& val, BigFloat Polynomial<NT>::evalExactSign(const BigFloat& val,
const extLong& oldMSB) const { const extLong& oldMSB) const {
assert(val.isExact()); CGAL_assertion(val.isExact());
if (getTrueDegree() == -1) if (getTrueDegree() == -1)
return BigFloat(0); return BigFloat(0);
@ -1063,7 +1063,7 @@ Polynomial<NT> & Polynomial<NT>::differentiate() { // self-differentiation
// multi-differentiate // multi-differentiate
template <class NT> template <class NT>
Polynomial<NT> & Polynomial<NT>::differentiate(int n) { Polynomial<NT> & Polynomial<NT>::differentiate(int n) {
assert(n >= 0); CGAL_assertion(n >= 0);
for (int i=1; i<=n; i++) for (int i=1; i<=n; i++)
this->differentiate(); this->differentiate();
return *this; return *this;
@ -1128,7 +1128,7 @@ template <class NT>
Polynomial<NT> & Polynomial<NT>::primPart() { Polynomial<NT> & Polynomial<NT>::primPart() {
// ASSERT: GCD must be provided by NT // ASSERT: GCD must be provided by NT
int d = getTrueDegree(); int d = getTrueDegree();
assert (d >= 0); CGAL_assertion (d >= 0);
if (d == 0) { if (d == 0) {
if (coeff[0] > 0) coeff[0] = 1; if (coeff[0] > 0) coeff[0] = 1;
else coeff[0] = -1; else coeff[0] = -1;
@ -1371,7 +1371,7 @@ Polynomial<NT> differentiate(const Polynomial<NT> & p) { // differentiate
template <class NT> template <class NT>
Polynomial<NT> differentiate(const Polynomial<NT> & p, int n) {//multi-differentiate Polynomial<NT> differentiate(const Polynomial<NT> & p, int n) {//multi-differentiate
Polynomial<NT> q(p); Polynomial<NT> q(p);
assert(n >= 0); CGAL_assertion(n >= 0);
for (int i=1; i<=n; i++) for (int i=1; i<=n; i++)
q.differentiate(); q.differentiate();
return q; return q;
@ -1491,7 +1491,7 @@ NT res(Polynomial<NT> p, Polynomial<NT> q) {
template <class NT> template <class NT>
NT psc(int i,Polynomial<NT> p, Polynomial<NT> q) { NT psc(int i,Polynomial<NT> p, Polynomial<NT> q) {
assert(i >= 0); CGAL_assertion(i >= 0);
if(i == 0) if(i == 0)
return res(p,q); return res(p,q);

View File

@ -59,6 +59,7 @@
#ifndef CORE_STURM_H #ifndef CORE_STURM_H
#define CORE_STURM_H #define CORE_STURM_H
#include <CGAL/assertions.h>
#include "CGAL/CORE/BigFloat.h" #include "CGAL/CORE/BigFloat.h"
#include "CGAL/CORE/Expr.h" #include "CGAL/CORE/Expr.h"
#include "CGAL/CORE/poly/Poly.h" #include "CGAL/CORE/poly/Poly.h"
@ -205,7 +206,7 @@ public:
// where sx = sign of evaluating seq[0] at x // where sx = sign of evaluating seq[0] at x
// PRE-CONDITION: sx != 0 and len > 0 // PRE-CONDITION: sx != 0 and len > 0
int signVariations(const BigFloat & x, int sx) const { int signVariations(const BigFloat & x, int sx) const {
assert((sx != 0) && (len >0)); CGAL_assertion((sx != 0) && (len >0));
int cnt = 0; int cnt = 0;
int last_sign = sx; int last_sign = sx;
for (int i=1; i<=len; i++) {// Chee (4/29/04): Bug fix, for (int i=1; i<=len; i++) {// Chee (4/29/04): Bug fix,
@ -237,7 +238,7 @@ public:
if (len <= 0) return len; if (len <= 0) return len;
int cnt = 0; int cnt = 0;
int last_sign = sign(seq[0].coeff[seq[0].getTrueDegree()]); 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++) { for (int i=1; i<=len; i++) {
int sgn = sign(seq[i].coeff[seq[i].getTrueDegree()]); int sgn = sign(seq[i].coeff[seq[i].getTrueDegree()]);
if (sgn*last_sign < 0) if (sgn*last_sign < 0)
@ -255,7 +256,7 @@ public:
int last_sign = sign(seq[0].coeff[seq[0].getTrueDegree()]); int last_sign = sign(seq[0].coeff[seq[0].getTrueDegree()]);
if (seq[0].getTrueDegree() % 2 != 0) if (seq[0].getTrueDegree() % 2 != 0)
last_sign *= -1; last_sign *= -1;
assert(last_sign != 0); CGAL_assertion(last_sign != 0);
for (int i=1; i<=len; i++) { for (int i=1; i<=len; i++) {
int parity = (seq[i].getTrueDegree() % 2 == 0) ? 1 : -1; int parity = (seq[i].getTrueDegree() % 2 == 0) ? 1 : -1;
int sgn = parity * sign(seq[i].coeff[seq[i].getTrueDegree()]); int sgn = parity * sign(seq[i].coeff[seq[i].getTrueDegree()]);
@ -275,7 +276,7 @@ public:
// "x.makeExact(); y.makeExact()" before calling]. // "x.makeExact(); y.makeExact()" before calling].
/////////////////////////////////////////// ///////////////////////////////////////////
int numberOfRoots(const BigFloat &x, const BigFloat &y) const { 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! if (len <= 0) return len; // return of -1 means infinity of roots!
int signx = sign(seq[0].evalExactSign(x)); int signx = sign(seq[0].evalExactSign(x));
if (x == y) return ((signx == 0) ? 1 : 0); if (x == y) return ((signx == 0) ? 1 : 0);
@ -354,7 +355,7 @@ public:
*/ */
void isolateRoots(const BigFloat &x, const BigFloat &y, void isolateRoots(const BigFloat &x, const BigFloat &y,
BFVecInterval &v) const { BFVecInterval &v) const {
assert(x<=y); CGAL_assertion(x<=y);
int n = numberOfRoots(x,y); int n = numberOfRoots(x,y);
if (n == 0) return; if (n == 0) return;
@ -767,7 +768,7 @@ public:
// says that z is a robust approximate zero). // says that z is a robust approximate zero).
// //
bool smaleBoundTest(const BigFloat& z){ 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 #ifdef CORE_DEBUG
std::cout <<"Computing Smale's bound = " << std::endl; std::cout <<"Computing Smale's bound = " << std::endl;
@ -869,7 +870,7 @@ std::cout << "In newtonRefine, input J=" << J.first
return J; return J;
} }
assert( leftSign * rightSign < 0 ); CGAL_assertion( leftSign * rightSign < 0 );
//N is number of times Newton is called without checking //N is number of times Newton is called without checking
// whether the result is still in the interval or not // 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; << J.first.err() << " Err at end = " << J.second.err() << std::endl;
#endif #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 #ifdef CORE_DEBUG_NEWTON
if (seq[0].evalExactSign(J.first) * seq[0].evalExactSign(J.second) > 0) if (seq[0].evalExactSign(J.first) * seq[0].evalExactSign(J.second) > 0)

View File

@ -37,6 +37,7 @@ typedef unsigned int uint;
#include <CGAL/tuple.h> #include <CGAL/tuple.h>
#include<CGAL/Exact_circular_kernel_2.h> #include<CGAL/Exact_circular_kernel_2.h>
#include <CGAL/Cartesian_converter.h> #include <CGAL/Cartesian_converter.h>
#include <CGAL/assertions.h>
#include <boost/utility.hpp> #include <boost/utility.hpp>
@ -538,10 +539,10 @@ public:
++next_s; if (next_s==map_theta.end()) next_s=map_theta.begin(); ++next_s; if (next_s==map_theta.end()) next_s=map_theta.begin();
do{ do{
if (current->second.first==OTRG) return; 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)); draw_in_ipe(Circular_arc_2(circle,*(current->second.second),*(next_s->second.second),CGAL::COUNTERCLOCKWISE));
if (next_s->second.first==OTRG) return; 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(); ++next_s; if (next_s==map_theta.end()) next_s=map_theta.begin();
current=next_s; current=next_s;
++next_s; if (next_s==map_theta.end()) next_s=map_theta.begin(); ++next_s; if (next_s==map_theta.end()) next_s=map_theta.begin();
@ -843,7 +844,7 @@ public:
switch (ints.size()){ switch (ints.size()){
case 1: case 1:
ok=CGAL::assign(tmp_pt,ints[0]); ok=CGAL::assign(tmp_pt,ints[0]);
assert(ok); CGAL_assertion(ok);
points.push_back(tmp_pt); points.push_back(tmp_pt);
index=points.size()-1; index=points.size()-1;
indices[i]=index; indices[i]=index;
@ -852,12 +853,12 @@ public:
case 2: case 2:
int right_ind=i<2?0:1; int right_ind=i<2?0:1;
ok=CGAL::assign(tmp_pt,ints[right_ind]); ok=CGAL::assign(tmp_pt,ints[right_ind]);
assert(ok); CGAL_assertion(ok);
points.push_back(tmp_pt); points.push_back(tmp_pt);
index=points.size()-1; index=points.size()-1;
indices[i]=index; indices[i]=index;
ok=CGAL::assign(tmp_pt,ints[(right_ind+1)%2]); ok=CGAL::assign(tmp_pt,ints[(right_ind+1)%2]);
assert(ok); CGAL_assertion(ok);
points.push_back(tmp_pt); points.push_back(tmp_pt);
index=points.size()-1; index=points.size()-1;
indices[(i+1)%4+4]=index; 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); *out++=build_arc(exact_circle,points[ indices[pair[1]] ].first,points[ indices[pair[0]] ].first);
return; return;
} }
assert (rem_pt==0); CGAL_assertion (rem_pt==0);
} }
}; };

View File

@ -37,6 +37,7 @@ typedef unsigned int uint;
#include <CGAL/tuple.h> #include <CGAL/tuple.h>
#include<CGAL/Exact_circular_kernel_2.h> #include<CGAL/Exact_circular_kernel_2.h>
#include <CGAL/Cartesian_converter.h> #include <CGAL/Cartesian_converter.h>
#include <CGAL/assertions.h>
#include <boost/utility.hpp> #include <boost/utility.hpp>
@ -546,10 +547,10 @@ public:
++next_s; if (next_s==map_theta.end()) next_s=map_theta.begin(); ++next_s; if (next_s==map_theta.end()) next_s=map_theta.begin();
do{ do{
if (current->second.first==OTRG) return; 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)); draw_in_ipe(Circular_arc_2(circle,*(current->second.second),*(next_s->second.second),CGAL::COUNTERCLOCKWISE));
if (next_s->second.first==OTRG) return; 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(); ++next_s; if (next_s==map_theta.end()) next_s=map_theta.begin();
current=next_s; current=next_s;
++next_s; if (next_s==map_theta.end()) next_s=map_theta.begin(); ++next_s; if (next_s==map_theta.end()) next_s=map_theta.begin();
@ -848,7 +849,7 @@ public:
switch (ints.size()){ switch (ints.size()){
case 1: case 1:
ok=CGAL::assign(tmp_pt,ints[0]); ok=CGAL::assign(tmp_pt,ints[0]);
assert(ok); CGAL_assertion(ok);
points.push_back(tmp_pt); points.push_back(tmp_pt);
index=points.size()-1; index=points.size()-1;
indices[i]=index; indices[i]=index;
@ -857,12 +858,12 @@ public:
case 2: case 2:
int right_ind=i<2?0:1; int right_ind=i<2?0:1;
ok=CGAL::assign(tmp_pt,ints[right_ind]); ok=CGAL::assign(tmp_pt,ints[right_ind]);
assert(ok); CGAL_assertion(ok);
points.push_back(tmp_pt); points.push_back(tmp_pt);
index=points.size()-1; index=points.size()-1;
indices[i]=index; indices[i]=index;
ok=CGAL::assign(tmp_pt,ints[(right_ind+1)%2]); ok=CGAL::assign(tmp_pt,ints[(right_ind+1)%2]);
assert(ok); CGAL_assertion(ok);
points.push_back(tmp_pt); points.push_back(tmp_pt);
index=points.size()-1; index=points.size()-1;
indices[(i+1)%4+4]=index; 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); *out++=build_arc(exact_circle,points[ indices[pair[1]] ].first,points[ indices[pair[0]] ].first);
return; return;
} }
assert (rem_pt==0); CGAL_assertion (rem_pt==0);
} }
}; };

View File

@ -26,6 +26,7 @@
#include <CGAL/Polyhedron_incremental_builder_3.h> #include <CGAL/Polyhedron_incremental_builder_3.h>
#include <CGAL/Origin.h> #include <CGAL/Origin.h>
#include <CGAL/convex_hull_3.h> #include <CGAL/convex_hull_3.h>
#include <CGAL/assertions.h>
// For interior_polyhedron_3 // For interior_polyhedron_3
#include <CGAL/Convex_hull_3/dual/interior_polyhedron_3.h> #include <CGAL/Convex_hull_3/dual/interior_polyhedron_3.h>
@ -87,7 +88,7 @@ namespace CGAL
for (Vertex_const_iterator it = _primal.vertices_begin(); for (Vertex_const_iterator it = _primal.vertices_begin();
it != _primal.vertices_end(); ++it) it != _primal.vertices_end(); ++it)
{ {
assert (it->is_bivalent() == false); CGAL_assertion (it->is_bivalent() == false);
typename Polyhedron::Halfedge_around_vertex_const_circulator typename Polyhedron::Halfedge_around_vertex_const_circulator
h0 = it->vertex_begin(), hf = h0; h0 = it->vertex_begin(), hf = h0;

View File

@ -28,6 +28,7 @@
#include <CGAL/QP_models.h> #include <CGAL/QP_models.h>
#include <limits> #include <limits>
#include <CGAL/number_utils.h> #include <CGAL/number_utils.h>
#include <CGAL/assertions.h>
// Description taken from http://www.qhull.org/html/qhalf.htm // 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 cj = CGAL::to_double(plane.c());
const double dj = CGAL::to_double(plane.d()); const double dj = CGAL::to_double(plane.d());
assert(!isinf(aj)); CGAL_assertion(!isinf(aj));
assert(!isinf(bj)); CGAL_assertion(!isinf(bj));
assert(!isinf(cj)); CGAL_assertion(!isinf(cj));
assert(!isinf(dj)); CGAL_assertion(!isinf(dj));
// plane defined the halfspace: aj * x1 + bj * x2 + cj * x3 + dj <= 0 // plane defined the halfspace: aj * x1 + bj * x2 + cj * x3 + dj <= 0
// <=> - (aj * x1 + bj * x2 + cj * x3 + dj) >= 0 // <=> - (aj * x1 + bj * x2 + cj * x3 + dj) >= 0

View File

@ -552,7 +552,7 @@ ch_quickhull_3_scan(TDS_2& tds,
border.erase(it); border.erase(it);
while(! border.empty()){ while(! border.empty()){
it = border.find(e.first->vertex(TDS_2::ccw(e.second))); 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 = it->second;
e.first->info() = 0; e.first->info() = 0;
edges.push_back(e); edges.push_back(e);

View File

@ -173,7 +173,7 @@ public:
Implicit_multi_domain_to_labeling_function_wrapper (const Function_vector& vf, const std::vector<std::vector<Sign> >& vps) Implicit_multi_domain_to_labeling_function_wrapper (const Function_vector& vf, const std::vector<std::vector<Sign> >& vps)
: funcs(vf), bmasks(vps.size(), Bmask(funcs.size() * 2, false)) : funcs(vf), bmasks(vps.size(), Bmask(funcs.size() * 2, false))
{ {
assert(funcs.size()); CGAL_assertion(funcs.size());
std::size_t mask_index = 0; std::size_t mask_index = 0;
for (std::vector<std::vector<Sign> >::const_iterator mask_iter = vps.begin(), mask_end_iter = vps.end(); for (std::vector<std::vector<Sign> >::const_iterator mask_iter = vps.begin(), mask_end_iter = vps.end();
@ -181,14 +181,14 @@ public:
++mask_iter) ++mask_iter)
{ {
const std::vector<Sign>& mask = *mask_iter; const std::vector<Sign>& mask = *mask_iter;
assert(funcs.size() == mask.size()); CGAL_assertion(funcs.size() == mask.size());
Bmask& bmask = bmasks[mask_index++]; Bmask& bmask = bmasks[mask_index++];
typename Bmask::size_type bit_index = 0; typename Bmask::size_type bit_index = 0;
for (std::vector<Sign>::const_iterator iter = mask.begin(), endIter = mask.end(); iter != endIter; ++iter) for (std::vector<Sign>::const_iterator iter = mask.begin(), endIter = mask.end(); iter != endIter; ++iter)
{ {
std::string::value_type character = *iter; std::string::value_type character = *iter;
assert(character == POSITIVE || character == NEGATIVE); CGAL_assertion(character == POSITIVE || character == NEGATIVE);
bmask[bit_index] = (character == POSITIVE); bmask[bit_index] = (character == POSITIVE);
++bit_index; ++bit_index;
@ -202,7 +202,7 @@ public:
Implicit_multi_domain_to_labeling_function_wrapper (const Function_vector& vf) Implicit_multi_domain_to_labeling_function_wrapper (const Function_vector& vf)
: funcs(vf) : funcs(vf)
{ {
assert(funcs.size()); CGAL_assertion(funcs.size());
bmasks.reserve((1 << funcs.size()) - 1); bmasks.reserve((1 << funcs.size()) - 1);
bmasks.push_back(Bmask(std::string("10"))); 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<std::string>& vps) Implicit_multi_domain_to_labeling_function_wrapper (const Function_vector& vf, const std::vector<std::string>& vps)
: funcs(vf), bmasks(vps.size(), Bmask(funcs.size() * 2, false)) : funcs(vf), bmasks(vps.size(), Bmask(funcs.size() * 2, false))
{ {
assert(funcs.size()); CGAL_assertion(funcs.size());
std::size_t mask_index = 0; std::size_t mask_index = 0;
for (std::vector<std::string>::const_iterator mask_iter = vps.begin(), mask_end_iter = vps.end(); for (std::vector<std::string>::const_iterator mask_iter = vps.begin(), mask_end_iter = vps.end();
@ -236,14 +236,14 @@ public:
++mask_iter) ++mask_iter)
{ {
const std::string& mask_str = *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++]; Bmask& bmask = bmasks[mask_index++];
typename Bmask::size_type bit_index = 0; typename Bmask::size_type bit_index = 0;
for (std::string::const_iterator iter = mask_str.begin(), endIter = mask_str.end(); iter != endIter; ++iter) for (std::string::const_iterator iter = mask_str.begin(), endIter = mask_str.end(); iter != endIter; ++iter)
{ {
std::string::value_type character = *iter; std::string::value_type character = *iter;
assert(character == '+' || character == '-'); CGAL_assertion(character == '+' || character == '-');
bmask[bit_index] = (character == '+'); bmask[bit_index] = (character == '+');
++bit_index; ++bit_index;

View File

@ -483,7 +483,7 @@ struct Mpzf {
} }
#endif #endif
if(u.s.sig) size=-size; 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 #ifdef CGAL_USE_GMPXX

View File

@ -27,6 +27,7 @@
#include <CGAL/convert_to_bfi.h> #include <CGAL/convert_to_bfi.h>
#include <CGAL/Coercion_traits.h> #include <CGAL/Coercion_traits.h>
#include <CGAL/Sqrt_extension/Sqrt_extension_type.h> #include <CGAL/Sqrt_extension/Sqrt_extension_type.h>
#include <CGAL/assertions.h>
// Disbale SQRT_EXTENSION_TO_BFI_CACHE by default // Disbale SQRT_EXTENSION_TO_BFI_CACHE by default
@ -92,8 +93,8 @@ convert_to_bfi(const CGAL::Sqrt_extension<NT,ROOT,ACDE_TAG,FP_TAG>& x) {
}else{ }else{
result_ = convert_to_bfi(x.a0()); result_ = convert_to_bfi(x.a0());
} }
assert(lower(result) == lower(result_)); CGAL_assertion(lower(result) == lower(result_));
assert(upper(result) == upper(result_)); CGAL_assertion(upper(result) == upper(result_));
#endif #endif
return result; return result;
} }

View File

@ -1396,7 +1396,7 @@ class Intersection_of_Polyhedra_3{
switch(type){ switch(type){
case internal_IOP::COPLNR: case internal_IOP::COPLNR:
#ifndef DO_NOT_HANDLE_COPLANAR_FACETS #ifndef DO_NOT_HANDLE_COPLANAR_FACETS
assert(!"COPLNR : this point should never be reached!"); CGAL_assertion(!"COPLANR : this point should never be reached!");
#else #else
//nothing need to be done, cf. comments at the beginning of the file //nothing need to be done, cf. comments at the beginning of the file
#endif #endif

View File

@ -32,6 +32,7 @@
#include <CGAL/boost/graph/iterator.h> #include <CGAL/boost/graph/iterator.h>
#include <CGAL/boost/graph/helpers.h> #include <CGAL/boost/graph/helpers.h>
#include <CGAL/assertions.h>
#include <CGAL/Polyhedron_3.h> #include <CGAL/Polyhedron_3.h>
#include <CGAL/Polyhedron_incremental_builder_3.h> #include <CGAL/Polyhedron_incremental_builder_3.h>
#include <CGAL/Union_find.h> #include <CGAL/Union_find.h>
@ -723,7 +724,7 @@ void keep_or_remove_connected_components(PolygonMesh& pmesh
} }
else { else {
// no face kept // 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 // vertices pointing to e must change their halfedge
if (halfedge(v, pmesh) == oh){ if (halfedge(v, pmesh) == oh){
set_halfedge(v, prev(h, pmesh), pmesh); set_halfedge(v, prev(h, pmesh), pmesh);
@ -745,7 +746,7 @@ void keep_or_remove_connected_components(PolygonMesh& pmesh
remove_edge(e, pmesh); remove_edge(e, pmesh);
} }
else { else {
assert(keep_vertex[w]); CGAL_assertion(keep_vertex[w]);
if (halfedge(w, pmesh) == h){ if (halfedge(w, pmesh) == h){
set_halfedge(w, prev(oh, pmesh), pmesh); set_halfedge(w, prev(oh, pmesh), pmesh);
} }

View File

@ -2516,7 +2516,7 @@ private: //------------------------------------------------------- private data
int n, f, e; int n, f, e;
std::string off; std::string off;
is >> off; is >> off;
assert(off == "OFF" || off == "COFF"); CGAL_assertion(off == "OFF" || off == "COFF");
is >> n >> f >> e; is >> n >> f >> e;
sm.reserve(n,2*f,e); sm.reserve(n,2*f,e);
P p; P p;

View File

@ -34,6 +34,7 @@
#include <boost/type_traits/is_same.hpp> #include <boost/type_traits/is_same.hpp>
#include <iterator> #include <iterator>
#include <CGAL/assertions.h>
#include <CGAL/AABB_tree.h> #include <CGAL/AABB_tree.h>
#include <CGAL/Default.h> #include <CGAL/Default.h>
@ -608,7 +609,7 @@ private:
typename Traits::Construct_vertex_2 cv2(m_traits.construct_vertex_2_object()); 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()); 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; cone->m_pendingLeftSubtree = NULL;
@ -635,7 +636,7 @@ private:
typename Traits::Construct_vertex_2 cv2(m_traits.construct_vertex_2_object()); 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()); 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; cone->m_pendingRightSubtree = NULL;
@ -693,7 +694,7 @@ private:
} }
break; break;
default: 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? // 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)); LineLineIntersectResult cgalIntersection = intersect_2(construct_line_2(entrySegment), construct_line_2(rayToLocation));
assert(cgalIntersection); CGAL_assertion(cgalIntersection);
Point_2* result = boost::get<Point_2, Point_2, Line_2>(&*cgalIntersection); Point_2* result = boost::get<Point_2, Point_2, Line_2>(&*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); FT t0 = parametric_distance_along_segment_2(construct_source_2(entrySegment), construct_target_2(entrySegment), *result);
@ -1616,7 +1617,7 @@ private:
current = current->parent(); current = current->parent();
break; break;
default: default:
assert(false && "Unhandled node type found in tree"); CGAL_assertion(false && "Unhandled node type found in tree");
} }
} }
} }
@ -1771,7 +1772,7 @@ private:
break; break;
default: default:
assert(false && "Invalid face location"); CGAL_assertion(false && "Invalid face location");
return std::pair<Node_distance_pair, Barycentric_coordinate>(); return std::pair<Node_distance_pair, Barycentric_coordinate>();
} }
} }
@ -2044,7 +2045,7 @@ public:
std::cout << "Final node count: " << m_currentNodeCount << std::endl; std::cout << "Final node count: " << m_currentNodeCount << std::endl;
} }
return; return;
assert(m_currentNodeCount == 0); CGAL_assertion(m_currentNodeCount == 0);
#endif #endif
} }

View File

@ -23,6 +23,7 @@
#include <CGAL/boost/graph/properties_Polyhedron_3.h> #include <CGAL/boost/graph/properties_Polyhedron_3.h>
#include <CGAL/boost/graph/graph_traits_Polyhedron_3.h> #include <CGAL/boost/graph/graph_traits_Polyhedron_3.h>
#include <CGAL/result_of.h> #include <CGAL/result_of.h>
#include <CGAL/assertions.h>
#include <CGAL/Surface_mesh_shortest_path/internal/misc_functions.h> #include <CGAL/Surface_mesh_shortest_path/internal/misc_functions.h>
@ -454,7 +455,7 @@ public:
LineLineIntersectResult intersectResult1(m_intersect_2(s1Line, l1)); LineLineIntersectResult intersectResult1(m_intersect_2(s1Line, l1));
assert(intersectResult1); CGAL_assertion(intersectResult1);
Point_2 p1; Point_2 p1;
@ -464,19 +465,19 @@ public:
{ {
Point_2* result = boost::get<Point_2, Point_2, Line_2>(&*intersectResult1); Point_2* result = boost::get<Point_2, Point_2, Line_2>(&*intersectResult1);
assert(result && "Intersection should have been a point"); CGAL_assertion(result && "Intersection should have been a point");
if (result) if (result)
{ {
t1 = m_parametric_distance_along_segment_2(s1, *result); t1 = m_parametric_distance_along_segment_2(s1, *result);
p1 = *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); LineLineIntersectResult intersectResult2 = m_intersect_2(s2Line, l2);
assert(intersectResult2); CGAL_assertion(intersectResult2);
FT t2; FT t2;
Point_2 p2; Point_2 p2;
@ -485,13 +486,13 @@ public:
{ {
Point_2* result = boost::get<Point_2, Point_2, Line_2>(&*intersectResult2); Point_2* result = boost::get<Point_2, Point_2, Line_2>(&*intersectResult2);
assert(result && "Intersection should have been a point"); CGAL_assertion(result && "Intersection should have been a point");
if (result) if (result)
{ {
t2 = m_parametric_distance_along_segment_2(s2, *result); t2 = m_parametric_distance_along_segment_2(s2, *result);
p2 = *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)); 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 do
{ {

View File

@ -446,7 +446,7 @@ enclosing_constraint(T vaa, T vbb, T& va, T& vb) const
va = *pos; va = *pos;
pos = hcit->pos; pos = hcit->pos;
++pos; ++pos;
assert(vbb == *pos); CGAL_triangulation_assertion(vbb == *pos);
while(!pos.input()){ while(!pos.input()){
++pos; ++pos;
} }
@ -549,7 +549,7 @@ swap(Constraint_id first, Constraint_id second){
++succ != end; ++succ != end;
++it){ ++it){
typename Sc_to_c_map::iterator scit = sc_to_c_map.find(make_edge(*it,*succ)); typename Sc_to_c_map::iterator scit = sc_to_c_map.find(make_edge(*it,*succ));
CGAL_triangulation_assertion(scit != sc_to_c_map.end()); CGAL_triangulation_assertaion(scit != sc_to_c_map.end());
Context_list* hcl = scit->second; Context_list* hcl = scit->second;
// and replace the context of the constraint // and replace the context of the constraint

View File

@ -25,6 +25,7 @@
#include <CGAL/Visibility_2/visibility_utils.h> #include <CGAL/Visibility_2/visibility_utils.h>
#include <CGAL/Arrangement_2.h> #include <CGAL/Arrangement_2.h>
#include <CGAL/bounding_box.h> #include <CGAL/bounding_box.h>
#include <CGAL/assertions.h>
#include <boost/unordered_map.hpp> #include <boost/unordered_map.hpp>
#include <iterator> #include <iterator>
@ -811,7 +812,7 @@ private:
Ccb_halfedge_const_circulator curr = fh->outer_ccb(); Ccb_halfedge_const_circulator curr = fh->outer_ccb();
Ccb_halfedge_const_circulator circ = curr; Ccb_halfedge_const_circulator circ = curr;
do { do {
assert(curr->face() == fh); CGAL_assertion(curr->face() == fh);
input_neighbor_f(curr); input_neighbor_f(curr);
} while (++curr != circ); } while (++curr != circ);
@ -819,7 +820,7 @@ private:
for (hi = fh->holes_begin(); hi != fh->holes_end(); ++hi) { for (hi = fh->holes_begin(); hi != fh->holes_end(); ++hi) {
Ccb_halfedge_const_circulator curr = *hi, circ = *hi; Ccb_halfedge_const_circulator curr = *hi, circ = *hi;
do { do {
assert(curr->face() == fh); CGAL_assertion(curr->face() == fh);
input_neighbor_f(curr); input_neighbor_f(curr);
} while (++curr != circ); } while (++curr != circ);
} }
@ -847,7 +848,7 @@ private:
Ccb_halfedge_const_circulator curr = fh->outer_ccb(); Ccb_halfedge_const_circulator curr = fh->outer_ccb();
Ccb_halfedge_const_circulator circ = curr; Ccb_halfedge_const_circulator circ = curr;
do { do {
assert(curr->face() == fh); CGAL_assertion(curr->face() == fh);
input_edge(curr, good_edges); input_edge(curr, good_edges);
} while (++curr != circ); } while (++curr != circ);
@ -855,7 +856,7 @@ private:
for (hi = fh->holes_begin(); hi != fh->holes_end(); ++hi) { for (hi = fh->holes_begin(); hi != fh->holes_end(); ++hi) {
Ccb_halfedge_const_circulator curr = circ = *hi; Ccb_halfedge_const_circulator curr = circ = *hi;
do { do {
assert(curr->face() == fh); CGAL_assertion(curr->face() == fh);
input_edge(curr, good_edges); input_edge(curr, good_edges);
} while (++curr != circ); } while (++curr != circ);
} }

View File

@ -404,7 +404,7 @@ namespace CGAL {
if (Object_2 result = Intersect_2()(seg, ray_origin) ) if (Object_2 result = Intersect_2()(seg, ray_origin) )
{ {
const Point_2 * ipoint = object_cast<Point_2>(&result); const Point_2 * ipoint = object_cast<Point_2>(&result);
assert( ipoint != NULL ); CGAL_assertion( ipoint != NULL );
s_t = *ipoint; s_t = *ipoint;
upcase = SCANB; upcase = SCANB;
} }
@ -487,7 +487,7 @@ namespace CGAL {
Object_2 result = Intersect_2()( seg, seg2 ); Object_2 result = Intersect_2()( seg, seg2 );
if(result) { if(result) {
const Point_2 * ipoint = object_cast<Point_2>(&result); const Point_2 * ipoint = object_cast<Point_2>(&result);
assert( ipoint != NULL ); CGAL_assertion( ipoint != NULL );
u = *ipoint; u = *ipoint;
mode = 2; mode = 2;
break; break;
@ -495,7 +495,7 @@ namespace CGAL {
} }
} }
assert( mode != 0 ); CGAL_assertion( mode != 0 );
if ( mode == 1 ) { if ( mode == 1 ) {
orient1 = traits->orientation_2_object()(q, vertices[i], vertices[i+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 ); Object_2 result = Intersect_2()( seg, ray );
const Point_2 * ipoint = object_cast<Point_2>(&result); const Point_2 * ipoint = object_cast<Point_2>(&result);
assert( ipoint != NULL ); CGAL_assertion( ipoint != NULL );
u = *ipoint; u = *ipoint;
if ( stack.top() != u ) { if ( stack.top() != u ) {
@ -539,7 +539,7 @@ namespace CGAL {
Object_2 result = Intersect_2()( seg, ray ); Object_2 result = Intersect_2()( seg, ray );
const Point_2 * ipoint = object_cast<Point_2>(&result); const Point_2 * ipoint = object_cast<Point_2>(&result);
assert( ipoint != NULL ); CGAL_assertion( ipoint != NULL );
u = *ipoint; u = *ipoint;
if ( stack.top() != u ) { if ( stack.top() != u ) {
@ -670,7 +670,7 @@ namespace CGAL {
} }
old_orient = curr_orient; old_orient = curr_orient;
} }
assert( k+1<vertices.size() ); CGAL_assertion( k+1<vertices.size() );
const Point_2 * ipoint = object_cast<Point_2>( &result ); const Point_2 * ipoint = object_cast<Point_2>( &result );
if ( ipoint ) { if ( ipoint ) {
u = *ipoint; u = *ipoint;

View File

@ -27,6 +27,7 @@
#include <boost/iterator/transform_iterator.hpp> #include <boost/iterator/transform_iterator.hpp>
#include <CGAL/Constrained_Delaunay_triangulation_2.h> #include <CGAL/Constrained_Delaunay_triangulation_2.h>
#include <CGAL/Arr_observer.h> #include <CGAL/Arr_observer.h>
#include <CGAL/assertions.h>
namespace CGAL { namespace CGAL {
@ -216,7 +217,7 @@ public:
out_arr.clear(); out_arr.clear();
needles.clear(); needles.clear();
assert(!face->is_unbounded()); CGAL_assertion(!face->is_unbounded());
std::vector<Point_2> raw_output; std::vector<Point_2> raw_output;
@ -268,7 +269,7 @@ public:
init_cdt(); init_cdt();
} }
assert(!he->face()->is_unbounded()); CGAL_assertion(!he->face()->is_unbounded());
out_arr.clear(); out_arr.clear();
needles.clear(); needles.clear();
@ -276,7 +277,7 @@ public:
typename CDT::Locate_type location; typename CDT::Locate_type location;
int index; int index;
typename CDT::Face_handle fh = p_cdt->locate(q,location,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. //the following code tries to figure out which triangle one should start in.
@ -292,8 +293,8 @@ public:
index = nfh->index(fh); index = nfh->index(fh);
fh = nfh; fh = nfh;
} }
assert(fh->vertex(p_cdt->cw(index))->point() == he->target()->point()); CGAL_assertion(fh->vertex(p_cdt->cw(index))->point() == he->target()->point());
assert(!p_cdt->is_infinite(fh->vertex(index))); CGAL_assertion(!p_cdt->is_infinite(fh->vertex(index)));
// output the edge the query lies on // output the edge the query lies on
@ -326,10 +327,10 @@ public:
//std::cout << "query on vertex" << std::endl; //std::cout << "query on vertex" << std::endl;
//bool query_point_on_vertex_is_not_working_yet = false; //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()); CGAL_assertion(q == he->target()->point());
assert(fh->vertex(index)->point() == he->target()->point()); CGAL_assertion(fh->vertex(index)->point() == he->target()->point());
// push points that are seen anyway // push points that are seen anyway
// raw_output.push_back(he->source()->point()); inserted last // raw_output.push_back(he->source()->point()); inserted last
@ -347,15 +348,15 @@ public:
int nindex = nfh->index(fh); int nindex = nfh->index(fh);
index = p_cdt->ccw(nindex); index = p_cdt->ccw(nindex);
fh = nfh; 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()); CGAL_assertion(he->next()->source()->point() == fh->vertex(index)->point());
assert(he->next()->target()->point() == CGAL_assertion(he->next()->target()->point() ==
fh->vertex(p_cdt->ccw(index))->point()); fh->vertex(p_cdt->ccw(index))->point());
assert(!p_cdt->is_infinite(fh)); CGAL_assertion(!p_cdt->is_infinite(fh));
assert(p_cdt->is_constrained(get_edge(fh,p_cdt->cw(index)))); CGAL_assertion(p_cdt->is_constrained(get_edge(fh,p_cdt->cw(index))));
while(he->source()->point() != fh->vertex(p_cdt->ccw(index))->point()){ while(he->source()->point() != fh->vertex(p_cdt->ccw(index))->point()){
@ -376,7 +377,7 @@ public:
int nindex = nfh->index(fh); int nindex = nfh->index(fh);
index = p_cdt->ccw(nindex); index = p_cdt->ccw(nindex);
fh = nfh; 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); return output(raw_output,out_arr);
@ -397,7 +398,7 @@ private:
Ray_2 ray(q,b); Ray_2 ray(q,b);
Segment_2 seg(s,t); 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); CGAL::Object obj = typename K::Intersect_2()(ray,seg);
Point_2 result = object_cast<Point_2>(obj); Point_2 result = object_cast<Point_2>(obj);
return result; return result;
@ -411,11 +412,11 @@ private:
const { const {
// the expanded edge should not be constrained // the expanded edge should not be constrained
assert(!p_cdt->is_constrained(get_edge(fh,index))); CGAL_assertion(!p_cdt->is_constrained(get_edge(fh,index)));
assert(!p_cdt->is_infinite(fh)); CGAL_assertion(!p_cdt->is_infinite(fh));
// go into the new face // go into the new face
const typename CDT::Face_handle nfh(fh->neighbor(index)); 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 // get indices of neighbors
int nindex = nfh->index(fh); // index of new vertex and old face 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 nvh(nfh->vertex(nindex));
const typename CDT::Vertex_handle rvh(nfh->vertex(p_cdt->cw (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))); const typename CDT::Vertex_handle lvh(nfh->vertex(p_cdt->ccw(nindex)));
assert(!p_cdt->is_infinite(nvh)); CGAL_assertion(!p_cdt->is_infinite(nvh));
assert(!p_cdt->is_infinite(lvh)); CGAL_assertion(!p_cdt->is_infinite(lvh));
assert(!p_cdt->is_infinite(rvh)); CGAL_assertion(!p_cdt->is_infinite(rvh));
// get edges seen from entering edge // get edges seen from entering edge
typename CDT::Edge re = get_edge(nfh,p_cdt->ccw(nindex)); typename CDT::Edge re = get_edge(nfh,p_cdt->ccw(nindex));
@ -476,7 +477,7 @@ private:
} }
break; break;
default: default:
assert(orient == CGAL::COLLINEAR); CGAL_assertion(orient == CGAL::COLLINEAR);
// looking on nvh, so it must be reported // looking on nvh, so it must be reported
// if it wasn't already (triangles rotate around vh) // if it wasn't already (triangles rotate around vh)
if(vh != nvh){ if(vh != nvh){
@ -505,12 +506,12 @@ private:
const { const {
// the expanded edge should not be constrained // the expanded edge should not be constrained
assert(!p_cdt->is_constrained(get_edge(fh,index))); CGAL_assertion(!p_cdt->is_constrained(get_edge(fh,index)));
assert(!p_cdt->is_infinite(fh)); CGAL_assertion(!p_cdt->is_infinite(fh));
// go into the new face // go into the new face
const typename CDT::Face_handle nfh(fh->neighbor(index)); 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 // get indices of neighbors
int nindex = nfh->index(fh); // index of new vertex and old face 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 nvh(nfh->vertex(nindex));
const typename CDT::Vertex_handle rvh(nfh->vertex(p_cdt->cw (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))); const typename CDT::Vertex_handle lvh(nfh->vertex(p_cdt->ccw(nindex)));
assert(!p_cdt->is_infinite(nvh)); CGAL_assertion(!p_cdt->is_infinite(nvh));
assert(!p_cdt->is_infinite(lvh)); CGAL_assertion(!p_cdt->is_infinite(lvh));
assert(!p_cdt->is_infinite(rvh)); CGAL_assertion(!p_cdt->is_infinite(rvh));
// get edges seen from entering edge // get edges seen from entering edge
typename CDT::Edge re = get_edge(nfh,p_cdt->ccw(nindex)); 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 ro = orientation(q,right,nvh->point());
CGAL::Orientation lo = orientation(q,left ,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); != CGAL::CLOCKWISE);
assert(typename K::Orientation_2()(q,right,rvh->point()) CGAL_assertion(typename K::Orientation_2()(q,right,rvh->point())
!= CGAL::COUNTERCLOCKWISE); != CGAL::COUNTERCLOCKWISE);
//std::cout << (ro == CGAL::COUNTERCLOCKWISE) << " " << //std::cout << (ro == CGAL::COUNTERCLOCKWISE) << " " <<
@ -588,7 +589,7 @@ private:
*oit++ = nvh->point(); *oit++ = nvh->point();
} }
if(!Regularization_category::value){ 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. // we have to check whether a needle starts here.
if(p_cdt->is_constrained(le) && !p_cdt->is_constrained(re) if(p_cdt->is_constrained(le) && !p_cdt->is_constrained(re)
&& ro == CGAL::COLLINEAR) && 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()) if(out_arr.faces_begin()->is_unbounded())
return ++out_arr.faces_begin(); return ++out_arr.faces_begin();