first time

This commit is contained in:
Eli Packer 2003-05-12 14:01:18 +00:00
parent 385c4b1938
commit 49e238ed62
12 changed files with 1104 additions and 0 deletions

View File

@ -0,0 +1,11 @@
@article{o-naler-90
, author = "M. Orlowski"
, title = "A new algorithm for the largest empty rectangle problem"
, journal = "Algorithmica"
, volume = 5
, year = 1990
, pages = "65--73"
, keywords = "area"
, annote = "$O(n \log n)$ expected time, $O(n)$ space"
}

View File

@ -0,0 +1,67 @@
% +------------------------------------------------------------------------+
% | CGAL Reference Manual: snapRounding.tex
% +------------------------------------------------------------------------+
% | snap rounding of line segments
% |
% | 9.4.00 Eli Packer
% |
%\RCSdef{\largestEmptyRectangleRev}{$Revision$}
%\RCSdefDate{largestEmptyRectangleDate}{$Date$}
% +------------------------------------------------------------------------+
\ccParDims
% \usepackage{graphics, amssymb,epsfig}
\chapter{Largest Empty Rectangle}
\label{chapterLer}
%\ccChapterRelease{\largestEmptyRectangleRev. \ \largestEmptyRectangleDate}\\
\ccChapterAuthor{Eli Packer}
% +------------------------------------------------------------------------+
\section{Overview}
The Largest Empty Rectangle problem answers the following query. Given
a set of points in the plane and a bounding box( iso-rectangle) that bounds them,
find the iso-rectangle with the largest area among all iso-rectangles that are
inside the above bounding box and do not contain any point of the point set.
See Figure~\ref{fig:ler1} for an illustration.
\begin{figure}[h]
\begin{ccTexOnly}
\centerline{
\includegraphics{ler_example.ps}
}
\end{ccTexOnly}
\caption{An example of the largest empty iso rectangle of a set of points
\label{fig:ler1}}
\begin{ccHtmlOnly}
<P>
<center>
<img src="ler_example.gif" border=0 alt="example output">
<!--An example of the largest empty iso rectangle of a set of points-->
</center>
\end{ccHtmlOnly}
\end{figure}
The algorithm is an implementation of \cite{o-naler-90}. The runtime of an
insertion or a removal is $O(\log n)$. A query takes $O(n^2)$ worst
case time and $O(n \log n)$ expected time. The working storage is $
O(n)$.
% +========================================================================+
\section{Examples of Largest Empty Rectangle}
% +========================================================================+
The following example generates the Largest Empty Rectangle of a set
of points.
\ccIncludeExampleCode{../../examples/Largest_empty_rect_2/example.C}
% +--------------------------------------------------------+
% EOF

View File

@ -0,0 +1,200 @@
%!PS-Adobe-2.0
%%Title: ler_example.ps
%%Creator: fig2dev Version 3.2.3 Patchlevel
%%CreationDate: Sun Feb 17 21:28:07 2002
%%For: elip@nova (Eli Packer,,036722528,)
%%Orientation: Landscape
%%Pages: 1
%%BoundingBox: 0 0 612 792
%%BeginSetup
%%IncludeFeature: *PageSize Letter
%%EndSetup
%%Magnification: 1.0000
%%EndComments
/$F2psDict 200 dict def
$F2psDict begin
$F2psDict /mtrx matrix put
/col-1 {0 setgray} bind def
/col0 {0.000 0.000 0.000 srgb} bind def
/col1 {0.000 0.000 1.000 srgb} bind def
/col2 {0.000 1.000 0.000 srgb} bind def
/col3 {0.000 1.000 1.000 srgb} bind def
/col4 {1.000 0.000 0.000 srgb} bind def
/col5 {1.000 0.000 1.000 srgb} bind def
/col6 {1.000 1.000 0.000 srgb} bind def
/col7 {1.000 1.000 1.000 srgb} bind def
/col8 {0.000 0.000 0.560 srgb} bind def
/col9 {0.000 0.000 0.690 srgb} bind def
/col10 {0.000 0.000 0.820 srgb} bind def
/col11 {0.530 0.810 1.000 srgb} bind def
/col12 {0.000 0.560 0.000 srgb} bind def
/col13 {0.000 0.690 0.000 srgb} bind def
/col14 {0.000 0.820 0.000 srgb} bind def
/col15 {0.000 0.560 0.560 srgb} bind def
/col16 {0.000 0.690 0.690 srgb} bind def
/col17 {0.000 0.820 0.820 srgb} bind def
/col18 {0.560 0.000 0.000 srgb} bind def
/col19 {0.690 0.000 0.000 srgb} bind def
/col20 {0.820 0.000 0.000 srgb} bind def
/col21 {0.560 0.000 0.560 srgb} bind def
/col22 {0.690 0.000 0.690 srgb} bind def
/col23 {0.820 0.000 0.820 srgb} bind def
/col24 {0.500 0.190 0.000 srgb} bind def
/col25 {0.630 0.250 0.000 srgb} bind def
/col26 {0.750 0.380 0.000 srgb} bind def
/col27 {1.000 0.500 0.500 srgb} bind def
/col28 {1.000 0.630 0.630 srgb} bind def
/col29 {1.000 0.750 0.750 srgb} bind def
/col30 {1.000 0.880 0.880 srgb} bind def
/col31 {1.000 0.840 0.000 srgb} bind def
end
save
newpath 0 792 moveto 0 0 lineto 612 0 lineto 612 792 lineto closepath clip newpath
% Fill background color
0 0 moveto 612 0 lineto 612 792 lineto 0 792 lineto
closepath 1.00 1.00 1.00 setrgbcolor fill
47.5 38.0 translate
90 rotate
1 -1 scale
/cp {closepath} bind def
/ef {eofill} bind def
/gr {grestore} bind def
/gs {gsave} bind def
/sa {save} bind def
/rs {restore} bind def
/l {lineto} bind def
/m {moveto} bind def
/rm {rmoveto} bind def
/n {newpath} bind def
/s {stroke} bind def
/sh {show} bind def
/slc {setlinecap} bind def
/slj {setlinejoin} bind def
/slw {setlinewidth} bind def
/srgb {setrgbcolor} bind def
/rot {rotate} bind def
/sc {scale} bind def
/sd {setdash} bind def
/ff {findfont} bind def
/sf {setfont} bind def
/scf {scalefont} bind def
/sw {stringwidth} bind def
/tr {translate} bind def
/tnt {dup dup currentrgbcolor
4 -2 roll dup 1 exch sub 3 -1 roll mul add
4 -2 roll dup 1 exch sub 3 -1 roll mul add
4 -2 roll dup 1 exch sub 3 -1 roll mul add srgb}
bind def
/shd {dup dup currentrgbcolor 4 -2 roll mul 4 -2 roll mul
4 -2 roll mul srgb} bind def
/DrawEllipse {
/endangle exch def
/startangle exch def
/yrad exch def
/xrad exch def
/y exch def
/x exch def
/savematrix mtrx currentmatrix def
x y tr xrad yrad sc 0 0 1 startangle endangle arc
closepath
savematrix setmatrix
} def
/$F2psBegin {$F2psDict begin /$F2psEnteredState save def} def
/$F2psEnd {$F2psEnteredState restore end} def
$F2psBegin
%%Page: 1 1
10 setmiterlimit
0.06000 0.06000 sc
%%Page: 1 1
30.000 slw
% Ellipse
n 6758 5360 45 45 0 360 DrawEllipse gs col7 0.00 shd ef gr gs col0 s gr
% Ellipse
n 2550 3660 45 45 0 360 DrawEllipse gs col7 0.00 shd ef gr gs col0 s gr
% Ellipse
n 6075 4440 45 45 0 360 DrawEllipse gs col7 0.00 shd ef gr gs col0 s gr
% Ellipse
n 2270 1552 45 45 0 360 DrawEllipse gs col7 0.00 shd ef gr gs col0 s gr
% Ellipse
n 8803 2477 45 45 0 360 DrawEllipse gs col7 0.00 shd ef gr gs col0 s gr
% Ellipse
n 4320 1935 45 45 0 360 DrawEllipse gs col7 0.00 shd ef gr gs col0 s gr
% Ellipse
n 2340 6855 45 45 0 360 DrawEllipse gs col7 0.00 shd ef gr gs col0 s gr
% Ellipse
n 4710 7005 45 45 0 360 DrawEllipse gs col7 0.00 shd ef gr gs col0 s gr
% Ellipse
n 9930 6975 45 45 0 360 DrawEllipse gs col7 0.00 shd ef gr gs col0 s gr
% Ellipse
n 8379 6573 45 45 0 360 DrawEllipse gs col7 0.00 shd ef gr gs col0 s gr
% Ellipse
n 9195 5400 45 45 0 360 DrawEllipse gs col7 0.00 shd ef gr gs col0 s gr
% Ellipse
n 6662 2191 45 45 0 360 DrawEllipse gs col7 0.00 shd ef gr gs col0 s gr
% Ellipse
n 7110 3195 45 45 0 360 DrawEllipse gs col7 0.00 shd ef gr gs col0 s gr
% Ellipse
n 9630 3480 45 45 0 360 DrawEllipse gs col7 0.00 shd ef gr gs col0 s gr
% Ellipse
n 8055 4170 45 45 0 360 DrawEllipse gs col7 0.00 shd ef gr gs col0 s gr
% Ellipse
n 5970 7170 45 45 0 360 DrawEllipse gs col7 0.00 shd ef gr gs col0 s gr
% Ellipse
n 7110 6645 45 45 0 360 DrawEllipse gs col7 0.00 shd ef gr gs col0 s gr
% Ellipse
n 6918 4335 45 45 0 360 DrawEllipse gs col7 0.00 shd ef gr gs col0 s gr
% Ellipse
n 8085 5565 45 45 0 360 DrawEllipse gs col7 0.00 shd ef gr gs col0 s gr
% Ellipse
n 9780 1575 45 45 0 360 DrawEllipse gs col7 0.00 shd ef gr gs col0 s gr
% Ellipse
n 7980 2100 45 45 0 360 DrawEllipse gs col7 0.00 shd ef gr gs col0 s gr
% Ellipse
n 8475 3300 45 45 0 360 DrawEllipse gs col7 0.00 shd ef gr gs col0 s gr
% Ellipse
n 3690 6645 45 45 0 360 DrawEllipse gs col7 0.00 shd ef gr gs col0 s gr
% Ellipse
n 1910 5155 45 45 0 360 DrawEllipse gs col7 0.00 shd ef gr gs col0 s gr
% Ellipse
n 3675 5715 45 45 0 360 DrawEllipse gs col7 0.00 shd ef gr gs col0 s gr
% Polyline
7.500 slw
n 1500 1125 m 10425 1125 l 10425 7500 l 1500 7500 l
cp gs col0 s gr
% Polyline
30.000 slw
n 2625 2025 m 6000 2025 l 6000 5625 l 2625 5625 l
cp gs col0 s gr
$F2psEnd
rs
showpage

View File

@ -0,0 +1,107 @@
% +------------------------------------------------------------------------+
% | Reference manual page: LargestEmptyIsoRectangleTraits_2.tex
% +------------------------------------------------------------------------+
% | 06.04.2000 Author
% | Package: Package
% |
\RCSdef{\RCSLargestEmptyIsoRectangleTraits_2Rev}{$Revision$}
\RCSdefDate{\RCSLargestEmptyIsoRectangleTraits_2Date}{$Date$}
% |
%%RefPage: end of header, begin of main body
% +------------------------------------------------------------------------+
\begin{ccRefConcept}{LargestEmptyIsoRectangleTraits_2}
%% \ccHtmlCrossLink{} %% add further rules for cross referencing links
%% \ccHtmlIndexC[concept]{} %% add further index entries
\ccDefinition
The concept \ccRefName\ describes the set of requirements to be
fulfilled by any class used to instantiate the template parameter of
the class \ccc{Largest_empty_iso_rectangle_2<T>}.
This concept provides the types of the geometric primitives used in
this class and some function object types for the required
predicates on those primitives.
%% Less_x_2, Less_yx_2, Less_yx_2, Compare_x_2, Compare_y_2, Comparison_result
\ccTypes
\ccNestedType{Point_2}{The point type.}
\ccGlue
\ccNestedType{Iso_rectangle_2}{The iso rectangle type.}
\ccNestedType{Compare_x_2_object}{Predicate object. Must provide
the operator
\ccc{Comparison_result operator()(Point_2 p, Point_2 q)}
which returns
\ccc{SMALLER, EQUAL} or \ccc{ LARGER}
according ding to the
$x$-ordering of points \ccc{p} and \ccc{q}.}
\ccGlue
\ccNestedType{Compare_y_2_object}{Predicate object. Must provide
the operator
\ccc{Comparison_result operator()(Point_2 p, Point_2 q)}
which returns
\ccc{SMALLER, EQUAL} or \ccc{ LARGER}
according to the
$y$-ordering of points \ccc{p} and \ccc{q}.}
\ccGlue
\ccNestedType{Less_x_2_object}{Predicate object. Must provide
the operator
\ccc{bool operator()(Point_2 p, Point_2 q)}
which returns
whether \ccc{p} is less than \ccc{q} according to their $x$-ordering.}
\ccGlue
\ccNestedType{Less_y_2_object}{Predicate object. Must provide
the operator
\ccc{bool operator()(Point_2 p, Point_2 q)}
which returns
whether \ccc{p} is less than \ccc{q} according to their $y$-ordering.}
\ccCreation
\ccCreationVariable{traits} %% choose variable name
Only a default constructor, copy constructor
and an assignement operator are required.
Note that further constructors
can be provided.
\ccConstructor{LargestEmptyIsoRectangleTraits_2();}{Default constructor.}
\ccGlue
\ccConstructor{LargestEmptyIsoRectangleTraits_2(LargestEmptyIsoRectangleTraits_2);}
{Copy constructor}
\ccMethod{LargestEmptyIsoRectangleTraits_2 operator=(LargestEmptyIsoRectangleTraits_2 gtr);}
{Assignment operator.}
\ccHeading{Predicate functions}
The following functions give access to the predicate
and constructor objects.
\ccThree{Construct_segment_2}{gt.compare_x(Point p0, Point p1)x}{}
\ccMethod{Comparison_x_2 compare_x_2_object();}{}
\ccGlue
\ccMethod{Comparison_y_2 compare_y_2_object();}{}
\ccGlue
\ccMethod{bool less_x_2_object();}{}
\ccGlue
\ccMethod{bool less_y_2_object();}{}
\ccHasModels
\ccc{CGAL::Cartesian<R>} \\
\ccc{CGAL::Homogeneous<R>}
\ccSeeAlso
\ccc{CGAL::Largest_empty_iso_rectangle_2<Traits>}
\end{ccRefConcept}
% +------------------------------------------------------------------------+
%%RefPage: end of main body, begin of footer
% EOF
% +------------------------------------------------------------------------+

View File

@ -0,0 +1,11 @@
@article{o-naler-90
, author = "M. Orlowski"
, title = "A new algorithm for the largest empty rectangle problem"
, journal = "Algorithmica"
, volume = 5
, year = 1990
, pages = "65--73"
, keywords = "area"
, annote = "$O(n \log n)$ expected time, $O(n)$ space"
}

View File

@ -0,0 +1,156 @@
% +------------------------------------------------------------------------+
% | Reference manual page: Largest_empty_iso_rectangle_2.tex
% +------------------------------------------------------------------------+
% | 27.3.2000 Eli Packer
% | Package:
% |
%\RCSdef{\RCSTriangulationRev}{$Revision$}
%\RCSdefDate{\RCSTriangulationDate}{$Date$}
% |
%%RefPage: end of header, begin of main body
% +------------------------------------------------------------------------+
\begin{ccRefClass}{Largest_empty_iso_rectangle_2<T>}
%% \ccHtmlCrossLink{} %% add further rules for cross referencing links
%% \ccHtmlIndexC[class]{} %% add further index entries
\ccDefinition
Given a set of points in the plane, the class \ccRefName\ is a data
structure that maintains an iso-rectangle with the largest area among
all iso-rectangles that are inside a given bounding box( iso-rectangle), and
that do not contain any point of the point set.
The class \ccRefName\ expects a model of the concept \ccc{LargestEmptyIsoRectangleTraits_2} as its template argument.
\ccInclude{CGAL/Largest_empty_iso_rectangle_2.h}
\ccTypes
The class \ccClassTemplateName\ defines the following types:
\ccThreeToTwo
\ccTypedef{typedef T Traits;}{}
\ccTypedef{typedef Traits::Point_2 Point_2;}{}
\ccTypedef{typedef Traits::Iso_rectangle_2 Iso_rectangle_2;}{}
The following iterator allows to enumerate the points.
It is non mutable, bidirectional
and its value type is \ccc{Point_2}.
It is invalidated by any insertion or removal of a point.
\ccNestedType{const_iterator}{Iterator over the points.}
\ccCreation
\ccCreationVariable{l} %% choose variable name
\ccSetTwoColumns{Qt_widget}{}
%\ccThree{Largest_empty_iso_rectangle_2<Traits>(const Point_2& bl, const Point_2& tr)}{}{}
\ccConstructor{Largest_empty_iso_rectangle_2<Traits>
(const Iso_rectangle_2 &b);}
{Constructor. The iso-rectangle \ccc{b} is the bounding rectangle.}
\ccConstructor{Largest_empty_iso_rectangle_2<Traits>
(const Point_2 p,const Point_2 q);}
{Constructor. The iso-rectangle whose lower left and upper right points are \ccc{p} and
\ccc{q} respectively is the bounding rectangle.}
\ccConstructor{Largest_empty_iso_rectangle_2<Traits>
();}
{Constructor. The iso-rectangle whose lower left point and upper right points are (0,0)
and (1,1) respectively is the bounding rectangle.}
\ccConstructor{Largest_empty_iso_rectangle_2<Traits>
(const Largest_empty_iso_rectangle_2<Traits> tr);}
{Copy constructor.}
%\ccConstructor{\tilde Largest_empty_iso_rectangle_2<Traits>();}
%{Destructor.}
%
\ccOperations
\ccSetThreeColumns{const_iterator}{container.begin() const;}{}
\ccHeading{Assignment}
\ccMethod{Largest_empty_iso_rectangle_2<T>
operator=(const Largest_empty_iso_rectangle_2<T> & tr);}
{}
\ccAccessFunctions
\ccMethod{const Traits & traits() const;}
{Returns a const reference to the traits object.}
\ccMethod{const_iterator begin() const;}
{Returns an iterator to the beginning of the point set.}
\ccMethod{const_iterator end() const;}
{Returns a past-the-end iterator for the point set.}
\ccHeading{Queries}
\ccMethod{Quadruple<Point_2, Point_2, Point_2, Point_2>
get_left_bottom_right_top();}
{Returns the four points that define the largest empty iso-rectangle.
(Note that these points are not necessarily on a corner of an iso-rectangle.)}
\ccGlue
\ccMethod{Iso_rectangle_2 get_largest_empty_iso_rectangle();}
{Returns the largest empty iso-rectangle. (Note that the two
points defining the iso-rectangle are not necessarily part of
the point set.)}
\ccGlue
\ccMethod{Iso_rectangle_2 get_bounding_box();}
{Returns the iso-rectangle passed in the constructor.}
\ccHeading{Insertion}
\ccMethod{void
insert(const Point_2& p);}
{Inserts point \ccc{p} in the point set, if it is not already in the set.}
\ccMethod{void
push_back(const Point_2& p);}
{Inserts point \ccc{p} in the point set, if it is not already in the set.}
\ccMethod{template < class InputIterator >
int
insert(InputIterator first, InputIterator last);}
{Inserts the points in the range $\left[\right.$\ccc{first},
\ccc{last}$\left.\right)$. Returns the number of inserted points. \\ \\
\ccRequirements The \ccc{value_type} of \ccc{first} and \ccc{last} is \ccc{Point}.}
\ccHeading{Removal}
\ccMethod{bool remove(const Point_2& p);}{Removes point \ccc{p}.
Returns false iff \ccc{p} is not in the point set. }
\ccMethod{void clear();}
{Removes all points of \ccVar.}
%\ccSeeAlso
\ccImplementation
The algorithm is an implementation of \cite{o-naler-90}. The runtime of an
insertion or a removal is $O(\log n)$. A query takes $O(n^2)$ worst
case time and $O(n \log n)$ expected time. The working storage is $
O(n)$.
\bibliography{Largest_empty_iso_rectangle_2}
\bibliographystyle{abbrv}
\end{ccRefClass}
% +------------------------------------------------------------------------+
%%RefPage: end of main body, begin of footer
% EOF
% +------------------------------------------------------------------------+

View File

@ -0,0 +1,11 @@
@article{o-naler-90
, author = "M. Orlowski"
, title = "A new algorithm for the largest empty rectangle problem"
, journal = "Algorithmica"
, volume = 5
, year = 1990
, pages = "65--73"
, keywords = "area"
, annote = "$O(n \log n)$ expected time, $O(n)$ space"
}

View File

@ -0,0 +1,67 @@
% +------------------------------------------------------------------------+
% | CGAL Reference Manual: snapRounding.tex
% +------------------------------------------------------------------------+
% | snap rounding of line segments
% |
% | 9.4.00 Eli Packer
% |
%\RCSdef{\largestEmptyRectangleRev}{$Revision$}
%\RCSdefDate{largestEmptyRectangleDate}{$Date$}
% +------------------------------------------------------------------------+
\ccParDims
% \usepackage{graphics, amssymb,epsfig}
\chapter{Largest Empty Rectangle}
\label{chapterLer}
%\ccChapterRelease{\largestEmptyRectangleRev. \ \largestEmptyRectangleDate}\\
\ccChapterAuthor{Eli Packer}
% +------------------------------------------------------------------------+
\section{Overview}
The Largest Empty Rectangle problem answers the following query. Given
a set of points in the plane and a bounding box( iso-rectangle) that bounds them,
find the iso-rectangle with the largest area among all iso-rectangles that are
inside the above bounding box and do not contain any point of the point set.
See Figure~\ref{fig:ler1} for an illustration.
\begin{figure}[h]
\begin{ccTexOnly}
\centerline{
\includegraphics{ler_example.ps}
}
\end{ccTexOnly}
\caption{An example of the largest empty iso rectangle of a set of points
\label{fig:ler1}}
\begin{ccHtmlOnly}
<P>
<center>
<img src="ler_example.gif" border=0 alt="example output">
<!--An example of the largest empty iso rectangle of a set of points-->
</center>
\end{ccHtmlOnly}
\end{figure}
The algorithm is an implementation of \cite{o-naler-90}. The runtime of an
insertion or a removal is $O(\log n)$. A query takes $O(n^2)$ worst
case time and $O(n \log n)$ expected time. The working storage is $
O(n)$.
% +========================================================================+
\section{Examples of Largest Empty Rectangle}
% +========================================================================+
The following example generates the Largest Empty Rectangle of a set
of points.
\ccIncludeExampleCode{../../examples/Largest_empty_rect_2/example.C}
% +--------------------------------------------------------+
% EOF

View File

@ -0,0 +1,200 @@
%!PS-Adobe-2.0
%%Title: ler_example.ps
%%Creator: fig2dev Version 3.2.3 Patchlevel
%%CreationDate: Sun Feb 17 21:28:07 2002
%%For: elip@nova (Eli Packer,,036722528,)
%%Orientation: Landscape
%%Pages: 1
%%BoundingBox: 0 0 612 792
%%BeginSetup
%%IncludeFeature: *PageSize Letter
%%EndSetup
%%Magnification: 1.0000
%%EndComments
/$F2psDict 200 dict def
$F2psDict begin
$F2psDict /mtrx matrix put
/col-1 {0 setgray} bind def
/col0 {0.000 0.000 0.000 srgb} bind def
/col1 {0.000 0.000 1.000 srgb} bind def
/col2 {0.000 1.000 0.000 srgb} bind def
/col3 {0.000 1.000 1.000 srgb} bind def
/col4 {1.000 0.000 0.000 srgb} bind def
/col5 {1.000 0.000 1.000 srgb} bind def
/col6 {1.000 1.000 0.000 srgb} bind def
/col7 {1.000 1.000 1.000 srgb} bind def
/col8 {0.000 0.000 0.560 srgb} bind def
/col9 {0.000 0.000 0.690 srgb} bind def
/col10 {0.000 0.000 0.820 srgb} bind def
/col11 {0.530 0.810 1.000 srgb} bind def
/col12 {0.000 0.560 0.000 srgb} bind def
/col13 {0.000 0.690 0.000 srgb} bind def
/col14 {0.000 0.820 0.000 srgb} bind def
/col15 {0.000 0.560 0.560 srgb} bind def
/col16 {0.000 0.690 0.690 srgb} bind def
/col17 {0.000 0.820 0.820 srgb} bind def
/col18 {0.560 0.000 0.000 srgb} bind def
/col19 {0.690 0.000 0.000 srgb} bind def
/col20 {0.820 0.000 0.000 srgb} bind def
/col21 {0.560 0.000 0.560 srgb} bind def
/col22 {0.690 0.000 0.690 srgb} bind def
/col23 {0.820 0.000 0.820 srgb} bind def
/col24 {0.500 0.190 0.000 srgb} bind def
/col25 {0.630 0.250 0.000 srgb} bind def
/col26 {0.750 0.380 0.000 srgb} bind def
/col27 {1.000 0.500 0.500 srgb} bind def
/col28 {1.000 0.630 0.630 srgb} bind def
/col29 {1.000 0.750 0.750 srgb} bind def
/col30 {1.000 0.880 0.880 srgb} bind def
/col31 {1.000 0.840 0.000 srgb} bind def
end
save
newpath 0 792 moveto 0 0 lineto 612 0 lineto 612 792 lineto closepath clip newpath
% Fill background color
0 0 moveto 612 0 lineto 612 792 lineto 0 792 lineto
closepath 1.00 1.00 1.00 setrgbcolor fill
47.5 38.0 translate
90 rotate
1 -1 scale
/cp {closepath} bind def
/ef {eofill} bind def
/gr {grestore} bind def
/gs {gsave} bind def
/sa {save} bind def
/rs {restore} bind def
/l {lineto} bind def
/m {moveto} bind def
/rm {rmoveto} bind def
/n {newpath} bind def
/s {stroke} bind def
/sh {show} bind def
/slc {setlinecap} bind def
/slj {setlinejoin} bind def
/slw {setlinewidth} bind def
/srgb {setrgbcolor} bind def
/rot {rotate} bind def
/sc {scale} bind def
/sd {setdash} bind def
/ff {findfont} bind def
/sf {setfont} bind def
/scf {scalefont} bind def
/sw {stringwidth} bind def
/tr {translate} bind def
/tnt {dup dup currentrgbcolor
4 -2 roll dup 1 exch sub 3 -1 roll mul add
4 -2 roll dup 1 exch sub 3 -1 roll mul add
4 -2 roll dup 1 exch sub 3 -1 roll mul add srgb}
bind def
/shd {dup dup currentrgbcolor 4 -2 roll mul 4 -2 roll mul
4 -2 roll mul srgb} bind def
/DrawEllipse {
/endangle exch def
/startangle exch def
/yrad exch def
/xrad exch def
/y exch def
/x exch def
/savematrix mtrx currentmatrix def
x y tr xrad yrad sc 0 0 1 startangle endangle arc
closepath
savematrix setmatrix
} def
/$F2psBegin {$F2psDict begin /$F2psEnteredState save def} def
/$F2psEnd {$F2psEnteredState restore end} def
$F2psBegin
%%Page: 1 1
10 setmiterlimit
0.06000 0.06000 sc
%%Page: 1 1
30.000 slw
% Ellipse
n 6758 5360 45 45 0 360 DrawEllipse gs col7 0.00 shd ef gr gs col0 s gr
% Ellipse
n 2550 3660 45 45 0 360 DrawEllipse gs col7 0.00 shd ef gr gs col0 s gr
% Ellipse
n 6075 4440 45 45 0 360 DrawEllipse gs col7 0.00 shd ef gr gs col0 s gr
% Ellipse
n 2270 1552 45 45 0 360 DrawEllipse gs col7 0.00 shd ef gr gs col0 s gr
% Ellipse
n 8803 2477 45 45 0 360 DrawEllipse gs col7 0.00 shd ef gr gs col0 s gr
% Ellipse
n 4320 1935 45 45 0 360 DrawEllipse gs col7 0.00 shd ef gr gs col0 s gr
% Ellipse
n 2340 6855 45 45 0 360 DrawEllipse gs col7 0.00 shd ef gr gs col0 s gr
% Ellipse
n 4710 7005 45 45 0 360 DrawEllipse gs col7 0.00 shd ef gr gs col0 s gr
% Ellipse
n 9930 6975 45 45 0 360 DrawEllipse gs col7 0.00 shd ef gr gs col0 s gr
% Ellipse
n 8379 6573 45 45 0 360 DrawEllipse gs col7 0.00 shd ef gr gs col0 s gr
% Ellipse
n 9195 5400 45 45 0 360 DrawEllipse gs col7 0.00 shd ef gr gs col0 s gr
% Ellipse
n 6662 2191 45 45 0 360 DrawEllipse gs col7 0.00 shd ef gr gs col0 s gr
% Ellipse
n 7110 3195 45 45 0 360 DrawEllipse gs col7 0.00 shd ef gr gs col0 s gr
% Ellipse
n 9630 3480 45 45 0 360 DrawEllipse gs col7 0.00 shd ef gr gs col0 s gr
% Ellipse
n 8055 4170 45 45 0 360 DrawEllipse gs col7 0.00 shd ef gr gs col0 s gr
% Ellipse
n 5970 7170 45 45 0 360 DrawEllipse gs col7 0.00 shd ef gr gs col0 s gr
% Ellipse
n 7110 6645 45 45 0 360 DrawEllipse gs col7 0.00 shd ef gr gs col0 s gr
% Ellipse
n 6918 4335 45 45 0 360 DrawEllipse gs col7 0.00 shd ef gr gs col0 s gr
% Ellipse
n 8085 5565 45 45 0 360 DrawEllipse gs col7 0.00 shd ef gr gs col0 s gr
% Ellipse
n 9780 1575 45 45 0 360 DrawEllipse gs col7 0.00 shd ef gr gs col0 s gr
% Ellipse
n 7980 2100 45 45 0 360 DrawEllipse gs col7 0.00 shd ef gr gs col0 s gr
% Ellipse
n 8475 3300 45 45 0 360 DrawEllipse gs col7 0.00 shd ef gr gs col0 s gr
% Ellipse
n 3690 6645 45 45 0 360 DrawEllipse gs col7 0.00 shd ef gr gs col0 s gr
% Ellipse
n 1910 5155 45 45 0 360 DrawEllipse gs col7 0.00 shd ef gr gs col0 s gr
% Ellipse
n 3675 5715 45 45 0 360 DrawEllipse gs col7 0.00 shd ef gr gs col0 s gr
% Polyline
7.500 slw
n 1500 1125 m 10425 1125 l 10425 7500 l 1500 7500 l
cp gs col0 s gr
% Polyline
30.000 slw
n 2625 2025 m 6000 2025 l 6000 5625 l 2625 5625 l
cp gs col0 s gr
$F2psEnd
rs
showpage

View File

@ -0,0 +1,107 @@
% +------------------------------------------------------------------------+
% | Reference manual page: LargestEmptyIsoRectangleTraits_2.tex
% +------------------------------------------------------------------------+
% | 06.04.2000 Author
% | Package: Package
% |
\RCSdef{\RCSLargestEmptyIsoRectangleTraits_2Rev}{$Revision$}
\RCSdefDate{\RCSLargestEmptyIsoRectangleTraits_2Date}{$Date$}
% |
%%RefPage: end of header, begin of main body
% +------------------------------------------------------------------------+
\begin{ccRefConcept}{LargestEmptyIsoRectangleTraits_2}
%% \ccHtmlCrossLink{} %% add further rules for cross referencing links
%% \ccHtmlIndexC[concept]{} %% add further index entries
\ccDefinition
The concept \ccRefName\ describes the set of requirements to be
fulfilled by any class used to instantiate the template parameter of
the class \ccc{Largest_empty_iso_rectangle_2<T>}.
This concept provides the types of the geometric primitives used in
this class and some function object types for the required
predicates on those primitives.
%% Less_x_2, Less_yx_2, Less_yx_2, Compare_x_2, Compare_y_2, Comparison_result
\ccTypes
\ccNestedType{Point_2}{The point type.}
\ccGlue
\ccNestedType{Iso_rectangle_2}{The iso rectangle type.}
\ccNestedType{Compare_x_2_object}{Predicate object. Must provide
the operator
\ccc{Comparison_result operator()(Point_2 p, Point_2 q)}
which returns
\ccc{SMALLER, EQUAL} or \ccc{ LARGER}
according ding to the
$x$-ordering of points \ccc{p} and \ccc{q}.}
\ccGlue
\ccNestedType{Compare_y_2_object}{Predicate object. Must provide
the operator
\ccc{Comparison_result operator()(Point_2 p, Point_2 q)}
which returns
\ccc{SMALLER, EQUAL} or \ccc{ LARGER}
according to the
$y$-ordering of points \ccc{p} and \ccc{q}.}
\ccGlue
\ccNestedType{Less_x_2_object}{Predicate object. Must provide
the operator
\ccc{bool operator()(Point_2 p, Point_2 q)}
which returns
whether \ccc{p} is less than \ccc{q} according to their $x$-ordering.}
\ccGlue
\ccNestedType{Less_y_2_object}{Predicate object. Must provide
the operator
\ccc{bool operator()(Point_2 p, Point_2 q)}
which returns
whether \ccc{p} is less than \ccc{q} according to their $y$-ordering.}
\ccCreation
\ccCreationVariable{traits} %% choose variable name
Only a default constructor, copy constructor
and an assignement operator are required.
Note that further constructors
can be provided.
\ccConstructor{LargestEmptyIsoRectangleTraits_2();}{Default constructor.}
\ccGlue
\ccConstructor{LargestEmptyIsoRectangleTraits_2(LargestEmptyIsoRectangleTraits_2);}
{Copy constructor}
\ccMethod{LargestEmptyIsoRectangleTraits_2 operator=(LargestEmptyIsoRectangleTraits_2 gtr);}
{Assignment operator.}
\ccHeading{Predicate functions}
The following functions give access to the predicate
and constructor objects.
\ccThree{Construct_segment_2}{gt.compare_x(Point p0, Point p1)x}{}
\ccMethod{Comparison_x_2 compare_x_2_object();}{}
\ccGlue
\ccMethod{Comparison_y_2 compare_y_2_object();}{}
\ccGlue
\ccMethod{bool less_x_2_object();}{}
\ccGlue
\ccMethod{bool less_y_2_object();}{}
\ccHasModels
\ccc{CGAL::Cartesian<R>} \\
\ccc{CGAL::Homogeneous<R>}
\ccSeeAlso
\ccc{CGAL::Largest_empty_iso_rectangle_2<Traits>}
\end{ccRefConcept}
% +------------------------------------------------------------------------+
%%RefPage: end of main body, begin of footer
% EOF
% +------------------------------------------------------------------------+

View File

@ -0,0 +1,11 @@
@article{o-naler-90
, author = "M. Orlowski"
, title = "A new algorithm for the largest empty rectangle problem"
, journal = "Algorithmica"
, volume = 5
, year = 1990
, pages = "65--73"
, keywords = "area"
, annote = "$O(n \log n)$ expected time, $O(n)$ space"
}

View File

@ -0,0 +1,156 @@
% +------------------------------------------------------------------------+
% | Reference manual page: Largest_empty_iso_rectangle_2.tex
% +------------------------------------------------------------------------+
% | 27.3.2000 Eli Packer
% | Package:
% |
%\RCSdef{\RCSTriangulationRev}{$Revision$}
%\RCSdefDate{\RCSTriangulationDate}{$Date$}
% |
%%RefPage: end of header, begin of main body
% +------------------------------------------------------------------------+
\begin{ccRefClass}{Largest_empty_iso_rectangle_2<T>}
%% \ccHtmlCrossLink{} %% add further rules for cross referencing links
%% \ccHtmlIndexC[class]{} %% add further index entries
\ccDefinition
Given a set of points in the plane, the class \ccRefName\ is a data
structure that maintains an iso-rectangle with the largest area among
all iso-rectangles that are inside a given bounding box( iso-rectangle), and
that do not contain any point of the point set.
The class \ccRefName\ expects a model of the concept \ccc{LargestEmptyIsoRectangleTraits_2} as its template argument.
\ccInclude{CGAL/Largest_empty_iso_rectangle_2.h}
\ccTypes
The class \ccClassTemplateName\ defines the following types:
\ccThreeToTwo
\ccTypedef{typedef T Traits;}{}
\ccTypedef{typedef Traits::Point_2 Point_2;}{}
\ccTypedef{typedef Traits::Iso_rectangle_2 Iso_rectangle_2;}{}
The following iterator allows to enumerate the points.
It is non mutable, bidirectional
and its value type is \ccc{Point_2}.
It is invalidated by any insertion or removal of a point.
\ccNestedType{const_iterator}{Iterator over the points.}
\ccCreation
\ccCreationVariable{l} %% choose variable name
\ccSetTwoColumns{Qt_widget}{}
%\ccThree{Largest_empty_iso_rectangle_2<Traits>(const Point_2& bl, const Point_2& tr)}{}{}
\ccConstructor{Largest_empty_iso_rectangle_2<Traits>
(const Iso_rectangle_2 &b);}
{Constructor. The iso-rectangle \ccc{b} is the bounding rectangle.}
\ccConstructor{Largest_empty_iso_rectangle_2<Traits>
(const Point_2 p,const Point_2 q);}
{Constructor. The iso-rectangle whose lower left and upper right points are \ccc{p} and
\ccc{q} respectively is the bounding rectangle.}
\ccConstructor{Largest_empty_iso_rectangle_2<Traits>
();}
{Constructor. The iso-rectangle whose lower left point and upper right points are (0,0)
and (1,1) respectively is the bounding rectangle.}
\ccConstructor{Largest_empty_iso_rectangle_2<Traits>
(const Largest_empty_iso_rectangle_2<Traits> tr);}
{Copy constructor.}
%\ccConstructor{\tilde Largest_empty_iso_rectangle_2<Traits>();}
%{Destructor.}
%
\ccOperations
\ccSetThreeColumns{const_iterator}{container.begin() const;}{}
\ccHeading{Assignment}
\ccMethod{Largest_empty_iso_rectangle_2<T>
operator=(const Largest_empty_iso_rectangle_2<T> & tr);}
{}
\ccAccessFunctions
\ccMethod{const Traits & traits() const;}
{Returns a const reference to the traits object.}
\ccMethod{const_iterator begin() const;}
{Returns an iterator to the beginning of the point set.}
\ccMethod{const_iterator end() const;}
{Returns a past-the-end iterator for the point set.}
\ccHeading{Queries}
\ccMethod{Quadruple<Point_2, Point_2, Point_2, Point_2>
get_left_bottom_right_top();}
{Returns the four points that define the largest empty iso-rectangle.
(Note that these points are not necessarily on a corner of an iso-rectangle.)}
\ccGlue
\ccMethod{Iso_rectangle_2 get_largest_empty_iso_rectangle();}
{Returns the largest empty iso-rectangle. (Note that the two
points defining the iso-rectangle are not necessarily part of
the point set.)}
\ccGlue
\ccMethod{Iso_rectangle_2 get_bounding_box();}
{Returns the iso-rectangle passed in the constructor.}
\ccHeading{Insertion}
\ccMethod{void
insert(const Point_2& p);}
{Inserts point \ccc{p} in the point set, if it is not already in the set.}
\ccMethod{void
push_back(const Point_2& p);}
{Inserts point \ccc{p} in the point set, if it is not already in the set.}
\ccMethod{template < class InputIterator >
int
insert(InputIterator first, InputIterator last);}
{Inserts the points in the range $\left[\right.$\ccc{first},
\ccc{last}$\left.\right)$. Returns the number of inserted points. \\ \\
\ccRequirements The \ccc{value_type} of \ccc{first} and \ccc{last} is \ccc{Point}.}
\ccHeading{Removal}
\ccMethod{bool remove(const Point_2& p);}{Removes point \ccc{p}.
Returns false iff \ccc{p} is not in the point set. }
\ccMethod{void clear();}
{Removes all points of \ccVar.}
%\ccSeeAlso
\ccImplementation
The algorithm is an implementation of \cite{o-naler-90}. The runtime of an
insertion or a removal is $O(\log n)$. A query takes $O(n^2)$ worst
case time and $O(n \log n)$ expected time. The working storage is $
O(n)$.
\bibliography{Largest_empty_iso_rectangle_2}
\bibliographystyle{abbrv}
\end{ccRefClass}
% +------------------------------------------------------------------------+
%%RefPage: end of main body, begin of footer
% EOF
% +------------------------------------------------------------------------+