diff --git a/Nef_3/bbox/AUTHORS b/Nef_3/bbox/AUTHORS deleted file mode 100644 index c16ad7a2263..00000000000 --- a/Nef_3/bbox/AUTHORS +++ /dev/null @@ -1 +0,0 @@ -Andreas Meyer diff --git a/Nef_3/bbox/Timer.h b/Nef_3/bbox/Timer.h deleted file mode 100644 index e18d0b0b570..00000000000 --- a/Nef_3/bbox/Timer.h +++ /dev/null @@ -1,32 +0,0 @@ -#ifndef TIMER_HXX -#define TIMER_HXX - -#include -#include - -struct Timer -{ - public: - struct timeval t1,t2; - - double t; - - void start() - { - gettimeofday (&t1, NULL); - } - - void stop() - { - gettimeofday (&t2, NULL); - t = (t2.tv_sec - t1.tv_sec) + (t2.tv_usec - t1.tv_usec) / 1000000.0; - } - - void reset() - { - t = 0.0; - } -}; - -#endif - diff --git a/Nef_3/bbox/automated_test.cc b/Nef_3/bbox/automated_test.cc deleted file mode 100644 index 35d9888e2e2..00000000000 --- a/Nef_3/bbox/automated_test.cc +++ /dev/null @@ -1,172 +0,0 @@ -#include "bbox.h" -#include - -#include -#include - -// enable invariant checking -#define SEGMENT_TREE_CHECK_INVARIANTS 1 -#include - -#include "Timer.h" - -#include -#include -#include -#include -#include -#include -#include - - -using namespace std; - -typedef Bbox_3< int > Box; -typedef Bbox_3_Adapter< Box > BoxAdapter; -typedef Default_Box_Traits< BoxAdapter > Traits; -typedef vector< Box > BoxContainer; -typedef pair< Box, Box > BoxPair; -typedef vector< BoxPair > ResultContainer; - - -static void readBoxesFromFile( FILE *infile, BoxContainer& boxes ) -{ - int numBoxes, numDim; - int numMatched; - int boxNum, dim; - - fscanf(infile, "%d %d\n", &numBoxes, &numDim); - vector< int > lo( numDim ), hi( numDim ); - /* Read boxes */ - for(boxNum = 0; boxNum < numBoxes; boxNum++) { - for(dim = 0; dim < numDim; dim++) - fscanf( infile, "[%d, %d) ", &lo[dim], &hi[dim] ); - boxes.push_back( Box( lo[0], lo[1], lo[2], hi[0], hi[1], hi[2] ) ); - fscanf(infile, "\n"); - } -} - -static void assertIntersection( const Box& a, const Box& b ) { - for( unsigned int dim = 0; dim < 3; ++dim ) { - if( Traits::does_intersect( a, b, dim ) == false ) { - cout << "does not intersect!" << endl; - //cout << a << endl << b << endl; - exit(-1); - } - } -} - -template< class Storage > -struct StorageCallback { - unsigned int counter; - Storage& storage; - StorageCallback( Storage& storage ) : counter( 0 ), storage( storage ) {} - void operator()( const Box& a, const Box& b ) { - assertIntersection( a, b ); - ++counter; - storage.push_back( make_pair( a, b ) ); - } -}; - -bool -operator==( const Box& a, const Box& b ) { - for( unsigned int dim = 0; dim < 3; ++dim ) - if( Traits::get_lo( a, dim ) != Traits::get_lo( b, dim ) || - Traits::get_hi( a, dim ) != Traits::get_hi( b, dim ) ) - return false; - return true; -} - -bool -operator==( const BoxPair& a, const BoxPair& b ) { - return( a.first == b.first && a.second == b.second || - a.first == b.second && a.second == b.first ); -} - -template< class Storage > -unsigned int countMissingItems( Storage& a, Storage& b ) { - unsigned int missing = 0; - for( typename Storage::iterator it = a.begin(); it != a.end(); ++it ) { - if( find( b.begin(), b.end(), *it ) == b.end() ) { - ++missing; - //cout << it->first << it->second << endl; - } - } - return missing; -} - -template< class Storage > -unsigned int countDuplicates( Storage& storage ) { - unsigned int counter = 0; - typedef typename Storage::iterator IT; - for( IT it = storage.begin(); it != storage.end(); ++it ) - for( IT it2 = it; it2 != storage.end(); ++it2 ) - if( it != it2 && *it == *it2 ) { - //cout << it->first.num() << " <-> " - // << it->second.num() << endl; - ++counter; - } - return counter; -} - -static void -test( const char* filename1, const char* filename2 ) -{ - BoxContainer boxes1, boxes2; - ResultContainer result_all_pairs, result_tree; - FILE *infile1, *infile2; - infile1 = fopen( filename1, "r"); - infile2 = fopen( filename2, "r"); - - readBoxesFromFile( infile1, boxes1 ); - readBoxesFromFile( infile2, boxes2 ); - - cout << endl; - StorageCallback< ResultContainer > - callback1( result_all_pairs ), - callback2( result_tree ); - - cout << "all pairs ...... " << flush; - Timer timer; - timer.start(); - all_pairs( boxes1.begin(), boxes1.end(), - boxes2.begin(), boxes2.end(), callback1, Traits(), 2 ); - timer.stop(); - cout << "got " << callback1.counter << " intersections in " - << timer.t << " seconds." << endl; - - cout << "segment tree ... " << flush; - timer.reset(); - timer.start(); - unsigned int n = boxes1.size(); - Traits::cutoff = n < 2000 ? 6 : n / 100; - segment_tree( boxes1.begin(), boxes1.end(), - boxes2.begin(), boxes2.end(), callback2, Traits(), 2 ); - timer.stop(); - cout << "got " << callback2.counter << " intersections in " - << timer.t << " seconds." < -#include - -/* -class Bbox_3 -{ - double x_lo, y_lo, z_lo; - double x_hi, y_hi, z_hi; -public: - Bbox_3(double x_lo, double y_lo, double z_lo, - double x_hi, double y_hi, double z_hi) - : x_lo( x_lo ), y_lo( y_lo ), z_lo( z_lo ), - x_hi( x_hi ), y_hi( y_hi ), z_hi( z_hi ) - {} - - double xlo() const { return x_lo; } - double ylo() const { return y_lo; } - double zlo() const { return z_lo; } - double xhi() const { return x_hi; } - double yhi() const { return y_hi; } - double zhi() const { return z_hi; } - - Bbox_3 operator+(const Bbox_3& b) const { - return Bbox_3(std::lo( xlo(), b.xlo() ), - std::lo( ylo(), b.ylo() ), - std::lo( zlo(), b.zlo() ), - std::hi( xhi(), b.xhi() ), - std::hi( yhi(), b.yhi() ), - std::hi( zhi(), b.zhi() )); - } -}; - -class Bbox_3_Adapter : public Bbox_3 { -public: - Bbox_3_Adapter( double x_lo, double y_lo, double z_lo, - double x_hi, double y_hi, double z_hi ) - : Bbox_3( x_lo, y_lo, z_lo, x_hi, y_hi, z_hi ) - {} - - double get_lo( unsigned int n ) const { - switch( n ) { - case 0: return xlo(); - case 1: return ylo(); - case 2: return zlo(); - default: return 0; - } - } - - double get_hi( unsigned int n ) const { - switch( n ) { - case 0: return xhi(); - case 1: return yhi(); - case 2: return zhi(); - default: return 0; - } - } - - -}; -*/ - -template< class T > -class Bbox_3 -{ - T __lo[3], __hi[3]; - unsigned int __num; -public: - typedef T NumberType; - - Bbox_3() {} - Bbox_3( T x_lo, T y_lo, T z_lo, - T x_hi, T y_hi, T z_hi ) - { - __lo[0]= x_lo; __lo[1]= y_lo; __lo[2]= z_lo; - __hi[0]= x_hi; __hi[1]= y_hi; __hi[2]= z_hi; - __num = getCounter(); - } - - static unsigned int getCounter( bool reset = false ) { - static unsigned int counter = 0; - if( reset ) - counter = 0; - else - ++counter; - return counter; - } - - T lo( unsigned int dim ) const { return __lo[dim]; } - T hi( unsigned int dim ) const { return __hi[dim]; } - unsigned int num() const { return __num; } - //unsigned int num() const { return (unsigned int )this; } -}; - -template< class _Box > -struct Bbox_3_Adapter { - typedef _Box Box; - typedef typename _Box::NumberType NumberType; - - static NumberType get_lo( const Box& b, unsigned int dim ) - { return b.lo( dim ); } - - static NumberType get_hi( const Box& b, unsigned int dim ) - { return b.hi( dim ); } - - static unsigned int get_num( const Box& b ) - { return b.num(); } -}; - -template< class _Box > -struct Bbox_3_Pointer_Adapter { - typedef _Box* Box; - typedef typename _Box::NumberType NumberType; - - static NumberType get_lo( const Box b, unsigned int dim ) - { return b->lo( dim ); } - - static NumberType get_hi( const Box b, unsigned int dim ) - { return b->hi( dim ); } - - static unsigned int get_num( const Box b ) - { return b->num(); } -}; - -#endif diff --git a/Nef_3/bbox/include/bbox/all_pairs.h b/Nef_3/bbox/include/bbox/all_pairs.h deleted file mode 100644 index 89182876a3f..00000000000 --- a/Nef_3/bbox/include/bbox/all_pairs.h +++ /dev/null @@ -1,31 +0,0 @@ -#ifndef CGAL_BBOX_ALL_PAIRS_H -#define CGAL_BBOX_ALL_PAIRS_H - -#include - - -template< class RandomAccessIter, class Callback, class Traits > -void all_pairs( RandomAccessIter p_begin, RandomAccessIter p_end, - RandomAccessIter i_begin, RandomAccessIter i_end, - Callback& callback, Traits traits, int last_dim, - bool in_order = true ) -{ - for( RandomAccessIter p = p_begin; p != p_end; ++p ) { - for( RandomAccessIter i = i_begin; i != i_end; ++i ) { - bool does_intersect = true; - for( unsigned int dim = 0; dim <= last_dim; ++dim ) - if( !Traits::does_intersect( *p, *i, dim ) ) - goto no_intersection; - if( in_order ) - callback( *p, *i ); - else - callback( *i, *p ); - no_intersection: - ; - } - } - -} - - -#endif diff --git a/Nef_3/bbox/include/bbox/box_traits.h b/Nef_3/bbox/include/bbox/box_traits.h deleted file mode 100644 index 209732ab1f9..00000000000 --- a/Nef_3/bbox/include/bbox/box_traits.h +++ /dev/null @@ -1,84 +0,0 @@ -#ifndef CGAL_BBOX_BOX_TRAITS_H -#define CGAL_BBOX_BOX_TRAITS_H - -#include -#include - -// BoxAdapter has to provide following static members: -// NumberType get_lo( Box, int dim ) -// NumberType get_hi( Box, int dim ) -// unsigned int get_num( Box ) -// Box may be of type immediate, reference, or pointer - -template< class BoxAdapter > -struct Default_Box_Traits : public BoxAdapter { - typedef typename BoxAdapter::Box Box; - typedef typename BoxAdapter::NumberType NumberType; - typedef Default_Box_Traits< BoxAdapter > Traits; - - static unsigned int cutoff; - - class Compare : public std::binary_function< Box, Box, bool > { - unsigned int dim; - public: - Compare( unsigned int dim ) : dim( dim ) {} - bool operator()( const Box& a, const Box& b ) const - { return Traits::is_lo_less_lo( a, b, dim ); } - }; - - class Lo_Less : public std::unary_function< Box, bool > { - NumberType value; - unsigned int dim; - public: - Lo_Less( NumberType value, unsigned int dim ) - : value( value ), dim( dim ) {} - bool operator() ( const Box& box ) const - { return get_lo( box, dim ) < value; } - }; - - class Hi_Greater : public std::unary_function< Box, bool > { - NumberType value; - unsigned int dim; - public: - Hi_Greater( NumberType value, unsigned int dim ) - : value( value ), dim( dim ) {} - bool operator() ( const Box& box ) const - { return get_hi( box, dim ) > value; } - }; - - // lambda( box ).(get_lo(box,dim) < lo && get_hi(box,dim) > hi ) ) - class Interval_Spanning_Predicate : public std::unary_function { - NumberType lo, hi; - unsigned int dim; - public: - Interval_Spanning_Predicate( NumberType lo, NumberType hi, - unsigned int dim ) - : lo( lo ), hi( hi ), dim( dim ) {} - // returns true <=> box spans [lo,hi) in dimension dim - bool operator() ( const Box& box ) const - { return get_lo( box, dim ) < lo && get_hi( box, dim ) > hi; } - }; - - static bool is_lo_less_lo( const Box& a, const Box& b, unsigned int dim ) { - return get_lo(a,dim) < get_lo(b,dim) || - get_lo(a,dim) == get_lo(b,dim) && get_num(a) < get_num(b); - } - - static bool is_lo_less_hi( const Box& a, const Box& b, unsigned int dim ) - { return get_lo(a,dim ) < get_hi(b,dim); } - - static bool does_intersect ( const Box& a, const Box& b, unsigned int dim ) - { return get_hi(a,dim) > get_lo(b,dim) && get_hi(b,dim) > get_lo(a,dim); } - - static bool contains_lo_point(const Box& a, const Box& b, unsigned int dim) - { return !is_lo_less_lo( b, a, dim ) && is_lo_less_hi( b, a, dim ); } - - static unsigned int get_cutoff() - { return cutoff; } -}; - -template< class BoxAdapter > -unsigned int -Default_Box_Traits::cutoff = 3000; - -#endif diff --git a/Nef_3/bbox/include/bbox/limits b/Nef_3/bbox/include/bbox/limits deleted file mode 100644 index b262c0203ba..00000000000 --- a/Nef_3/bbox/include/bbox/limits +++ /dev/null @@ -1,1926 +0,0 @@ -// The template and inlines for the -*- C++ -*- numeric_limits classes. - -// Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -// Note: this is not a conforming implementation. -// Written by Gabriel Dos Reis - -// -// ISO 14882:1998 -// 18.2.1 -// - -/** @file limits - * This is a Standard C++ Library header. You should @c #include this header - * in your programs, rather than any of the "st[dl]_*.h" implementation files. - */ - -#ifndef _CPP_NUMERIC_LIMITS -#define _CPP_NUMERIC_LIMITS 1 - -//#pragma GCC system_header - -//#include -//#include - -// -// The numeric_limits<> traits document implementation-defined aspects -// of fundamental arithmetic data types (integers and floating points). -// From Standard C++ point of view, there are 13 such types: -// * integers -// bool (1) -// char, signed char, unsigned char (3) -// short, unsigned short (2) -// int, unsigned (2) -// long, unsigned long (2) -// -// * floating points -// float (1) -// double (1) -// long double (1) -// -// GNU C++ undertstands (where supported by the host C-library) -// * integer -// long long, unsigned long long (2) -// -// which brings us to 15 fundamental arithmetic data types in GNU C++. -// -// -// Since a numeric_limits<> is a bit tricky to get right, we rely on -// an interface composed of macros which should be defined in config/os -// or config/cpu when they differ from the generic (read arbitrary) -// definitions given here. -// - -// These values can be overridden in the target configuration file. -// The default values are appropriate for many 32-bit targets. - -#ifndef __glibcpp_char_bits -#define __glibcpp_char_bits 8 -#endif -#ifdef __CHAR_UNSIGNED__ -#define __glibcpp_plain_char_is_signed false -#else -#define __glibcpp_plain_char_is_signed true -#endif -#ifndef __glibcpp_short_bits -#define __glibcpp_short_bits 16 -#endif -#ifndef __glibcpp_int_bits -#define __glibcpp_int_bits 32 -#endif -#ifndef __glibcpp_long_bits -#define __glibcpp_long_bits 32 -#endif -#ifndef __glibcpp_wchar_t_bits -#define __glibcpp_wchar_t_bits 32 -#endif -#ifndef __glibcpp_wchar_t_is_signed -#define __glibcpp_wchar_t_is_signed true -#endif -#ifndef __glibcpp_long_long_bits -#define __glibcpp_long_long_bits 64 -#endif -#ifndef __glibcpp_float_bits -#define __glibcpp_float_bits 32 -#endif -#ifndef __glibcpp_double_bits -#define __glibcpp_double_bits 64 -#endif -#ifndef __glibcpp_long_double_bits -#define __glibcpp_long_double_bits 128 -#endif - -#ifndef __glibcpp_char_traps -#define __glibcpp_char_traps true -#endif -#ifndef __glibcpp_short_traps -#define __glibcpp_short_traps true -#endif -#ifndef __glibcpp_int_traps -#define __glibcpp_int_traps true -#endif -#ifndef __glibcpp_long_traps -#define __glibcpp_long_traps true -#endif -#ifndef __glibcpp_wchar_t_traps -#define __glibcpp_wchar_t_traps true -#endif -#ifndef __glibcpp_long_long_traps -#define __glibcpp_long_long_traps true -#endif - -// You should not need to define any macros below this point, unless -// you have a machine with non-standard bit-widths. - -// These values are the minimums and maximums for standard data types -// of common widths. - -#define __glibcpp_s8_max 127 -#define __glibcpp_s8_min (-__glibcpp_s8_max - 1) -#define __glibcpp_s8_digits 7 -#define __glibcpp_s8_digits10 2 -#define __glibcpp_u8_min 0U -#define __glibcpp_u8_max (__glibcpp_s8_max * 2 + 1) -#define __glibcpp_u8_digits 8 -#define __glibcpp_u8_digits10 2 -#define __glibcpp_s16_max 32767 -#define __glibcpp_s16_min (-__glibcpp_s16_max - 1) -#define __glibcpp_s16_digits 15 -#define __glibcpp_s16_digits10 4 -#define __glibcpp_u16_min 0U -#define __glibcpp_u16_max (__glibcpp_s16_max * 2 + 1) -#define __glibcpp_u16_digits 16 -#define __glibcpp_u16_digits10 4 -#define __glibcpp_s32_max 2147483647L -#define __glibcpp_s32_min (-__glibcpp_s32_max - 1) -#define __glibcpp_s32_digits 31 -#define __glibcpp_s32_digits10 9 -#define __glibcpp_u32_min 0UL -#define __glibcpp_u32_max (__glibcpp_s32_max * 2U + 1) -#define __glibcpp_u32_digits 32 -#define __glibcpp_u32_digits10 9 -#define __glibcpp_s64_max 9223372036854775807LL -#define __glibcpp_s64_min (-__glibcpp_s64_max - 1) -#define __glibcpp_s64_digits 63 -#define __glibcpp_s64_digits10 18 -#define __glibcpp_u64_min 0ULL -#define __glibcpp_u64_max (__glibcpp_s64_max * 2ULL + 1) -#define __glibcpp_u64_digits 64 -#define __glibcpp_u64_digits10 19 - -#define __glibcpp_f32_min 1.17549435e-38F -#define __glibcpp_f32_max 3.40282347e+38F -#define __glibcpp_f32_digits 24 -#define __glibcpp_f32_digits10 6 -#define __glibcpp_f32_radix 2 -#define __glibcpp_f32_epsilon 1.19209290e-07F -#define __glibcpp_f32_round_error 1.0F -#define __glibcpp_f32_min_exponent -125 -#define __glibcpp_f32_min_exponent10 -37 -#define __glibcpp_f32_max_exponent 128 -#define __glibcpp_f32_max_exponent10 38 -#define __glibcpp_f64_min 2.2250738585072014e-308 -#define __glibcpp_f64_max 1.7976931348623157e+308 -#define __glibcpp_f64_digits 53 -#define __glibcpp_f64_digits10 15 -#define __glibcpp_f64_radix 2 -#define __glibcpp_f64_epsilon 2.2204460492503131e-16 -#define __glibcpp_f64_round_error 1.0 -#define __glibcpp_f64_min_exponent -1021 -#define __glibcpp_f64_min_exponent10 -307 -#define __glibcpp_f64_max_exponent 1024 -#define __glibcpp_f64_max_exponent10 308 -#define __glibcpp_f80_min 3.36210314311209350626e-4932L -#define __glibcpp_f80_max 1.18973149535723176502e+4932L -#define __glibcpp_f80_digits 64 -#define __glibcpp_f80_digits10 18 -#define __glibcpp_f80_radix 2 -#define __glibcpp_f80_epsilon 1.08420217248550443401e-19L -#define __glibcpp_f80_round_error 1.0L -#define __glibcpp_f80_min_exponent -16381 -#define __glibcpp_f80_min_exponent10 -4931 -#define __glibcpp_f80_max_exponent 16384 -#define __glibcpp_f80_max_exponent10 4932 -#define __glibcpp_f96_min 1.68105157155604675313e-4932L -#define __glibcpp_f96_max 1.18973149535723176502e+4932L -#define __glibcpp_f96_digits 64 -#define __glibcpp_f96_digits10 18 -#define __glibcpp_f96_radix 2 -#define __glibcpp_f96_epsilon 1.08420217248550443401e-19L -#define __glibcpp_f96_round_error 1.0L -#define __glibcpp_f96_min_exponent -16382 -#define __glibcpp_f96_min_exponent10 -4931 -#define __glibcpp_f96_max_exponent 16384 -#define __glibcpp_f96_max_exponent10 4932 -#define __glibcpp_f128_min 3.362103143112093506262677817321752603E-4932L -#define __glibcpp_f128_max 1.189731495357231765085759326628007016E+4932L -#define __glibcpp_f128_digits 113 -#define __glibcpp_f128_digits10 33 -#define __glibcpp_f128_radix 2 -#define __glibcpp_f128_epsilon 1.925929944387235853055977942584927319E-34L -#define __glibcpp_f128_round_error 1.0L -#define __glibcpp_f128_min_exponent -16381 -#define __glibcpp_f128_min_exponent10 -4931 -#define __glibcpp_f128_max_exponent 16384 -#define __glibcpp_f128_max_exponent10 4932 - -// bool-specific hooks: -// __glibcpp_bool_digits __glibcpp_int_traps __glibcpp_long_traps - -#ifndef __glibcpp_bool_digits -#define __glibcpp_bool_digits 1 -#endif - -// char. - -#define __glibcpp_plain_char_traps true -#define __glibcpp_signed_char_traps true -#define __glibcpp_unsigned_char_traps true -#ifndef __glibcpp_char_is_modulo -#define __glibcpp_char_is_modulo true -#endif -#ifndef __glibcpp_signed_char_is_modulo -#define __glibcpp_signed_char_is_modulo true -#endif -#if __glibcpp_char_bits == 8 -#define __glibcpp_signed_char_min __glibcpp_s8_min -#define __glibcpp_signed_char_max __glibcpp_s8_max -#define __glibcpp_signed_char_digits __glibcpp_s8_digits -#define __glibcpp_signed_char_digits10 __glibcpp_s8_digits10 -#define __glibcpp_unsigned_char_min __glibcpp_u8_min -#define __glibcpp_unsigned_char_max __glibcpp_u8_max -#define __glibcpp_unsigned_char_digits __glibcpp_u8_digits -#define __glibcpp_unsigned_char_digits10 __glibcpp_u8_digits10 -#elif __glibcpp_char_bits == 16 -#define __glibcpp_signed_char_min __glibcpp_s16_min -#define __glibcpp_signed_char_max __glibcpp_s16_max -#define __glibcpp_signed_char_digits __glibcpp_s16_digits -#define __glibcpp_signed_char_digits10 __glibcpp_s16_digits10 -#define __glibcpp_unsigned_char_min __glibcpp_u16_min -#define __glibcpp_unsigned_char_max __glibcpp_u16_max -#define __glibcpp_unsigned_char_digits __glibcpp_u16_digits -#define __glibcpp_unsigned_char_digits10 __glibcpp_u16_digits10 -#elif __glibcpp_char_bits == 32 -#define __glibcpp_signed_char_min (signed char)__glibcpp_s32_min -#define __glibcpp_signed_char_max (signed char)__glibcpp_s32_max -#define __glibcpp_signed_char_digits __glibcpp_s32_digits -#define __glibcpp_signed_char_digits10 __glibcpp_s32_digits10 -#define __glibcpp_unsigned_char_min (unsigned char)__glibcpp_u32_min -#define __glibcpp_unsigned_char_max (unsigned char)__glibcpp_u32_max -#define __glibcpp_unsigned_char_digits __glibcpp_u32_digits -#define __glibcpp_unsigned_char_digits10 __glibcpp_u32_digits10 -#elif __glibcpp_char_bits == 64 -#define __glibcpp_signed_char_min (signed char)__glibcpp_s64_min -#define __glibcpp_signed_char_max (signed char)__glibcpp_s64_max -#define __glibcpp_signed_char_digits __glibcpp_s64_digits -#define __glibcpp_signed_char_digits10 __glibcpp_s64_digits10 -#define __glibcpp_unsigned_char_min (unsigned char)__glibcpp_u64_min -#define __glibcpp_unsigned_char_max (unsigned char)__glibcpp_u64_max -#define __glibcpp_unsigned_char_digits __glibcpp_u64_digits -#define __glibcpp_unsigned_char_digits10 __glibcpp_u64_digits10 -#else -// You must define these macros in the configuration file. -#endif - -#if __glibcpp_plain_char_is_signed -#define __glibcpp_char_min (char)__glibcpp_signed_char_min -#define __glibcpp_char_max (char)__glibcpp_signed_char_max -#define __glibcpp_char_digits __glibcpp_signed_char_digits -#define __glibcpp_char_digits10 __glibcpp_signed_char_digits10 -#else -#define __glibcpp_char_min (char)__glibcpp_unsigned_char_min -#define __glibcpp_char_max (char)__glibcpp_unsigned_char_max -#define __glibcpp_char_digits __glibcpp_unsigned_char_digits -#define __glibcpp_char_digits10 __glibcpp_unsigned_char_digits10 -#endif - -// short - -#define __glibcpp_signed_short_traps true -#define __glibcpp_unsigned_short_traps true -#ifndef __glibcpp_signed_short_is_modulo -#define __glibcpp_signed_short_is_modulo true -#endif -#if __glibcpp_short_bits == 8 -#define __glibcpp_signed_short_min __glibcpp_s8_min -#define __glibcpp_signed_short_max __glibcpp_s8_max -#define __glibcpp_signed_short_digits __glibcpp_s8_digits -#define __glibcpp_signed_short_digits10 __glibcpp_s8_digits10 -#define __glibcpp_unsigned_short_min __glibcpp_u8_min -#define __glibcpp_unsigned_short_max __glibcpp_u8_max -#define __glibcpp_unsigned_short_digits __glibcpp_u8_digits -#define __glibcpp_unsigned_short_digits10 __glibcpp_u8_digits10 -#elif __glibcpp_short_bits == 16 -#define __glibcpp_signed_short_min __glibcpp_s16_min -#define __glibcpp_signed_short_max __glibcpp_s16_max -#define __glibcpp_signed_short_digits __glibcpp_s16_digits -#define __glibcpp_signed_short_digits10 __glibcpp_s16_digits10 -#define __glibcpp_unsigned_short_min __glibcpp_u16_min -#define __glibcpp_unsigned_short_max __glibcpp_u16_max -#define __glibcpp_unsigned_short_digits __glibcpp_u16_digits -#define __glibcpp_unsigned_short_digits10 __glibcpp_u16_digits10 -#elif __glibcpp_short_bits == 32 -#define __glibcpp_signed_short_min (short)__glibcpp_s32_min -#define __glibcpp_signed_short_max (short)__glibcpp_s32_max -#define __glibcpp_signed_short_digits __glibcpp_s32_digits -#define __glibcpp_signed_short_digits10 __glibcpp_s32_digits10 -#define __glibcpp_unsigned_short_min (unsigned short)__glibcpp_u32_min -#define __glibcpp_unsigned_short_max (unsigned short)__glibcpp_u32_max -#define __glibcpp_unsigned_short_digits __glibcpp_u32_digits -#define __glibcpp_unsigned_short_digits10 __glibcpp_u32_digits10 -#elif __glibcpp_short_bits == 64 -#define __glibcpp_signed_short_min (short)__glibcpp_s64_min -#define __glibcpp_signed_short_max (short)__glibcpp_s64_max -#define __glibcpp_signed_short_digits __glibcpp_s64_digits -#define __glibcpp_signed_short_digits10 __glibcpp_s64_digits10 -#define __glibcpp_unsigned_short_min (unsigned short)__glibcpp_u64_min -#define __glibcpp_unsigned_short_max (unsigned short)__glibcpp_u64_max -#define __glibcpp_unsigned_short_digits __glibcpp_u64_digits -#define __glibcpp_unsigned_short_digits10 __glibcpp_u64_digits10 -#else -// You must define these macros in the configuration file. -#endif - -// int - -#define __glibcpp_signed_int_traps true -#define __glibcpp_unsigned_int_traps true -#ifndef __glibcpp_signed_int_is_modulo -#define __glibcpp_signed_int_is_modulo true -#endif -#if __glibcpp_int_bits == 8 -#define __glibcpp_signed_int_min __glibcpp_s8_min -#define __glibcpp_signed_int_max __glibcpp_s8_max -#define __glibcpp_signed_int_digits __glibcpp_s8_digits -#define __glibcpp_signed_int_digits10 __glibcpp_s8_digits10 -#define __glibcpp_unsigned_int_min __glibcpp_u8_min -#define __glibcpp_unsigned_int_max __glibcpp_u8_max -#define __glibcpp_unsigned_int_digits __glibcpp_u8_digits -#define __glibcpp_unsigned_int_digits10 __glibcpp_u8_digits10 -#elif __glibcpp_int_bits == 16 -#define __glibcpp_signed_int_min __glibcpp_s16_min -#define __glibcpp_signed_int_max __glibcpp_s16_max -#define __glibcpp_signed_int_digits __glibcpp_s16_digits -#define __glibcpp_signed_int_digits10 __glibcpp_s16_digits10 -#define __glibcpp_unsigned_int_min __glibcpp_u16_min -#define __glibcpp_unsigned_int_max __glibcpp_u16_max -#define __glibcpp_unsigned_int_digits __glibcpp_u16_digits -#define __glibcpp_unsigned_int_digits10 __glibcpp_u16_digits10 -#elif __glibcpp_int_bits == 32 -#define __glibcpp_signed_int_min (int)__glibcpp_s32_min -#define __glibcpp_signed_int_max (int)__glibcpp_s32_max -#define __glibcpp_signed_int_digits __glibcpp_s32_digits -#define __glibcpp_signed_int_digits10 __glibcpp_s32_digits10 -#define __glibcpp_unsigned_int_min (unsigned)__glibcpp_u32_min -#define __glibcpp_unsigned_int_max (unsigned)__glibcpp_u32_max -#define __glibcpp_unsigned_int_digits __glibcpp_u32_digits -#define __glibcpp_unsigned_int_digits10 __glibcpp_u32_digits10 -#elif __glibcpp_int_bits == 64 -#define __glibcpp_signed_int_min (int)__glibcpp_s64_min -#define __glibcpp_signed_int_max (int)__glibcpp_s64_max -#define __glibcpp_signed_int_digits __glibcpp_s64_digits -#define __glibcpp_signed_int_digits10 __glibcpp_s64_digits10 -#define __glibcpp_unsigned_int_min (unsigned)__glibcpp_u64_min -#define __glibcpp_unsigned_int_max (unsigned)__glibcpp_u64_max -#define __glibcpp_unsigned_int_digits __glibcpp_u64_digits -#define __glibcpp_unsigned_int_digits10 __glibcpp_u64_digits10 -#else -// You must define these macros in the configuration file. -#endif - -// long - -#define __glibcpp_signed_long_traps true -#define __glibcpp_unsigned_long_traps true -#ifndef __glibcpp_signed_long_is_modulo -#define __glibcpp_signed_long_is_modulo true -#endif -#if __glibcpp_long_bits == 8 -#define __glibcpp_signed_long_min __glibcpp_s8_min -#define __glibcpp_signed_long_max __glibcpp_s8_max -#define __glibcpp_signed_long_digits __glibcpp_s8_digits -#define __glibcpp_signed_long_digits10 __glibcpp_s8_digits10 -#define __glibcpp_unsigned_long_min __glibcpp_u8_min -#define __glibcpp_unsigned_long_max __glibcpp_u8_max -#define __glibcpp_unsigned_long_digits __glibcpp_u8_digits -#define __glibcpp_unsigned_long_digits10 __glibcpp_u8_digits10 -#elif __glibcpp_long_bits == 16 -#define __glibcpp_signed_long_min __glibcpp_s16_min -#define __glibcpp_signed_long_max __glibcpp_s16_max -#define __glibcpp_signed_long_digits __glibcpp_s16_digits -#define __glibcpp_signed_long_digits10 __glibcpp_s16_digits10 -#define __glibcpp_unsigned_long_min __glibcpp_u16_min -#define __glibcpp_unsigned_long_max __glibcpp_u16_max -#define __glibcpp_unsigned_long_digits __glibcpp_u16_digits -#define __glibcpp_unsigned_long_digits10 __glibcpp_u16_digits10 -#elif __glibcpp_long_bits == 32 -#define __glibcpp_signed_long_min __glibcpp_s32_min -#define __glibcpp_signed_long_max __glibcpp_s32_max -#define __glibcpp_signed_long_digits __glibcpp_s32_digits -#define __glibcpp_signed_long_digits10 __glibcpp_s32_digits10 -#define __glibcpp_unsigned_long_min __glibcpp_u32_min -#define __glibcpp_unsigned_long_max __glibcpp_u32_max -#define __glibcpp_unsigned_long_digits __glibcpp_u32_digits -#define __glibcpp_unsigned_long_digits10 __glibcpp_u32_digits10 -#elif __glibcpp_long_bits == 64 -#define __glibcpp_signed_long_min (long)__glibcpp_s64_min -#define __glibcpp_signed_long_max (long)__glibcpp_s64_max -#define __glibcpp_signed_long_digits __glibcpp_s64_digits -#define __glibcpp_signed_long_digits10 __glibcpp_s64_digits10 -#define __glibcpp_unsigned_long_min (unsigned long)__glibcpp_u64_min -#define __glibcpp_unsigned_long_max (unsigned long)__glibcpp_u64_max -#define __glibcpp_unsigned_long_digits __glibcpp_u64_digits -#define __glibcpp_unsigned_long_digits10 __glibcpp_u64_digits10 -#else -// You must define these macros in the configuration file. -#endif - -// long long - -#define __glibcpp_signed_long_long_traps true -#define __glibcpp_signed_long_long_traps true -#ifndef __glibcpp_signed_long_long_is_modulo -#define __glibcpp_signed_long_long_is_modulo true -#endif -#if __glibcpp_long_long_bits == 8 -#define __glibcpp_signed_long_long_min __glibcpp_s8_min -#define __glibcpp_signed_long_long_max __glibcpp_s8_max -#define __glibcpp_signed_long_long_digits __glibcpp_s8_digits -#define __glibcpp_signed_long_long_digits10 __glibcpp_s8_digits10 -#define __glibcpp_unsigned_long_long_min __glibcpp_u8_min -#define __glibcpp_unsigned_long_long_max __glibcpp_u8_max -#define __glibcpp_unsigned_long_long_digits __glibcpp_u8_digits -#define __glibcpp_unsigned_long_long_digits10 __glibcpp_u8_digits10 -#elif __glibcpp_long_long_bits == 16 -#define __glibcpp_signed_long_long_min __glibcpp_s16_min -#define __glibcpp_signed_long_long_max __glibcpp_s16_max -#define __glibcpp_signed_long_long_digits __glibcpp_s16_digits -#define __glibcpp_signed_long_long_digits10 __glibcpp_s16_digits10 -#define __glibcpp_unsigned_long_long_min __glibcpp_u16_min -#define __glibcpp_unsigned_long_long_max __glibcpp_u16_max -#define __glibcpp_unsigned_long_long_digits __glibcpp_u16_digits -#define __glibcpp_unsigned_long_long_digits10 __glibcpp_u16_digits10 -#elif __glibcpp_long_long_bits == 32 -#define __glibcpp_signed_long_long_min __glibcpp_s32_min -#define __glibcpp_signed_long_long_max __glibcpp_s32_max -#define __glibcpp_signed_long_long_digits __glibcpp_s32_digits -#define __glibcpp_signed_long_long_digits10 __glibcpp_s32_digits10 -#define __glibcpp_unsigned_long_long_min __glibcpp_u32_min -#define __glibcpp_unsigned_long_long_max __glibcpp_u32_max -#define __glibcpp_unsigned_long_long_digits __glibcpp_u32_digits -#define __glibcpp_unsigned_long_long_digits10 __glibcpp_u32_digits10 -#elif __glibcpp_long_long_bits == 64 -#define __glibcpp_signed_long_long_min __glibcpp_s64_min -#define __glibcpp_signed_long_long_max __glibcpp_s64_max -#define __glibcpp_signed_long_long_digits __glibcpp_s64_digits -#define __glibcpp_signed_long_long_digits10 __glibcpp_s64_digits10 -#define __glibcpp_signed_long_long_traps true -#define __glibcpp_unsigned_long_long_min __glibcpp_u64_min -#define __glibcpp_unsigned_long_long_max __glibcpp_u64_max -#define __glibcpp_unsigned_long_long_digits __glibcpp_u64_digits -#define __glibcpp_unsigned_long_long_digits10 __glibcpp_u64_digits10 -#define __glibcpp_unsigned_long_long_traps true -#else -// You must define these macros in the configuration file. -#endif - -// wchar_t - -#define __glibcpp_wchar_t_traps true -#ifndef __glibcpp_wchar_t_is_modulo -#define __glibcpp_wchar_t_is_modulo true -#endif -#if __glibcpp_wchar_t_is_signed -#if __glibcpp_wchar_t_bits == 8 -#define __glibcpp_wchar_t_min __glibcpp_s8_min -#define __glibcpp_wchar_t_max __glibcpp_s8_max -#define __glibcpp_wchar_t_digits __glibcpp_s8_digits -#define __glibcpp_wchar_t_digits10 __glibcpp_s8_digits10 -#elif __glibcpp_wchar_t_bits == 16 -#define __glibcpp_wchar_t_min __glibcpp_s16_min -#define __glibcpp_wchar_t_max __glibcpp_s16_max -#define __glibcpp_wchar_t_digits __glibcpp_s16_digits -#define __glibcpp_wchar_t_digits10 __glibcpp_s16_digits10 -#elif __glibcpp_wchar_t_bits == 32 -#define __glibcpp_wchar_t_min (wchar_t)__glibcpp_s32_min -#define __glibcpp_wchar_t_max (wchar_t)__glibcpp_s32_max -#define __glibcpp_wchar_t_digits __glibcpp_s32_digits -#define __glibcpp_wchar_t_digits10 __glibcpp_s32_digits10 -#elif __glibcpp_wchar_t_bits == 64 -#define __glibcpp_wchar_t_min (wchar_t)__glibcpp_s64_min -#define __glibcpp_wchar_t_max (wchar_t)__glibcpp_s64_max -#define __glibcpp_wchar_t_digits __glibcpp_s64_digits -#define __glibcpp_wchar_t_digits10 __glibcpp_s64_digits10 -#else -// You must define these macros in the configuration file. -#endif -#else -#if __glibcpp_wchar_t_bits == 8 -#define __glibcpp_wchar_t_min __glibcpp_u8_min -#define __glibcpp_wchar_t_max __glibcpp_u8_max -#define __glibcpp_wchar_t_digits __glibcpp_u8_digits -#define __glibcpp_wchar_t_digits10 __glibcpp_u8_digits10 -#elif __glibcpp_wchar_t_bits == 16 -#define __glibcpp_wchar_t_min __glibcpp_u16_min -#define __glibcpp_wchar_t_max __glibcpp_u16_max -#define __glibcpp_wchar_t_digits __glibcpp_u16_digits -#define __glibcpp_wchar_t_digits10 __glibcpp_u16_digits10 -#elif __glibcpp_wchar_t_bits == 32 -#define __glibcpp_wchar_t_min (wchar_t)__glibcpp_u32_min -#define __glibcpp_wchar_t_max (wchar_t)__glibcpp_u32_max -#define __glibcpp_wchar_t_digits __glibcpp_u32_digits -#define __glibcpp_wchar_t_digits10 __glibcpp_u32_digits10 -#elif __glibcpp_wchar_t_bits == 64 -#define __glibcpp_wchar_t_min (wchar_t)__glibcpp_u64_min -#define __glibcpp_wchar_t_max (wchar_t)__glibcpp_u64_max -#define __glibcpp_wchar_t_digits __glibcpp_u64_digits -#define __glibcpp_wchar_t_digits10 __glibcpp_u64_digits10 -#else -// You must define these macros in the configuration file. -#endif -#endif - -// float -// - -#if __glibcpp_float_bits == 32 -#define __glibcpp_float_min __glibcpp_f32_min -#define __glibcpp_float_max __glibcpp_f32_max -#define __glibcpp_float_digits __glibcpp_f32_digits -#define __glibcpp_float_digits10 __glibcpp_f32_digits10 -#define __glibcpp_float_radix __glibcpp_f32_radix -#define __glibcpp_float_epsilon __glibcpp_f32_epsilon -#define __glibcpp_float_round_error __glibcpp_f32_round_error -#define __glibcpp_float_min_exponent __glibcpp_f32_min_exponent -#define __glibcpp_float_min_exponent10 __glibcpp_f32_min_exponent10 -#define __glibcpp_float_max_exponent __glibcpp_f32_max_exponent -#define __glibcpp_float_max_exponent10 __glibcpp_f32_max_exponent10 -#elif __glibcpp_float_bits == 64 -#define __glibcpp_float_min __glibcpp_f64_min -#define __glibcpp_float_max __glibcpp_f64_max -#define __glibcpp_float_digits __glibcpp_f64_digits -#define __glibcpp_float_digits10 __glibcpp_f64_digits10 -#define __glibcpp_float_radix __glibcpp_f64_radix -#define __glibcpp_float_epsilon __glibcpp_f64_epsilon -#define __glibcpp_float_round_error __glibcpp_f64_round_error -#define __glibcpp_float_min_exponent __glibcpp_f64_min_exponent -#define __glibcpp_float_min_exponent10 __glibcpp_f64_min_exponent10 -#define __glibcpp_float_max_exponent __glibcpp_f64_max_exponent -#define __glibcpp_float_max_exponent10 __glibcpp_f64_max_exponent10 -#elif __glibcpp_float_bits == 80 -#define __glibcpp_float_min __glibcpp_f80_min -#define __glibcpp_float_max __glibcpp_f80_max -#define __glibcpp_float_digits __glibcpp_f80_digits -#define __glibcpp_float_digits10 __glibcpp_f80_digits10 -#define __glibcpp_float_radix __glibcpp_f80_radix -#define __glibcpp_float_epsilon __glibcpp_f80_epsilon -#define __glibcpp_float_round_error __glibcpp_f80_round_error -#define __glibcpp_float_min_exponent __glibcpp_f80_min_exponent -#define __glibcpp_float_min_exponent10 __glibcpp_f80_min_exponent10 -#define __glibcpp_float_max_exponent __glibcpp_f80_max_exponent -#define __glibcpp_float_max_exponent10 __glibcpp_f80_max_exponent10 -#else -// You must define these macros in the configuration file. -#endif - -// FIXME: These are just stubs and inkorrect - -#ifndef __glibcpp_float_has_infinity -#define __glibcpp_float_has_infinity false -#endif - -#ifndef __glibcpp_float_has_quiet_NaN -#define __glibcpp_float_has_quiet_NaN false -#endif - -#ifndef __glibcpp_float_has_signaling_NaN -#define __glibcpp_float_has_signaling_NaN false -#endif - -#ifndef __glibcpp_float_has_denorm -#define __glibcpp_float_has_denorm denorm_absent -#endif - -#ifndef __glibcpp_float_has_denorm_loss -#define __glibcpp_float_has_denorm_loss false -#endif - -#ifndef __glibcpp_float_infinity -#define __glibcpp_float_infinity 0.0F -#endif - -#ifndef __glibcpp_float_quiet_NaN -#define __glibcpp_float_quiet_NaN 0.0F -#endif - -#ifndef __glibcpp_float_signaling_NaN -#define __glibcpp_float_signaling_NaN 0.0F -#endif - -#ifndef __glibcpp_float_denorm_min -#define __glibcpp_float_denorm_min 0.0F -#endif - -#ifndef __glibcpp_float_is_iec559 -#define __glibcpp_float_is_iec559 false -#endif - -#ifndef __glibcpp_float_is_bounded -#define __glibcpp_float_is_bounded true -#endif - -#ifndef __glibcpp_float_is_modulo -#define __glibcpp_float_is_modulo false -#endif - -#ifndef __glibcpp_float_traps -#define __glibcpp_float_traps false -#endif - -#ifndef __glibcpp_float_tinyness_before -#define __glibcpp_float_tinyness_before false -#endif - -#ifndef __glibcpp_float_round_style -#define __glibcpp_float_round_style round_toward_zero -#endif - -// double - -#if __glibcpp_double_bits == 32 -#define __glibcpp_double_min __glibcpp_f32_min -#define __glibcpp_double_max __glibcpp_f32_max -#define __glibcpp_double_digits __glibcpp_f32_digits -#define __glibcpp_double_digits10 __glibcpp_f32_digits10 -#define __glibcpp_double_radix __glibcpp_f32_radix -#define __glibcpp_double_epsilon __glibcpp_f32_epsilon -#define __glibcpp_double_round_error __glibcpp_f32_round_error -#define __glibcpp_double_min_exponent __glibcpp_f32_min_exponent -#define __glibcpp_double_min_exponent10 __glibcpp_f32_min_exponent10 -#define __glibcpp_double_max_exponent __glibcpp_f32_max_exponent -#define __glibcpp_double_max_exponent10 __glibcpp_f32_max_exponent10 -#elif __glibcpp_double_bits == 64 -#define __glibcpp_double_min __glibcpp_f64_min -#define __glibcpp_double_max __glibcpp_f64_max -#define __glibcpp_double_digits __glibcpp_f64_digits -#define __glibcpp_double_digits10 __glibcpp_f64_digits10 -#define __glibcpp_double_radix __glibcpp_f64_radix -#define __glibcpp_double_epsilon __glibcpp_f64_epsilon -#define __glibcpp_double_round_error __glibcpp_f64_round_error -#define __glibcpp_double_min_exponent __glibcpp_f64_min_exponent -#define __glibcpp_double_min_exponent10 __glibcpp_f64_min_exponent10 -#define __glibcpp_double_max_exponent __glibcpp_f64_max_exponent -#define __glibcpp_double_max_exponent10 __glibcpp_f64_max_exponent10 -#elif __glibcpp_double_bits == 80 -#define __glibcpp_double_min __glibcpp_f80_min -#define __glibcpp_double_max __glibcpp_f80_max -#define __glibcpp_double_digits __glibcpp_f80_digits -#define __glibcpp_double_digits10 __glibcpp_f80_digits10 -#define __glibcpp_double_radix __glibcpp_f80_radix -#define __glibcpp_double_epsilon __glibcpp_f80_epsilon -#define __glibcpp_double_round_error __glibcpp_f80_round_error -#define __glibcpp_double_min_exponent __glibcpp_f80_min_exponent -#define __glibcpp_double_min_exponent10 __glibcpp_f80_min_exponent10 -#define __glibcpp_double_max_exponent __glibcpp_f80_max_exponent -#define __glibcpp_double_max_exponent10 __glibcpp_f80_max_exponent10 -#else -// You must define these macros in the configuration file. -#endif - -// FIXME: These are just stubs and inkorrect - -#ifndef __glibcpp_double_has_infinity -#define __glibcpp_double_has_infinity false -#endif - -#ifndef __glibcpp_double_has_quiet_NaN -#define __glibcpp_double_has_quiet_NaN false -#endif - -#ifndef __glibcpp_double_has_signaling_NaN -#define __glibcpp_double_has_signaling_NaN false -#endif - -#ifndef __glibcpp_double_has_denorm -#define __glibcpp_double_has_denorm denorm_absent -#endif - -#ifndef __glibcpp_double_has_denorm_loss -#define __glibcpp_double_has_denorm_loss false -#endif - -#ifndef __glibcpp_double_infinity -#define __glibcpp_double_infinity 0.0 -#endif - -#ifndef __glibcpp_double_quiet_NaN -#define __glibcpp_double_quiet_NaN 0.0 -#endif - -#ifndef __glibcpp_double_signaling_NaN -#define __glibcpp_double_signaling_NaN 0.0 -#endif - -#ifndef __glibcpp_double_denorm_min -#define __glibcpp_double_denorm_min 0.0 -#endif - -#ifndef __glibcpp_double_is_iec559 -#define __glibcpp_double_is_iec559 false -#endif - -#ifndef __glibcpp_double_is_bounded -#define __glibcpp_double_is_bounded true -#endif - -#ifndef __glibcpp_double_is_modulo -#define __glibcpp_double_is_modulo false -#endif - -#ifndef __glibcpp_double_traps -#define __glibcpp_double_traps false -#endif - -#ifndef __glibcpp_double_tinyness_before -#define __glibcpp_double_tinyness_before false -#endif - -#ifndef __glibcpp_double_round_style -#define __glibcpp_double_round_style round_toward_zero -#endif - -// long double - -#if __glibcpp_long_double_bits == 32 -#define __glibcpp_long_double_min __glibcpp_f32_min -#define __glibcpp_long_double_max __glibcpp_f32_max -#define __glibcpp_long_double_digits __glibcpp_f32_digits -#define __glibcpp_long_double_digits10 __glibcpp_f32_digits10 -#define __glibcpp_long_double_radix __glibcpp_f32_radix -#define __glibcpp_long_double_epsilon __glibcpp_f32_epsilon -#define __glibcpp_long_double_round_error __glibcpp_f32_round_error -#define __glibcpp_long_double_min_exponent __glibcpp_f32_min_exponent -#define __glibcpp_long_double_min_exponent10 __glibcpp_f32_min_exponent10 -#define __glibcpp_long_double_max_exponent __glibcpp_f32_max_exponent -#define __glibcpp_long_double_max_exponent10 __glibcpp_f32_max_exponent10 -#elif __glibcpp_long_double_bits == 64 -#define __glibcpp_long_double_min __glibcpp_f64_min -#define __glibcpp_long_double_max __glibcpp_f64_max -#define __glibcpp_long_double_digits __glibcpp_f64_digits -#define __glibcpp_long_double_digits10 __glibcpp_f64_digits10 -#define __glibcpp_long_double_radix __glibcpp_f64_radix -#define __glibcpp_long_double_epsilon __glibcpp_f64_epsilon -#define __glibcpp_long_double_round_error __glibcpp_f64_round_error -#define __glibcpp_long_double_min_exponent __glibcpp_f64_min_exponent -#define __glibcpp_long_double_min_exponent10 __glibcpp_f64_min_exponent10 -#define __glibcpp_long_double_max_exponent __glibcpp_f64_max_exponent -#define __glibcpp_long_double_max_exponent10 __glibcpp_f64_max_exponent10 -#elif __glibcpp_long_double_bits == 80 -#define __glibcpp_long_double_min __glibcpp_f80_min -#define __glibcpp_long_double_max __glibcpp_f80_max -#define __glibcpp_long_double_digits __glibcpp_f80_digits -#define __glibcpp_long_double_digits10 __glibcpp_f80_digits10 -#define __glibcpp_long_double_radix __glibcpp_f80_radix -#define __glibcpp_long_double_epsilon __glibcpp_f80_epsilon -#define __glibcpp_long_double_round_error __glibcpp_f80_round_error -#define __glibcpp_long_double_min_exponent __glibcpp_f80_min_exponent -#define __glibcpp_long_double_min_exponent10 __glibcpp_f80_min_exponent10 -#define __glibcpp_long_double_max_exponent __glibcpp_f80_max_exponent -#define __glibcpp_long_double_max_exponent10 __glibcpp_f80_max_exponent10 -#elif __glibcpp_long_double_bits == 96 -#define __glibcpp_long_double_min __glibcpp_f96_min -#define __glibcpp_long_double_max __glibcpp_f96_max -#define __glibcpp_long_double_digits __glibcpp_f96_digits -#define __glibcpp_long_double_digits10 __glibcpp_f96_digits10 -#define __glibcpp_long_double_radix __glibcpp_f96_radix -#define __glibcpp_long_double_epsilon __glibcpp_f96_epsilon -#define __glibcpp_long_double_round_error __glibcpp_f96_round_error -#define __glibcpp_long_double_min_exponent __glibcpp_f96_min_exponent -#define __glibcpp_long_double_min_exponent10 __glibcpp_f96_min_exponent10 -#define __glibcpp_long_double_max_exponent __glibcpp_f96_max_exponent -#define __glibcpp_long_double_max_exponent10 __glibcpp_f96_max_exponent10 -#elif __glibcpp_long_double_bits == 128 -#define __glibcpp_long_double_min __glibcpp_f128_min -#define __glibcpp_long_double_max __glibcpp_f128_max -#define __glibcpp_long_double_digits __glibcpp_f128_digits -#define __glibcpp_long_double_digits10 __glibcpp_f128_digits10 -#define __glibcpp_long_double_radix __glibcpp_f128_radix -#define __glibcpp_long_double_epsilon __glibcpp_f128_epsilon -#define __glibcpp_long_double_round_error __glibcpp_f128_round_error -#define __glibcpp_long_double_min_exponent __glibcpp_f128_min_exponent -#define __glibcpp_long_double_min_exponent10 __glibcpp_f128_min_exponent10 -#define __glibcpp_long_double_max_exponent __glibcpp_f128_max_exponent -#define __glibcpp_long_double_max_exponent10 __glibcpp_f128_max_exponent10 -#else -// You must define these macros in the configuration file. -#endif - -// FIXME: These are just stubs and inkorrect - -#ifndef __glibcpp_long_double_has_infinity -#define __glibcpp_long_double_has_infinity false -#endif - -#ifndef __glibcpp_long_double_has_quiet_NaN -#define __glibcpp_long_double_has_quiet_NaN false -#endif - -#ifndef __glibcpp_long_double_has_signaling_NaN -#define __glibcpp_long_double_has_signaling_NaN false -#endif - -#ifndef __glibcpp_long_double_has_denorm -#define __glibcpp_long_double_has_denorm denorm_absent -#endif - -#ifndef __glibcpp_long_double_has_denorm_loss -#define __glibcpp_long_double_has_denorm_loss false -#endif - -#ifndef __glibcpp_long_double_infinity -#define __glibcpp_long_double_infinity 0.0L -#endif - -#ifndef __glibcpp_long_double_quiet_NaN -#define __glibcpp_long_double_quiet_NaN 0.0L -#endif - -#ifndef __glibcpp_long_double_signaling_NaN -#define __glibcpp_long_double_signaling_NaN 0.0L -#endif - -#ifndef __glibcpp_long_double_denorm_min -#define __glibcpp_long_double_denorm_min 0.0L -#endif - -#ifndef __glibcpp_long_double_is_iec559 -#define __glibcpp_long_double_is_iec559 false -#endif - -#ifndef __glibcpp_long_double_is_bounded -#define __glibcpp_long_double_is_bounded true -#endif - -#ifndef __glibcpp_long_double_is_modulo -#define __glibcpp_long_double_is_modulo false -#endif - -#ifndef __glibcpp_long_double_traps -#define __glibcpp_long_double_traps false -#endif - -#ifndef __glibcpp_long_double_tinyness_before -#define __glibcpp_long_double_tinyness_before false -#endif - -#ifndef __glibcpp_long_double_round_style -#define __glibcpp_long_double_round_style round_toward_zero -#endif - - -namespace std -{ - enum float_round_style - { - round_indeterminate = -1, - round_toward_zero = 0, - round_to_nearest = 1, - round_toward_infinity = 2, - round_toward_neg_infinity = 3 - }; - - enum float_denorm_style - { - denorm_indeterminate = -1, - denorm_absent = 0, - denorm_present = 1 - }; - - // - // The primary class traits - // - struct __numeric_limits_base - { - static const bool is_specialized = false; - - static const int digits = 0; - static const int digits10 = 0; - static const bool is_signed = false; - static const bool is_integer = false; - static const bool is_exact = false; - static const int radix = 0; - - static const int min_exponent = 0; - static const int min_exponent10 = 0; - static const int max_exponent = 0; - static const int max_exponent10 = 0; - - static const bool has_infinity = false; - static const bool has_quiet_NaN = false; - static const bool has_signaling_NaN = false; - static const float_denorm_style has_denorm = denorm_absent; - static const bool has_denorm_loss = false; - - static const bool is_iec559 = false; - static const bool is_bounded = false; - static const bool is_modulo = false; - - static const bool traps = false; - static const bool tinyness_before = false; - static const float_round_style round_style = round_toward_zero; - }; - - template - struct numeric_limits : public __numeric_limits_base - { - static _Tp min() throw() { return static_cast<_Tp>(0); } - static _Tp max() throw() { return static_cast<_Tp>(0); } - static _Tp epsilon() throw() { return static_cast<_Tp>(0); } - static _Tp round_error() throw() { return static_cast<_Tp>(0); } - static _Tp infinity() throw() { return static_cast<_Tp>(0); } - static _Tp quiet_NaN() throw() { return static_cast<_Tp>(0); } - static _Tp signaling_NaN() throw() { return static_cast<_Tp>(0); } - static _Tp denorm_min() throw() { return static_cast<_Tp>(0); } - }; - - // Now there follow 15 explicit specializations. Yes, 15. Make sure - // you get the count right. - template<> - struct numeric_limits - { - static const bool is_specialized = true; - - static bool min() throw() - { return false; } - - static bool max() throw() - { return true; } - - static const int digits = __glibcpp_bool_digits; - static const int digits10 = 0; - static const bool is_signed = false; - static const bool is_integer = true; - static const bool is_exact = true; - static const int radix = 2; - static bool epsilon() throw() - { return false; } - static bool round_error() throw() - { return false; } - - static const int min_exponent = 0; - static const int min_exponent10 = 0; - static const int max_exponent = 0; - static const int max_exponent10 = 0; - - static const bool has_infinity = false; - static const bool has_quiet_NaN = false; - static const bool has_signaling_NaN = false; - static const float_denorm_style has_denorm = denorm_absent; - static const bool has_denorm_loss = false; - - static bool infinity() throw() - { return false; } - static bool quiet_NaN() throw() - { return false; } - static bool signaling_NaN() throw() - { return false; } - static bool denorm_min() throw() - { return false; } - - static const bool is_iec559 = false; - static const bool is_bounded = true; - static const bool is_modulo = false; - - // It is not clear what it means for a boolean type to trap. - // This is a DR on the LWG issue list. Here, I use integer - // promotion semantics. - static const bool traps = __glibcpp_signed_int_traps - || __glibcpp_signed_long_traps; - static const bool tinyness_before = false; - static const float_round_style round_style = round_toward_zero; - }; - -#undef __glibcpp_bool_digits - - template<> - struct numeric_limits - { - static const bool is_specialized = true; - - static char min() throw() - { return __glibcpp_char_min; } - static char max() throw() - { return __glibcpp_char_max; } - - static const int digits = __glibcpp_char_digits; - static const int digits10 = __glibcpp_char_digits10; - static const bool is_signed = __glibcpp_plain_char_is_signed; - static const bool is_integer = true; - static const bool is_exact = true; - static const int radix = 2; - static char epsilon() throw() - { return char(); } - static char round_error() throw() - { return char(); } - - static const int min_exponent = 0; - static const int min_exponent10 = 0; - static const int max_exponent = 0; - static const int max_exponent10 = 0; - - static const bool has_infinity = false; - static const bool has_quiet_NaN = false; - static const bool has_signaling_NaN = false; - static const float_denorm_style has_denorm = denorm_absent; - static const bool has_denorm_loss = false; - - static char infinity() throw() - { return char(); } - static char quiet_NaN() throw() - { return char(); } - static char signaling_NaN() throw() - { return char(); } - static char denorm_min() throw() - { return static_cast(0); } - - static const bool is_iec559 = false; - static const bool is_bounded = true; - static const bool is_modulo = __glibcpp_char_is_modulo; - - static const bool traps = __glibcpp_char_traps; - static const bool tinyness_before = false; - static const float_round_style round_style = round_toward_zero; - }; - -#undef __glibcpp_char_min -#undef __glibcpp_char_max -#undef __glibcpp_char_digits -#undef __glibcpp_char_digits10 -#undef __glibcpp_char_is_signed -#undef __glibcpp_char_is_modulo -#undef __glibcpp_char_traps - - - - template<> - struct numeric_limits - { - static const bool is_specialized = true; - - static signed char min() throw() - { return __glibcpp_signed_char_min; } - static signed char max() throw() - { return __glibcpp_signed_char_max; } - - static const int digits = __glibcpp_signed_char_digits; - static const int digits10 = __glibcpp_signed_char_digits10; - static const bool is_signed = true; - static const bool is_integer = true; - static const bool is_exact = true; - static const int radix = 2; - static signed char epsilon() throw() - { return 0; } - static signed char round_error() throw() - { return 0; } - - static const int min_exponent = 0; - static const int min_exponent10 = 0; - static const int max_exponent = 0; - static const int max_exponent10 = 0; - - static const bool has_infinity = false; - static const bool has_quiet_NaN = false; - static const bool has_signaling_NaN = false; - static const float_denorm_style has_denorm = denorm_absent; - static const bool has_denorm_loss = false; - - static signed char infinity() throw() - { return static_cast(0); } - static signed char quiet_NaN() throw() - { return static_cast(0); } - static signed char signaling_NaN() throw() - { return static_cast(0); } - static signed char denorm_min() throw() - { return static_cast(0); } - - static const bool is_iec559 = false; - static const bool is_bounded = true; - static const bool is_modulo = __glibcpp_signed_char_is_modulo; - - static const bool traps = __glibcpp_signed_char_traps; - static const bool tinyness_before = false; - static const float_round_style round_style = round_toward_zero; - }; - -#undef __glibcpp_signed_char_min -#undef __glibcpp_signed_char_max -#undef __glibcpp_signed_char_digits -#undef __glibcpp_signed_char_digits10 -#undef __glibcpp_signed_char_is_modulo -#undef __glibcpp_signed_char_traps - - template<> - struct numeric_limits - { - static const bool is_specialized = true; - - static unsigned char min() throw() - { return 0; } - static unsigned char max() throw() - { return __glibcpp_unsigned_char_max; } - - static const int digits = __glibcpp_unsigned_char_digits; - static const int digits10 = __glibcpp_unsigned_char_digits10; - static const bool is_signed = false; - static const bool is_integer = true; - static const bool is_exact = true; - static const int radix = 2; - static unsigned char epsilon() throw() - { return 0; } - static unsigned char round_error() throw() - { return 0; } - - static const int min_exponent = 0; - static const int min_exponent10 = 0; - static const int max_exponent = 0; - static const int max_exponent10 = 0; - - static const bool has_infinity = false; - static const bool has_quiet_NaN = false; - static const bool has_signaling_NaN = false; - static const float_denorm_style has_denorm = denorm_absent; - static const bool has_denorm_loss = false; - - static unsigned char infinity() throw() - { return static_cast(0); } - static unsigned char quiet_NaN() throw() - { return static_cast(0); } - static unsigned char signaling_NaN() throw() - { return static_cast(0); } - static unsigned char denorm_min() throw() - { return static_cast(0); } - - static const bool is_iec559 = false; - static const bool is_bounded = true; - static const bool is_modulo = true; - - static const bool traps = __glibcpp_unsigned_char_traps; - static const bool tinyness_before = false; - static const float_round_style round_style = round_toward_zero; - }; - -#undef __glibcpp_unsigned_char_max -#undef __glibcpp_unsigned_char_digits -#undef __glibcpp_unsigned_char_digits10 -#undef __glibcpp_unsigned_char_traps - - template<> - struct numeric_limits - { - static const bool is_specialized = true; - - static wchar_t min() throw() - { return __glibcpp_wchar_t_min; } - static wchar_t max() throw() - { return __glibcpp_wchar_t_max; } - - static const int digits = __glibcpp_wchar_t_digits; - static const int digits10 = __glibcpp_wchar_t_digits10; - static const bool is_signed = __glibcpp_wchar_t_is_signed; - static const bool is_integer = true; - static const bool is_exact = true; - static const int radix = 2; - static wchar_t epsilon() throw() - { return 0; } - static wchar_t round_error() throw() - { return 0; } - - static const int min_exponent = 0; - static const int min_exponent10 = 0; - static const int max_exponent = 0; - static const int max_exponent10 = 0; - - static const bool has_infinity = false; - static const bool has_quiet_NaN = false; - static const bool has_signaling_NaN = false; - static const float_denorm_style has_denorm = denorm_absent; - static const bool has_denorm_loss = false; - - static wchar_t infinity() throw() - { return wchar_t(); } - static wchar_t quiet_NaN() throw() - { return wchar_t(); } - static wchar_t signaling_NaN() throw() - { return wchar_t(); } - static wchar_t denorm_min() throw() - { return wchar_t(); } - - static const bool is_iec559 = false; - static const bool is_bounded = true; - static const bool is_modulo = __glibcpp_wchar_t_is_modulo; - - static const bool traps = __glibcpp_wchar_t_traps; - static const bool tinyness_before = false; - static const float_round_style round_style = round_toward_zero; - }; - -#undef __glibcpp_wchar_t_min -#undef __glibcpp_wchar_t_max -#undef __glibcpp_wchar_t_digits -#undef __glibcpp_wchar_t_digits10 -#undef __glibcpp_wchar_t_is_signed -#undef __glibcpp_wchar_t_is_modulo -#undef __glibcpp_wchar_t_traps - - template<> - struct numeric_limits - { - static const bool is_specialized = true; - - static short min() throw() - { return __glibcpp_signed_short_min; } - static short max() throw() - { return __glibcpp_signed_short_max; } - - static const int digits = __glibcpp_signed_short_digits; - static const int digits10 = __glibcpp_signed_short_digits10; - static const bool is_signed = true; - static const bool is_integer = true; - static const bool is_exact = true; - static const int radix = 2; - static short epsilon() throw() - { return 0; } - static short round_error() throw() - { return 0; } - - static const int min_exponent = 0; - static const int min_exponent10 = 0; - static const int max_exponent = 0; - static const int max_exponent10 = 0; - - static const bool has_infinity = false; - static const bool has_quiet_NaN = false; - static const bool has_signaling_NaN = false; - static const float_denorm_style has_denorm = denorm_absent; - static const bool has_denorm_loss = false; - - static short infinity() throw() - { return short(); } - static short quiet_NaN() throw() - { return short(); } - static short signaling_NaN() throw() - { return short(); } - static short denorm_min() throw() - { return short(); } - - static const bool is_iec559 = true; - static const bool is_bounded = true; - static const bool is_modulo = __glibcpp_signed_short_is_modulo; - - static const bool traps = __glibcpp_signed_short_traps; - static const bool tinyness_before = false; - static const float_round_style round_style = round_toward_zero; - }; - -#undef __glibcpp_signed_short_min -#undef __glibcpp_signed_short_max -#undef __glibcpp_signed_short_digits -#undef __glibcpp_signed_short_digits10 -#undef __glibcpp_signed_short_is_modulo -#undef __glibcpp_signed_short_traps - - template<> - struct numeric_limits - { - static const bool is_specialized = true; - - static unsigned short min() throw() - { return 0; } - static unsigned short max() throw() - { return __glibcpp_unsigned_short_max; } - - static const int digits = __glibcpp_unsigned_short_digits; - static const int digits10 = __glibcpp_unsigned_short_digits10; - static const bool is_signed = false; - static const bool is_integer = true; - static const bool is_exact = true; - static const int radix = 2; - static unsigned short epsilon() throw() - { return 0; } - static unsigned short round_error() throw() - { return 0; } - - static const int min_exponent = 0; - static const int min_exponent10 = 0; - static const int max_exponent = 0; - static const int max_exponent10 = 0; - - static const bool has_infinity = false; - static const bool has_quiet_NaN = false; - static const bool has_signaling_NaN = false; - static const float_denorm_style has_denorm = denorm_absent; - static const bool has_denorm_loss = false; - - static unsigned short infinity() throw() - { return static_cast(0); } - static unsigned short quiet_NaN() throw() - { return static_cast(0); } - static unsigned short signaling_NaN() throw() - { return static_cast(0); } - static unsigned short denorm_min() throw() - { return static_cast(0); } - - static const bool is_iec559 = true; - static const bool is_bounded = true; - static const bool is_modulo = true; - - static const bool traps = __glibcpp_unsigned_short_traps; - static const bool tinyness_before = false; - static const float_round_style round_style = round_toward_zero; - }; - -#undef __glibcpp_unsigned_short_max -#undef __glibcpp_unsigned_short_digits -#undef __glibcpp_unsigned_short_digits10 -#undef __glibcpp_unsigned_short_traps - - template<> - struct numeric_limits - { - static const bool is_specialized = true; - - static int min() throw() - { return __glibcpp_signed_int_min; } - static int max() throw() - { return __glibcpp_signed_int_max; } - - static const int digits = __glibcpp_signed_int_digits; - static const int digits10 = __glibcpp_signed_int_digits10; - static const bool is_signed = true; - static const bool is_integer = true; - static const bool is_exact = true; - static const int radix = 2; - static int epsilon() throw() - { return 0; } - static int round_error() throw() - { return 0; } - - static const int min_exponent = 0; - static const int min_exponent10 = 0; - static const int max_exponent = 0; - static const int max_exponent10 = 0; - - static const bool has_infinity = false; - static const bool has_quiet_NaN = false; - static const bool has_signaling_NaN = false; - static const float_denorm_style has_denorm = denorm_absent; - static const bool has_denorm_loss = false; - - static int infinity() throw() - { return static_cast(0); } - static int quiet_NaN() throw() - { return static_cast(0); } - static int signaling_NaN() throw() - { return static_cast(0); } - static int denorm_min() throw() - { return static_cast(0); } - - static const bool is_iec559 = true; - static const bool is_bounded = true; - static const bool is_modulo = __glibcpp_signed_int_is_modulo; - - static const bool traps = __glibcpp_signed_int_traps; - static const bool tinyness_before = false; - static const float_round_style round_style = round_toward_zero; - }; - -#undef __glibcpp_signed_int_min -#undef __glibcpp_signed_int_max -#undef __glibcpp_signed_int_digits -#undef __glibcpp_signed_int_digits10 -#undef __glibcpp_signed_int_is_modulo -#undef __glibcpp_signed_int_traps - - template<> - struct numeric_limits - { - static const bool is_specialized = true; - - static unsigned int min() throw() - { return 0; } - static unsigned int max() throw() - { return __glibcpp_unsigned_int_max; } - - static const int digits = __glibcpp_unsigned_int_digits; - static const int digits10 = __glibcpp_unsigned_int_digits10; - static const bool is_signed = false; - static const bool is_integer = true; - static const bool is_exact = true; - static const int radix = 2; - static unsigned int epsilon() throw() - { return 0; } - static unsigned int round_error() throw() - { return 0; } - - static const int min_exponent = 0; - static const int min_exponent10 = 0; - static const int max_exponent = 0; - static const int max_exponent10 = 0; - - static const bool has_infinity = false; - static const bool has_quiet_NaN = false; - static const bool has_signaling_NaN = false; - static const float_denorm_style has_denorm = denorm_absent; - static const bool has_denorm_loss = false; - - static unsigned int infinity() throw() - { return static_cast(0); } - static unsigned int quiet_NaN() throw() - { return static_cast(0); } - static unsigned int signaling_NaN() throw() - { return static_cast(0); } - static unsigned int denorm_min() throw() - { return static_cast(0); } - - static const bool is_iec559 = true; - static const bool is_bounded = true; - static const bool is_modulo = true; - - static const bool traps = __glibcpp_unsigned_int_traps; - static const bool tinyness_before = false; - static const float_round_style round_style = round_toward_zero; - }; - -#undef __glibcpp_unsigned_int_max -#undef __glibcpp_unsigned_int_digits -#undef __glibcpp_unsigned_int_digits10 -#undef __glibcpp_unsigned_int_traps - - template<> - struct numeric_limits - { - static const bool is_specialized = true; - - static long min() throw() - { return __glibcpp_signed_long_min; } - static long max() throw() - { return __glibcpp_signed_long_max; } - - static const int digits = __glibcpp_signed_long_digits; - static const int digits10 = __glibcpp_signed_long_digits10; - static const bool is_signed = true; - static const bool is_integer = true; - static const bool is_exact = true; - static const int radix = 2; - static long epsilon() throw() - { return 0; } - static long round_error() throw() - { return 0; } - - static const int min_exponent = 0; - static const int min_exponent10 = 0; - static const int max_exponent = 0; - static const int max_exponent10 = 0; - - static const bool has_infinity = false; - static const bool has_quiet_NaN = false; - static const bool has_signaling_NaN = false; - static const float_denorm_style has_denorm = denorm_absent; - static const bool has_denorm_loss = false; - - static long infinity() throw() - { return static_cast(0); } - static long quiet_NaN() throw() - { return static_cast(0); } - static long signaling_NaN() throw() - { return static_cast(0); } - static long denorm_min() throw() - { return static_cast(0); } - - static const bool is_iec559 = true; - static const bool is_bounded = true; - static const bool is_modulo = __glibcpp_signed_long_is_modulo; - - static const bool traps = __glibcpp_signed_long_traps; - static const bool tinyness_before = false; - static const float_round_style round_style = round_toward_zero; - }; - -#undef __glibcpp_signed_long_min -#undef __glibcpp_signed_long_max -#undef __glibcpp_signed_long_digits -#undef __glibcpp_signed_long_digits10 -#undef __glibcpp_signed_long_is_modulo -#undef __glibcpp_signed_long_traps - - template<> - struct numeric_limits - { - static const bool is_specialized = true; - - static unsigned long min() throw() - { return 0; } - static unsigned long max() throw() - { return __glibcpp_unsigned_long_max; } - - static const int digits = __glibcpp_unsigned_long_digits; - static const int digits10 = __glibcpp_unsigned_long_digits10; - static const bool is_signed = false; - static const bool is_integer = true; - static const bool is_exact = true; - static const int radix = 2; - static unsigned long epsilon() throw() - { return 0; } - static unsigned long round_error() throw() - { return 0; } - - static const int min_exponent = 0; - static const int min_exponent10 = 0; - static const int max_exponent = 0; - static const int max_exponent10 = 0; - - static const bool has_infinity = false; - static const bool has_quiet_NaN = false; - static const bool has_signaling_NaN = false; - static const float_denorm_style has_denorm = denorm_absent; - static const bool has_denorm_loss = false; - - static unsigned long infinity() throw() - { return static_cast(0); } - static unsigned long quiet_NaN() throw() - { return static_cast(0); } - static unsigned long signaling_NaN() throw() - { return static_cast(0); } - static unsigned long denorm_min() throw() - { return static_cast(0); } - - static const bool is_iec559 = true; - static const bool is_bounded = true; - static const bool is_modulo = true; - - static const bool traps = __glibcpp_unsigned_long_traps; - static const bool tinyness_before = false; - static const float_round_style round_style = round_toward_zero; - }; - -#undef __glibcpp_unsigned_long_max -#undef __glibcpp_unsigned_long_digits -#undef __glibcpp_unsigned_long_digits10 -#undef __glibcpp_unsigned_long_traps - - template<> - struct numeric_limits - { - static const bool is_specialized = true; - - static long long min() throw() - { return __glibcpp_signed_long_long_min; } - static long long max() throw() - { return __glibcpp_signed_long_long_max; } - - static const int digits = __glibcpp_signed_long_long_digits; - static const int digits10 = __glibcpp_signed_long_long_digits10; - static const bool is_signed = true; - static const bool is_integer = true; - static const bool is_exact = true; - static const int radix = 2; - static long long epsilon() throw() - { return 0; } - static long long round_error() throw() - { return 0; } - - static const int min_exponent = 0; - static const int min_exponent10 = 0; - static const int max_exponent = 0; - static const int max_exponent10 = 0; - - static const bool has_infinity = false; - static const bool has_quiet_NaN = false; - static const bool has_signaling_NaN = false; - static const float_denorm_style has_denorm = denorm_absent; - static const bool has_denorm_loss = false; - - static long long infinity() throw() - { return static_cast(0); } - static long long quiet_NaN() throw() - { return static_cast(0); } - static long long signaling_NaN() throw() - { return static_cast(0); } - static long long denorm_min() throw() - { return static_cast(0); } - - static const bool is_iec559 = true; - static const bool is_bounded = true; - static const bool is_modulo = __glibcpp_signed_long_long_is_modulo; - - static const bool traps = __glibcpp_signed_long_long_traps; - static const bool tinyness_before = false; - static const float_round_style round_style = round_toward_zero; - }; - -#undef __glibcpp_signed_long_long_min -#undef __glibcpp_signed_long_long_max -#undef __glibcpp_signed_long_long_digits -#undef __glibcpp_signed_long_long_digits10 -#undef __glibcpp_signed_long_long_is_modulo -#undef __glibcpp_signed_long_long_traps - - template<> - struct numeric_limits - { - static const bool is_specialized = true; - - static unsigned long long min() throw() - { return 0; } - static unsigned long long max() throw() - { return __glibcpp_unsigned_long_long_max; } - - static const int digits = __glibcpp_unsigned_long_long_digits; - static const int digits10 = __glibcpp_unsigned_long_long_digits10; - static const bool is_signed = false; - static const bool is_integer = true; - static const bool is_exact = true; - static const int radix = 2; - static unsigned long long epsilon() throw() - { return 0; } - static unsigned long long round_error() throw() - { return 0; } - - static const int min_exponent = 0; - static const int min_exponent10 = 0; - static const int max_exponent = 0; - static const int max_exponent10 = 0; - - static const bool has_infinity = false; - static const bool has_quiet_NaN = false; - static const bool has_signaling_NaN = false; - static const float_denorm_style has_denorm = denorm_absent; - static const bool has_denorm_loss = false; - - static unsigned long long infinity() throw() - { return static_cast(0); } - static unsigned long long quiet_NaN() throw() - { return static_cast(0); } - static unsigned long long signaling_NaN() throw() - { return static_cast(0); } - static unsigned long long denorm_min() throw() - { return static_cast(0); } - - static const bool is_iec559 = true; - static const bool is_bounded = true; - static const bool is_modulo = true; - - static const bool traps = true; - static const bool tinyness_before = false; - static const float_round_style round_style = round_toward_zero; - }; - -#undef __glibcpp_unsigned_long_long_max -#undef __glibcpp_unsigned_long_long_digits -#undef __glibcpp_unsigned_long_long_digits10 -#undef __glibcpp_unsigned_long_long_traps - - template<> - struct numeric_limits - { - static const bool is_specialized = true; - - static float min() throw() - { return __glibcpp_float_min; } - static float max() throw() - { return __glibcpp_float_max; } - - static const int digits = __glibcpp_float_digits; - static const int digits10 = __glibcpp_float_digits10; - static const bool is_signed = true; - static const bool is_integer = false; - static const bool is_exact = false; - static const int radix = __glibcpp_float_radix; - static float epsilon() throw() - { return __glibcpp_float_epsilon; } - static float round_error() throw() - { return __glibcpp_float_round_error; } - - static const int min_exponent = __glibcpp_float_min_exponent; - static const int min_exponent10 = __glibcpp_float_min_exponent10; - static const int max_exponent = __glibcpp_float_max_exponent; - static const int max_exponent10 = __glibcpp_float_max_exponent10; - - static const bool has_infinity = __glibcpp_float_has_infinity; - static const bool has_quiet_NaN = __glibcpp_float_has_quiet_NaN; - static const bool has_signaling_NaN = __glibcpp_float_has_signaling_NaN; - static const float_denorm_style has_denorm = __glibcpp_float_has_denorm; - static const bool has_denorm_loss = __glibcpp_float_has_denorm_loss; - - static float infinity() throw() - { return __glibcpp_float_infinity; } - static float quiet_NaN() throw() - { return __glibcpp_float_quiet_NaN; } - static float signaling_NaN() throw() - { return __glibcpp_float_signaling_NaN; } - static float denorm_min() throw() - { return __glibcpp_float_denorm_min; } - - static const bool is_iec559 = __glibcpp_float_is_iec559; - static const bool is_bounded = __glibcpp_float_is_bounded; - static const bool is_modulo = __glibcpp_float_is_modulo; - - static const bool traps = __glibcpp_float_traps; - static const bool tinyness_before = __glibcpp_float_tinyness_before; - static const float_round_style round_style = __glibcpp_float_round_style; - }; - -#undef __glibcpp_float_min -#undef __glibcpp_float_max -#undef __glibcpp_float_digits -#undef __glibcpp_float_digits10 -#undef __glibcpp_float_radix -#undef __glibcpp_float_round_error -#undef __glibcpp_float_min_exponent -#undef __glibcpp_float_min_exponent10 -#undef __glibcpp_float_max_exponent -#undef __glibcpp_float_max_exponent10 -#undef __glibcpp_float_has_infinity -#undef __glibcpp_float_has_quiet_NaN -#undef __glibcpp_float_has_signaling_NaN -#undef __glibcpp_float_has_denorm -#undef __glibcpp_float_has_denorm_loss -#undef __glibcpp_float_infinity -#undef __glibcpp_float_quiet_NaN -#undef __glibcpp_float_signaling_NaN -#undef __glibcpp_float_denorm_min -#undef __glibcpp_float_is_iec559 -#undef __glibcpp_float_is_bounded -#undef __glibcpp_float_is_modulo -#undef __glibcpp_float_traps -#undef __glibcpp_float_tinyness_before -#undef __glibcpp_float_round_style - - template<> - struct numeric_limits - { - static const bool is_specialized = true; - - static double min() throw() - { return __glibcpp_double_min; } - static double max() throw() - { return __glibcpp_double_max; } - - static const int digits = __glibcpp_double_digits; - static const int digits10 = __glibcpp_double_digits10; - static const bool is_signed = true; - static const bool is_integer = false; - static const bool is_exact = false; - static const int radix = __glibcpp_double_radix; - static double epsilon() throw() - { return __glibcpp_double_epsilon; } - static double round_error() throw() - { return __glibcpp_double_round_error; } - - static const int min_exponent = __glibcpp_double_min_exponent; - static const int min_exponent10 = __glibcpp_double_min_exponent10; - static const int max_exponent = __glibcpp_double_max_exponent; - static const int max_exponent10 = __glibcpp_double_max_exponent10; - - static const bool has_infinity = __glibcpp_double_has_infinity; - static const bool has_quiet_NaN = __glibcpp_double_has_quiet_NaN; - static const bool has_signaling_NaN = __glibcpp_double_has_signaling_NaN; - static const float_denorm_style has_denorm = - __glibcpp_double_has_denorm; - static const bool has_denorm_loss = __glibcpp_double_has_denorm_loss; - - static double infinity() throw() - { return __glibcpp_double_infinity; } - static double quiet_NaN() throw() - { return __glibcpp_double_quiet_NaN; } - static double signaling_NaN() throw() - { return __glibcpp_double_signaling_NaN; } - static double denorm_min() throw() - { return __glibcpp_double_denorm_min; } - - static const bool is_iec559 = __glibcpp_double_is_iec559; - static const bool is_bounded = __glibcpp_double_is_bounded; - static const bool is_modulo = __glibcpp_double_is_modulo; - - static const bool traps = __glibcpp_double_traps; - static const bool tinyness_before = __glibcpp_double_tinyness_before; - static const float_round_style round_style = - __glibcpp_double_round_style; - }; - -#undef __glibcpp_double_min -#undef __glibcpp_double_max -#undef __glibcpp_double_digits -#undef __glibcpp_double_digits10 -#undef __glibcpp_double_radix -#undef __glibcpp_double_round_error -#undef __glibcpp_double_min_exponent -#undef __glibcpp_double_min_exponent10 -#undef __glibcpp_double_max_exponent -#undef __glibcpp_double_max_exponent10 -#undef __glibcpp_double_has_infinity -#undef __glibcpp_double_has_quiet_NaN -#undef __glibcpp_double_has_signaling_NaN -#undef __glibcpp_double_has_denorm -#undef __glibcpp_double_has_denorm_loss -#undef __glibcpp_double_infinity -#undef __glibcpp_double_quiet_NaN -#undef __glibcpp_double_signaling_NaN -#undef __glibcpp_double_denorm_min -#undef __glibcpp_double_is_iec559 -#undef __glibcpp_double_is_bounded -#undef __glibcpp_double_is_modulo -#undef __glibcpp_double_traps -#undef __glibcpp_double_tinyness_before -#undef __glibcpp_double_round_style - - - template<> - struct numeric_limits - { - static const bool is_specialized = true; - - static long double min() throw() - { return __glibcpp_long_double_min; } - static long double max() throw() - { return __glibcpp_long_double_max; } - - static const int digits = __glibcpp_long_double_digits; - static const int digits10 = __glibcpp_long_double_digits10; - static const bool is_signed = true; - static const bool is_integer = false; - static const bool is_exact = false; - static const int radix = __glibcpp_long_double_radix; - static long double epsilon() throw() - { return __glibcpp_long_double_epsilon; } - static long double round_error() throw() - { return __glibcpp_long_double_round_error; } - - static const int min_exponent = __glibcpp_long_double_min_exponent; - static const int min_exponent10 = __glibcpp_long_double_min_exponent10; - static const int max_exponent = __glibcpp_long_double_max_exponent; - static const int max_exponent10 = __glibcpp_long_double_max_exponent10; - - static const bool has_infinity = __glibcpp_long_double_has_infinity; - static const bool has_quiet_NaN = __glibcpp_long_double_has_quiet_NaN; - static const bool has_signaling_NaN = - __glibcpp_long_double_has_signaling_NaN; - static const float_denorm_style has_denorm = - __glibcpp_long_double_has_denorm; - static const bool has_denorm_loss = - __glibcpp_long_double_has_denorm_loss; - - static long double infinity() throw() - { return __glibcpp_long_double_infinity; } - static long double quiet_NaN() throw() - { return __glibcpp_long_double_quiet_NaN; } - static long double signaling_NaN() throw() - { return __glibcpp_long_double_signaling_NaN; } - static long double denorm_min() throw() - { return __glibcpp_long_double_denorm_min; } - - static const bool is_iec559 = __glibcpp_long_double_is_iec559; - static const bool is_bounded = __glibcpp_long_double_is_bounded; - static const bool is_modulo = __glibcpp_long_double_is_modulo; - - static const bool traps = __glibcpp_long_double_traps; - static const bool tinyness_before = __glibcpp_long_double_tinyness_before; - static const float_round_style round_style = - __glibcpp_long_double_round_style; - }; - -#undef __glibcpp_long_double_min -#undef __glibcpp_long_double_max -#undef __glibcpp_long_double_digits -#undef __glibcpp_long_double_digits10 -#undef __glibcpp_long_double_radix -#undef __glibcpp_long_double_round_error -#undef __glibcpp_long_double_min_exponent -#undef __glibcpp_long_double_min_exponent10 -#undef __glibcpp_long_double_max_exponent -#undef __glibcpp_long_double_max_exponent10 -#undef __glibcpp_long_double_has_infinity -#undef __glibcpp_long_double_has_quiet_NaN -#undef __glibcpp_long_double_has_signaling_NaN -#undef __glibcpp_long_double_has_denorm -#undef __glibcpp_long_double_has_denorm_loss -#undef __glibcpp_long_double_infinity -#undef __glibcpp_long_double_quiet_NaN -#undef __glibcpp_long_double_signaling_NaN -#undef __glibcpp_long_double_denorm_min -#undef __glibcpp_long_double_is_iec559 -#undef __glibcpp_long_double_is_bounded -#undef __glibcpp_long_double_is_modulo -#undef __glibcpp_long_double_traps -#undef __glibcpp_long_double_tinyness_before -#undef __glibcpp_long_double_round_style - -} // namespace std - -#endif // _CPP_NUMERIC_LIMITS diff --git a/Nef_3/bbox/include/bbox/modified_two_way_scan.h b/Nef_3/bbox/include/bbox/modified_two_way_scan.h deleted file mode 100644 index 7e1407a0e68..00000000000 --- a/Nef_3/bbox/include/bbox/modified_two_way_scan.h +++ /dev/null @@ -1,63 +0,0 @@ -#ifndef CGAL_BBOX_MODIFIED_TWO_WAY_SCAN_H -#define CGAL_BBOX_MODIFIED_TWO_WAY_SCAN_H - -#include - -template< class RandomAccessIter, - class Callback, - class Traits > -void modified_two_way_scan( RandomAccessIter p_begin, RandomAccessIter p_end, - RandomAccessIter i_begin, RandomAccessIter i_end, - Callback& callback, Traits traits, unsigned int last_dim, - bool in_order = true ) -{ - typedef typename Traits::Compare Compare; - - std::sort( p_begin, p_end, Compare( 0 ) ); - std::sort( i_begin, i_end, Compare( 0 ) ); - - // for each box viewed as interval i - while( i_begin != i_end && p_begin != p_end ) { - if( Traits::is_lo_less_lo( *i_begin, *p_begin, 0 ) ) { - for( RandomAccessIter p = p_begin; - p != p_end && Traits::is_lo_less_hi( *p, *i_begin, 0 ); - ++p ) - { - for( unsigned int dim = 1; dim <= last_dim; ++dim ) - if( !Traits::does_intersect( *p, *i_begin, dim ) ) - goto no_intersection1; - if( Traits::contains_lo_point( *i_begin, *p, last_dim ) ) { - if( in_order ) - callback( *p, *i_begin ); - else - callback( *i_begin, *p ); - } - no_intersection1: - ; - } - ++i_begin; - } else { - for( RandomAccessIter i = i_begin; - i != i_end && Traits::is_lo_less_hi( *i, *p_begin, 0 ); - ++i ) - { - for( unsigned int dim = 1; dim <= last_dim; ++dim ) - if( !Traits::does_intersect( *p_begin, *i, dim ) ) - goto no_intersection2; - if( Traits::contains_lo_point( *i, *p_begin, last_dim ) ) { - if( in_order ) - callback( *p_begin, *i ); - else - callback( *i, *p_begin ); - } - no_intersection2: - ; - } - ++p_begin; - } - } - -} - - -#endif diff --git a/Nef_3/bbox/include/bbox/one_way_scan.h b/Nef_3/bbox/include/bbox/one_way_scan.h deleted file mode 100644 index c895587370a..00000000000 --- a/Nef_3/bbox/include/bbox/one_way_scan.h +++ /dev/null @@ -1,43 +0,0 @@ -#ifndef CGAL_BBOX_ONE_WAY_SCAN_H -#define CGAL_BBOX_ONE_WAY_SCAN_H - -#include - - -template< class RandomAccessIter, class Callback, class Traits > -void one_way_scan( RandomAccessIter p_begin, RandomAccessIter p_end, - RandomAccessIter i_begin, RandomAccessIter i_end, - Callback& callback, Traits traits, unsigned int last_dim, - bool in_order = true ) -{ - typedef typename Traits::Compare Compare; - std::sort( p_begin, p_end, Compare( 0 ) ); - std::sort( i_begin, i_end, Compare( 0 ) ); - - // for each box viewed as interval i - for( RandomAccessIter i = i_begin; i != i_end; ++i ) { - // look for the first box b with i.min <= p.min - for( ; p_begin != p_end && Traits::is_lo_less_lo( *p_begin, *i, 0 ); - ++p_begin ); - - // look for all boxes with p.min < i.max - for( RandomAccessIter p = p_begin; - p != p_end && Traits::is_lo_less_hi( *p, *i, 0 ); - ++p ) - { - for( unsigned int dim = 1; dim <= last_dim; ++dim ) - if( !Traits::does_intersect( *p, *i, dim ) ) - goto no_intersection; - if( in_order ) - callback( *p, *i ); - else - callback( *i, *p ); - no_intersection: - ; - } - } - -} - - -#endif diff --git a/Nef_3/bbox/include/bbox/segment_tree.h b/Nef_3/bbox/include/bbox/segment_tree.h deleted file mode 100644 index b1ec8fdbbf2..00000000000 --- a/Nef_3/bbox/include/bbox/segment_tree.h +++ /dev/null @@ -1,245 +0,0 @@ -#ifndef CGAL_BBOX_SEGMENT_TREE_H -#define CGAL_BBOX_SEGMENT_TREE_H - -#include -#include - -#include -#include -#include -#include -#include -#include - -#ifdef USE_MY_NUMERIC_LIMITS - #include -#else - #include -#endif - - - -#define DEBUG 0 - -template< class RandomAccessIter, class Traits > -RandomAccessIter -median_of_three( RandomAccessIter a, RandomAccessIter b, RandomAccessIter c, - Traits traits, unsigned int dim ) -{ - if( Traits::is_lo_less_lo( *a, *b, dim ) ) - if( Traits::is_lo_less_lo( *b, *c, dim ) ) - return b; - else if( Traits::is_lo_less_lo( *a, *c, dim ) ) - return c; - else - return a; - else if( Traits::is_lo_less_lo( *a, *c, dim ) ) - return a; - else if( Traits::is_lo_less_lo( *b, *c, dim ) ) - return c; - else - return b; -} - -template< class RandomAccessIter, class Traits > -RandomAccessIter -iterative_radon( RandomAccessIter begin, RandomAccessIter end, - Traits traits, unsigned int dim, int num_levels ) -{ - if( num_levels < 0 ) - return begin + lrand48() % std::distance( begin, end ); - - return median_of_three( - iterative_radon( begin, end, traits, dim, num_levels - 1 ), - iterative_radon( begin, end, traits, dim, num_levels - 1 ), - iterative_radon( begin, end, traits, dim, num_levels - 1 ), - traits, dim ); -} - -// returns iterator for first element in [begin,end) which does not satisfy -// the Split_Points_Predicate: [begin,mid) contains only points strictly less -// than mi. so, elements from [mid,end) are equal or higher than mi. -template< class RandomAccessIter, class Traits, class T > -RandomAccessIter -split_points( RandomAccessIter begin, RandomAccessIter end, Traits traits, - int dim, T& mi ) -{ - // magic formula - int levels = (int)(.91*log(((double)std::distance(begin,end))/137.0)+1); - levels = (levels <= 0) ? 1 : levels; - RandomAccessIter it = iterative_radon( begin, end, traits, dim, levels ); - mi = Traits::get_lo( *it, dim ); - return std::partition( begin, end, typename Traits::Lo_Less( mi, dim ) ); -} - - -//#define DEBUG 0 - -#if DEBUG - static int level = -1; - #define DUMP(msg) { \ - for( unsigned int i = level; i; --i ) \ - std::cout << " "; \ - std::cout << msg; \ - } -#else - #define DUMP(msg) ; -#endif - - -template< class ForwardIter, class Traits > -void dump_points( ForwardIter begin, ForwardIter end, Traits traits, - unsigned int dim ) { - while( begin != end ) { - std::cout << Traits::get_lo( *begin, dim ) << " "; - ++begin; - } - std::cout << std::endl; -} - -template< class ForwardIter, class Traits > -void dump_intervals( ForwardIter begin, ForwardIter end, Traits traits, - unsigned int dim ) { - while( begin != end ) { - std::cout << "[" << Traits::get_lo( *begin, dim ) << "," - << Traits::get_hi( *begin, dim ) << ") "; - ++begin; - } - std::cout << std::endl; -} - -template< class ForwardIter, class Traits > -void dump_box_numbers( ForwardIter begin, ForwardIter end, Traits traits ) { - while( begin != end ) { - std::cout << Traits::get_num( *begin ) << " "; - ++begin; - } - std::cout << std::endl; -} - -template< class T > -struct Counter { - T& value; - Counter( T& value ) : value( value ) { ++value; } - ~Counter() { --value; } -}; - -template< class RandomAccessIter, class Callback, class T, class Traits > -void segment_tree( RandomAccessIter p_begin, RandomAccessIter p_end, - RandomAccessIter i_begin, RandomAccessIter i_end, - T lo, T hi, - Callback& callback, Traits traits, unsigned int dim, - bool in_order ) -{ - typedef typename Traits::Box Box; - typedef typename Traits::Interval_Spanning_Predicate Spanning; - typedef typename Traits::Lo_Less Lo_Less; - typedef typename Traits::Hi_Greater Hi_Greater; - -#if DEBUG - Counter bla( level ); - //DUMP("----------------===========[ new node ]============-------------") - DUMP("range: [" << lo << "," << hi << ") dim " << dim << std::endl ) - DUMP("intervals: " ) - dump_box_numbers( i_begin, i_end, traits ); - //dump_intervals( i_begin, i_end, traits, dim ); - DUMP("points: " ) - dump_box_numbers( p_begin, p_end, traits ); - //dump_points( p_begin, p_end, traits, dim ); -#endif - -#if SEGMENT_TREE_CHECK_INVARIANTS - // first: each point is inside segment [lo,hi) - for( RandomAccessIter it = p_begin; it != p_end; ++it ) { - assert( Traits::get_lo( *it, dim ) < hi ); - assert( Traits::get_lo( *it, dim ) >= lo ); - } - // second: each interval intersects segment [lo,hi) - for( RandomAccessIter it = i_begin; it != i_end; ++it ) { - assert( Traits::get_lo( *it, dim ) < hi ); - assert( Traits::get_hi( *it, dim ) > lo ); - } -#endif - - if( p_begin == p_end || i_begin == i_end || lo >= hi ) - return; - - if( dim == 0 ) { - DUMP( "dim = 0. scanning ... " << std::endl ) - one_way_scan( p_begin, p_end, i_begin, i_end, - callback, traits, dim, in_order ); - return; - } - - if( (unsigned int)std::distance( p_begin, p_end ) < Traits::get_cutoff() || - (unsigned int)std::distance( i_begin, i_end ) < Traits::get_cutoff() ) - { - DUMP( "scanning ... " << std::endl ) - modified_two_way_scan( p_begin, p_end, i_begin, i_end, - callback, traits, dim, in_order ); - return; - } - - RandomAccessIter i_span_end = - lo == std::numeric_limits< T >::min() || - hi == std::numeric_limits< T >::max() ? i_begin : - std::partition( i_begin, i_end, Spanning( lo, hi, dim ) ); - - if( i_begin != i_span_end ) { - DUMP( "checking spanning intervals ... " << std::endl ) - // make two calls for roots of segment tree at next level. - segment_tree( p_begin, p_end, i_begin, i_span_end, - std::numeric_limits< T >::min(), - std::numeric_limits< T >::max(), - callback, traits, dim - 1, in_order ); - segment_tree( i_begin, i_span_end, p_begin, p_end, - std::numeric_limits< T >::min(), - std::numeric_limits< T >::max(), - callback, traits, dim - 1, !in_order ); - } - - T mi; - RandomAccessIter p_mid = split_points( p_begin, p_end, traits, dim, mi ); - - if( p_mid == p_begin || p_mid == p_end ) { - DUMP( "unable to split points! ") - //dump_points( p_begin, p_end, traits, dim ); - DUMP( "performing modified two_way_san ... " << std::endl ) - modified_two_way_scan( p_begin, p_end, i_span_end, i_end, - callback, traits, dim, in_order ); - return; - } - - RandomAccessIter i_mid; - // separate left intervals. - // left intervals have a low point strictly less than mi - i_mid = std::partition( i_span_end, i_end, Lo_Less( mi, dim ) ); - DUMP("->left" << std::endl ) - segment_tree( p_begin, p_mid, i_span_end, i_mid, lo, mi, - callback, traits, dim, in_order ); - // separate right intervals. - // right intervals have a high point strictly higher than mi - i_mid = std::partition( i_span_end, i_end, Hi_Greater( mi, dim ) ); - DUMP("->right"<< std::endl ) - segment_tree( p_mid, p_end, i_span_end, i_mid, mi, hi, - callback, traits, dim, in_order ); -} - -template< class RandomAccessIter, class Callback, class Traits > -void segment_tree( RandomAccessIter p_begin, RandomAccessIter p_end, - RandomAccessIter i_begin, RandomAccessIter i_end, - Callback& callback, Traits traits, unsigned int dim ) -{ - typedef typename Traits::NumberType T; - segment_tree( p_begin, p_end, i_begin, i_end, - -std::numeric_limits< T >::max(), - std::numeric_limits< T >::max(), - callback, traits, dim, true ); - - segment_tree( i_begin, i_end, p_begin, p_end, - -std::numeric_limits< T >::max(), - std::numeric_limits< T >::max(), - callback, traits, dim, false ); -} - -#endif diff --git a/Nef_3/bbox/makefile b/Nef_3/bbox/makefile deleted file mode 100644 index 3cf4d6750c6..00000000000 --- a/Nef_3/bbox/makefile +++ /dev/null @@ -1,15 +0,0 @@ -CXX = g++ -INCLUDE = -I./include -CXXFLAGS = $(INCLUDE) -O1 - -random_set_test: random_set_test.cc - $(CXX) $(CXXFLAGS) random_set_test.cc -o random_set_test - -automated_test: automated_test.cc - $(CXX) $(CXXFLAGS) automated_test.cc -o automated_test - - - - - # $(CXX) -O3 -fomit-frame-pointer -fexpensive-optimizations -falign-functions=4 -malign-double -fprefetch-loop-arrays -march=pentium3 -msse automated_test.cc -o segment_tree -# -funroll-loops brings 10 percent slowdown on duron750 (64kb cache) diff --git a/Nef_3/bbox/random_set_test.cc b/Nef_3/bbox/random_set_test.cc deleted file mode 100644 index 26fb352bd81..00000000000 --- a/Nef_3/bbox/random_set_test.cc +++ /dev/null @@ -1,164 +0,0 @@ -#include "bbox.h" -#include - -#include - -// enable invariant checking -#define SEGMENT_TREE_CHECK_INVARIANTS 1 -#include - -#include "Timer.h" - -#include -#include -#include -#include -#include -#include - - -using namespace std; - -typedef double NumberType; -typedef Bbox_3< NumberType > Box; -typedef Bbox_3_Adapter< Box > BoxAdapter; -typedef Default_Box_Traits< BoxAdapter > Traits; -typedef vector< Box > BoxContainer; -typedef pair< Box, Box > BoxPair; -typedef vector< BoxPair > ResultContainer; - - -static void fill_boxes( unsigned int n, BoxContainer& boxes ) { - unsigned int maxEdgeLength = (int) pow(n, (double)2/3); - - for( unsigned int i = 0; i < n; ++i ) { - NumberType lo[3], hi[3]; - for( unsigned int d = 0; d < 3; ++d ) { - lo[d] = (NumberType)(drand48() * (n - maxEdgeLength)); - hi[d] = lo[d] + 1 + (NumberType)(drand48() * maxEdgeLength); - } - boxes.push_back( Box( lo[0], lo[1], lo[2], hi[0], hi[1], hi[2] ) ); - } -} - -static void assertIntersection( const Box& a, const Box& b ) { - for( unsigned int dim = 0; dim < 3; ++dim ) { - if( Traits::does_intersect( a, b, dim ) == false ) { - cout << "does not intersect!" << endl; - //cout << a << endl << b << endl; - exit(-1); - } - } -} - - -template< class Storage > -struct StorageCallback { - unsigned int counter; - Storage& storage; - StorageCallback( Storage& storage ) : counter( 0 ), storage( storage ) {} - void operator()( const Box& a, const Box& b ) { - assertIntersection( a, b ); - ++counter; - storage.push_back( make_pair( a, b ) ); - } -}; - - - - -bool -operator==( const Box& a, const Box& b ) { - for( unsigned int dim = 0; dim < 3; ++dim ) - if( Traits::get_lo( a, dim ) != Traits::get_lo( b, dim ) || - Traits::get_hi( a, dim ) != Traits::get_hi( b, dim ) ) - return false; - return true; -} - -bool -operator==( const BoxPair& a, const BoxPair& b ) { - return( a.first == b.first && a.second == b.second || - a.first == b.second && a.second == b.first ); -} - -template< class Storage > -unsigned int countMissingItems( Storage& a, Storage& b ) { - unsigned int missing = 0; - for( typename Storage::iterator it = a.begin(); it != a.end(); ++it ) { - if( find( b.begin(), b.end(), *it ) == b.end() ) { - ++missing; - //cout << it->first << it->second << endl; - } - } - return missing; -} - -template< class Storage > -unsigned int countDuplicates( Storage& storage ) { - unsigned int counter = 0; - typedef typename Storage::iterator IT; - for( IT it = storage.begin(); it != storage.end(); ++it ) - for( IT it2 = it; it2 != storage.end(); ++it2 ) - if( it != it2 && *it == *it2 ) { - //cout << it->first.num() << " <-> " - // << it->second.num() << endl; - ++counter; - } - return counter; -} - -static void -test_n( unsigned int n ) -{ - BoxContainer boxes1, boxes2; - ResultContainer result_scanner, result_tree; - cout << "generating random box sets with size " << n << " ... " << flush; - fill_boxes( n, boxes1 ); - fill_boxes( n, boxes2 ); - cout << endl; - StorageCallback< ResultContainer > - callback1( result_scanner ), - callback2( result_tree ); - - cout << "one way scan ... " << flush; - Timer timer; - timer.start(); - one_way_scan( boxes1.begin(), boxes1.end(), - boxes2.begin(), boxes2.end(), callback1, Traits(), 2 ); - one_way_scan( boxes2.begin(), boxes2.end(), - boxes1.begin(), boxes1.end(), callback1, Traits(), 2 ); - timer.stop(); - cout << "got " << callback1.counter << " intersections in " - << timer.t << " seconds." - << endl; - - cout << "segment tree ... " << flush; - timer.reset(); - timer.start(); - Traits::cutoff = n < 2000 ? 6 : n / 100; - //Traits::cutoff = 5; - segment_tree( boxes1.begin(), boxes1.end(), - boxes2.begin(), boxes2.end(), callback2, Traits(), 2 ); - timer.stop(); - cout << "got " << callback2.counter << " intersections in " - << timer.t << " seconds." <