mirror of https://github.com/CGAL/cgal
*** empty log message ***
This commit is contained in:
parent
0918e97cac
commit
7edef82e75
|
|
@ -0,0 +1,2 @@
|
|||
- Added a destructor for Interval_skip_list as the constructor calls new
|
||||
- Added function clear()
|
||||
|
|
@ -0,0 +1,60 @@
|
|||
|
||||
\RCSdef{\IntervalskiplistRev}{$Revision$}
|
||||
\RCSdefDate{\IntervalskiplistDate}{$Date$}
|
||||
% +------------------------------------------------------------------------+
|
||||
|
||||
\ccParDims
|
||||
|
||||
\chapter{Interval Skiplist}
|
||||
\label{chapter_Interval_skip_list}
|
||||
\ccChapterRelease{\IntervalskiplistRev. \ \IntervalskiplistDate}\\
|
||||
\ccChapterAuthor{Andreas Fabri}
|
||||
|
||||
|
||||
|
||||
|
||||
% +========================================================================+
|
||||
\section{Definition}
|
||||
% +========================================================================+
|
||||
|
||||
An interval skiplist is a data strucure for finding all intervals
|
||||
that overlap a point. The implementation we provide is dynamic, that
|
||||
is the user can insert and remove intervals.
|
||||
|
||||
% +========================================================================+
|
||||
\section{Example Programs}
|
||||
% +========================================================================+
|
||||
\label{sectionIntervalskiplistExamples}
|
||||
|
||||
We give two examples. The first one uses a basic interval class.
|
||||
The second one stores face handles to faces of a Delaunay
|
||||
triangulation of 3D points representing a terrain model.
|
||||
|
||||
% +-------------------------------------------------------------+
|
||||
\subsection{First Example with Simple Interval}
|
||||
|
||||
The first example reads two numbers \ccc{n} and \ccc{d} from \ccc{std::cin}.
|
||||
It creates n intervals of length \ccc{d} with the left endpoint at \ccc{n}.
|
||||
It then reads out the intervals for at the 1-dimensional point with
|
||||
coordinate $0 ... n+d$.
|
||||
|
||||
\ccIncludeExampleCode{../../examples/Interval_skip_list/intervals.C}
|
||||
|
||||
% +-------------------------------------------------------------+
|
||||
\subsection{Example with Faces of a Triangulated Terrain}
|
||||
|
||||
This example creates an interval skiplist for the faces of a terrains.
|
||||
We read the points from a file, and we write all faces to \ccc{std::cout}
|
||||
that intersect the plane parallel to the \ccc{xy}-plane and with \ccc{z}
|
||||
coordinate 50.
|
||||
|
||||
\ccIncludeExampleCode{../../examples/Interval_skip_list/terrain.C}
|
||||
|
||||
|
||||
% +--------------------------------------------------------+
|
||||
|
||||
\input{Interval_skip_list_ref/main}
|
||||
|
||||
% EOF
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,96 @@
|
|||
% ======================================================================
|
||||
%
|
||||
% Copyright (c) 2003 GeometryFactory
|
||||
%
|
||||
% This software and related documentation is part of the
|
||||
% Computational Geometry Algorithms Library (CGAL).
|
||||
%
|
||||
% Every use of CGAL requires a license. Licenses come in three kinds:
|
||||
%
|
||||
% - For academic research and teaching purposes, permission to use and
|
||||
% copy the software and its documentation is hereby granted free of
|
||||
% charge, provided that
|
||||
% (1) it is not a component of a commercial product, and
|
||||
% (2) this notice appears in all copies of the software and
|
||||
% related documentation.
|
||||
% - Development licenses grant access to the source code of the library
|
||||
% to develop programs. These programs may be sold to other parties as
|
||||
% executable code. To obtain a development license, please contact
|
||||
% the GALIA Consortium (at cgal@cs.uu.nl).
|
||||
% - Commercialization licenses grant access to the source code and the
|
||||
% right to sell development licenses. To obtain a commercialization
|
||||
% license, please contact the GALIA Consortium (at cgal@cs.uu.nl).
|
||||
%
|
||||
% This software and documentation is provided "as-is" and without
|
||||
% warranty of any kind. In no event shall the CGAL Consortium be
|
||||
% liable for any damage of any kind.
|
||||
%
|
||||
% The GALIA Consortium consists of Utrecht University (The Netherlands),
|
||||
% ETH Zurich (Switzerland), Free University of Berlin (Germany),
|
||||
% INRIA Sophia-Antipolis (France), Martin-Luther-University Halle-Wittenberg
|
||||
% (Germany), Max-Planck-Institute Saarbrucken (Germany),
|
||||
% and Tel-Aviv University (Israel).
|
||||
%
|
||||
% ----------------------------------------------------------------------
|
||||
%
|
||||
% package : Interval_skip_list
|
||||
% author(s) : Andreas Fabri <Andreas.Fabri@geometryfactory.com>
|
||||
%
|
||||
% coordinator : GeometryFactory (<Andreas.Fabri@geometryfactory.com>)
|
||||
%
|
||||
% ======================================================================
|
||||
|
||||
\RCSdef{\FaceIntervalRevision}{$Revision$}
|
||||
\RCSdefDate{\FaceIntervalDate}{$Date$}
|
||||
|
||||
%----------------------------------------------------------------------
|
||||
|
||||
\begin{ccRefClass} {Face_interval<FaceHandle>}
|
||||
|
||||
\ccDefinition
|
||||
|
||||
The class \ccClassTemplateName\ represents intervals for the minimum and
|
||||
maximum value of the \ccc{z}-coordinate of a face of a triangulation.
|
||||
|
||||
{\it Remark: Here we will exploit that the face type knows the vertex type,
|
||||
who knows the point type, who is known by the kernel traits who knows the FT,
|
||||
which will become the type Value.}
|
||||
|
||||
\ccInclude{CGAL/Face_interval.h}
|
||||
|
||||
\ccTypes
|
||||
\ccSetThreeColumns{Oriented_side}{}{\hspace*{10cm}}
|
||||
\ccThreeToTwo
|
||||
|
||||
|
||||
|
||||
\ccCreation
|
||||
\ccCreationVariable{i}
|
||||
|
||||
\ccConstructor{Face_interval();}
|
||||
{Default constructor.}
|
||||
|
||||
\ccConstructor{Face_interval(FaceHandle fh);}
|
||||
{Constructs the interval with smallest and largest \ccc{z} coordinate of the points
|
||||
stored in the vertices of the face..}
|
||||
|
||||
\ccOperations
|
||||
|
||||
\ccMethod{Value inf() const;}
|
||||
{returns the infimum.}
|
||||
|
||||
\ccMethod{Value sup() const;}
|
||||
{returns the supremum.}
|
||||
|
||||
\ccMethod{FaceHandle face_handle();}
|
||||
{returns the face handle.}
|
||||
|
||||
\ccHeading{I/O}
|
||||
|
||||
\ccFunction{ostream& operator<<(ostream& os,
|
||||
const Face_interval<FaceHandle>& i);}
|
||||
{Inserts the interval \ccc{i} into the stream \ccc{os}.
|
||||
\ccPrecond The output operator for \ccc{*Face_handle} is defined.}
|
||||
|
||||
\end{ccRefClass}
|
||||
|
||||
|
|
@ -0,0 +1,71 @@
|
|||
% +------------------------------------------------------------------------+
|
||||
% | Reference manual page: Interval.tex
|
||||
% +------------------------------------------------------------------------+
|
||||
% | 11.04.2000 Author
|
||||
% | Package: Package
|
||||
% |
|
||||
\RCSdef{\RCSIntervalRev}{$Revision$}
|
||||
\RCSdefDate{\RCSIntervalDate}{$Date$}
|
||||
% |
|
||||
%%RefPage: end of header, begin of main body
|
||||
% +------------------------------------------------------------------------+
|
||||
|
||||
|
||||
\begin{ccRefConcept}{Interval}
|
||||
|
||||
%% \ccHtmlCrossLink{} %% add further rules for cross referencing links
|
||||
%% \ccHtmlIndexC[concept]{} %% add further index entries
|
||||
|
||||
\ccDefinition
|
||||
|
||||
The concept \ccRefName\ describes the requirements for the
|
||||
interval class of a \ccc{Interval_skip_list<Interval>}.
|
||||
|
||||
|
||||
|
||||
\ccCreation
|
||||
\ccCreationVariable{in} %% choose variable name
|
||||
|
||||
\ccConstructor{Interval();}{default constructor.}
|
||||
\ccTypes
|
||||
|
||||
\ccNestedType{Value}{The type of infimum and supremum of the interval.}
|
||||
|
||||
|
||||
\ccAccessFunctions
|
||||
\ccMethod{Value inf() const;}
|
||||
{returns the infimum.}
|
||||
\ccGlue
|
||||
\ccMethod{Value sup() const;}{returns the supremum.}
|
||||
|
||||
|
||||
\ccMethod{bool contains(const Value& v) const;}
|
||||
{returns \ccc{true}, iff \ccc{in} contains \ccc{v}.}
|
||||
|
||||
\ccMethod{bool contains_interval(const Value& i, const Value& s) const;}
|
||||
{returns \ccc{true}, iff \ccc{in} contains \ccc{(i,s)}.}
|
||||
|
||||
\ccMethod{bool operator==(const Interval& I) const;}
|
||||
{Equality test.}
|
||||
|
||||
\ccMethod{bool operator!=(const Interval& I) const;}
|
||||
{Unequality test.}
|
||||
|
||||
\ccHasModels
|
||||
|
||||
\ccc{CGAL::Interval_skip_list_interval<Value>}\\
|
||||
\ccc{CGAL::Face_interval}
|
||||
|
||||
|
||||
\ccSeeAlso
|
||||
|
||||
\ccc{Interval_skip_list}
|
||||
|
||||
|
||||
\end{ccRefConcept}
|
||||
|
||||
% +------------------------------------------------------------------------+
|
||||
%%RefPage: end of main body, begin of footer
|
||||
% EOF
|
||||
% +------------------------------------------------------------------------+
|
||||
|
||||
|
|
@ -49,17 +49,19 @@
|
|||
|
||||
\ccDefinition
|
||||
|
||||
The class \ccClassTemplateName\ represents .
|
||||
The class \ccClassTemplateName\ is a dynamic datastructure that implements a
|
||||
1-dimensional segment tree, that is it allows to find all members of a set of
|
||||
intervals that overlap a point.
|
||||
|
||||
\ccInclude{CGAL/Interval_skip_list.h}
|
||||
|
||||
\ccTypes
|
||||
\ccSetThreeColumns{Oriented_side}{}{\hspace*{10cm}}
|
||||
\ccSetThreeColumns{typedef Interval::Value }{}{\hspace*{10cm}}
|
||||
\ccThreeToTwo
|
||||
|
||||
\ccTypedef{typedef Interval::Value Value;}{the type of inf and sup of the interval.}
|
||||
|
||||
\ccNestedType{const_iterator}{An iterator that allows to enumerate all intervals in the
|
||||
interval skip list.}
|
||||
\ccNestedType{const_iterator}{An iterator over all intervals.}
|
||||
|
||||
|
||||
|
||||
|
|
@ -85,7 +87,7 @@ interval skip list.}
|
|||
InputIterator first,
|
||||
InputIterator last);}
|
||||
{Inserts the iterator range \ccc{[first, last)} in the interval skip list, and returns
|
||||
the number of inserted intervals.\\
|
||||
the number of inserted intervals.
|
||||
\ccPrecond The \ccc{value_type} of \ccc{first} and
|
||||
\ccc{last} is \ccc{Interval}.}
|
||||
|
||||
|
|
@ -102,18 +104,19 @@ the number of inserted intervals.\\
|
|||
int find_intervals(
|
||||
const Value& v,
|
||||
OutputIterator out);}
|
||||
{Writes the intervals \ccc{i} with \ccc{i.inf()} $<=$ \ccc{v} $<=$ \ccc{i.sup} in \ccc{out}.\\
|
||||
{Writes the intervals \ccc{i} with \ccc{i.inf()} $\leq$ \ccc{v} $\leq$ \ccc{i.sup} to the
|
||||
output iterator \ccc{out}.
|
||||
\ccPrecond The \ccc{value_type} of \ccc{out} is \ccc{Interval}.}
|
||||
|
||||
|
||||
\ccMethod{void
|
||||
clear();}
|
||||
{Clears the structure.}
|
||||
{Removes all intervals from the interval skip list.}
|
||||
|
||||
|
||||
|
||||
\ccMethod{const_iterator begin() const;}
|
||||
{Returns the .}
|
||||
{Returns an iterator over all intervals.}
|
||||
|
||||
\ccMethod{const_iterator end() const;}
|
||||
{Returns the past the end iterator.}
|
||||
|
|
@ -121,15 +124,19 @@ the number of inserted intervals.\\
|
|||
|
||||
\ccHeading{I/O}
|
||||
|
||||
The output operator is defined for \ccc{std::ostream}
|
||||
|
||||
\ccFunction{ostream& operator<<(ostream& os,
|
||||
const Interval_skip_list<Interval>& isl);}
|
||||
{Inserts the interval skip list \ccc{isl} into the stream \ccc{os}.
|
||||
\ccPrecond The insert operator must be defined for \ccc{Interval}.}
|
||||
\ccPrecond The output operator must be defined for \ccc{Interval}.}
|
||||
|
||||
|
||||
\ccImplementation
|
||||
The
|
||||
The insertion and deletion of a segment in the interval skiplist
|
||||
takes expected time $O(\log^2 n)$, if the segment endpoints are
|
||||
chosen from a continuous distribution. A stabbing query takes expected
|
||||
time $O(\log n)$.
|
||||
|
||||
The implementation is based on the code developed by Eric N.~Hansen.
|
||||
\end{ccRefClass}
|
||||
|
||||
|
|
|
|||
|
|
@ -49,10 +49,11 @@
|
|||
|
||||
\ccDefinition
|
||||
|
||||
The class \ccClassTemplateName\ represents .
|
||||
The class \ccClassTemplateName\ represents intervals with infimum
|
||||
and supremum of type \ccc{Value}, and which can be open or closed.
|
||||
|
||||
\ccInclude{CGAL/Interval_skip_list_interval.h}
|
||||
|
||||
\ccTypes
|
||||
\ccSetThreeColumns{Oriented_side}{}{\hspace*{10cm}}
|
||||
\ccThreeToTwo
|
||||
|
||||
|
|
@ -64,23 +65,35 @@ The class \ccClassTemplateName\ represents .
|
|||
\ccConstructor{Interval_skip_list_interval();}
|
||||
{Default constructor.}
|
||||
|
||||
\ccConstructor{Interval_skip_list_interval(char lb,
|
||||
const Value& i,
|
||||
const Value& s,
|
||||
char rb);}
|
||||
{Constructs the interval with infimum \ccc{i} and supremum \ccc{s}.
|
||||
The arguments \ccc{lb} and \ccc{rb} can be \ccc{,} and \ccc{,} respectively.}
|
||||
|
||||
\ccOperations
|
||||
|
||||
\ccMethod{(Value inf() const;}
|
||||
\ccMethod{Value inf() const;}
|
||||
{returns the infimum.}
|
||||
|
||||
\ccMethod{(Value sup() const;}
|
||||
\ccMethod{Value sup() const;}
|
||||
{returns the supremum.}
|
||||
|
||||
\ccMethod{char lbound() const;}
|
||||
{returns the left bound.}
|
||||
|
||||
\ccMethod{char rbound() const;}
|
||||
{returns the right bound.}
|
||||
|
||||
\ccHeading{I/O}
|
||||
|
||||
The output operator is defined for \ccc{std::ostream}
|
||||
The output operator is defined for \ccc{std::ostream}.
|
||||
|
||||
\ccFunction{ostream& operator<<(ostream& os,
|
||||
const Interval_skip_list_interval<V>& i);}
|
||||
{Inserts the interval \ccc{i} into the stream \ccc{os}.}
|
||||
|
||||
{Inserts the interval \ccc{i} into the stream \ccc{os}.\\
|
||||
\ccPrecond The output operator for \ccc{Value} is defined.}
|
||||
|
||||
\end{ccRefClass}
|
||||
|
||||
|
|
|
|||
|
|
@ -50,8 +50,8 @@
|
|||
|
||||
\chapter{Interval Skiplist}
|
||||
|
||||
This chapter presents the Interval Skiplist. The description is based on
|
||||
the articles \cite{}.
|
||||
This chapter presents the interval skiplist as it is described in
|
||||
the article \cite{}.
|
||||
|
||||
\subsection*{Concepts}
|
||||
|
||||
|
|
@ -62,3 +62,4 @@ the articles \cite{}.
|
|||
|
||||
\ccRefIdfierPage{CGAL::Interval_skip_list<Interval>}\\
|
||||
\ccRefIdfierPage{CGAL::Interval_skip_list_interval<Value>}\\
|
||||
\ccRefIdfierPage{CGAL::Face_interval<FaceHandle>}\\
|
||||
|
|
|
|||
|
|
@ -0,0 +1,60 @@
|
|||
|
||||
\RCSdef{\IntervalskiplistRev}{$Revision$}
|
||||
\RCSdefDate{\IntervalskiplistDate}{$Date$}
|
||||
% +------------------------------------------------------------------------+
|
||||
|
||||
\ccParDims
|
||||
|
||||
\chapter{Interval Skiplist}
|
||||
\label{chapter_Interval_skip_list}
|
||||
\ccChapterRelease{\IntervalskiplistRev. \ \IntervalskiplistDate}\\
|
||||
\ccChapterAuthor{Andreas Fabri}
|
||||
|
||||
|
||||
|
||||
|
||||
% +========================================================================+
|
||||
\section{Definition}
|
||||
% +========================================================================+
|
||||
|
||||
An interval skiplist is a data strucure for finding all intervals
|
||||
that overlap a point. The implementation we provide is dynamic, that
|
||||
is the user can insert and remove intervals.
|
||||
|
||||
% +========================================================================+
|
||||
\section{Example Programs}
|
||||
% +========================================================================+
|
||||
\label{sectionIntervalskiplistExamples}
|
||||
|
||||
We give two examples. The first one uses a basic interval class.
|
||||
The second one stores face handles to faces of a Delaunay
|
||||
triangulation of 3D points representing a terrain model.
|
||||
|
||||
% +-------------------------------------------------------------+
|
||||
\subsection{First Example with Simple Interval}
|
||||
|
||||
The first example reads two numbers \ccc{n} and \ccc{d} from \ccc{std::cin}.
|
||||
It creates n intervals of length \ccc{d} with the left endpoint at \ccc{n}.
|
||||
It then reads out the intervals for at the 1-dimensional point with
|
||||
coordinate $0 ... n+d$.
|
||||
|
||||
\ccIncludeExampleCode{../../examples/Interval_skip_list/intervals.C}
|
||||
|
||||
% +-------------------------------------------------------------+
|
||||
\subsection{Example with Faces of a Triangulated Terrain}
|
||||
|
||||
This example creates an interval skiplist for the faces of a terrains.
|
||||
We read the points from a file, and we write all faces to \ccc{std::cout}
|
||||
that intersect the plane parallel to the \ccc{xy}-plane and with \ccc{z}
|
||||
coordinate 50.
|
||||
|
||||
\ccIncludeExampleCode{../../examples/Interval_skip_list/terrain.C}
|
||||
|
||||
|
||||
% +--------------------------------------------------------+
|
||||
|
||||
\input{Interval_skip_list_ref/main}
|
||||
|
||||
% EOF
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,96 @@
|
|||
% ======================================================================
|
||||
%
|
||||
% Copyright (c) 2003 GeometryFactory
|
||||
%
|
||||
% This software and related documentation is part of the
|
||||
% Computational Geometry Algorithms Library (CGAL).
|
||||
%
|
||||
% Every use of CGAL requires a license. Licenses come in three kinds:
|
||||
%
|
||||
% - For academic research and teaching purposes, permission to use and
|
||||
% copy the software and its documentation is hereby granted free of
|
||||
% charge, provided that
|
||||
% (1) it is not a component of a commercial product, and
|
||||
% (2) this notice appears in all copies of the software and
|
||||
% related documentation.
|
||||
% - Development licenses grant access to the source code of the library
|
||||
% to develop programs. These programs may be sold to other parties as
|
||||
% executable code. To obtain a development license, please contact
|
||||
% the GALIA Consortium (at cgal@cs.uu.nl).
|
||||
% - Commercialization licenses grant access to the source code and the
|
||||
% right to sell development licenses. To obtain a commercialization
|
||||
% license, please contact the GALIA Consortium (at cgal@cs.uu.nl).
|
||||
%
|
||||
% This software and documentation is provided "as-is" and without
|
||||
% warranty of any kind. In no event shall the CGAL Consortium be
|
||||
% liable for any damage of any kind.
|
||||
%
|
||||
% The GALIA Consortium consists of Utrecht University (The Netherlands),
|
||||
% ETH Zurich (Switzerland), Free University of Berlin (Germany),
|
||||
% INRIA Sophia-Antipolis (France), Martin-Luther-University Halle-Wittenberg
|
||||
% (Germany), Max-Planck-Institute Saarbrucken (Germany),
|
||||
% and Tel-Aviv University (Israel).
|
||||
%
|
||||
% ----------------------------------------------------------------------
|
||||
%
|
||||
% package : Interval_skip_list
|
||||
% author(s) : Andreas Fabri <Andreas.Fabri@geometryfactory.com>
|
||||
%
|
||||
% coordinator : GeometryFactory (<Andreas.Fabri@geometryfactory.com>)
|
||||
%
|
||||
% ======================================================================
|
||||
|
||||
\RCSdef{\FaceIntervalRevision}{$Revision$}
|
||||
\RCSdefDate{\FaceIntervalDate}{$Date$}
|
||||
|
||||
%----------------------------------------------------------------------
|
||||
|
||||
\begin{ccRefClass} {Face_interval<FaceHandle>}
|
||||
|
||||
\ccDefinition
|
||||
|
||||
The class \ccClassTemplateName\ represents intervals for the minimum and
|
||||
maximum value of the \ccc{z}-coordinate of a face of a triangulation.
|
||||
|
||||
{\it Remark: Here we will exploit that the face type knows the vertex type,
|
||||
who knows the point type, who is known by the kernel traits who knows the FT,
|
||||
which will become the type Value.}
|
||||
|
||||
\ccInclude{CGAL/Face_interval.h}
|
||||
|
||||
\ccTypes
|
||||
\ccSetThreeColumns{Oriented_side}{}{\hspace*{10cm}}
|
||||
\ccThreeToTwo
|
||||
|
||||
|
||||
|
||||
\ccCreation
|
||||
\ccCreationVariable{i}
|
||||
|
||||
\ccConstructor{Face_interval();}
|
||||
{Default constructor.}
|
||||
|
||||
\ccConstructor{Face_interval(FaceHandle fh);}
|
||||
{Constructs the interval with smallest and largest \ccc{z} coordinate of the points
|
||||
stored in the vertices of the face..}
|
||||
|
||||
\ccOperations
|
||||
|
||||
\ccMethod{Value inf() const;}
|
||||
{returns the infimum.}
|
||||
|
||||
\ccMethod{Value sup() const;}
|
||||
{returns the supremum.}
|
||||
|
||||
\ccMethod{FaceHandle face_handle();}
|
||||
{returns the face handle.}
|
||||
|
||||
\ccHeading{I/O}
|
||||
|
||||
\ccFunction{ostream& operator<<(ostream& os,
|
||||
const Face_interval<FaceHandle>& i);}
|
||||
{Inserts the interval \ccc{i} into the stream \ccc{os}.
|
||||
\ccPrecond The output operator for \ccc{*Face_handle} is defined.}
|
||||
|
||||
\end{ccRefClass}
|
||||
|
||||
|
|
@ -0,0 +1,71 @@
|
|||
% +------------------------------------------------------------------------+
|
||||
% | Reference manual page: Interval.tex
|
||||
% +------------------------------------------------------------------------+
|
||||
% | 11.04.2000 Author
|
||||
% | Package: Package
|
||||
% |
|
||||
\RCSdef{\RCSIntervalRev}{$Revision$}
|
||||
\RCSdefDate{\RCSIntervalDate}{$Date$}
|
||||
% |
|
||||
%%RefPage: end of header, begin of main body
|
||||
% +------------------------------------------------------------------------+
|
||||
|
||||
|
||||
\begin{ccRefConcept}{Interval}
|
||||
|
||||
%% \ccHtmlCrossLink{} %% add further rules for cross referencing links
|
||||
%% \ccHtmlIndexC[concept]{} %% add further index entries
|
||||
|
||||
\ccDefinition
|
||||
|
||||
The concept \ccRefName\ describes the requirements for the
|
||||
interval class of a \ccc{Interval_skip_list<Interval>}.
|
||||
|
||||
|
||||
|
||||
\ccCreation
|
||||
\ccCreationVariable{in} %% choose variable name
|
||||
|
||||
\ccConstructor{Interval();}{default constructor.}
|
||||
\ccTypes
|
||||
|
||||
\ccNestedType{Value}{The type of infimum and supremum of the interval.}
|
||||
|
||||
|
||||
\ccAccessFunctions
|
||||
\ccMethod{Value inf() const;}
|
||||
{returns the infimum.}
|
||||
\ccGlue
|
||||
\ccMethod{Value sup() const;}{returns the supremum.}
|
||||
|
||||
|
||||
\ccMethod{bool contains(const Value& v) const;}
|
||||
{returns \ccc{true}, iff \ccc{in} contains \ccc{v}.}
|
||||
|
||||
\ccMethod{bool contains_interval(const Value& i, const Value& s) const;}
|
||||
{returns \ccc{true}, iff \ccc{in} contains \ccc{(i,s)}.}
|
||||
|
||||
\ccMethod{bool operator==(const Interval& I) const;}
|
||||
{Equality test.}
|
||||
|
||||
\ccMethod{bool operator!=(const Interval& I) const;}
|
||||
{Unequality test.}
|
||||
|
||||
\ccHasModels
|
||||
|
||||
\ccc{CGAL::Interval_skip_list_interval<Value>}\\
|
||||
\ccc{CGAL::Face_interval}
|
||||
|
||||
|
||||
\ccSeeAlso
|
||||
|
||||
\ccc{Interval_skip_list}
|
||||
|
||||
|
||||
\end{ccRefConcept}
|
||||
|
||||
% +------------------------------------------------------------------------+
|
||||
%%RefPage: end of main body, begin of footer
|
||||
% EOF
|
||||
% +------------------------------------------------------------------------+
|
||||
|
||||
|
|
@ -49,17 +49,19 @@
|
|||
|
||||
\ccDefinition
|
||||
|
||||
The class \ccClassTemplateName\ represents .
|
||||
The class \ccClassTemplateName\ is a dynamic datastructure that implements a
|
||||
1-dimensional segment tree, that is it allows to find all members of a set of
|
||||
intervals that overlap a point.
|
||||
|
||||
\ccInclude{CGAL/Interval_skip_list.h}
|
||||
|
||||
\ccTypes
|
||||
\ccSetThreeColumns{Oriented_side}{}{\hspace*{10cm}}
|
||||
\ccSetThreeColumns{typedef Interval::Value }{}{\hspace*{10cm}}
|
||||
\ccThreeToTwo
|
||||
|
||||
\ccTypedef{typedef Interval::Value Value;}{the type of inf and sup of the interval.}
|
||||
|
||||
\ccNestedType{const_iterator}{An iterator that allows to enumerate all intervals in the
|
||||
interval skip list.}
|
||||
\ccNestedType{const_iterator}{An iterator over all intervals.}
|
||||
|
||||
|
||||
|
||||
|
|
@ -85,7 +87,7 @@ interval skip list.}
|
|||
InputIterator first,
|
||||
InputIterator last);}
|
||||
{Inserts the iterator range \ccc{[first, last)} in the interval skip list, and returns
|
||||
the number of inserted intervals.\\
|
||||
the number of inserted intervals.
|
||||
\ccPrecond The \ccc{value_type} of \ccc{first} and
|
||||
\ccc{last} is \ccc{Interval}.}
|
||||
|
||||
|
|
@ -102,18 +104,19 @@ the number of inserted intervals.\\
|
|||
int find_intervals(
|
||||
const Value& v,
|
||||
OutputIterator out);}
|
||||
{Writes the intervals \ccc{i} with \ccc{i.inf()} $<=$ \ccc{v} $<=$ \ccc{i.sup} in \ccc{out}.\\
|
||||
{Writes the intervals \ccc{i} with \ccc{i.inf()} $\leq$ \ccc{v} $\leq$ \ccc{i.sup} to the
|
||||
output iterator \ccc{out}.
|
||||
\ccPrecond The \ccc{value_type} of \ccc{out} is \ccc{Interval}.}
|
||||
|
||||
|
||||
\ccMethod{void
|
||||
clear();}
|
||||
{Clears the structure.}
|
||||
{Removes all intervals from the interval skip list.}
|
||||
|
||||
|
||||
|
||||
\ccMethod{const_iterator begin() const;}
|
||||
{Returns the .}
|
||||
{Returns an iterator over all intervals.}
|
||||
|
||||
\ccMethod{const_iterator end() const;}
|
||||
{Returns the past the end iterator.}
|
||||
|
|
@ -121,15 +124,19 @@ the number of inserted intervals.\\
|
|||
|
||||
\ccHeading{I/O}
|
||||
|
||||
The output operator is defined for \ccc{std::ostream}
|
||||
|
||||
\ccFunction{ostream& operator<<(ostream& os,
|
||||
const Interval_skip_list<Interval>& isl);}
|
||||
{Inserts the interval skip list \ccc{isl} into the stream \ccc{os}.
|
||||
\ccPrecond The insert operator must be defined for \ccc{Interval}.}
|
||||
\ccPrecond The output operator must be defined for \ccc{Interval}.}
|
||||
|
||||
|
||||
\ccImplementation
|
||||
The
|
||||
The insertion and deletion of a segment in the interval skiplist
|
||||
takes expected time $O(\log^2 n)$, if the segment endpoints are
|
||||
chosen from a continuous distribution. A stabbing query takes expected
|
||||
time $O(\log n)$.
|
||||
|
||||
The implementation is based on the code developed by Eric N.~Hansen.
|
||||
\end{ccRefClass}
|
||||
|
||||
|
|
|
|||
|
|
@ -49,10 +49,11 @@
|
|||
|
||||
\ccDefinition
|
||||
|
||||
The class \ccClassTemplateName\ represents .
|
||||
The class \ccClassTemplateName\ represents intervals with infimum
|
||||
and supremum of type \ccc{Value}, and which can be open or closed.
|
||||
|
||||
\ccInclude{CGAL/Interval_skip_list_interval.h}
|
||||
|
||||
\ccTypes
|
||||
\ccSetThreeColumns{Oriented_side}{}{\hspace*{10cm}}
|
||||
\ccThreeToTwo
|
||||
|
||||
|
|
@ -64,23 +65,35 @@ The class \ccClassTemplateName\ represents .
|
|||
\ccConstructor{Interval_skip_list_interval();}
|
||||
{Default constructor.}
|
||||
|
||||
\ccConstructor{Interval_skip_list_interval(char lb,
|
||||
const Value& i,
|
||||
const Value& s,
|
||||
char rb);}
|
||||
{Constructs the interval with infimum \ccc{i} and supremum \ccc{s}.
|
||||
The arguments \ccc{lb} and \ccc{rb} can be \ccc{,} and \ccc{,} respectively.}
|
||||
|
||||
\ccOperations
|
||||
|
||||
\ccMethod{(Value inf() const;}
|
||||
\ccMethod{Value inf() const;}
|
||||
{returns the infimum.}
|
||||
|
||||
\ccMethod{(Value sup() const;}
|
||||
\ccMethod{Value sup() const;}
|
||||
{returns the supremum.}
|
||||
|
||||
\ccMethod{char lbound() const;}
|
||||
{returns the left bound.}
|
||||
|
||||
\ccMethod{char rbound() const;}
|
||||
{returns the right bound.}
|
||||
|
||||
\ccHeading{I/O}
|
||||
|
||||
The output operator is defined for \ccc{std::ostream}
|
||||
The output operator is defined for \ccc{std::ostream}.
|
||||
|
||||
\ccFunction{ostream& operator<<(ostream& os,
|
||||
const Interval_skip_list_interval<V>& i);}
|
||||
{Inserts the interval \ccc{i} into the stream \ccc{os}.}
|
||||
|
||||
{Inserts the interval \ccc{i} into the stream \ccc{os}.\\
|
||||
\ccPrecond The output operator for \ccc{Value} is defined.}
|
||||
|
||||
\end{ccRefClass}
|
||||
|
||||
|
|
|
|||
|
|
@ -50,8 +50,8 @@
|
|||
|
||||
\chapter{Interval Skiplist}
|
||||
|
||||
This chapter presents the Interval Skiplist. The description is based on
|
||||
the articles \cite{}.
|
||||
This chapter presents the interval skiplist as it is described in
|
||||
the article \cite{}.
|
||||
|
||||
\subsection*{Concepts}
|
||||
|
||||
|
|
@ -62,3 +62,4 @@ the articles \cite{}.
|
|||
|
||||
\ccRefIdfierPage{CGAL::Interval_skip_list<Interval>}\\
|
||||
\ccRefIdfierPage{CGAL::Interval_skip_list_interval<Value>}\\
|
||||
\ccRefIdfierPage{CGAL::Face_interval<FaceHandle>}\\
|
||||
|
|
|
|||
|
|
@ -0,0 +1,39 @@
|
|||
#include <CGAL/Interval_skip_list.h>
|
||||
#include <CGAL/Interval_skip_list_interval.h>
|
||||
#include <vector>
|
||||
#include <iostream>
|
||||
|
||||
typedef CGAL::Interval_skip_list_interval<double> Interval;
|
||||
typedef CGAL::Interval_skip_list<Interval> Interval_skip_list;
|
||||
|
||||
int main()
|
||||
{
|
||||
Interval_skip_list isl;
|
||||
int i, n, d;
|
||||
|
||||
std::cin >> n >> d;
|
||||
std::vector<Interval> intervals(n);
|
||||
for(i = 0; i < n; i++) {
|
||||
intervals[i] = Interval('[', i, i+d, ']');
|
||||
}
|
||||
std::random_shuffle(intervals.begin(), intervals.end());
|
||||
|
||||
isl.insert(intervals.begin(), intervals.end());
|
||||
|
||||
for(i = 0; i < n+d; i++) {
|
||||
std::list<Interval> L;
|
||||
isl.find_intervals(i, std::back_inserter(L));
|
||||
for(std::list<Interval>::iterator it = L.begin(); it != L.end(); it++){
|
||||
std::cout << *it;
|
||||
}
|
||||
std::cout << std::endl;
|
||||
}
|
||||
|
||||
for(i = 0; i < n; i++) {
|
||||
isl.remove(intervals[i]);
|
||||
}
|
||||
return 0;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,40 @@
|
|||
#include <CGAL/Simple_cartesian.h>
|
||||
#include <CGAL/Delaunay_triangulation_2.h>
|
||||
#include <CGAL/Triangulation_euclidean_traits_xy_3.h>
|
||||
#include <CGAL/Interval_skip_list.h>
|
||||
#include <CGAL/Face_interval.h>
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
|
||||
typedef CGAL::Simple_cartesian<double> SC;
|
||||
typedef SC::Point_3 Point_3;
|
||||
typedef CGAL::Triangulation_euclidean_traits_xy_3<SC> K;
|
||||
typedef CGAL::Delaunay_triangulation_2<K> Delaunay;
|
||||
typedef Delaunay::Face_handle Face_handle;
|
||||
typedef Delaunay::Finite_faces_iterator Finite_faces_iterator;
|
||||
typedef CGAL::Face_interval<Face_handle> Interval;
|
||||
typedef CGAL::Interval_skip_list<Interval> Interval_skip_list;
|
||||
|
||||
int main()
|
||||
{
|
||||
std::ifstream fin("terrain.pts"); // elevation ranges from 0 to 100
|
||||
Delaunay dt;
|
||||
|
||||
dt.insert(std::istream_iterator<Point_3>(fin),
|
||||
std::istream_iterator<Point_3>());
|
||||
|
||||
Interval_skip_list isl;
|
||||
for(Finite_faces_iterator fh = dt.finite_faces_begin();
|
||||
fh != dt.finite_faces_end();
|
||||
++fh){
|
||||
isl.insert(Interval(fh));
|
||||
}
|
||||
std::list<Interval> level;
|
||||
isl.find_intervals(50, std::back_inserter(level));
|
||||
for(std::list<Interval>::iterator it = level.begin();
|
||||
it != level.end();
|
||||
++it){
|
||||
std::cout << dt.triangle(it->face_handle()) << std::endl;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -0,0 +1,126 @@
|
|||
// ======================================================================
|
||||
//
|
||||
// Copyright (c) 2003 GeometryFactory
|
||||
//
|
||||
// This software and related documentation is part of an INTERNAL release
|
||||
// of the Computational Geometry Algorithms Library (CGAL). It is not
|
||||
// intended for general use.
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
//
|
||||
// release :
|
||||
// release_date :
|
||||
//
|
||||
// file : include/CGAL/Face_interval.h
|
||||
// package : Interval_skip_list
|
||||
// revision : $Revision$
|
||||
// revision_date : $Date$
|
||||
// author(s) : Andreas Fabri
|
||||
//
|
||||
// coordinator : GeometryFactory (<Andreas.Fabri@geometryfactory.com>)
|
||||
//
|
||||
// ======================================================================
|
||||
|
||||
#ifndef CGAL_FACE_INTERVAL_H
|
||||
#define CGAL_FACE_INTERVAL_H
|
||||
|
||||
#include <iostream>
|
||||
|
||||
|
||||
namespace CGAL {
|
||||
|
||||
template <class FaceHandle>
|
||||
class Face_interval
|
||||
{
|
||||
public:
|
||||
// TODO: derive type from Ft of coordinates of points in vertex
|
||||
typedef double Value;
|
||||
|
||||
private:
|
||||
FaceHandle fh_;
|
||||
Value inf_;
|
||||
Value sup_; // left and right boundary values
|
||||
public:
|
||||
|
||||
Face_interval(){}
|
||||
Face_interval(FaceHandle fh);
|
||||
const Value& inf() const {return inf_;}
|
||||
const Value& sup() const {return sup_;}
|
||||
FaceHandle face_handle() const { return fh_;}
|
||||
bool contains(const Value& V) const;
|
||||
|
||||
// true iff this contains (l,r)
|
||||
bool contains_interval(const Value& l, const Value& r) const;
|
||||
|
||||
bool operator==(const Face_interval& I) const
|
||||
{
|
||||
return ( (inf() == I.inf()) && (sup() == I.sup()) &&
|
||||
(face_handle() == I.face_handle()) );
|
||||
}
|
||||
|
||||
bool operator!=(const Face_interval& I) const
|
||||
{
|
||||
return ! (*this == I);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
template <class V>
|
||||
std::ostream& operator<<(std::ostream& os,
|
||||
const Face_interval<V>& i)
|
||||
{
|
||||
os << i.face_handle()->vertex(0)->point() << ", " <<
|
||||
i.face_handle()->vertex(1)->point() << ", " <<
|
||||
i.face_handle()->vertex(2)->point() << std::endl;
|
||||
return os;
|
||||
}
|
||||
|
||||
|
||||
template <class FaceHandle>
|
||||
Face_interval<FaceHandle>::Face_interval(FaceHandle fh)
|
||||
: fh_(fh), inf_(fh->vertex(0)->point().z()), sup_(inf_)
|
||||
{
|
||||
double z = fh->vertex(1)->point().z();
|
||||
sup_= (z>sup_)? z : sup_;
|
||||
inf_ = (z<inf_) ? z : inf_;
|
||||
z = fh->vertex(2)->point().z();
|
||||
sup_ = (z>sup_)? z : sup_;
|
||||
inf_ = (z<inf_) ? z : inf_;
|
||||
}
|
||||
|
||||
|
||||
template <class FaceHandle>
|
||||
bool
|
||||
Face_interval<FaceHandle>::contains_interval(const Value& i,
|
||||
const Value& s) const
|
||||
// true iff this contains (l,r)
|
||||
{
|
||||
return( (inf() <= i) && (sup() >= s) );
|
||||
}
|
||||
|
||||
|
||||
template <class FaceHandle>
|
||||
bool
|
||||
Face_interval<FaceHandle>::contains(const Value& v) const
|
||||
{
|
||||
// return true if this contains V, false otherwise
|
||||
if((v >= inf()) && (v <= sup()))
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
} // namespace CGAL
|
||||
|
||||
#endif // CGAL_FACE_INTERVAL_H
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -24,11 +24,7 @@
|
|||
#ifndef CGAL_INTERVAL_SKIP_LIST_INTERVAL_H
|
||||
#define CGAL_INTERVAL_SKIP_LIST_INTERVAL_H
|
||||
|
||||
#include <cassert>
|
||||
#include <stdio.h>
|
||||
#include <iostream>
|
||||
#include <CGAL/Random.h>
|
||||
#include <list>
|
||||
|
||||
|
||||
namespace CGAL {
|
||||
|
|
|
|||
|
|
@ -54,4 +54,4 @@ main()
|
|||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue