*** empty log message ***

This commit is contained in:
Michael Hoffmann 1999-11-23 18:27:33 +00:00
parent c586b52388
commit 76764fec7e
40 changed files with 12 additions and 787 deletions

View File

@ -1,5 +1,3 @@
#line 1475 "mon_search.aw"
#line 18 "code_formatting.awi"
// ============================================================================
//
// Copyright (c) 1998 The CGAL Consortium
@ -26,9 +24,6 @@
// Demo program: All Furthest Neighbors for a Convex Polygon
// ============================================================================
#line 1479 "mon_search.aw"
#line 509 "afn.awi"
#line 542 "afn.awi"
#include <CGAL/Cartesian.h>
#include <CGAL/Point_2.h>
#include <CGAL/Polygon_2.h>
@ -37,16 +32,12 @@
#include <CGAL/distance_predicates_2.h>
#include <CGAL/all_furthest_neighbors_2.h>
#include <vector>
#line 510 "afn.awi"
#line 553 "afn.awi"
#include <CGAL/squared_distance_2.h>
#include <CGAL/IO/Window_stream.h>
#include <iostream>
#line 511 "afn.awi"
using std::cout;
using std::endl;
#line 559 "afn.awi"
using std::vector;
using std::back_inserter;
using CGAL::Cartesian;
@ -56,12 +47,10 @@ using CGAL::Random_points_in_square_2;
using CGAL::random_convex_set_2;
using CGAL::has_smaller_dist_to_point;
using CGAL::all_furthest_neighbors;
#line 515 "afn.awi"
using CGAL::cgalize;
using CGAL::RED;
typedef double FT;
#line 571 "afn.awi"
typedef Cartesian< FT > R;
typedef CGAL::Point_2< R > Point;
typedef Polygon_traits_2< R > P_traits;
@ -70,8 +59,6 @@ typedef vector< int > Index_cont;
typedef CGAL::Polygon_2< P_traits, Point_cont > Polygon;
typedef Creator_uniform_2< FT, Point > Creator;
typedef Random_points_in_square_2< Point, Creator > Point_generator;
#line 520 "afn.awi"
#line 659 "afn.awi"
void
wait_for_button_release( leda_window& W)
{
@ -81,7 +68,6 @@ wait_for_button_release( leda_window& W)
do {}
while ( W.read_event( v, x, y) != button_release_event);
}
#line 521 "afn.awi"
int
main()
@ -91,7 +77,6 @@ main()
W.init(-1.25, 1.25, -1.25);
W.display();
#line 582 "afn.awi"
// get points, last point with middle button:
cout << "\nCGAL ALL FURTHEST NEIGHBORS DEMO\n"
<< "================================\n\n"
@ -101,25 +86,19 @@ main()
<< " neighbor of a vertex >\n"
<< " < click any other mouse button to quit >\n"
<< endl;
#line 531 "afn.awi"
int number_of_points(30);
#line 594 "afn.awi"
// generate random convex polygon:
Polygon p;
random_convex_set_2( number_of_points,
back_inserter( p),
Point_generator( 1));
#line 533 "afn.awi"
W << RED << p;
#line 602 "afn.awi"
// compute all furthest neighbors:
Index_cont neighbors;
all_furthest_neighbors(
p.vertices_begin(),
p.vertices_end(),
back_inserter( neighbors));
#line 535 "afn.awi"
#line 617 "afn.awi"
// output solution:
W.set_mode(leda_xor_mode);
W.set_fg_color(leda_blue);
@ -155,12 +134,9 @@ main()
}
wait_for_button_release(W);
#line 536 "afn.awi"
return 0;
} // int main()
#line 1480 "mon_search.aw"
#line 12 "code_formatting.awi"
// ----------------------------------------------------------------------------
// ** EOF
// ----------------------------------------------------------------------------

View File

@ -1,5 +1,3 @@
#line 1506 "mon_search.aw"
#line 18 "code_formatting.awi"
// ============================================================================
//
// Copyright (c) 1998 The CGAL Consortium
@ -26,8 +24,6 @@
// Demo program: Compute extremal polygons of a convex polygon
// ============================================================================
#line 1510 "mon_search.aw"
#line 23 "testprog.awi"
#include <CGAL/Cartesian.h>
#include <CGAL/Point_2.h>
#include <CGAL/Segment_2.h>
@ -53,7 +49,6 @@ using std::back_inserter;
using std::copy;
using std::max;
#line 367 "testprog.awi"
using std::vector;
using CGAL::Cartesian;
using CGAL::Random_access_circulator_from_container;
@ -83,8 +78,6 @@ typedef vector< Vertex_iterator > Vertex_iteratorCont;
typedef Vertex_iteratorCont::iterator Vertex_iteratorIter;
#line 49 "testprog.awi"
#line 659 "afn.awi"
void
wait_for_button_release( leda_window& W)
{
@ -94,12 +87,10 @@ wait_for_button_release( leda_window& W)
do {}
while ( W.read_event( v, x, y) != button_release_event);
}
#line 50 "testprog.awi"
int
main()
{
#line 177 "testprog.awi"
leda_window W( 650, 650);
int k( 3);
W.int_item( "k", k, 2, 12, "#vertices of polygon to inscribe");
@ -128,14 +119,12 @@ main()
cgalize( W);
W.display();
W.init( -1.5, 1.5, -1.5);
#line 55 "testprog.awi"
PointCont points;
Polygon p;
bool polygon_changed(false);
for (;;) {
#line 122 "testprog.awi"
if (polygon_changed) {
// compute convex hull:
PointCont ch_points;
@ -180,7 +169,6 @@ main()
W.message( vertices_message);
#line 62 "testprog.awi"
if (compute_mode != 1) {
// compute maximum area inscribed k-gon:
@ -201,14 +189,12 @@ main()
cout << "[time: " << t.time() << " msec]" << endl;
#endif // EXTREMAL_POLYGON_MEASURE
W.set_fg_color(leda_green);
#line 168 "testprog.awi"
if ( !p.empty()) {
PointIter i( k_gon.begin());
while ( ++i != k_gon.end())
W << Segment( *(i-1), *i);
W << Segment( *--i, *(k_gon.begin()));
} // if ( !p.empty())
#line 83 "testprog.awi"
} // if ( p.size() >= 3)
} // if ( compute_mode != 1)
if (compute_mode != 0) {
@ -236,24 +222,20 @@ main()
cout << "[time: " << t.time() << " msec]" << endl;
#endif // EXTREMAL_POLYGON_MEASURE
W.set_fg_color( leda_orange);
#line 168 "testprog.awi"
if ( !p.empty()) {
PointIter i( k_gon.begin());
while ( ++i != k_gon.end())
W << Segment( *(i-1), *i);
W << Segment( *--i, *(k_gon.begin()));
} // if ( !p.empty())
#line 111 "testprog.awi"
} // if ( compute_mode != 0)
#line 208 "testprog.awi"
// wait for input:
int input;
for (;;) {
double x( 0), y( 0);
input = W.get_mouse( x, y);
if ( input == MOUSE_BUTTON( 2)) {
#line 273 "testprog.awi"
// move point
// find nearest vertex
@ -330,10 +312,8 @@ main()
polygon_changed = true;
break;
}
#line 215 "testprog.awi"
}
else if ( input == MOUSE_BUTTON( 3)) {
#line 254 "testprog.awi"
// delete point
// find nearest vertex
@ -350,7 +330,6 @@ main()
polygon_changed = true;
break;
}
#line 218 "testprog.awi"
}
else if ( input == help_button) {
// display help text
@ -373,7 +352,6 @@ main()
return 0;
else if ( input == generate_button) {
// generate random convex polygon with n vertices
#line 352 "testprog.awi"
typedef Random_points_in_square_2<
Point,
Creator_uniform_2< FT, Point >
@ -386,7 +364,6 @@ main()
polygon_changed = true;
break;
#line 240 "testprog.awi"
}
else if ( input == compute_button)
// recompute largest inscribing k-gon
@ -398,15 +375,12 @@ main()
break;
}
} // for (;;)
#line 114 "testprog.awi"
} // for (;;)
return 0;
} // int main()
#line 1511 "mon_search.aw"
#line 12 "code_formatting.awi"
// ----------------------------------------------------------------------------
// ** EOF
// ----------------------------------------------------------------------------

View File

@ -1,5 +1,3 @@
#line 645 "pcenter.aw"
#line 18 "code_formatting.awi"
// ============================================================================
//
// Copyright (c) 1998 The CGAL Consortium
@ -26,9 +24,6 @@
// Demo: 2-4-Centering Axis-Parallel 2D-Rectangles
// ============================================================================
#line 649 "pcenter.aw"
#line 185 "pc_testprog.awi"
#line 12 "pc_testprog.awi"
#include <CGAL/Cartesian.h>
#include <CGAL/Iso_rectangle_2.h>
#include <CGAL/Point_2.h>
@ -78,7 +73,6 @@ using CGAL::RED;
using CGAL::ORANGE;
using CGAL::GREEN;
#line 103 "pc_testprog.awi"
#ifdef _MSC_VER
// that compiler cannot even distinguish between global
// and class scope, so ...
@ -158,7 +152,6 @@ private:
#ifdef _MSC_VER
#undef Base
#endif // _MSC_VER
#line 62 "pc_testprog.awi"
// typedefs
//typedef Filtered_exact< double, leda_real > FT;
@ -182,9 +175,7 @@ typedef Istream_iterator< Point, leda_window>
Istream_iterator_point;
#line 186 "pc_testprog.awi"
#line 87 "pc_testprog.awi"
// function class to construct a box
// around a point p with radius r
template < class Point, class FT, class Box >
@ -198,7 +189,6 @@ struct Build_box
Point(p.x() + r, p.y() + r));
}
};
#line 188 "pc_testprog.awi"
int
main(int argc, char* argv[])
@ -295,7 +285,6 @@ main(int argc, char* argv[])
cerr << "random seed is " << random_seed << endl;
} else if (argc >= 2 && argv[1][0] == 'i') {
#ifndef _MSC_VER
#line 867 "pc_testprog.awi"
// read parameters
int p;
cin >> p;
@ -309,7 +298,6 @@ main(int argc, char* argv[])
cin >> p;
input_points.push_back(p);
}
#line 285 "pc_testprog.awi"
number_of_points = n;
number_of_clusters = p;
#endif
@ -583,8 +571,6 @@ main(int argc, char* argv[])
return 0;
}
#line 650 "pcenter.aw"
#line 12 "code_formatting.awi"
// ----------------------------------------------------------------------------
// ** EOF
// ----------------------------------------------------------------------------

View File

@ -1,5 +1,3 @@
#line 1493 "mon_search.aw"
#line 768 "afn.awi"
#include <CGAL/Cartesian.h>
#include <CGAL/Point_2.h>
#include <CGAL/Polygon_2.h>
@ -41,4 +39,3 @@ main()
return 0;
}
#line 1494 "mon_search.aw"

View File

@ -1,5 +1,3 @@
#line 1542 "mon_search.aw"
#line 757 "testprog.awi"
#include <CGAL/Cartesian.h>
#include <CGAL/Point_2.h>
#include <CGAL/Polygon_2.h>

View File

@ -1,5 +1,3 @@
#line 1546 "mon_search.aw"
#line 757 "testprog.awi"
#include <CGAL/Cartesian.h>
#include <CGAL/Point_2.h>
#include <CGAL/Polygon_2.h>

View File

@ -1,5 +1,3 @@
#line 690 "pcenter.aw"
#line 563 "pc_testprog.awi"
#include <CGAL/Cartesian.h>
#include <CGAL/Point_2.h>
#include <CGAL/point_generators_2.h>
@ -52,4 +50,3 @@ int main() {
return 0;
}
#line 691 "pcenter.aw"

View File

@ -1,5 +1,3 @@
#line 355 "fj_testprog.awi"
#line 293 "fj_testprog.awi"
#include <CGAL/Random.h>
#include <CGAL/function_objects.h>
#include <CGAL/Cartesian_matrix.h>
@ -50,4 +48,3 @@ int main() {
return 0;
}
#line 356 "fj_testprog.awi"

View File

@ -1,5 +1,3 @@
#line 1493 "mon_search.aw"
#line 768 "afn.awi"
#include <CGAL/Cartesian.h>
#include <CGAL/Point_2.h>
#include <CGAL/Polygon_2.h>
@ -41,4 +39,3 @@ main()
return 0;
}
#line 1494 "mon_search.aw"

View File

@ -1,5 +1,3 @@
#line 1542 "mon_search.aw"
#line 757 "testprog.awi"
#include <CGAL/Cartesian.h>
#include <CGAL/Point_2.h>
#include <CGAL/Polygon_2.h>

View File

@ -1,5 +1,3 @@
#line 1546 "mon_search.aw"
#line 757 "testprog.awi"
#include <CGAL/Cartesian.h>
#include <CGAL/Point_2.h>
#include <CGAL/Polygon_2.h>

View File

@ -1,5 +1,3 @@
#line 690 "pcenter.aw"
#line 563 "pc_testprog.awi"
#include <CGAL/Cartesian.h>
#include <CGAL/Point_2.h>
#include <CGAL/point_generators_2.h>
@ -52,4 +50,3 @@ int main() {
return 0;
}
#line 691 "pcenter.aw"

View File

@ -1,5 +1,3 @@
#line 355 "fj_testprog.awi"
#line 293 "fj_testprog.awi"
#include <CGAL/Random.h>
#include <CGAL/function_objects.h>
#include <CGAL/Cartesian_matrix.h>
@ -50,4 +48,3 @@ int main() {
return 0;
}
#line 356 "fj_testprog.awi"

View File

@ -1,5 +1,3 @@
#line 1484 "mon_search.aw"
#line 18 "code_formatting.awi"
// ============================================================================
//
// Copyright (c) 1998 The CGAL Consortium
@ -26,8 +24,6 @@
// Example program: All Furthest Neighbors for a Convex Polygon
// ============================================================================
#line 1488 "mon_search.aw"
#line 768 "afn.awi"
#include <CGAL/Cartesian.h>
#include <CGAL/Point_2.h>
#include <CGAL/Polygon_2.h>
@ -69,8 +65,6 @@ main()
return 0;
}
#line 1489 "mon_search.aw"
#line 12 "code_formatting.awi"
// ----------------------------------------------------------------------------
// ** EOF
// ----------------------------------------------------------------------------

View File

@ -1,5 +1,3 @@
#line 1533 "mon_search.aw"
#line 18 "code_formatting.awi"
// ============================================================================
//
// Copyright (c) 1998 The CGAL Consortium
@ -26,8 +24,6 @@
// Example program: Compute extremal polygons of a convex polygon
// ============================================================================
#line 1537 "mon_search.aw"
#line 757 "testprog.awi"
#include <CGAL/Cartesian.h>
#include <CGAL/Point_2.h>
#include <CGAL/Polygon_2.h>
@ -72,7 +68,6 @@ int main() {
return 0;
}
#line 12 "code_formatting.awi"
// ----------------------------------------------------------------------------
// ** EOF
// ----------------------------------------------------------------------------

View File

@ -1,5 +1,3 @@
#line 681 "pcenter.aw"
#line 18 "code_formatting.awi"
// ============================================================================
//
// Copyright (c) 1998 The CGAL Consortium
@ -26,8 +24,6 @@
// 2-4-Centering Axis-Parallel 2D-Rectangles - example program
// ============================================================================
#line 685 "pcenter.aw"
#line 563 "pc_testprog.awi"
#include <CGAL/Cartesian.h>
#include <CGAL/Point_2.h>
#include <CGAL/point_generators_2.h>
@ -80,8 +76,6 @@ int main() {
return 0;
}
#line 686 "pcenter.aw"
#line 12 "code_formatting.awi"
// ----------------------------------------------------------------------------
// ** EOF
// ----------------------------------------------------------------------------

View File

@ -1,5 +1,3 @@
#line 346 "fj_testprog.awi"
#line 18 "code_formatting.awi"
// ============================================================================
//
// Copyright (c) 1998 The CGAL Consortium
@ -26,8 +24,6 @@
// Sorted matrix search: Example Program
// ============================================================================
#line 350 "fj_testprog.awi"
#line 293 "fj_testprog.awi"
#include <CGAL/Random.h>
#include <CGAL/function_objects.h>
#include <CGAL/Cartesian_matrix.h>
@ -78,8 +74,6 @@ int main() {
return 0;
}
#line 351 "fj_testprog.awi"
#line 12 "code_formatting.awi"
// ----------------------------------------------------------------------------
// ** EOF
// ----------------------------------------------------------------------------

View File

@ -1,5 +1,3 @@
#line 1394 "mon_search.aw"
#line 18 "code_formatting.awi"
// ============================================================================
//
// Copyright (c) 1998 The CGAL Consortium
@ -26,21 +24,16 @@
// Compute all furthest neighbors for the vertices of a convex polygon
// ============================================================================
#line 1398 "mon_search.aw"
#line 54 "code_formatting.awi"
#if ! (CGAL_ALL_FURTHEST_NEIGHBORS_TRAITS_2_H)
#define CGAL_ALL_FURTHEST_NEIGHBORS_TRAITS_2_H 1
#line 281 "afn.awi"
#include <CGAL/basic.h>
#include <CGAL/Optimisation/assertions.h>
//!!! this should go into function_objects.h
#include <functional>
#include <CGAL/squared_distance_2.h>
#line 46 "code_formatting.awi"
CGAL_BEGIN_NAMESPACE
#line 288 "afn.awi"
template < class T1, class T2 >
struct Squared_distance
@ -51,15 +44,11 @@ struct Squared_distance
{ return squared_distance( t1, t2); }
};
#line 50 "code_formatting.awi"
CGAL_END_NAMESPACE
#line 299 "afn.awi"
#ifdef CGAL_CFG_NO_MEMBER_TEMPLATES
#include <vector>
#endif
#line 46 "code_formatting.awi"
CGAL_BEGIN_NAMESPACE
#line 303 "afn.awi"
template < class _R >
class All_furthest_neighbors_traits {
@ -75,7 +64,6 @@ public:
OutputIterator;
#endif
#line 130 "traits.awi"
#ifndef CGAL_CFG_NO_MEMBER_TEMPLATES
template < class RandomAccessIC >
#endif
@ -93,7 +81,6 @@ public:
Polygon_2 p( points_begin, points_end);
return p.is_convex();
} // is_convex( points_begin, points_end)
#line 319 "afn.awi"
};
template < class RandomAccessIC, class OutputIterator >
@ -129,13 +116,10 @@ CGAL_all_furthest_neighbors( RandomAccessIC points_begin,
All_furthest_neighbors_traits< R >());
} // CGAL_all_furthest_neighbors( ... )
#line 50 "code_formatting.awi"
CGAL_END_NAMESPACE
#line 355 "afn.awi"
#endif // ! (CGAL_ALL_FURTHEST_NEIGHBORS_TRAITS_2_H)
#line 12 "code_formatting.awi"
// ----------------------------------------------------------------------------
// ** EOF
// ----------------------------------------------------------------------------

View File

@ -1,5 +1,3 @@
#line 1328 "mon_search.aw"
#line 18 "code_formatting.awi"
// ============================================================================
//
// Copyright (c) 1998 The CGAL Consortium
@ -26,18 +24,13 @@
// A Representation for Cartesian Matrices
// ============================================================================
#line 1332 "mon_search.aw"
#line 54 "code_formatting.awi"
#if ! (CGAL_CARTESIAN_MATRIX_H)
#define CGAL_CARTESIAN_MATRIX_H 1
#line 28 "cartesian.awi"
#include <CGAL/basic.h>
#include <CGAL/Optimisation/assertions.h>
#line 46 "code_formatting.awi"
CGAL_BEGIN_NAMESPACE
#line 32 "cartesian.awi"
template < class Operation,
class RandomAccessIC_row,
@ -120,13 +113,10 @@ cartesian_matrix( RandomAccessIC_row r_f,
( r_f, r_l, c_f, c_l, o);
}
#line 50 "code_formatting.awi"
CGAL_END_NAMESPACE
#line 115 "cartesian.awi"
#endif // ! (CGAL_CARTESIAN_MATRIX_H)
#line 12 "code_formatting.awi"
// ----------------------------------------------------------------------------
// ** EOF
// ----------------------------------------------------------------------------

View File

@ -1,5 +1,3 @@
#line 1339 "mon_search.aw"
#line 18 "code_formatting.awi"
// ============================================================================
//
// Copyright (c) 1998 The CGAL Consortium
@ -26,17 +24,12 @@
// A Representation for Dynamic Matrices
// ============================================================================
#line 1343 "mon_search.aw"
#line 54 "code_formatting.awi"
#if ! (CGAL_DYNAMIC_MATRIX_H)
#define CGAL_DYNAMIC_MATRIX_H 1
#line 183 "afn.awi"
#include <CGAL/Optimisation/assertions.h>
#line 46 "code_formatting.awi"
CGAL_BEGIN_NAMESPACE
#line 186 "afn.awi"
template < class Matrix >
class Dynamic_matrix
@ -128,13 +121,10 @@ Dynamic_matrix< Matrix >
dynamic_matrix( const Matrix& m)
{ return Dynamic_matrix< Matrix >( m); }
#line 50 "code_formatting.awi"
CGAL_END_NAMESPACE
#line 278 "afn.awi"
#endif // ! (CGAL_DYNAMIC_MATRIX_H)
#line 12 "code_formatting.awi"
// ----------------------------------------------------------------------------
// ** EOF
// ----------------------------------------------------------------------------

View File

@ -1,5 +1,3 @@
#line 1464 "mon_search.aw"
#line 18 "code_formatting.awi"
// ============================================================================
//
// Copyright (c) 1998 The CGAL Consortium
@ -26,21 +24,15 @@
// Predefined Traits classes for Extremal Polygon Computation
// ============================================================================
#line 1468 "mon_search.aw"
#line 54 "code_formatting.awi"
#if ! (CGAL_EXTREMAL_POLYGON_TRAITS_2_H)
#define CGAL_EXTREMAL_POLYGON_TRAITS_2_H 1
#line 1449 "mon_search.aw"
#include <CGAL/Optimisation/assertions.h>
#include <CGAL/squared_distance_2.h>
#include <CGAL/Polygon_2.h>
#include <CGAL/function_objects.h>
#line 46 "code_formatting.awi"
CGAL_BEGIN_NAMESPACE
#line 1455 "mon_search.aw"
#line 20 "traits.awi"
template < class R > inline
#ifndef CGAL_CFG_RETURN_TYPE_BUG_1
typename R::FT
@ -56,8 +48,6 @@ Kgon_triangle_area( const Point_2< R >& p,
r.x() * ( p.y() - q.y()));
}
#line 72 "traits.awi"
#line 42 "traits.awi"
template < class _R >
class _Kgon_area_operator
: public CGAL_STD::binary_function< Point_2< _R >,
@ -82,7 +72,6 @@ private:
};
#line 73 "traits.awi"
template < class _R >
class Kgon_area_traits
@ -131,7 +120,6 @@ public:
// of maximum area to o in counterclockwise order and return
// the past-the-end iterator for that range (== o + min_k()).
{
#line 205 "traits.awi"
int number_of_points(
iterator_distance( points_begin, points_end));
CGAL_optimisation_precondition( number_of_points > min_k());
@ -173,10 +161,8 @@ public:
*o++ = opt_p1;
*o++ = 0;
return o;
#line 122 "traits.awi"
} // compute_min_k_gon( ... )
#line 130 "traits.awi"
#ifndef CGAL_CFG_NO_MEMBER_TEMPLATES
template < class RandomAccessIC >
#endif
@ -194,23 +180,16 @@ public:
Polygon_2 p( points_begin, points_end);
return p.is_convex();
} // is_convex( points_begin, points_end)
#line 125 "traits.awi"
};
#line 1456 "mon_search.aw"
#line 251 "traits.awi"
#line 50 "code_formatting.awi"
CGAL_END_NAMESPACE
#line 252 "traits.awi"
#include <CGAL/Optimisation/assertions.h>
#include <cmath>
#ifdef CGAL_USE_LEDA
#include <CGAL/leda_real.h>
#endif // CGAL_USE_LEDA
#line 46 "code_formatting.awi"
CGAL_BEGIN_NAMESPACE
#line 258 "traits.awi"
template < class _FT >
struct Sqrt
@ -223,8 +202,6 @@ struct Sqrt
{ return CGAL::sqrt( x); }
};
#line 315 "traits.awi"
#line 281 "traits.awi"
template < class _R >
class _Kgon_perimeter_operator
: public CGAL_STD::binary_function< Point_2< _R >,
@ -253,7 +230,6 @@ private:
const Point_2& root;
};
#line 316 "traits.awi"
template < class _R >
class Kgon_perimeter_traits
@ -308,7 +284,6 @@ public:
using std::max_element;
#endif
#line 384 "traits.awi"
CGAL_optimisation_precondition_code(
int number_of_points(
iterator_distance( points_begin, points_end));)
@ -330,10 +305,8 @@ public:
*o++ = 0;
return o;
#line 371 "traits.awi"
} // compute_min_k_gon( ... )
#line 130 "traits.awi"
#ifndef CGAL_CFG_NO_MEMBER_TEMPLATES
template < class RandomAccessIC >
#endif
@ -351,13 +324,10 @@ public:
Polygon_2 p( points_begin, points_end);
return p.is_convex();
} // is_convex( points_begin, points_end)
#line 374 "traits.awi"
};
#line 1457 "mon_search.aw"
#line 200 "mon_search.aw"
template < class RandomAccessIC,
class OutputIterator >
inline
@ -367,7 +337,6 @@ maximum_area_inscribed_k_gon(
RandomAccessIC points_end,
int k,
OutputIterator o)
#line 169 "mon_search.aw"
//
// preconditions:
// --------------
@ -376,22 +345,18 @@ maximum_area_inscribed_k_gon(
// * the range [points_begin, points_end) of size n > 0
// describes the vertices of a convex polygon $P$
// enumerated clock- or counterclockwise
#line 210 "mon_search.aw"
// * value_type of RandomAccessIC (=: Point_2)
// is Point_2<R> for some representation class R
// * OutputIterator accepts Point_2 as value_type
// * k >= 3
#line 186 "mon_search.aw"
//
// functionality:
// --------------
// computes maximum area inscribed k-gon $P_k$
// of the polygon $P$,
#line 194 "mon_search.aw"
// writes the indices (relative to points_begin)
// of $P_k$'s vertices to o and
// returns the past-the-end iterator of that sequence.
#line 216 "mon_search.aw"
{
return CGAL_maximum_area_inscribed_k_gon(
points_begin,
@ -412,7 +377,6 @@ CGAL_maximum_area_inscribed_k_gon(
int k,
OutputIterator o,
Point_2< R >*)
#line 169 "mon_search.aw"
//
// preconditions:
// --------------
@ -421,22 +385,18 @@ CGAL_maximum_area_inscribed_k_gon(
// * the range [points_begin, points_end) of size n > 0
// describes the vertices of a convex polygon $P$
// enumerated clock- or counterclockwise
#line 237 "mon_search.aw"
// * R is a CGAL representation class
// * value_type of RandomAccessIC is Point_2<R>
// * OutputIterator accepts Point_2<R> as value_type
// * k >= 3
#line 186 "mon_search.aw"
//
// functionality:
// --------------
// computes maximum area inscribed k-gon $P_k$
// of the polygon $P$,
#line 194 "mon_search.aw"
// writes the indices (relative to points_begin)
// of $P_k$'s vertices to o and
// returns the past-the-end iterator of that sequence.
#line 243 "mon_search.aw"
{
return extremal_polygon(
points_begin,
@ -446,7 +406,6 @@ CGAL_maximum_area_inscribed_k_gon(
Kgon_area_traits< R >());
} // CGAL_maximum_area_inscribed_k_gon( ... )
#line 200 "mon_search.aw"
template < class RandomAccessIC,
class OutputIterator >
inline
@ -456,7 +415,6 @@ maximum_perimeter_inscribed_k_gon(
RandomAccessIC points_end,
int k,
OutputIterator o)
#line 169 "mon_search.aw"
//
// preconditions:
// --------------
@ -465,22 +423,18 @@ maximum_perimeter_inscribed_k_gon(
// * the range [points_begin, points_end) of size n > 0
// describes the vertices of a convex polygon $P$
// enumerated clock- or counterclockwise
#line 210 "mon_search.aw"
// * value_type of RandomAccessIC (=: Point_2)
// is Point_2<R> for some representation class R
// * OutputIterator accepts Point_2 as value_type
// * k >= 2
#line 186 "mon_search.aw"
//
// functionality:
// --------------
// computes maximum perimeter inscribed k-gon $P_k$
// of the polygon $P$,
#line 194 "mon_search.aw"
// writes the indices (relative to points_begin)
// of $P_k$'s vertices to o and
// returns the past-the-end iterator of that sequence.
#line 216 "mon_search.aw"
{
return CGAL_maximum_perimeter_inscribed_k_gon(
points_begin,
@ -501,7 +455,6 @@ CGAL_maximum_perimeter_inscribed_k_gon(
int k,
OutputIterator o,
Point_2< R >*)
#line 169 "mon_search.aw"
//
// preconditions:
// --------------
@ -510,22 +463,18 @@ CGAL_maximum_perimeter_inscribed_k_gon(
// * the range [points_begin, points_end) of size n > 0
// describes the vertices of a convex polygon $P$
// enumerated clock- or counterclockwise
#line 237 "mon_search.aw"
// * R is a CGAL representation class
// * value_type of RandomAccessIC is Point_2<R>
// * OutputIterator accepts Point_2<R> as value_type
// * k >= 2
#line 186 "mon_search.aw"
//
// functionality:
// --------------
// computes maximum perimeter inscribed k-gon $P_k$
// of the polygon $P$,
#line 194 "mon_search.aw"
// writes the indices (relative to points_begin)
// of $P_k$'s vertices to o and
// returns the past-the-end iterator of that sequence.
#line 243 "mon_search.aw"
{
return extremal_polygon(
points_begin,
@ -535,13 +484,10 @@ CGAL_maximum_perimeter_inscribed_k_gon(
Kgon_perimeter_traits< R >());
} // CGAL_maximum_perimeter_inscribed_k_gon( ... )
#line 50 "code_formatting.awi"
CGAL_END_NAMESPACE
#line 1461 "mon_search.aw"
#endif // ! (CGAL_EXTREMAL_POLYGON_TRAITS_2_H)
#line 12 "code_formatting.awi"
// ----------------------------------------------------------------------------
// ** EOF
// ----------------------------------------------------------------------------

View File

@ -1,5 +1,3 @@
#line 70 "pierce_traits.awi"
#line 18 "code_formatting.awi"
// ============================================================================
//
// Copyright (c) 1998 The CGAL Consortium
@ -26,17 +24,12 @@
// 2-4-Piercing Axis-Parallel 2D-Rectangles
// ============================================================================
#line 74 "pierce_traits.awi"
#line 54 "code_formatting.awi"
#if ! (CGAL_PIERCE_RECTANGLES_2_TRAITS_H)
#define CGAL_PIERCE_RECTANGLES_2_TRAITS_H 1
#line 25 "pierce_traits.awi"
#include <CGAL/Point_2.h>
#line 46 "code_formatting.awi"
CGAL_BEGIN_NAMESPACE
#line 28 "pierce_traits.awi"
template < class _R >
struct Piercing_traits_cartesian {
@ -53,15 +46,11 @@ struct Piercing_traits_cartesian {
{ return Infinity_distance_2(); }
}; // Piercing_traits_cartesian
#line 66 "pierce_traits.awi"
#line 50 "code_formatting.awi"
CGAL_END_NAMESPACE
#line 67 "pierce_traits.awi"
#endif // ! (CGAL_PIERCE_RECTANGLES_2_TRAITS_H)
#line 12 "code_formatting.awi"
// ----------------------------------------------------------------------------
// ** EOF
// ----------------------------------------------------------------------------

View File

@ -1,5 +1,3 @@
#line 585 "pcenter.aw"
#line 18 "code_formatting.awi"
// ============================================================================
//
// Copyright (c) 1998 The CGAL Consortium
@ -26,26 +24,17 @@
// 2-4-Center Computation for Axis-Parallel 2D-Rectangles
// ============================================================================
#line 589 "pcenter.aw"
#line 54 "code_formatting.awi"
#if ! (CGAL_RECTANGULAR_P_CENTER_TRAITS_2_H)
#define CGAL_RECTANGULAR_P_CENTER_TRAITS_2_H 1
#line 338 "pc_traits.awi"
#line 565 "pc_traits.awi"
#include <CGAL/Point_2.h>
#include <CGAL/Iso_rectangle_2.h>
#include <CGAL/basic_constructions_2.h>
#line 339 "pc_traits.awi"
#line 46 "code_formatting.awi"
CGAL_BEGIN_NAMESPACE
#line 341 "pc_traits.awi"
#line 344 "pc_traits.awi"
#line 30 "pc_traits.awi"
template < class R >
struct Less_x_2
: public CGAL_STD::binary_function< Point_2< R >, Point_2< R >, bool >
@ -83,7 +72,6 @@ struct Greater_y_2
const Point_2< R >& q) const
{ return p.y() > q.y(); }
};
#line 70 "pc_traits.awi"
template < class R >
struct Construct_min_point_2
: public CGAL_STD::unary_function< Iso_rectangle_2< R >, Point_2< R > >
@ -100,7 +88,6 @@ struct Construct_max_point_2
{ return r.max(); }
};
*/
#line 89 "pc_traits.awi"
template < class A, class S >
struct Select : public CGAL_STD::binary_function< A, A, A > {
Select() {}
@ -113,14 +100,12 @@ private:
S s_;
};
#line 104 "pc_traits.awi"
template < class R >
struct Construct_iso_rectangle_2 {
Iso_rectangle_2< R >
operator()(const Point_2< R >& min, const Point_2< R >& max) const
{ return Iso_rectangle_2< R >(min, max); }
};
#line 215 "pc_traits.awi"
template < class R >
struct Signed_x_distance_2
: public CGAL_STD::binary_function<
@ -130,7 +115,6 @@ struct Signed_x_distance_2
operator()(const Point_2< R >& q1, const Point_2< R >& q2) const
{ return q1.x() - q2.x(); }
};
#line 227 "pc_traits.awi"
template < class R >
struct Signed_y_distance_2
: public CGAL_STD::binary_function<
@ -140,7 +124,6 @@ struct Signed_y_distance_2
operator()(const Point_2< R >& q1, const Point_2< R >& q2) const
{ return q1.y() - q2.y(); }
};
#line 239 "pc_traits.awi"
template < class R >
struct Infinity_distance_2
: public CGAL_STD::binary_function<
@ -152,7 +135,6 @@ struct Infinity_distance_2
CGAL::abs(q1.y() - q2.y()));
}
};
#line 253 "pc_traits.awi"
template < class R >
struct Signed_infinity_distance_2
: public CGAL_STD::binary_function<
@ -162,7 +144,6 @@ struct Signed_infinity_distance_2
operator()(const Point_2< R >& q1, const Point_2< R >& q2) const
{ return std::max(q1.x() - q2.x(), q1.y() - q2.y()); }
};
#line 265 "pc_traits.awi"
template < class R >
struct Construct_corner_2
: public CGAL_STD::binary_function<
@ -172,7 +153,6 @@ struct Construct_corner_2
operator()(const Iso_rectangle_2< R >& q, unsigned int i) const
{ return q[i]; }
};
#line 277 "pc_traits.awi"
template < class R >
struct Construct_point_2_above_right_implicit_point_2 {
// (p, q, r) |--> (p.x() + r, q.y() + r)
@ -216,7 +196,6 @@ struct Construct_point_2_below_right_implicit_point_2 {
operator()(const P& p, const P& q, FT r) const
{ return P(p.x() + r, q.y() - r); }
};
#line 323 "pc_traits.awi"
// Point_2 x Point_2 --> Point_2
// (p, q) |-> projection of p onto the horizontal line through q
template < class R >
@ -230,7 +209,6 @@ struct Construct_projection_onto_horizontal_implicit_line_2
{ return Point_2(p.x(), q.y()); }
};
#line 346 "pc_traits.awi"
template < class R >
struct Rectangular_p_center_default_traits_2 : public R
@ -255,7 +233,6 @@ struct Rectangular_p_center_default_traits_2 : public R
Less_y_2 less_y_2_object() const { return Less_y_2(); }
// additions
#line 444 "pc_traits.awi"
struct Greater_x_2 : public std::binary_function< Point_2, Point_2, bool >
{
Greater_x_2(const Less_x_2& l) : lessx2(l) {}
@ -280,7 +257,6 @@ struct Rectangular_p_center_default_traits_2 : public R
{ return Greater_x_2(less_x_2_object()); }
Greater_y_2 greater_y_2_object() const
{ return Greater_y_2(less_y_2_object()); }
#line 371 "pc_traits.awi"
// -----------------------------------------------------------------
// constructions:
@ -349,7 +325,6 @@ struct Rectangular_p_center_default_traits_2 : public R
//!!! this shouldn't be here as it can be written in terms
// of known stuff
#line 471 "pc_traits.awi"
struct Min_x_2 : public Select< Point_2, Less_x_2 > {
Min_x_2(const Less_x_2& l) : Select< Point_2, Less_x_2 >(l) {}
};
@ -374,9 +349,7 @@ struct Rectangular_p_center_default_traits_2 : public R
{ return Min_y_2(less_y_2_object()); }
Max_y_2 max_y_2_object() const
{ return Max_y_2(greater_y_2_object()); }
#line 440 "pc_traits.awi"
};
#line 501 "pc_traits.awi"
template < class _Traits, class _PiercingFunction >
struct Rectangular_p_center_matrix_search_traits_2 {
@ -432,7 +405,6 @@ private:
}; // Rectangular_p_center_matrix_search_traits_2< ... >
#line 113 "pc_traits.awi"
template < class ForwardIterator, class Traits >
Iso_rectangle_2<
typename std::iterator_traits< ForwardIterator >::value_type::R >
@ -469,7 +441,6 @@ bounding_box_2(ForwardIterator f, ForwardIterator l, const Traits& t)
return rect(pohil(*xmin, *ymin), pohil(*xmax, *ymax));
} // bounding_box_2(f, l, t)
#line 152 "pc_traits.awi"
template < class ForwardIterator >
inline typename
std::iterator_traits< ForwardIterator >::value_type::R::Iso_rectangle_2
@ -485,7 +456,6 @@ bounding_box_2(ForwardIterator f, ForwardIterator l)
Traits t;
return bounding_box_2(f, l, t);
} // bounding_box_2(f, l)
#line 170 "pc_traits.awi"
template < class Rectangle, class Traits >
inline Rectangle
construct_bounding_box_union_2(const Rectangle& r1,
@ -518,7 +488,6 @@ construct_bounding_box_union_2(const Rectangle& r1,
pohil(lessx(maxpt(r2), maxpt(r1)) ? maxpt(r1) : maxpt(r2),
lessy(maxpt(r2), maxpt(r1)) ? maxpt(r1) : maxpt(r2)));
} // construct_bounding_box_union_2(r1, r2, t)
#line 205 "pc_traits.awi"
template < class Rectangle >
inline Rectangle
construct_bounding_box_union_2(const Rectangle& r1, const Rectangle& r2)
@ -527,16 +496,12 @@ construct_bounding_box_union_2(const Rectangle& r1, const Rectangle& r2)
return construct_bounding_box_union_2(r1, r2, t);
} // construct_bounding_box_union_2(r1, r2)
#line 557 "pc_traits.awi"
#line 50 "code_formatting.awi"
CGAL_END_NAMESPACE
#line 559 "pc_traits.awi"
#endif // ! (CGAL_RECTANGULAR_P_CENTER_TRAITS_2_H)
#line 12 "code_formatting.awi"
// ----------------------------------------------------------------------------
// ** EOF
// ----------------------------------------------------------------------------

View File

@ -1,5 +1,3 @@
#line 939 "fjsearch.aw"
#line 18 "code_formatting.awi"
// ============================================================================
//
// Copyright (c) 1998 The CGAL Consortium
@ -26,15 +24,10 @@
// Frederickson-Johnson matrix search: traits class adaptor
// ============================================================================
#line 943 "fjsearch.aw"
#line 54 "code_formatting.awi"
#if ! (CGAL_SORTED_MATRIX_SEARCH_TRAITS_ADAPTOR_H)
#define CGAL_SORTED_MATRIX_SEARCH_TRAITS_ADAPTOR_H 1
#line 892 "fjsearch.aw"
#line 46 "code_formatting.awi"
CGAL_BEGIN_NAMESPACE
#line 893 "fjsearch.aw"
template < class _FeasibilityTest, class _Matrix >
class Sorted_matrix_search_traits_adaptor {
@ -77,13 +70,10 @@ sorted_matrix_search_traits_adaptor(FeasibilityTest f, const Matrix&)
return Traits(f);
} // sorted_matrix_search_traits_adaptor( ... )
#line 50 "code_formatting.awi"
CGAL_END_NAMESPACE
#line 936 "fjsearch.aw"
#endif // ! (CGAL_SORTED_MATRIX_SEARCH_TRAITS_ADAPTOR_H)
#line 12 "code_formatting.awi"
// ----------------------------------------------------------------------------
// ** EOF
// ----------------------------------------------------------------------------

View File

@ -1,5 +1,3 @@
#line 1350 "mon_search.aw"
#line 18 "code_formatting.awi"
// ============================================================================
//
// Copyright (c) 1998 The CGAL Consortium
@ -26,19 +24,14 @@
// An OutputIterator Adaptor applying an unary function
// ============================================================================
#line 1354 "mon_search.aw"
#line 54 "code_formatting.awi"
#if ! (CGAL_TRANSFORM_ITERATOR_H)
#define CGAL_TRANSFORM_ITERATOR_H 1
#line 270 "mon_search.aw"
#include <CGAL/Optimisation/assertions.h>
#include <CGAL/circulator_bases.h>
#include <iterator>
#line 46 "code_formatting.awi"
CGAL_BEGIN_NAMESPACE
#line 275 "mon_search.aw"
template < class OutputIterator, class Operation >
class Transform_iterator : public CGAL_STD::output_iterator {
@ -94,13 +87,10 @@ query_circulator_or_iterator(
const Transform_iterator< OutputIterator, Operation >&)
{ return Iterator_tag(); }
#line 50 "code_formatting.awi"
CGAL_END_NAMESPACE
#line 331 "mon_search.aw"
#endif // ! (CGAL_TRANSFORM_ITERATOR_H)
#line 12 "code_formatting.awi"
// ----------------------------------------------------------------------------
// ** EOF
// ----------------------------------------------------------------------------

View File

@ -1,5 +1,3 @@
#line 1383 "mon_search.aw"
#line 18 "code_formatting.awi"
// ============================================================================
//
// Copyright (c) 1998 The CGAL Consortium
@ -26,12 +24,9 @@
// Compute all furthest neighbors for the vertices of a convex polygon
// ============================================================================
#line 1387 "mon_search.aw"
#line 54 "code_formatting.awi"
#if ! (CGAL_ALL_FURTHEST_NEIGHBORS_2_H)
#define CGAL_ALL_FURTHEST_NEIGHBORS_2_H 1
#line 358 "afn.awi"
#include <CGAL/Optimisation/assertions.h>
#ifdef CGAL_REP_CLASS_DEFINED
@ -44,10 +39,7 @@
#include <functional>
#include <algorithm>
#line 46 "code_formatting.awi"
CGAL_BEGIN_NAMESPACE
#line 371 "afn.awi"
#line 108 "afn.awi"
#ifdef _MSC_VER
// that compiler cannot even distinguish between global
// and class scope, so ...
@ -93,18 +85,13 @@ public:
#ifdef _MSC_VER
#undef Base
#endif // _MSC_VER
#line 372 "afn.awi"
#if !defined(CGAL_CFG_NO_ITERATOR_TRAITS) && \
!defined(CGAL_CFG_MATCHING_BUG_2)
#line 50 "code_formatting.awi"
CGAL_END_NAMESPACE
#line 377 "afn.awi"
#include <iterator>
#line 46 "code_formatting.awi"
CGAL_BEGIN_NAMESPACE
#line 379 "afn.awi"
template < class RandomAccessIC, class OutputIterator, class Traits >
inline
@ -222,13 +209,10 @@ all_furthest_neighbors( RandomAccessIC points_begin,
bind2nd( modulus< int >(), number_of_points));
} // all_furthest_neighbors( ... )
#line 50 "code_formatting.awi"
CGAL_END_NAMESPACE
#line 497 "afn.awi"
#endif // ! (CGAL_ALL_FURTHEST_NEIGHBORS_2_H)
#line 12 "code_formatting.awi"
// ----------------------------------------------------------------------------
// ** EOF
// ----------------------------------------------------------------------------

View File

@ -1,5 +1,3 @@
#line 1438 "mon_search.aw"
#line 18 "code_formatting.awi"
// ============================================================================
//
// Copyright (c) 1998 The CGAL Consortium
@ -26,13 +24,9 @@
// Compute extremal polygons of a convex polygon
// ============================================================================
#line 1442 "mon_search.aw"
#line 54 "code_formatting.awi"
#if ! (CGAL_EXTREMAL_POLYGON_2_H)
#define CGAL_EXTREMAL_POLYGON_2_H 1
#line 114 "mon_search.aw"
#line 1405 "mon_search.aw"
#ifndef CGAL_MONOTONE_MATRIX_SEARCH_H
#include <CGAL/monotone_matrix_search.h>
#endif // CGAL_MONOTONE_MATRIX_SEARCH_H
@ -59,13 +53,9 @@
#include <CGAL/Extremal_polygon_traits_2.h>
#endif // CGAL_EXTREMAL_POLYGON_TRAITS_2_H
#endif // CGAL_REP_CLASS_DEFINED
#line 115 "mon_search.aw"
#line 46 "code_formatting.awi"
CGAL_BEGIN_NAMESPACE
#line 117 "mon_search.aw"
//!!! This will eventually be integrated into function_objects.h
#line 254 "mon_search.aw"
template < class Array, class Index, class Element >
struct Index_operator
: public CGAL_STD::binary_function< Array, Index, Element >
@ -79,9 +69,7 @@ public:
operator()( const Array& a, const Index& i) const
{ return a[i]; }
};
#line 119 "mon_search.aw"
#line 28 "exp_matrix.awi"
#ifndef CGAL_CFG_NO_ITERATOR_TRAITS
template < class _RandomAccessIC_object,
class _RandomAccessIC_value,
@ -177,7 +165,6 @@ private:
int n_cols;
};
#line 131 "exp_matrix.awi"
#ifndef CGAL_CFG_NO_ITERATOR_TRAITS
template < class RandomAccessIC_object,
class RandomAccessIC_value,
@ -205,9 +192,7 @@ extremal_polygon_matrix(
}
#endif
#line 121 "mon_search.aw"
#line 414 "mon_search.aw"
#ifndef CGAL_CFG_MATCHING_BUG_1
template < class RandomAccessIC,
class Outputiterator,
@ -230,7 +215,6 @@ CGAL_maximum_inscribed_rooted_k_gon(
#endif
Outputiterator o,
const Traits& t)
#line 169 "mon_search.aw"
//
// preconditions:
// --------------
@ -239,14 +223,10 @@ CGAL_maximum_inscribed_rooted_k_gon(
// * the range [points_begin, points_end) of size n > 0
// describes the vertices of a convex polygon $P$
// enumerated clock- or counterclockwise
#line 437 "mon_search.aw"
// n > k,
#line 180 "mon_search.aw"
// * k >= t.min_k()
// * value_type of RandomAccessIC is Traits::Point_2
// * OutputIterator accepts Traits::Point_2 as value_type
#line 439 "mon_search.aw"
#line 186 "mon_search.aw"
//
// functionality:
// --------------
@ -254,11 +234,9 @@ CGAL_maximum_inscribed_rooted_k_gon(
// of the polygon $P$,
// that is rooted at points_begin[0],
// sets max_area to its associated value (as specified by t)
#line 194 "mon_search.aw"
// writes the indices (relative to points_begin)
// of $P_k$'s vertices to o and
// returns the past-the-end iterator of that sequence.
#line 443 "mon_search.aw"
{
// check preconditions:
CGAL_precondition( k >= t.min_k());
@ -268,17 +246,14 @@ CGAL_maximum_inscribed_rooted_k_gon(
typedef std::vector< int > Index_cont;
#line 466 "mon_search.aw"
if ( k == t.min_k())
// compute min_k gon:
return t.compute_min_k_gon(
points_begin, points_end, max_area, o);
#line 453 "mon_search.aw"
// current i-gon (i = 2/3...k)
Index_cont gon( k + 1);
#line 495 "mon_search.aw"
// compute initial min_k-gon:
int i( t.min_k());
t.compute_min_k_gon(
@ -313,10 +288,8 @@ CGAL_maximum_inscribed_rooted_k_gon(
max_area,
o,
t);
#line 458 "mon_search.aw"
} // CGAL_maximum_inscribed_rooted_k_gon( ... )
#line 547 "mon_search.aw"
#ifndef CGAL_CFG_MATCHING_BUG_1
template < class RandomAccessIC_point,
class RandomAccessIC_int,
@ -345,7 +318,6 @@ CGAL_maximum_inscribed_rooted_k_gon(
#endif
OutputIterator o,
const Traits& t)
#line 169 "mon_search.aw"
//
// preconditions:
// --------------
@ -354,7 +326,6 @@ CGAL_maximum_inscribed_rooted_k_gon(
// * the range [points_begin, points_end) of size n > 0
// describes the vertices of a convex polygon $P$
// enumerated clock- or counterclockwise
#line 576 "mon_search.aw"
// * value_type of RandomAccessIC_point is Traits::Point
// * value_type of RandomAccessIC_int is int
// * OutputIterator accepts int as value type
@ -367,7 +338,6 @@ CGAL_maximum_inscribed_rooted_k_gon(
// * for any 0 <= i < length: o + i must not be contained in
// the range [right_c_begin, right_c_begin + length - i - 2].
// (NOT checked!)
#line 186 "mon_search.aw"
//
// functionality:
// --------------
@ -377,11 +347,9 @@ CGAL_maximum_inscribed_rooted_k_gon(
// such that for any 0 <= i < length:
// left_c_begin[i] <= vertex i of $P_k$ <= right_c_begin[i],
// sets max_area to its associated value (as specified by t),
#line 194 "mon_search.aw"
// writes the indices (relative to points_begin)
// of $P_k$'s vertices to o and
// returns the past-the-end iterator of that sequence.
#line 594 "mon_search.aw"
{
#ifndef CGAL_CFG_NO_NAMESPACE
using std::max_element;
@ -415,7 +383,6 @@ CGAL_maximum_inscribed_rooted_k_gon(
CGAL_expensive_precondition( left_c_begin[i] <= right_c_begin[i]);
})
#line 894 "mon_search.aw"
#ifndef CGAL_CFG_MATCHING_BUG_1
typedef typename Traits::FT FT;
#else
@ -424,8 +391,6 @@ CGAL_maximum_inscribed_rooted_k_gon(
typedef std::vector< FT > FT_cont;
typedef std::vector< int > Index_cont;
typedef typename Traits::Operation Operation;
#line 628 "mon_search.aw"
#line 703 "mon_search.aw"
//!!! static ???
// area container:
FT_cont area( number_of_points);
@ -435,16 +400,12 @@ CGAL_maximum_inscribed_rooted_k_gon(
// matrix operation:
Operation op( t.operation( points_begin[root]));
#line 720 "mon_search.aw"
// initialize area and last vertex containers:
for ( i = left_c_begin[0]; i <= right_c_begin[0]; ++i) {
area[i] = t.init( points_begin[i], points_begin[root]);
last_vertex[i] = root;
}
#line 629 "mon_search.aw"
#line 730 "mon_search.aw"
#line 761 "mon_search.aw"
for ( i = 1; i < size_of_gon; ++i) {
@ -494,9 +455,7 @@ CGAL_maximum_inscribed_rooted_k_gon(
}
} // for ( i = 1; i < size_of_gon; ++i)
#line 731 "mon_search.aw"
#line 842 "mon_search.aw"
// find maximum in last range:
int maxi =
iterator_distance(
@ -506,7 +465,6 @@ CGAL_maximum_inscribed_rooted_k_gon(
// set max_area:
max_area = area[maxi];
#line 860 "mon_search.aw"
// construct gon:
*o++ = maxi;
maxi = last_vertex[maxi];
@ -526,14 +484,10 @@ CGAL_maximum_inscribed_rooted_k_gon(
*o++ = root;
return o;
#line 733 "mon_search.aw"
#line 630 "mon_search.aw"
} // CGAL_maximum_inscribed_rooted_k_gon( p, k, result)
#line 123 "mon_search.aw"
#line 127 "mon_search.aw"
template < class RandomAccessIC,
class OutputIterator,
class Traits >
@ -545,7 +499,6 @@ extremal_polygon(
int k,
OutputIterator o,
const Traits& t)
#line 169 "mon_search.aw"
//
// preconditions:
// --------------
@ -554,23 +507,17 @@ extremal_polygon(
// * the range [points_begin, points_end) of size n > 0
// describes the vertices of a convex polygon $P$
// enumerated clock- or counterclockwise
#line 139 "mon_search.aw"
#line 180 "mon_search.aw"
// * k >= t.min_k()
// * value_type of RandomAccessIC is Traits::Point_2
// * OutputIterator accepts Traits::Point_2 as value_type
#line 140 "mon_search.aw"
#line 186 "mon_search.aw"
//
// functionality:
// --------------
// computes maximum (as specified by t) inscribed k-gon $P_k$
// of the polygon $P$,
#line 194 "mon_search.aw"
// writes the indices (relative to points_begin)
// of $P_k$'s vertices to o and
// returns the past-the-end iterator of that sequence.
#line 142 "mon_search.aw"
{
#ifndef CGAL_CFG_NO_NAMESPACE
using std::bind1st;
@ -595,7 +542,6 @@ extremal_polygon(
points_begin)),
t);
}
#line 965 "mon_search.aw"
template < class RandomAccessIC,
class OutputIterator,
class Traits >
@ -606,7 +552,6 @@ CGAL_maximum_inscribed_k_gon(
int k,
OutputIterator o,
const Traits& t)
#line 169 "mon_search.aw"
//
// preconditions:
// --------------
@ -615,23 +560,17 @@ CGAL_maximum_inscribed_k_gon(
// * the range [points_begin, points_end) of size n > 0
// describes the vertices of a convex polygon $P$
// enumerated clock- or counterclockwise
#line 976 "mon_search.aw"
#line 180 "mon_search.aw"
// * k >= t.min_k()
// * value_type of RandomAccessIC is Traits::Point_2
// * OutputIterator accepts Traits::Point_2 as value_type
#line 977 "mon_search.aw"
#line 186 "mon_search.aw"
//
// functionality:
// --------------
// computes maximum (as specified by t) inscribed k-gon $P_k$
// of the polygon $P$,
#line 194 "mon_search.aw"
// writes the indices (relative to points_begin)
// of $P_k$'s vertices to o and
// returns the past-the-end iterator of that sequence.
#line 979 "mon_search.aw"
{
// check preconditions:
CGAL_precondition( k >= t.min_k());
@ -647,14 +586,11 @@ CGAL_maximum_inscribed_k_gon(
typedef typename Traits::FT FT;
typedef std::vector< int > Index_cont;
#line 1007 "mon_search.aw"
if ( number_of_points <= k) {
for ( int j( k - 1); j >= 0; --j)
*o++ = min( j, number_of_points - 1);
return o;
}
#line 995 "mon_search.aw"
#line 1018 "mon_search.aw"
// compute k-gon rooted at points_begin[0]
Index_cont P_0( k + 1);
FT area_0;
@ -667,7 +603,6 @@ CGAL_maximum_inscribed_k_gon(
t);
P_0[k] = number_of_points - 1;
CGAL_assertion( P_0[0] == 0);
#line 1057 "mon_search.aw"
// compute k-gon rooted at points_begin[P_0[1]]
Index_cont P_1( k);
FT area_1;
@ -686,8 +621,6 @@ CGAL_maximum_inscribed_k_gon(
CGAL_assertion( P_1[0] == P_0[1]);
#line 996 "mon_search.aw"
#line 1080 "mon_search.aw"
// start recursive computation:
FT area_r( 0);
@ -708,8 +641,6 @@ CGAL_maximum_inscribed_k_gon(
t);
}
#line 997 "mon_search.aw"
#line 1116 "mon_search.aw"
if ( area_r > area_0)
if ( area_r > area_1)
// recursive is maximum
@ -723,11 +654,9 @@ CGAL_maximum_inscribed_k_gon(
else
// P_1 is maximum
copy( P_1.begin(), P_1.end(), o);
#line 998 "mon_search.aw"
return o;
} // CGAL_maximum_inscribed_k_gon( ... )
#line 1132 "mon_search.aw"
#ifndef CGAL_CFG_MATCHING_BUG_1
template < class RandomAccessIC_point,
class RandomAccessIC_int,
@ -758,7 +687,6 @@ CGAL_maximum_inscribed_k_gon(
#endif
OutputIterator o,
const Traits& t)
#line 169 "mon_search.aw"
//
// preconditions:
// --------------
@ -767,7 +695,6 @@ CGAL_maximum_inscribed_k_gon(
// * the range [points_begin, points_end) of size n > 0
// describes the vertices of a convex polygon $P$
// enumerated clock- or counterclockwise
#line 1163 "mon_search.aw"
// * value_type of RandomAccessIC_point is Traits::Point
// * value_type of RandomAccessIC_int is int
// * OutputIterator accepts int as value type
@ -779,7 +706,6 @@ CGAL_maximum_inscribed_k_gon(
// for any 0 <= i < k:
// left_c_begin[i] <= right_c_begin[i]
// * k >= t.min_k()
#line 186 "mon_search.aw"
//
// functionality:
// --------------
@ -789,11 +715,9 @@ CGAL_maximum_inscribed_k_gon(
// points_begin[right_index]] and
// * interleaves with both $P_l$ and $P_r$,
// sets max_area to its associated value (as specified by t),
#line 194 "mon_search.aw"
// writes the indices (relative to points_begin)
// of $P_k$'s vertices to o and
// returns the past-the-end iterator of that sequence.
#line 1180 "mon_search.aw"
{
// typedefs
#ifndef CGAL_CFG_MATCHING_BUG_1
@ -831,7 +755,6 @@ CGAL_maximum_inscribed_k_gon(
})
#line 1232 "mon_search.aw"
int middle_index( (left_index + right_index) >> 1);
Index_cont P_m( k);
FT area_middle;
@ -847,8 +770,6 @@ CGAL_maximum_inscribed_k_gon(
P_m.rbegin(),
t);
CGAL_assertion( P_m[0] == middle_index);
#line 1222 "mon_search.aw"
#line 1250 "mon_search.aw"
// left recursive branch:
FT area_left( 0);
Index_cont P_l( k);
@ -869,8 +790,6 @@ CGAL_maximum_inscribed_k_gon(
} // if ( left_index < middle_index)
#line 1223 "mon_search.aw"
#line 1272 "mon_search.aw"
// right recursive branch:
FT area_right( 0);
Index_cont P_r( k);
@ -891,9 +810,7 @@ CGAL_maximum_inscribed_k_gon(
} // if ( right_index > middle_index)
#line 1224 "mon_search.aw"
#line 1294 "mon_search.aw"
if ( area_left > area_right)
if ( area_left > area_middle) {
// left is maximum
@ -915,21 +832,15 @@ CGAL_maximum_inscribed_k_gon(
max_area = area_middle;
copy( P_m.begin(), P_m.end(), o);
}
#line 1226 "mon_search.aw"
return o;
} // CGAL_maximum_inscribed_k_gon( ... )
#line 124 "mon_search.aw"
#line 1434 "mon_search.aw"
#line 50 "code_formatting.awi"
CGAL_END_NAMESPACE
#line 1435 "mon_search.aw"
#endif // ! (CGAL_EXTREMAL_POLYGON_2_H)
#line 12 "code_formatting.awi"
// ----------------------------------------------------------------------------
// ** EOF
// ----------------------------------------------------------------------------

View File

@ -1,5 +1,3 @@
#line 1372 "mon_search.aw"
#line 18 "code_formatting.awi"
// ============================================================================
//
// Copyright (c) 1998 The CGAL Consortium
@ -26,20 +24,14 @@
// Monotone Matrix Search
// ============================================================================
#line 1376 "mon_search.aw"
#line 54 "code_formatting.awi"
#if ! (CGAL_MONOTONE_MATRIX_SEARCH_H)
#define CGAL_MONOTONE_MATRIX_SEARCH_H 1
#line 1361 "mon_search.aw"
#include <CGAL/Optimisation/assertions.h>
#include <vector>
#include <functional>
#line 46 "code_formatting.awi"
CGAL_BEGIN_NAMESPACE
#line 1366 "mon_search.aw"
#line 48 "overview.awi"
template < class Matrix, class RandomAccessIterator >
inline
void
@ -50,7 +42,6 @@ monotone_matrix_search(
typedef typename Matrix::Value V;
monotone_matrix_search( M, t, std::less< V >());
} // monotone_matrix_search( M, t)
#line 81 "maxcompute.awi"
template < class Matrix,
class RandomAccessIterator,
class Compare_strictly >
@ -59,7 +50,6 @@ monotone_matrix_search(
const Matrix& M,
RandomAccessIterator t,
const Compare_strictly& compare_strictly)
#line 115 "maxcompute.awi"
// Matrix has to define:
// o operator()( int, int) [access]
// o int number_of_columns(), int number_of_rows()
@ -68,7 +58,6 @@ monotone_matrix_search(
// o Matrix* extract_all_even_rows()
//
// Precondition: M is totally monotone
#line 90 "maxcompute.awi"
// M.number_of_rows() > 1 and
// RandomAccessIterator has value type int
//
@ -77,7 +66,6 @@ monotone_matrix_search(
{
// divide
// ------
#line 134 "maxcompute.awi"
// get even rows of M:
Matrix* M_new = M.extract_all_even_rows();
CGAL_optimisation_assertion(
@ -86,9 +74,7 @@ monotone_matrix_search(
M_new->number_of_rows() == 0 ||
M_new->number_of_rows() == ( M.number_of_rows() + 1) >> 1);
#line 99 "maxcompute.awi"
#line 170 "maxcompute.awi"
// reduce M_new to a quadratic matrix:
// table to store the reduction permutation:
@ -114,9 +100,7 @@ monotone_matrix_search(
}
#line 101 "maxcompute.awi"
#line 224 "maxcompute.awi"
// recursion:
CGAL_optimisation_assertion(
@ -134,11 +118,9 @@ monotone_matrix_search(
else
monotone_matrix_search( *M_new, t_new);
#line 103 "maxcompute.awi"
// and conquer
// -----------
#line 269 "maxcompute.awi"
int j( 0); // actual index in t
int j_new( 0); // actual index in t_new
@ -159,19 +141,14 @@ monotone_matrix_search(
++j_tmp;
}
} while ( ++j < M.number_of_rows());
#line 107 "maxcompute.awi"
#line 315 "maxcompute.awi"
delete M_new;
delete[] t_new;
delete[] reduction_table;
#line 109 "maxcompute.awi"
} // monotone_matrix_search( M, t)
#line 1367 "mon_search.aw"
#line 346 "maxcompute.awi"
template < class Matrix,
class RandomAccessIterator,
class Compare_strictly >
@ -180,7 +157,6 @@ _reduce_matrix(
Matrix& M,
RandomAccessIterator t,
const Compare_strictly& compare_strictly)
#line 115 "maxcompute.awi"
// Matrix has to define:
// o operator()( int, int) [access]
// o int number_of_columns(), int number_of_rows()
@ -189,7 +165,6 @@ _reduce_matrix(
// o Matrix* extract_all_even_rows()
//
// Precondition: M is totally monotone
#line 355 "maxcompute.awi"
// reduces M, i.e. deletes some columns that
// do not contain the maximum value of any row
// such that M becomes quadratic
@ -198,7 +173,6 @@ _reduce_matrix(
{
CGAL_optimisation_precondition(
M.number_of_columns() >= M.number_of_rows());
#line 430 "maxcompute.awi"
// active columns are 0, ..., j1, j2, ..., M.x_dim()-1
int j1( 0), j2( 1);
*t = 0;
@ -234,16 +208,11 @@ _reduce_matrix(
}
M.shrink_to_quadratic_size();
#line 364 "maxcompute.awi"
} // _reduce_matrix( M, t)
#line 1368 "mon_search.aw"
#line 50 "code_formatting.awi"
CGAL_END_NAMESPACE
#line 1369 "mon_search.aw"
#endif // ! (CGAL_MONOTONE_MATRIX_SEARCH_H)
#line 12 "code_formatting.awi"
// ----------------------------------------------------------------------------
// ** EOF
// ----------------------------------------------------------------------------

View File

@ -1,5 +1,3 @@
#line 138 "pierce.awi"
#line 18 "code_formatting.awi"
// ============================================================================
//
// Copyright (c) 1998 The CGAL Consortium
@ -26,26 +24,18 @@
// 2-4-Piercing Axis-Parallel 2D-Rectangles
// ============================================================================
#line 142 "pierce.awi"
#line 54 "code_formatting.awi"
#if ! (CGAL_PIERCE_RECTANGLES_2_H)
#define CGAL_PIERCE_RECTANGLES_2_H 1
#line 110 "pierce.awi"
#line 101 "pierce.awi"
#include <CGAL/Optimisation/assertions.h>
#include <CGAL/circulator.h>
#include <CGAL/function_objects.h>
#include <CGAL/algorithm.h>
#include <algorithm>
#include <vector>
#line 111 "pierce.awi"
#line 46 "code_formatting.awi"
CGAL_BEGIN_NAMESPACE
#line 113 "pierce.awi"
#line 66 "pierce.awi"
//!!! STL-extensions
template < class T >
struct Wastebasket : public CGAL_STD::output_iterator
@ -68,9 +58,7 @@ struct Wastebasket : public CGAL_STD::output_iterator
operator++( int)
{ return *this; }
};
#line 115 "pierce.awi"
#line 90 "pc_intro.awi"
template < class _Traits >
struct Loc_domain {
// ---------------------------------------------
@ -220,8 +208,6 @@ public:
Traits traits;
}; // class Loc_domain
#line 117 "pierce.awi"
#line 57 "pierce_4.awi"
template < class _Traits >
struct Staircases : public Loc_domain< _Traits > {
typedef _Traits Traits;
@ -456,19 +442,13 @@ private:
// exceeds the x-dimension of the location domain its y-dimension?
bool xgy;
};
#line 118 "pierce.awi"
#line 50 "code_formatting.awi"
CGAL_END_NAMESPACE
#line 120 "pierce.awi"
//#ifdef CGAL_REP_CLASS_DEFINED
//#include <CGAL/Pierce_rectangles_2_traits.h>
//#endif // CGAL_REP_CLASS_DEFINED
#line 46 "code_formatting.awi"
CGAL_BEGIN_NAMESPACE
#line 124 "pierce.awi"
#line 11 "pierce_2.awi"
template < class InputIC, class OutputIterator, class Traits >
inline OutputIterator
two_cover_points(
@ -481,7 +461,6 @@ two_cover_points(
return two_cover_points(d, o, ok, t);
} // two_cover_points(f, l, o, ok, t)
#line 11 "pierce_2.awi"
template < class InputIC, class OutputIterator, class Traits >
inline OutputIterator
three_cover_points(
@ -494,7 +473,6 @@ three_cover_points(
return three_cover_points(d, o, ok, t);
} // three_cover_points(f, l, o, ok, t)
#line 11 "pierce_2.awi"
template < class InputIC, class OutputIterator, class Traits >
inline OutputIterator
four_cover_points(
@ -507,7 +485,6 @@ four_cover_points(
return four_cover_points(d, o, ok, t);
} // four_cover_points(f, l, o, ok, t)
#line 41 "pierce_2.awi"
template < class OutputIterator, class Traits >
OutputIterator
two_cover_points(
@ -533,16 +510,13 @@ two_cover_points(
Min< FT > minft;
less< FT > lessft;
#line 85 "pierce_2.awi"
if (sdist(d[2], d[0]) <= FT(0)) {
// the location domain is degenerate and [f,l) is one-pierceable
*o++ = d[0];
ok = true;
return o;
}
#line 70 "pierce_2.awi"
#line 98 "pierce_2.awi"
// check whether {d[0], d[2]} forms a piercing set
if (d.end() ==
@ -558,7 +532,6 @@ two_cover_points(
ok = true;
return o;
}
#line 98 "pierce_2.awi"
// check whether {d[1], d[3]} forms a piercing set
if (d.end() ==
@ -579,8 +552,6 @@ two_cover_points(
ok = false;
return o;
} // two_cover_points(d, o, ok, t)
#line 129 "pierce.awi"
#line 12 "pierce_3.awi"
template < class OutputIterator, class Traits >
OutputIterator
three_cover_points(
@ -605,15 +576,12 @@ three_cover_points(
d.traits.infinity_distance_2_object();
less< FT > lessft;
#line 57 "pierce_3.awi"
// test the four corners:
for (int k = 0; k < 4; ++k) {
#line 81 "pierce_3.awi"
// extract all points which are close enough to d[k]
Point_2 corner = d[k];
#line 92 "pierce_3.awi"
// find first point not covered by the rectangle at d[k]
Iterator i = find_if(d.begin(), d.end(),
compose1(bind1st(lessft, d.r),
@ -691,8 +659,6 @@ three_cover_points(
return o;
} // three_cover_points(d, o, ok)
#line 130 "pierce.awi"
#line 324 "pierce_4.awi"
CGAL_END_NAMESPACE
CGAL_BEGIN_NAMESPACE
template < class OutputIterator, class Traits >
@ -700,7 +666,6 @@ OutputIterator
four_cover_points(Staircases< Traits >& d, OutputIterator o, bool& ok)
{
#line 380 "pierce_4.awi"
#ifndef CGAL_CFG_NO_NAMESPACE
using std::less;
using std::iter_swap;
@ -744,9 +709,7 @@ four_cover_points(Staircases< Traits >& d, OutputIterator o, bool& ok)
d.traits.construct_point_2_below_right_implicit_point_2_object();
#line 341 "pierce_4.awi"
#line 353 "pierce_4.awi"
// test the four corners:
for (int j = 0; j < 5; ++j) {
const int k = j < 4 ? j : 3;
@ -766,7 +729,6 @@ four_cover_points(Staircases< Traits >& d, OutputIterator o, bool& ok)
}
#line 92 "pierce_3.awi"
// find first point not covered by the rectangle at d[k]
Iterator i = find_if(d.begin(), d.end(),
compose1(bind1st(lessft, d.r),
@ -838,9 +800,7 @@ four_cover_points(Staircases< Traits >& d, OutputIterator o, bool& ok)
d.end() = save_end;
} // for (int k = 0; k < 4; ++k)
#line 343 "pierce_4.awi"
#line 454 "pierce_4.awi"
// test if four covering rectangles can be placed
// on the boundary of d, one on each side
@ -853,7 +813,6 @@ four_cover_points(Staircases< Traits >& d, OutputIterator o, bool& ok)
// (no need to consider S_bl, since we move from left
// to right and leaving a rectangle won't make piercing easier)
#line 497 "pierce_4.awi"
Intervall top_i = d.top_intervall();
Intervall left_i = d.left_intervall();
@ -1034,18 +993,14 @@ four_cover_points(Staircases< Traits >& d, OutputIterator o, bool& ok)
} // for (;;)
} // if (tl != d.tlstc_end())
#line 470 "pierce_4.awi"
} // if (!d.is_middle_empty())
#line 345 "pierce_4.awi"
ok = false;
return o;
} // four_cover_points(d, o, ok)
#line 131 "pierce.awi"
#line 55 "pierce_traits.awi"
struct Two_covering_algorithm {
template < class Traits, class OutputIterator >
OutputIterator
@ -1054,7 +1009,6 @@ struct Two_covering_algorithm {
bool& ok) const
{ return two_cover_points(d, o, ok); }
}; // class Two_covering_algorithm
#line 55 "pierce_traits.awi"
struct Three_covering_algorithm {
template < class Traits, class OutputIterator >
OutputIterator
@ -1063,7 +1017,6 @@ struct Three_covering_algorithm {
bool& ok) const
{ return three_cover_points(d, o, ok); }
}; // class Three_covering_algorithm
#line 55 "pierce_traits.awi"
struct Four_covering_algorithm {
template < class Traits, class OutputIterator >
OutputIterator
@ -1072,13 +1025,10 @@ struct Four_covering_algorithm {
bool& ok) const
{ return four_cover_points(d, o, ok); }
}; // class Four_covering_algorithm
#line 50 "code_formatting.awi"
CGAL_END_NAMESPACE
#line 135 "pierce.awi"
#endif // ! (CGAL_PIERCE_RECTANGLES_2_H)
#line 12 "code_formatting.awi"
// ----------------------------------------------------------------------------
// ** EOF
// ----------------------------------------------------------------------------

View File

@ -1,5 +1,3 @@
#line 623 "pcenter.aw"
#line 18 "code_formatting.awi"
// ============================================================================
//
// Copyright (c) 1998 The CGAL Consortium
@ -26,12 +24,9 @@
// 2,3-Center Computation for Axis-Parallel 2D-Rectangles
// ============================================================================
#line 627 "pcenter.aw"
#line 54 "code_formatting.awi"
#if ! (CGAL_RECTANGULAR_3_CENTER_2_H)
#define CGAL_RECTANGULAR_3_CENTER_2_H 1
#line 596 "pcenter.aw"
#include <CGAL/Cartesian.h>
#include <CGAL/function_objects.h>
#include <CGAL/algorithm.h>
@ -48,10 +43,7 @@
#define Base B_B_Base
#endif // _MSC_VER
#line 46 "code_formatting.awi"
CGAL_BEGIN_NAMESPACE
#line 613 "pcenter.aw"
#line 13 "pc_traits.awi"
/*
struct Wastebasket
: public CGAL_STD::iterator< std::output_iterator_tag, void >
@ -67,8 +59,6 @@ struct Wastebasket
};
*/
#line 614 "pcenter.aw"
#line 12 "3cover.awi"
template < class ForwardIterator, class OutputIterator,
class FT, class Traits >
OutputIterator
@ -145,7 +135,6 @@ rectangular_2_center_2(
}
return o;
}
#line 91 "3cover.awi"
template < class RandomAccessIterator,
class OutputIterator,
class Traits >
@ -272,13 +261,11 @@ rectangular_3_center_2_type1(
}
return o;
}
#line 292 "3cover.awi"
#ifndef _MSC_VER
template < class R >
struct Rectangular_3_center_2_type2_operations_base {
#line 220 "3cover.awi"
typedef typename R::FT FT;
typedef typename R::Point_2 Point_2;
typedef typename R::Iso_rectangle_2 Iso_rectangle_2;
@ -348,7 +335,6 @@ struct Rectangular_3_center_2_type2_operations_base {
private:
R& r_;
Delta delta_;
#line 298 "3cover.awi"
public:
@ -357,7 +343,6 @@ public:
{}
};
#line 406 "3cover.awi"
template < class R >
struct Rectangular_3_center_2_type2_operations0
: public Rectangular_3_center_2_type2_operations_base< R >
@ -375,7 +360,6 @@ struct Rectangular_3_center_2_type2_operations0
: Rectangular_3_center_2_type2_operations_base< R >(r, p)
{}
#line 309 "3cover.awi"
X_compare compare_x() const { return less_x_2_object(); }
Y_compare compare_y() const { return greater_y_2_object(); }
@ -470,9 +454,7 @@ struct Rectangular_3_center_2_type2_operations0
Point construct_y_square(const Point& p, FT r) const
{ return pt_a_l()(p, p, r); }
#line 424 "3cover.awi"
};
#line 523 "3cover.awi"
template < class R >
struct Rectangular_3_center_2_type2_operations1
: public Rectangular_3_center_2_type2_operations_base< R >
@ -489,7 +471,6 @@ struct Rectangular_3_center_2_type2_operations1
: Rectangular_3_center_2_type2_operations_base< R >(r, p)
{}
#line 428 "3cover.awi"
X_compare compare_x() const { return greater_x_2_object(); }
Y_compare compare_y() const { return greater_y_2_object(); }
@ -582,9 +563,7 @@ struct Rectangular_3_center_2_type2_operations1
Point construct_y_square(const Point& p, FT r) const
{ return pt_a_r()(p, p, r); }
#line 540 "3cover.awi"
};
#line 639 "3cover.awi"
template < class R >
struct Rectangular_3_center_2_type2_operations2
: public Rectangular_3_center_2_type2_operations_base< R >
@ -601,7 +580,6 @@ struct Rectangular_3_center_2_type2_operations2
: Rectangular_3_center_2_type2_operations_base< R >(r, p)
{}
#line 544 "3cover.awi"
X_compare compare_x() const { return greater_x_2_object(); }
Y_compare compare_y() const { return less_y_2_object(); }
@ -694,9 +672,7 @@ struct Rectangular_3_center_2_type2_operations2
Point construct_y_square(const Point& p, FT r) const
{ return pt_b_r()(p, p, r); }
#line 656 "3cover.awi"
};
#line 822 "3cover.awi"
template < class R >
struct Rectangular_3_center_2_type2_operations3
: public Rectangular_3_center_2_type2_operations_base< R >
@ -713,7 +689,6 @@ struct Rectangular_3_center_2_type2_operations3
: Rectangular_3_center_2_type2_operations_base< R >(r, p)
{}
#line 660 "3cover.awi"
X_compare compare_x() const { return less_x_2_object(); }
Y_compare compare_y() const { return less_y_2_object(); }
@ -806,7 +781,6 @@ struct Rectangular_3_center_2_type2_operations3
Point construct_y_square(const Point& p, FT r) const
{ return pt_b_l()(p, p, r); }
#line 839 "3cover.awi"
};
#else
@ -814,7 +788,6 @@ struct Rectangular_3_center_2_type2_operations3
#include <CGAL/rectangular_3_center_2_msvc.h>
#endif // _MSC_VER
#line 849 "3cover.awi"
template < class RandomAccessIterator,
class Rectangle,
class OutputIterator,
@ -1425,7 +1398,6 @@ rectangular_3_center_2_type2(
*o++ = op.construct_y_square(q_r, rad / FT(2));
return o;
} // rectangular_3_center_2_type2( ... )
#line 1462 "3cover.awi"
template < class ForwardIterator, class OutputIterator, class Traits >
OutputIterator
rectangular_3_center_2(
@ -1520,10 +1492,7 @@ rectangular_3_center_2(
} // rectangular_3_center_2( ... )
#line 615 "pcenter.aw"
#line 50 "code_formatting.awi"
CGAL_END_NAMESPACE
#line 616 "pcenter.aw"
#ifdef _MSC_VER
#undef Base
@ -1531,7 +1500,6 @@ CGAL_END_NAMESPACE
#endif // ! (CGAL_RECTANGULAR_3_CENTER_2_H)
#line 12 "code_formatting.awi"
// ----------------------------------------------------------------------------
// ** EOF
// ----------------------------------------------------------------------------

View File

@ -1,5 +1,3 @@
#line 634 "pcenter.aw"
#line 18 "code_formatting.awi"
// ============================================================================
//
// Copyright (c) 1998 The CGAL Consortium
@ -26,15 +24,11 @@
// MSVC Workarounds
// ============================================================================
#line 638 "pcenter.aw"
#line 54 "code_formatting.awi"
#if ! (CGAL_RECTANGULAR_3_CENTER_2_MSVC_H)
#define CGAL_RECTANGULAR_3_CENTER_2_MSVC_H 1
#line 755 "3cover.awi"
template < class R >
struct Rectangular_3_center_2_type2_operations0 {
#line 220 "3cover.awi"
typedef typename R::FT FT;
typedef typename R::Point_2 Point_2;
typedef typename R::Iso_rectangle_2 Iso_rectangle_2;
@ -104,7 +98,6 @@ struct Rectangular_3_center_2_type2_operations0 {
private:
R& r_;
Delta delta_;
#line 758 "3cover.awi"
public:
typedef Point_2 Point;
typedef Iso_rectangle_2 Rectangle;
@ -116,7 +109,6 @@ public:
: r_(r), delta_(std::bind1st(r.infinity_distance_2_object(), p))
{}
#line 309 "3cover.awi"
X_compare compare_x() const { return less_x_2_object(); }
Y_compare compare_y() const { return greater_y_2_object(); }
@ -211,11 +203,9 @@ public:
Point construct_y_square(const Point& p, FT r) const
{ return pt_a_l()(p, p, r); }
#line 770 "3cover.awi"
};
template < class R >
struct Rectangular_3_center_2_type2_operations1 {
#line 220 "3cover.awi"
typedef typename R::FT FT;
typedef typename R::Point_2 Point_2;
typedef typename R::Iso_rectangle_2 Iso_rectangle_2;
@ -285,7 +275,6 @@ struct Rectangular_3_center_2_type2_operations1 {
private:
R& r_;
Delta delta_;
#line 774 "3cover.awi"
public:
typedef Point_2 Point;
typedef Iso_rectangle_2 Rectangle;
@ -297,7 +286,6 @@ public:
: r_(r), delta_(std::bind1st(r.infinity_distance_2_object(), p))
{}
#line 428 "3cover.awi"
X_compare compare_x() const { return greater_x_2_object(); }
Y_compare compare_y() const { return greater_y_2_object(); }
@ -390,11 +378,9 @@ public:
Point construct_y_square(const Point& p, FT r) const
{ return pt_a_r()(p, p, r); }
#line 786 "3cover.awi"
};
template < class R >
struct Rectangular_3_center_2_type2_operations2 {
#line 220 "3cover.awi"
typedef typename R::FT FT;
typedef typename R::Point_2 Point_2;
typedef typename R::Iso_rectangle_2 Iso_rectangle_2;
@ -464,7 +450,6 @@ struct Rectangular_3_center_2_type2_operations2 {
private:
R& r_;
Delta delta_;
#line 790 "3cover.awi"
public:
typedef Point_2 Point;
typedef Iso_rectangle_2 Rectangle;
@ -476,7 +461,6 @@ public:
: r_(r), delta_(std::bind1st(r.infinity_distance_2_object(), p))
{}
#line 544 "3cover.awi"
X_compare compare_x() const { return greater_x_2_object(); }
Y_compare compare_y() const { return less_y_2_object(); }
@ -569,11 +553,9 @@ public:
Point construct_y_square(const Point& p, FT r) const
{ return pt_b_r()(p, p, r); }
#line 802 "3cover.awi"
};
template < class R >
struct Rectangular_3_center_2_type2_operations3 {
#line 220 "3cover.awi"
typedef typename R::FT FT;
typedef typename R::Point_2 Point_2;
typedef typename R::Iso_rectangle_2 Iso_rectangle_2;
@ -643,7 +625,6 @@ struct Rectangular_3_center_2_type2_operations3 {
private:
R& r_;
Delta delta_;
#line 806 "3cover.awi"
public:
typedef Point_2 Point;
typedef Iso_rectangle_2 Rectangle;
@ -655,7 +636,6 @@ public:
: r_(r), delta_(std::bind1st(r.infinity_distance_2_object(), p))
{}
#line 660 "3cover.awi"
X_compare compare_x() const { return less_x_2_object(); }
Y_compare compare_y() const { return less_y_2_object(); }
@ -748,12 +728,10 @@ public:
Point construct_y_square(const Point& p, FT r) const
{ return pt_b_l()(p, p, r); }
#line 818 "3cover.awi"
};
#endif // ! (CGAL_RECTANGULAR_3_CENTER_2_MSVC_H)
#line 12 "code_formatting.awi"
// ----------------------------------------------------------------------------
// ** EOF
// ----------------------------------------------------------------------------

View File

@ -1,5 +1,3 @@
#line 574 "pcenter.aw"
#line 18 "code_formatting.awi"
// ============================================================================
//
// Copyright (c) 1998 The CGAL Consortium
@ -26,12 +24,9 @@
// 2-4-Center Computation for Axis-Parallel 2D-Rectangles
// ============================================================================
#line 578 "pcenter.aw"
#line 54 "code_formatting.awi"
#if ! (CGAL_RECTANGULAR_P_CENTER_2_H)
#define CGAL_RECTANGULAR_P_CENTER_2_H 1
#line 556 "pcenter.aw"
#include <CGAL/pierce_rectangles_2.h>
#include <CGAL/function_objects.h>
#include <CGAL/sorted_matrix_search.h>
@ -41,19 +36,12 @@
#include <CGAL/Rectangular_p_center_traits_2.h>
#endif // CGAL_REP_CLASS_DEFINED
#line 46 "code_formatting.awi"
CGAL_BEGIN_NAMESPACE
#line 566 "pcenter.aw"
#line 28 "matrix_flip.awi"
#line 50 "code_formatting.awi"
CGAL_END_NAMESPACE
#line 29 "matrix_flip.awi"
#include <CGAL/Cartesian_matrix.h>
#line 46 "code_formatting.awi"
CGAL_BEGIN_NAMESPACE
#line 33 "matrix_flip.awi"
#ifdef _MSC_VER
// that compiler cannot even distinguish between global
@ -137,8 +125,6 @@ cartesian_matrix_horizontally_flipped(
RandomAccessIC_column >
( r_f, r_l, c_f, c_l, o);
}
#line 567 "pcenter.aw"
#line 141 "pcenter.aw"
/*
template < class ForwardIterator,
class OutputIterator,
@ -207,7 +193,6 @@ rectangular_p_center_2_binary_search(
// create Traits object:
Traits pierce_it( f, l, pf);
#line 225 "pcenter.aw"
// check, if input data is trivial
bool ok;
OutputIterator oi = pierce_it(FT(0), o, ok);
@ -215,8 +200,6 @@ rectangular_p_center_2_binary_search(
r = 0;
return oi;
}
#line 213 "pcenter.aw"
#line 237 "pcenter.aw"
// create vector with absolute coordinate differences:
std::vector< FT > c_diffs;
c_diffs.reserve( pierce_it.number_of_points() *
@ -232,8 +215,6 @@ rectangular_p_center_2_binary_search(
// sort it:
sort( c_diffs.begin(), c_diffs.end());
#line 214 "pcenter.aw"
#line 263 "pcenter.aw"
// search it:
int b( 0);
int e( c_diffs.size());
@ -259,11 +240,9 @@ rectangular_p_center_2_binary_search(
OutputIterator o_return( pierce_it( r, o, ok));
CGAL_optimisation_assertion( ok);
return o_return;
#line 215 "pcenter.aw"
} // rectangular_p_center_2_binary_search( ... )
*/
#line 321 "pcenter.aw"
template < class RandomAccessIC,
class OutputIterator,
#ifdef CGAL_CFG_MATCHING_BUG_1
@ -316,7 +295,6 @@ rectangular_p_center_2_matrix_search(
// create Traits object:
MSTraits pierce_it(f, l, t, pf);
#line 225 "pcenter.aw"
// check, if input data is trivial
bool ok;
OutputIterator oi = pierce_it(FT(0), o, ok);
@ -324,12 +302,10 @@ rectangular_p_center_2_matrix_search(
r = 0;
return oi;
}
#line 377 "pcenter.aw"
// create matrix search traits:
Matrix_search_traits search_it(pierce_it);
#line 444 "pcenter.aw"
// copy x and y coordinates from [f,l):
std::vector< FT > x_coords;
std::vector< FT > y_coords;
@ -365,7 +341,6 @@ rectangular_p_center_2_matrix_search(
compose1_2(
bind1st( Max< FT >(), 0),
minus< FT >())));
#line 382 "pcenter.aw"
// do the actual search:
r = sorted_matrix_search(matrices.begin(),
@ -420,9 +395,7 @@ rectangular_p_center_2_matrix_search(
} // Pcenter_matrix_search( ... )
#line 568 "pcenter.aw"
#line 484 "pcenter.aw"
template < class ForwardIterator, class OutputIterator, class FT >
inline OutputIterator
rectangular_p_center_matrix_search_2(
@ -489,14 +462,10 @@ rectangular_p_center_2(ForwardIterator f,
} // rectangular_p_center_2( ... )
#line 570 "pcenter.aw"
#line 50 "code_formatting.awi"
CGAL_END_NAMESPACE
#line 571 "pcenter.aw"
#endif // ! (CGAL_RECTANGULAR_P_CENTER_2_H)
#line 12 "code_formatting.awi"
// ----------------------------------------------------------------------------
// ** EOF
// ----------------------------------------------------------------------------

View File

@ -1,5 +1,3 @@
#line 863 "fjsearch.aw"
#line 18 "code_formatting.awi"
// ============================================================================
//
// Copyright (c) 1998 The CGAL Consortium
@ -26,22 +24,16 @@
// Frederickson-Johnson matrix search
// ============================================================================
#line 867 "fjsearch.aw"
#line 54 "code_formatting.awi"
#if ! (CGAL_SORTED_MATRIX_SEARCH_H)
#define CGAL_SORTED_MATRIX_SEARCH_H 1
#line 848 "fjsearch.aw"
#include <CGAL/basic.h>
#include <algorithm>
#include <functional>
#include <vector>
#include <CGAL/Sorted_matrix_search_traits_adaptor.h>
#line 46 "code_formatting.awi"
CGAL_BEGIN_NAMESPACE
#line 855 "fjsearch.aw"
#line 217 "fjsearch.aw"
template < class Matrix >
class Padded_matrix {
public:
@ -79,8 +71,6 @@ public:
private:
const Matrix* matrix;
};
#line 856 "fjsearch.aw"
#line 285 "fjsearch.aw"
template < class PaddedMatrix >
class Matrix_cell {
public:
@ -130,7 +120,6 @@ private:
int x;
int y;
};
#line 345 "fjsearch.aw"
template < class Cell >
struct Cell_min
: public CGAL_STD::unary_function< Cell, typename Cell::Value >
@ -154,14 +143,11 @@ private:
int ofs;
};
#line 857 "fjsearch.aw"
#line 165 "fjsearch.aw"
template < class InputIterator, class Traits >
typename Traits::Value
sorted_matrix_search(InputIterator f, InputIterator l, Traits t)
{
#line 375 "fjsearch.aw"
#ifndef CGAL_CFG_NO_NAMESPACE
using std::max;
using std::nth_element;
@ -185,8 +171,6 @@ sorted_matrix_search(InputIterator f, InputIterator l, Traits t)
typedef typename Cell_container::reverse_iterator Cell_reverse_iterator;
Cell_container active_cells;
#line 170 "fjsearch.aw"
#line 408 "fjsearch.aw"
// set of input matrices must not be empty:
CGAL_precondition( f != l);
@ -214,12 +198,10 @@ sorted_matrix_search(InputIterator f, InputIterator l, Traits t)
#line 171 "fjsearch.aw"
// now start the search:
for (;;) {
#line 473 "fjsearch.aw"
if ( ccd > 1) {
// ------------------------------------------------------
// divide cells:
@ -268,8 +250,6 @@ sorted_matrix_search(InputIterator f, InputIterator l, Traits t)
// there has to be at least one cell left:
CGAL_assertion( active_cells.size() > 0);
#line 179 "fjsearch.aw"
#line 562 "fjsearch.aw"
// ------------------------------------------------------
// compute medians of smallest and largest elements:
@ -313,8 +293,6 @@ sorted_matrix_search(InputIterator f, InputIterator l, Traits t)
bind1st(equal_to< Value >(), lower_median),
Cell_min< Cell >()));
CGAL_optimisation_assertion(lower_median_cell != active_cells.end());
#line 180 "fjsearch.aw"
#line 644 "fjsearch.aw"
// ------------------------------------------------------
// test feasibility of medians and remove cells accordingly:
Cell_iterator new_end;
@ -425,7 +403,6 @@ sorted_matrix_search(InputIterator f, InputIterator l, Traits t)
} // both upper_median and lower_median are infeasible
active_cells.erase( new_end, active_cells.end());
#line 181 "fjsearch.aw"
} // for (;;)
// there must be only one cell left:
@ -435,14 +412,10 @@ sorted_matrix_search(InputIterator f, InputIterator l, Traits t)
return (*active_cells.begin()).min();
}
#line 859 "fjsearch.aw"
#line 50 "code_formatting.awi"
CGAL_END_NAMESPACE
#line 860 "fjsearch.aw"
#endif // ! (CGAL_SORTED_MATRIX_SEARCH_H)
#line 12 "code_formatting.awi"
// ----------------------------------------------------------------------------
// ** EOF
// ----------------------------------------------------------------------------

View File

@ -1,146 +1,13 @@
//=====================================================================
// Revision History for package Matrix_search
//=====================================================================
CHANGES:
1.6:
- added package and chapter to file headers.
- removed htmlfiles (now in Optimisation_basic).
- changed pkg-name acc. to naming conventions.
- minor fix in the docs.
//---------------------------------------------------------------------
// revision 1.25
//---------------------------------------------------------------------
DEMO: Fixed a few things for VC++.
DOCS: Uniform traits classes documented.
SRC : Completely new four-center implementation.
//---------------------------------------------------------------------
// revision 1.24
//---------------------------------------------------------------------
SRC : Completely new four-cover implementation.
SRC : Unified traits classes.
SRC : Added std:: to vector in several places in extremal_polygon_2.h.
SRC : Removed CGAL::sqrt (now in double.h/leda_real.h).
SRC : added some return 0;
SRC : MSVBC workaround for TYPENAME_BUGs.
SRC : New linear 2- and 3-center algorithm.
SRC : added std:: in a number of places where it was missing
SRC : use namespace std and CGAL
SRC : use standard header files
SRC : fix signed <-> unsigned comparison warning on gcc.
SRC : some minor changes to prevent warnings for gcc -Wall.
SRC : fixed a bug in Rectangle_partition::first_left_of.
SRC : Initial revision
SRC : Matrix_search
//---------------------------------------------------------------------
// revision 1.23
//---------------------------------------------------------------------
SRC : Worked around some MSVC using-bugs.
SRC : Removed, --> Rectangular_p_center_traits_2.h.
SRC : added std:: in a number of places where it was missing
SRC : use namespace std and CGAL
SRC : use standard header files
SRC : fix signed <-> unsigned comparison warning on gcc.
SRC : some minor changes to prevent warnings for gcc -Wall.
SRC : fixed a bug in Rectangle_partition::first_left_of.
SRC : Initial revision
SRC : Matrix_search
//---------------------------------------------------------------------
// revision 1.22
//---------------------------------------------------------------------
ALL : Replaced selfmade timer by CGAL::Timer.
TEST: Removed "warning" from program output.
//---------------------------------------------------------------------
// revision 1.21
//---------------------------------------------------------------------
SRC : Added std:: to vector in several places in extremal_polygon_2.h.
//---------------------------------------------------------------------
// revision 1.20
//---------------------------------------------------------------------
DEMO: Prefixed leda_drawing_mode.
SRC : Removed CGAL::sqrt (now in double.h/leda_real.h).
//---------------------------------------------------------------------
// revision 1.19
//---------------------------------------------------------------------
ALL : added some return 0;
ALL : MSVBC workaround for TYPENAME_BUGs.
//---------------------------------------------------------------------
// revision 1.18
//---------------------------------------------------------------------
DEMO: New User-Interface with different Generators.
SRC : New linear 2- and 3-center algorithm.
TEST: Use Intervall_arithmetic number type.
//---------------------------------------------------------------------
// revision 1.17
//---------------------------------------------------------------------
DEMO: fixed for LEDA-3.8 (the point_set<I> data structure vanished)
DEMO: Now nearest neighbor queries are done brute-force.
//---------------------------------------------------------------------
// revision 1.16
//---------------------------------------------------------------------
DOCS: fixed "cal" problem with html converter
//---------------------------------------------------------------------
// revision 1.15
//---------------------------------------------------------------------
DOCS: fixed preconditions in replace_column (reported by Mariette).
//---------------------------------------------------------------------
// revision 1.14
//---------------------------------------------------------------------
ALL : added std:: in a number of places where it was missing
//---------------------------------------------------------------------
// revision 1.13
//---------------------------------------------------------------------
DEMO: New User-Interface with different Generators.
ALL : Initial revision
TEST: added some return 0;
TEST: MSVBC workaround for TYPENAME_BUGs.
TEST: Added LONG_NAME_PROBLEM flags to makefile
//---------------------------------------------------------------------
// revision 1.12
//---------------------------------------------------------------------
ALL : use namespace std and CGAL
ALL : use standard header files
DOCS: Uniform traits classes documented.
DOCS: added some return 0;
DOCS: MSVBC workaround for TYPENAME_BUGs.
DOCS: fixed "cal" problem with html converter
DOCS: fixed preconditions in replace_column (reported by Mariette).
DOCS: Initial revision
//---------------------------------------------------------------------
// revision 1.11
//---------------------------------------------------------------------
//---------------------------------------------------------------------
// revision 1.10
//---------------------------------------------------------------------
//---------------------------------------------------------------------
// revision 1.9
//---------------------------------------------------------------------
SRC : fix signed <-> unsigned comparison warning on gcc.
1.5:
- Now rectangular 3- and 4-centers.
- Uses Iso_square_static_2 instead of Iso_rectangle_2
(improved performance and robustness).
- some fixes in the docs.

View File

@ -1,5 +1,3 @@
#line 1497 "mon_search.aw"
#line 18 "code_formatting.awi"
// ============================================================================
//
// Copyright (c) 1998 The CGAL Consortium
@ -26,9 +24,6 @@
// Test program: All Furthest Neighbors for a Convex Polygon
// ============================================================================
#line 1501 "mon_search.aw"
#line 680 "afn.awi"
#line 542 "afn.awi"
#include <CGAL/Cartesian.h>
#include <CGAL/Point_2.h>
#include <CGAL/Polygon_2.h>
@ -37,10 +32,8 @@
#include <CGAL/distance_predicates_2.h>
#include <CGAL/all_furthest_neighbors_2.h>
#include <vector>
#line 681 "afn.awi"
using std::equal;
#line 559 "afn.awi"
using std::vector;
using std::back_inserter;
using CGAL::Cartesian;
@ -50,12 +43,10 @@ using CGAL::Random_points_in_square_2;
using CGAL::random_convex_set_2;
using CGAL::has_smaller_dist_to_point;
using CGAL::all_furthest_neighbors;
#line 684 "afn.awi"
using CGAL::squared_distance;
using CGAL::iterator_distance;
typedef double FT;
#line 571 "afn.awi"
typedef Cartesian< FT > R;
typedef CGAL::Point_2< R > Point;
typedef Polygon_traits_2< R > P_traits;
@ -64,9 +55,7 @@ typedef vector< int > Index_cont;
typedef CGAL::Polygon_2< P_traits, Point_cont > Polygon;
typedef Creator_uniform_2< FT, Point > Creator;
typedef Random_points_in_square_2< Point, Creator > Point_generator;
#line 689 "afn.awi"
#line 725 "afn.awi"
#include <CGAL/squared_distance_2.h>
#include <CGAL/circulator.h>
#include <algorithm>
@ -91,7 +80,6 @@ afn_brute_force( RandomAccessIC b,
} while ( ++i1 != e);
return o;
} // afn_brute_force( b, e, o)
#line 691 "afn.awi"
int
main()
@ -99,22 +87,17 @@ main()
int size [] = { 3, 5, 20, 101, 534 };
for ( int i( 0); i < 5; ++i) {
int number_of_points( size[i]);
#line 594 "afn.awi"
// generate random convex polygon:
Polygon p;
random_convex_set_2( number_of_points,
back_inserter( p),
Point_generator( 1));
#line 699 "afn.awi"
#line 602 "afn.awi"
// compute all furthest neighbors:
Index_cont neighbors;
all_furthest_neighbors(
p.vertices_begin(),
p.vertices_end(),
back_inserter( neighbors));
#line 700 "afn.awi"
#line 752 "afn.awi"
// compute again brute force:
Index_cont neighbors2;
afn_brute_force(
@ -126,7 +109,6 @@ main()
CGAL_assertion( equal( neighbors.begin(),
neighbors.end(),
neighbors2.begin()));
#line 701 "afn.awi"
} // for ( int i( 0); i < 5; ++i)
#if !defined(CGAL_CFG_NO_ITERATOR_TRAITS) && \
@ -134,13 +116,11 @@ main()
// try also once with a random-acccess iterator:
int number_of_points( 222);
#line 594 "afn.awi"
// generate random convex polygon:
Polygon p;
random_convex_set_2( number_of_points,
back_inserter( p),
Point_generator( 1));
#line 709 "afn.awi"
Index_cont neighbors( number_of_points);
all_furthest_neighbors(
p.vertices_begin(),
@ -150,8 +130,6 @@ main()
return 0;
} // int main()
#line 1502 "mon_search.aw"
#line 12 "code_formatting.awi"
// ----------------------------------------------------------------------------
// ** EOF
// ----------------------------------------------------------------------------

View File

@ -1,5 +1,3 @@
#line 1524 "mon_search.aw"
#line 18 "code_formatting.awi"
// ============================================================================
//
// Copyright (c) 1998 The CGAL Consortium
@ -26,8 +24,6 @@
// Test program: Compute extremal polygons of a convex polygon
// ============================================================================
#line 1528 "mon_search.aw"
#line 516 "testprog.awi"
#include <CGAL/Cartesian.h>
#include <CGAL/Point_2.h>
#include <CGAL/point_generators_2.h>
@ -67,7 +63,6 @@ typedef vector< Point_double > Cont_double;
typedef Creator_uniform_2< double, Point_double > Creator;
typedef Random_points_in_square_2< Point_double, Creator >
Point_generator;
#line 668 "testprog.awi"
template < class RandomAccessIC,
class OutputIterator >
OutputIterator
@ -104,7 +99,6 @@ brute_force_area_3( RandomAccessIC b,
return o;
} // brute_force_3( b, e, o)
#line 707 "testprog.awi"
template < class RandomAccessIC,
class OutputIterator >
OutputIterator
@ -151,7 +145,6 @@ brute_force_area_4( RandomAccessIC b,
} // brute_force_4( b, e, o)
#line 556 "testprog.awi"
/*
struct D2R : public unary_function< Point_double, Point >
@ -261,8 +254,6 @@ int main() {
return 0;
} // int main()
#line 1529 "mon_search.aw"
#line 12 "code_formatting.awi"
// ----------------------------------------------------------------------------
// ** EOF
// ----------------------------------------------------------------------------

View File

@ -1,5 +1,3 @@
#line 663 "pcenter.aw"
#line 18 "code_formatting.awi"
// ============================================================================
//
// Copyright (c) 1998 The CGAL Consortium
@ -26,9 +24,6 @@
// 2-4-Centering Axis-Parallel 2D-Rectangles - test program
// ============================================================================
#line 667 "pcenter.aw"
#line 714 "pc_testprog.awi"
#line 621 "pc_testprog.awi"
#include <CGAL/Cartesian.h>
#include <CGAL/Point_2.h>
#include <CGAL/Vector_2.h>
@ -83,7 +78,6 @@ typedef PCont::iterator iterator;
typedef Creator_uniform_2< FT, Point > Creator;
typedef Random_points_in_square_2< Point, Creator >
Point_generator;
#line 103 "pc_testprog.awi"
#ifdef _MSC_VER
// that compiler cannot even distinguish between global
// and class scope, so ...
@ -163,7 +157,6 @@ private:
#ifdef _MSC_VER
#undef Base
#endif // _MSC_VER
#line 676 "pc_testprog.awi"
int
main(int argc, char* argv[])
@ -199,7 +192,6 @@ main(int argc, char* argv[])
#ifndef CGAL_PCENTER_NO_OUTPUT
cerr << "random seed is " << random_seed << endl;
#endif // CGAL_PCENTER_NO_OUTPUT
#line 715 "pc_testprog.awi"
PCont input_points;
CGAL::copy_n(Point_generator(1, rnd),
number_of_points,
@ -226,7 +218,6 @@ main(int argc, char* argv[])
#endif // CGAL_PCENTER_NO_OUTPUT
#ifdef CGAL_USE_LEDA
#line 751 "pc_testprog.awi"
// check that all points are covered
CGAL::Infinity_distance_2< R > dist;
#ifndef _MSC_VER
@ -276,15 +267,12 @@ main(int argc, char* argv[])
if (!boundary)
cerr << "Error: No square has two points on boundary." << endl;
CGAL_assertion(boundary);
#line 742 "pc_testprog.awi"
#endif // CGAL_USE_LEDA
} // for (int p(2); p < 5; ++p)
return 0;
}
#line 668 "pcenter.aw"
#line 12 "code_formatting.awi"
// ----------------------------------------------------------------------------
// ** EOF
// ----------------------------------------------------------------------------

View File

@ -1,5 +1,3 @@
#line 672 "pcenter.aw"
#line 18 "code_formatting.awi"
// ============================================================================
//
// Copyright (c) 1998 The CGAL Consortium
@ -26,9 +24,6 @@
// 2-4-Centering Axis-Parallel 2D-Rectangles - test program
// ============================================================================
#line 676 "pcenter.aw"
#line 803 "pc_testprog.awi"
#line 621 "pc_testprog.awi"
#include <CGAL/Cartesian.h>
#include <CGAL/Point_2.h>
#include <CGAL/Vector_2.h>
@ -83,7 +78,6 @@ typedef PCont::iterator iterator;
typedef Creator_uniform_2< FT, Point > Creator;
typedef Random_points_in_square_2< Point, Creator >
Point_generator;
#line 103 "pc_testprog.awi"
#ifdef _MSC_VER
// that compiler cannot even distinguish between global
// and class scope, so ...
@ -163,7 +157,6 @@ private:
#ifdef _MSC_VER
#undef Base
#endif // _MSC_VER
#line 676 "pc_testprog.awi"
int
main(int argc, char* argv[])
@ -199,7 +192,6 @@ main(int argc, char* argv[])
#ifndef CGAL_PCENTER_NO_OUTPUT
cerr << "random seed is " << random_seed << endl;
#endif // CGAL_PCENTER_NO_OUTPUT
#line 804 "pc_testprog.awi"
FT result;
@ -241,7 +233,6 @@ main(int argc, char* argv[])
#endif // CGAL_PCENTER_NO_OUTPUT
#ifdef CGAL_USE_LEDA
#line 751 "pc_testprog.awi"
// check that all points are covered
CGAL::Infinity_distance_2< R > dist;
#ifndef _MSC_VER
@ -291,7 +282,6 @@ main(int argc, char* argv[])
if (!boundary)
cerr << "Error: No square has two points on boundary." << endl;
CGAL_assertion(boundary);
#line 857 "pc_testprog.awi"
#endif // CGAL_USE_LEDA
} // for (int sz = 0; sz < 3; ++sz)
@ -299,8 +289,6 @@ main(int argc, char* argv[])
return 0;
}
#line 677 "pcenter.aw"
#line 12 "code_formatting.awi"
// ----------------------------------------------------------------------------
// ** EOF
// ----------------------------------------------------------------------------

View File

@ -1,5 +1,3 @@
#line 266 "fj_testprog.awi"
#line 18 "code_formatting.awi"
// ============================================================================
//
// Copyright (c) 1998 The CGAL Consortium
@ -26,15 +24,11 @@
// Sorted matrix search: Test Program
// ============================================================================
#line 270 "fj_testprog.awi"
#line 258 "fj_testprog.awi"
#include <CGAL/Random.h>
#include <CGAL/function_objects.h>
#include <CGAL/Cartesian_matrix.h>
#include <CGAL/sorted_matrix_search.h>
#include <vector>
#line 271 "fj_testprog.awi"
#line 230 "fj_testprog.awi"
template < class Matrix_iterator, class Value >
Value
compute_upper_bound( Matrix_iterator f,
@ -58,9 +52,6 @@ compute_upper_bound( Matrix_iterator f,
}
return best;
} // compute_upper_bound( f, l, b, max)
#line 272 "fj_testprog.awi"
#line 20 "fj_testprog.awi"
#line 55 "fj_testprog.awi"
using std::vector;
using std::plus;
using std::sort;
@ -88,12 +79,10 @@ typedef Cartesian_matrix<
typedef vector< Matrix > Matrix_cont;
#line 21 "fj_testprog.awi"
int
main( int argc, char* argv[])
{
#line 40 "fj_testprog.awi"
// seed for random number generator:
int random_seed;
// number of matrices:
@ -106,8 +95,6 @@ main( int argc, char* argv[])
Matrix_cont matrices;
// set of vectors the matrices are build from:
Vector_cont vectors;
#line 26 "fj_testprog.awi"
#line 88 "fj_testprog.awi"
// handle command line arguments:
if ( argc < 4 ||
(num = atoi(argv[1])) <= 0 ||
@ -135,8 +122,6 @@ main( int argc, char* argv[])
#ifdef OUTPUT
cout << "random seed is " << random_seed << endl;
#endif
#line 27 "fj_testprog.awi"
#line 127 "fj_testprog.awi"
// maximum entry of all matrices:
Value max_entry( -1);
@ -192,8 +177,6 @@ main( int argc, char* argv[])
Matrix( (*i).begin(), (*i).end(),
(*j).begin(), (*j).end()));
}
#line 28 "fj_testprog.awi"
#line 188 "fj_testprog.awi"
// search lower bound for a random value v in matrices
Value bound;
// assure there is any feasible value in m:
@ -230,12 +213,9 @@ main( int argc, char* argv[])
<< "\nresult was " << u << "\ntrivial algorithm gives "
<< brute_force << endl;
#endif
#line 29 "fj_testprog.awi"
return 0;
}
#line 273 "fj_testprog.awi"
#line 12 "code_formatting.awi"
// ----------------------------------------------------------------------------
// ** EOF
// ----------------------------------------------------------------------------

View File

@ -1 +1 @@
1.25 (23 November 1999)
1.26 (23 November 1999)