Skip to content

Commit

Permalink
CGAL: assert() -> CGAL::assertion()
Browse files Browse the repository at this point in the history
  • Loading branch information
afabri committed Sep 27, 2024
1 parent 119bd10 commit 782e741
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion Arrangement_on_surface_2/include/CGAL/Arr_conic_traits_2.h
Original file line number Diff line number Diff line change
Expand Up @@ -4260,7 +4260,7 @@ class Arr_conic_traits_2 {
// Compute the radi of the hyperbola:
ts = std::asinh(ys_t/b);
tt = std::asinh(yt_t/b);
assert(std::signbit(xs_t) == std::signbit(xt_t));
CGAL_assertion(std::signbit(xs_t) == std::signbit(xt_t));

if (std::signbit(xs_t)) a = -a;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ namespace CGAL {
void init_storage()
{
// Allocate a dart for null_dart_descriptor
assert(mdarts.empty()); // the compact container is empty
CGAL_assertion(mdarts.empty()); // the compact container is empty
Dart_index local_null_dart_descriptor = mdarts.emplace();
if(local_null_dart_descriptor!=0)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ class Free_list_management<CC_with_index, CGAL::Tag_true, CGAL::Tag_true>
void init()
{
m_free_list=std::stack<size_type>();
assert(m_free_list.empty());
CGAL_assertion(m_free_list.empty());
if(m_cc_with_index->capacity()>0)
{ m_used.assign(m_cc_with_index->capacity(), false); }
else { m_used.clear(); }
Expand Down
2 changes: 1 addition & 1 deletion Combinatorial_map/include/CGAL/Dart.h
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ namespace CGAL {

Dart_descriptor get_f(unsigned int i) const
{
assert(i<=dimension);
CGAL_assertion(i<=dimension);
return mf[i];
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ namespace CGAL {
void init_storage()
{
// Allocate a dart for null_dart_descriptor
assert(mdarts.empty()); // the compact container is empty
CGAL_assertion(mdarts.empty()); // the compact container is empty
Dart_index local_null_dart_descriptor = mdarts.emplace();
if(local_null_dart_descriptor!=0)
{
Expand Down
4 changes: 2 additions & 2 deletions Number_types/include/CGAL/CORE_BigFloat.h
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ class Interval_traits<CORE::BigFloat>
// shift such that err.m()+err.err() fits into long
int digits_long = std::numeric_limits<long>::digits;
if(::CORE::bitLength(err.m()+err.err()) >= static_cast<std::size_t>(digits_long)){
assert(std::size_t((std::numeric_limits<long>::max)()) > ::CORE::bitLength(err.m()));
CGAL_assertion(std::size_t((std::numeric_limits<long>::max)()) > ::CORE::bitLength(err.m()));
long shift = static_cast<long>(::CORE::bitLength(err.m())) - digits_long + 1;
//std::cout << "shift " << shift<< std::endl;
CORE::BigInt bi = (err.m() + err.err());
Expand Down Expand Up @@ -276,7 +276,7 @@ round(const CORE::BigFloat& x, long rel_prec = CORE::get_static_defRelPrec().toL

long shift ;
if (err == 0) {
assert(std::size_t((std::numeric_limits<long>::max)()) > ::CORE::bitLength(m));
CGAL_assertion(std::size_t((std::numeric_limits<long>::max)()) > ::CORE::bitLength(m));
shift = static_cast<long>(::CORE::bitLength(m)) - rel_prec - 3;
}else
shift = CGAL::relative_precision(x) - rel_prec -1;
Expand Down
20 changes: 10 additions & 10 deletions Number_types/include/CGAL/cpp_float.h
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ class cpp_float {
man.backend().negate();
}
#ifdef CGAL_DEBUG_CPPF
assert(rat.sign() == man.sign());
CGAL_assertion(rat.sign() == man.sign());
#endif
// std::cout << "m = " << m << " * 2^" << exp << std::endl;
// fmt(m);
Expand Down Expand Up @@ -353,7 +353,7 @@ class cpp_float {
#endif
cpp_float d = b-a;
#ifdef CGAL_DEBUG_CPPF
assert(qres == d.is_positive());
CGAL_assertion(qres == d.is_positive());
#endif
return d.is_positive();
}
Expand All @@ -379,18 +379,18 @@ class cpp_float {
if(shift > 0){
Mantissa ac = a.man << shift;
#ifdef CGAL_DEBUG_CPPF
assert( qres == (ac == b.man));
CGAL_assertion( qres == (ac == b.man));
#endif
return ac == b.man;
}else if(shift < 0){
Mantissa bc = b.man << -shift;
#ifdef CGAL_DEBUG_CPPF
assert(qres == (a.man == bc));
CGAL_assertion(qres == (a.man == bc));
#endif
return a.man == bc;
}
#ifdef CGAL_DEBUG_CPPF
assert(qres == (a.man == b.man));
CGAL_assertion(qres == (a.man == b.man));
#endif
return a.man==b.man;
}
Expand Down Expand Up @@ -489,7 +489,7 @@ class cpp_float {
Type operator()(
const Type& /* x */,
const Type& /* y */ ) const {
assert(false);
CGAL_assertion(false);
return Type(); // cpp_float_gcd(x, y);
}
};
Expand All @@ -506,15 +506,15 @@ class cpp_float {
Type operator()(
const Type& /* x */,
const Type& /* y */ ) const {
assert(false);
CGAL_assertion(false);
return Type(); // x / y;
}
};

struct Sqrt
: public CGAL::cpp98::unary_function< Type, Type > {
Type operator()( const Type& /* x */) const {
assert(false);
CGAL_assertion(false);
return Type(); // cpp_float_sqrt(x);
}
};
Expand All @@ -523,11 +523,11 @@ class cpp_float {
: public CGAL::cpp98::binary_function< Type, Type&, bool > {
bool operator()( const Type& /* x */, Type& /* y */ ) const {
// TODO: avoid doing 2 calls.
assert(false);
CGAL_assertion(false);
return true;
}
bool operator()( const Type& /* x */) const {
assert(false);
CGAL_assertion(false);
return true;
}
};
Expand Down

0 comments on commit 782e741

Please sign in to comment.