mirror of https://github.com/CGAL/cgal
CBP_ncopy changed to CBP_copy_n. Footnote refers to STL copy_n.
More general template argument list for copy_n and for random_selection.
This commit is contained in:
parent
ace5f9d240
commit
8a4b76bb6b
|
|
@ -39,38 +39,43 @@ permutations (e.g.~for points on a grid).
|
||||||
\section{Support Functions for Generators}
|
\section{Support Functions for Generators}
|
||||||
\ccThree{OutputIterator}{rand}{}
|
\ccThree{OutputIterator}{rand}{}
|
||||||
|
|
||||||
Two support functions are provided. \ccc{CGAL_ncopy()} copies $n$
|
Two support functions are provided. \ccc{CGAL_copy_n()} copies $n$
|
||||||
items from an input iterator to an output iterator which is useful for
|
items from an input iterator to an output iterator which is useful for
|
||||||
possibly infinite sequnces of random geometric objects.
|
possibly infinite sequences of random geometric objects\footnote{%
|
||||||
|
The STL release June 13, 1997, from SGI has a new function \ccc{copy_n} which is equivalent with \ccc{CGAL_copy_n}.}.
|
||||||
\ccc{CGAL_random_selection} chooses $n$ items at random from a random
|
\ccc{CGAL_random_selection} chooses $n$ items at random from a random
|
||||||
access iterator range which is useful to produce degenerate input data
|
access iterator range which is useful to produce degenerate input data
|
||||||
sets with multiple entries of identical items.
|
sets with multiple entries of identical items.
|
||||||
|
|
||||||
\subsection{{\it CGAL\_ncopy()}}
|
\subsection{{\it CGAL\_copy\_n()}}
|
||||||
\label{sectionNCopy}
|
\label{sectionCopyN}
|
||||||
|
|
||||||
\ccInclude{CGAL/ncopy.h}
|
\ccInclude{CGAL/copy_n.h}
|
||||||
|
|
||||||
\ccFunction{template <class InputIterator, class OutputIterator>
|
\ccFunction{template <class InputIterator, class Size, class OutputIterator>
|
||||||
OutputIterator CGAL_ncopy( InputIterator first, size_t n,
|
OutputIterator CGAL_copy_n( InputIterator first, Size n,
|
||||||
OutputIterator first2);}
|
OutputIterator result);}
|
||||||
{copies the first $n$ elements from \ccc{first} to \ccc{first2}.}
|
{copies the first $n$ items from \ccc{first} to \ccc{result}.
|
||||||
|
Returns the value of \ccc{result} after inserting the $n$ items.}
|
||||||
|
|
||||||
\subsection{{\it CGAL\_random\_selection()}}
|
\subsection{{\it CGAL\_random\_selection()}}
|
||||||
\label{sectionRandomSelection}
|
\label{sectionRandomSelection}
|
||||||
|
|
||||||
\ccInclude{CGAL/random_selection.h}
|
\ccInclude{CGAL/random_selection.h}
|
||||||
|
|
||||||
\ccFunction{template <class RandomAccessIterator, class OutputIterator>
|
\ccFunction{template <class RandomAccessIterator, class Size,
|
||||||
|
class OutputIterator, class Random>
|
||||||
OutputIterator CGAL_random_selection( RandomAccessIterator first,
|
OutputIterator CGAL_random_selection( RandomAccessIterator first,
|
||||||
RandomAccessIterator last,
|
RandomAccessIterator last,
|
||||||
size_t n, OutputIterator first2, CGAL_Random& rnd = CGAL_random);}
|
Size n, OutputIterator result, Random& rnd = CGAL_random);}
|
||||||
{ choose a random item from the range $[\ccc{first},\ccc{last})$ and
|
{ choose a random item from the range $[\ccc{first},\ccc{last})$ and
|
||||||
write it to \ccc{first2}, each item from the range with equal
|
write it to \ccc{result}, each item from the range with equal
|
||||||
probability. Repeat this $n$ times, thus writing $n$ items to
|
probability. Repeat this $n$ times, thus writing $n$ items to
|
||||||
\ccc{first2}.
|
\ccc{result}.
|
||||||
A single random number is needed from \ccc{rnd} for each item.
|
A single random number is needed from \ccc{rnd} for each item.
|
||||||
Returns the value of \ccc{first2} after inserting the $n$ items.
|
Returns the value of \ccc{result} after inserting the $n$ items.
|
||||||
|
\ccPrecond \ccc{Random} is a random number generator type as provided
|
||||||
|
by the STL or by \ccc{CGAL_Random}.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -116,8 +121,8 @@ The random point generators are implemented as classes that satisfies
|
||||||
the requirements for input iterators. They represent the possibly
|
the requirements for input iterators. They represent the possibly
|
||||||
infinite sequence of randomly generated points. Each call to the
|
infinite sequence of randomly generated points. Each call to the
|
||||||
\ccc{operator*} returns a new point. To create a finite sequence in a
|
\ccc{operator*} returns a new point. To create a finite sequence in a
|
||||||
container, the function \ccc{CGAL_ncopy()} could be used, see
|
container, the function \ccc{CGAL_copy_n()} could be used, see
|
||||||
Section~\ref{sectionNCopy}.
|
Section~\ref{sectionCopyN}.
|
||||||
|
|
||||||
\ccHtmlNoClassFile
|
\ccHtmlNoClassFile
|
||||||
\begin{ccClassTemplate}{CGAL_Random_points_in_disc_2<P>}
|
\begin{ccClassTemplate}{CGAL_Random_points_in_disc_2<P>}
|
||||||
|
|
@ -352,7 +357,7 @@ two endpoints. \ccClassTemplateName\ satisfies the requirements for
|
||||||
an input iterator. It represents the possibly infinite sequence of
|
an input iterator. It represents the possibly infinite sequence of
|
||||||
generated segments. Each call to the \ccc{operator*} returns a new
|
generated segments. Each call to the \ccc{operator*} returns a new
|
||||||
segment. To create a finite sequence in a container, the function
|
segment. To create a finite sequence in a container, the function
|
||||||
\ccc{CGAL_ncopy()} could be used, see Section~\ref{sectionNCopy}.
|
\ccc{CGAL_copy_n()} could be used, see Section~\ref{sectionCopyN}.
|
||||||
|
|
||||||
\ccInclude{CGAL/Segment_generator_2.h}
|
\ccInclude{CGAL/Segment_generator_2.h}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -39,38 +39,43 @@ permutations (e.g.~for points on a grid).
|
||||||
\section{Support Functions for Generators}
|
\section{Support Functions for Generators}
|
||||||
\ccThree{OutputIterator}{rand}{}
|
\ccThree{OutputIterator}{rand}{}
|
||||||
|
|
||||||
Two support functions are provided. \ccc{CGAL_ncopy()} copies $n$
|
Two support functions are provided. \ccc{CGAL_copy_n()} copies $n$
|
||||||
items from an input iterator to an output iterator which is useful for
|
items from an input iterator to an output iterator which is useful for
|
||||||
possibly infinite sequnces of random geometric objects.
|
possibly infinite sequences of random geometric objects\footnote{%
|
||||||
|
The STL release June 13, 1997, from SGI has a new function \ccc{copy_n} which is equivalent with \ccc{CGAL_copy_n}.}.
|
||||||
\ccc{CGAL_random_selection} chooses $n$ items at random from a random
|
\ccc{CGAL_random_selection} chooses $n$ items at random from a random
|
||||||
access iterator range which is useful to produce degenerate input data
|
access iterator range which is useful to produce degenerate input data
|
||||||
sets with multiple entries of identical items.
|
sets with multiple entries of identical items.
|
||||||
|
|
||||||
\subsection{{\it CGAL\_ncopy()}}
|
\subsection{{\it CGAL\_copy\_n()}}
|
||||||
\label{sectionNCopy}
|
\label{sectionCopyN}
|
||||||
|
|
||||||
\ccInclude{CGAL/ncopy.h}
|
\ccInclude{CGAL/copy_n.h}
|
||||||
|
|
||||||
\ccFunction{template <class InputIterator, class OutputIterator>
|
\ccFunction{template <class InputIterator, class Size, class OutputIterator>
|
||||||
OutputIterator CGAL_ncopy( InputIterator first, size_t n,
|
OutputIterator CGAL_copy_n( InputIterator first, Size n,
|
||||||
OutputIterator first2);}
|
OutputIterator result);}
|
||||||
{copies the first $n$ elements from \ccc{first} to \ccc{first2}.}
|
{copies the first $n$ items from \ccc{first} to \ccc{result}.
|
||||||
|
Returns the value of \ccc{result} after inserting the $n$ items.}
|
||||||
|
|
||||||
\subsection{{\it CGAL\_random\_selection()}}
|
\subsection{{\it CGAL\_random\_selection()}}
|
||||||
\label{sectionRandomSelection}
|
\label{sectionRandomSelection}
|
||||||
|
|
||||||
\ccInclude{CGAL/random_selection.h}
|
\ccInclude{CGAL/random_selection.h}
|
||||||
|
|
||||||
\ccFunction{template <class RandomAccessIterator, class OutputIterator>
|
\ccFunction{template <class RandomAccessIterator, class Size,
|
||||||
|
class OutputIterator, class Random>
|
||||||
OutputIterator CGAL_random_selection( RandomAccessIterator first,
|
OutputIterator CGAL_random_selection( RandomAccessIterator first,
|
||||||
RandomAccessIterator last,
|
RandomAccessIterator last,
|
||||||
size_t n, OutputIterator first2, CGAL_Random& rnd = CGAL_random);}
|
Size n, OutputIterator result, Random& rnd = CGAL_random);}
|
||||||
{ choose a random item from the range $[\ccc{first},\ccc{last})$ and
|
{ choose a random item from the range $[\ccc{first},\ccc{last})$ and
|
||||||
write it to \ccc{first2}, each item from the range with equal
|
write it to \ccc{result}, each item from the range with equal
|
||||||
probability. Repeat this $n$ times, thus writing $n$ items to
|
probability. Repeat this $n$ times, thus writing $n$ items to
|
||||||
\ccc{first2}.
|
\ccc{result}.
|
||||||
A single random number is needed from \ccc{rnd} for each item.
|
A single random number is needed from \ccc{rnd} for each item.
|
||||||
Returns the value of \ccc{first2} after inserting the $n$ items.
|
Returns the value of \ccc{result} after inserting the $n$ items.
|
||||||
|
\ccPrecond \ccc{Random} is a random number generator type as provided
|
||||||
|
by the STL or by \ccc{CGAL_Random}.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -116,8 +121,8 @@ The random point generators are implemented as classes that satisfies
|
||||||
the requirements for input iterators. They represent the possibly
|
the requirements for input iterators. They represent the possibly
|
||||||
infinite sequence of randomly generated points. Each call to the
|
infinite sequence of randomly generated points. Each call to the
|
||||||
\ccc{operator*} returns a new point. To create a finite sequence in a
|
\ccc{operator*} returns a new point. To create a finite sequence in a
|
||||||
container, the function \ccc{CGAL_ncopy()} could be used, see
|
container, the function \ccc{CGAL_copy_n()} could be used, see
|
||||||
Section~\ref{sectionNCopy}.
|
Section~\ref{sectionCopyN}.
|
||||||
|
|
||||||
\ccHtmlNoClassFile
|
\ccHtmlNoClassFile
|
||||||
\begin{ccClassTemplate}{CGAL_Random_points_in_disc_2<P>}
|
\begin{ccClassTemplate}{CGAL_Random_points_in_disc_2<P>}
|
||||||
|
|
@ -352,7 +357,7 @@ two endpoints. \ccClassTemplateName\ satisfies the requirements for
|
||||||
an input iterator. It represents the possibly infinite sequence of
|
an input iterator. It represents the possibly infinite sequence of
|
||||||
generated segments. Each call to the \ccc{operator*} returns a new
|
generated segments. Each call to the \ccc{operator*} returns a new
|
||||||
segment. To create a finite sequence in a container, the function
|
segment. To create a finite sequence in a container, the function
|
||||||
\ccc{CGAL_ncopy()} could be used, see Section~\ref{sectionNCopy}.
|
\ccc{CGAL_copy_n()} could be used, see Section~\ref{sectionCopyN}.
|
||||||
|
|
||||||
\ccInclude{CGAL/Segment_generator_2.h}
|
\ccInclude{CGAL/Segment_generator_2.h}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue