mirror of https://github.com/CGAL/cgal
linking unlinking
This commit is contained in:
parent
ad0fc8e1cf
commit
bc1524f6ab
|
|
@ -24,6 +24,9 @@ actions. If a particular feature is not supported nothing is done.
|
||||||
Note that for example the creation of new halfedges is mandatory for
|
Note that for example the creation of new halfedges is mandatory for
|
||||||
all halfedge data structures and will not appear here again.
|
all halfedge data structures and will not appear here again.
|
||||||
|
|
||||||
|
\tparam HDS must be a model of `HalfedgeDS`
|
||||||
|
|
||||||
|
|
||||||
### Example ###
|
### Example ###
|
||||||
|
|
||||||
The following program fragment illustrates the implementation of a
|
The following program fragment illustrates the implementation of a
|
||||||
|
|
@ -83,8 +86,8 @@ unequal to their respective default construction value. For all
|
||||||
halfedges `h`: The opposite halfedge is different from `h` and the
|
halfedges `h`: The opposite halfedge is different from `h` and the
|
||||||
opposite of the opposite is equal to `h`. The next of the previous
|
opposite of the opposite is equal to `h`. The next of the previous
|
||||||
halfedge is equal to `h`. For all vertices `v`: the incident vertex
|
halfedge is equal to `h`. For all vertices `v`: the incident vertex
|
||||||
of the incident halfedge of`v` is equal to`v`. The halfedges
|
of the incident halfedge of `v` is equal to `v`. The halfedges
|
||||||
around`v` starting with the incident halfedge of`v` form a cycle.
|
around `v` starting with the incident halfedge of `v` form a cycle.
|
||||||
For all faces `f`: the incident face of the incident halfedge of `f`
|
For all faces `f`: the incident face of the incident halfedge of `f`
|
||||||
is equal to `f`. The halfedges around `f` starting with the incident
|
is equal to `f`. The halfedges around `f` starting with the incident
|
||||||
halfedge of `f` form a cycle. Redundancies among internal variables
|
halfedge of `f` form a cycle. Redundancies among internal variables
|
||||||
|
|
@ -106,7 +109,7 @@ be reached through the faces must be equal to the number of all
|
||||||
halfedges, i.e., all halfedges surrounding a face must form a single
|
halfedges, i.e., all halfedges surrounding a face must form a single
|
||||||
cycle (no holes in faces).
|
cycle (no holes in faces).
|
||||||
<DT><B>Level 4</B><DD>
|
<DT><B>Level 4</B><DD>
|
||||||
All tests of level 3 and `normalized_border_is_valid`.
|
All tests of level 3 and `normalized_border_is_valid()`.
|
||||||
</DL>
|
</DL>
|
||||||
*/
|
*/
|
||||||
/// @{
|
/// @{
|
||||||
|
|
@ -124,7 +127,7 @@ representation, which is when enumerating all halfedges with the
|
||||||
halfedge iterator the following holds: The non-border edges precede the
|
halfedge iterator the following holds: The non-border edges precede the
|
||||||
border edges. For border edges, the second halfedge is a border halfedge.
|
border edges. For border edges, the second halfedge is a border halfedge.
|
||||||
(The first halfedge may or may not be a border halfedge.) The halfedge
|
(The first halfedge may or may not be a border halfedge.) The halfedge
|
||||||
iterator `border_halfedges_begin()` denotes the first border
|
iterator `HalfedgeDS::border_halfedges_begin()` denotes the first border
|
||||||
edge. If `verbose` is `true`, statistics are written to `cerr`.
|
edge. If `verbose` is `true`, statistics are written to `cerr`.
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -178,7 +178,7 @@ face incident to `h` from `hds` and changes all halfedges
|
||||||
incident to the face into border edges or removes them from the
|
incident to the face into border edges or removes them from the
|
||||||
halfedge data structure if they were already border edges. If this
|
halfedge data structure if they were already border edges. If this
|
||||||
creates isolated vertices they get removed as well. See
|
creates isolated vertices they get removed as well. See
|
||||||
`make_hole(h)` for a more specialized variant.
|
`make_hole()` for a more specialized variant.
|
||||||
\pre `h->is_border() == false`.
|
\pre `h->is_border() == false`.
|
||||||
|
|
||||||
\requires If faces are supported, `Supports_removal` \f$ \equiv\f$ `CGAL::Tag_true`.
|
\requires If faces are supported, `Supports_removal` \f$ \equiv\f$ `CGAL::Tag_true`.
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@ the implementation given here runs in time proportional to the size of the
|
||||||
incident face. For const-correctness a second implementation with signature
|
incident face. For const-correctness a second implementation with signature
|
||||||
`Halfedge_const_handle prev() const;` is needed.
|
`Halfedge_const_handle prev() const;` is needed.
|
||||||
|
|
||||||
Note also the use of the static member function `halfedge_handle()`
|
Note also the use of the static member function `HalfedgeDS::halfedge_handle()`
|
||||||
of the halfedge data structure. It converts a pointer to the halfedge
|
of the halfedge data structure. It converts a pointer to the halfedge
|
||||||
into a halfedge handle. This conversion encapsulates possible
|
into a halfedge handle. This conversion encapsulates possible
|
||||||
adjustments for hidden data members in the true halfedge type, such as
|
adjustments for hidden data members in the true halfedge type, such as
|
||||||
|
|
@ -229,42 +229,42 @@ Halfedge_handle get_face_halfedge( Face_handle f);
|
||||||
/// @{
|
/// @{
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
makes `h->opposite()` the successor of `h`.
|
makes `h->%opposite()` the successor of `h`.
|
||||||
*/
|
*/
|
||||||
void close_tip( Halfedge_handle h) const;
|
void close_tip( Halfedge_handle h) const;
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
makes `h->opposite()` the successor of `h` and sets the
|
makes `h->%opposite()` the successor of `h` and sets the
|
||||||
incident vertex of `h` to `v`.
|
incident vertex of `h` to `v`.
|
||||||
*/
|
*/
|
||||||
void close_tip( Halfedge_handle h, Vertex_handle v) const;
|
void close_tip( Halfedge_handle h, Vertex_handle v) const;
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
inserts the tip of the edge `h` into the halfedges around the vertex
|
inserts the tip of the edge `h` into the halfedges around the vertex
|
||||||
pointed to by `v`. Halfedge `h->opposite()` is the new successor of
|
pointed to by `v`. Halfedge `h->%opposite()` is the new successor of
|
||||||
`v` and `h->next()` will be set to `v->next()`. The vertex of `h`
|
`v` and `h->%next()` will be set to `v->next()`. The vertex of `h`
|
||||||
will be set to the vertex `v` refers to if vertices are supported.
|
will be set to the vertex `v` refers to if vertices are supported.
|
||||||
*/
|
*/
|
||||||
void insert_tip( Halfedge_handle h, Halfedge_handle v) const;
|
void insert_tip( Halfedge_handle h, Halfedge_handle v) const;
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
removes the edge `h->next()->opposite()` from the halfedge
|
removes the edge `h->%next()->%opposite()` from the halfedge
|
||||||
circle around the vertex referred to by `h`. The new successor
|
circle around the vertex referred to by `h`. The new successor
|
||||||
halfedge of `h` will be `h->next()->opposite()->next()`.
|
halfedge of `h` will be `h->%next()->%opposite()->%next()`.
|
||||||
*/
|
*/
|
||||||
void remove_tip( Halfedge_handle h) const;
|
void remove_tip( Halfedge_handle h) const;
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
inserts the halfedge `h` between `f` and `f->next()`.
|
inserts the halfedge `h` between `f` and `f->%next()`.
|
||||||
The face of `h` will be the one `f` refers to if faces
|
The face of `h` will be the one `f` refers to if faces
|
||||||
are supported.
|
are supported.
|
||||||
*/
|
*/
|
||||||
void insert_halfedge( Halfedge_handle h, Halfedge_handle f) const;
|
void insert_halfedge( Halfedge_handle h, Halfedge_handle f) const;
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
removes edge `h->next()` from the halfedge circle around
|
removes edge `h->%next()` from the halfedge circle around
|
||||||
the face referred to by `h`. The new successor of `h` will be
|
the face referred to by `h`. The new successor of `h` will be
|
||||||
`h->next()->next()`.
|
`h->%next()->%next()`.
|
||||||
*/
|
*/
|
||||||
void remove_halfedge( Halfedge_handle h) const;
|
void remove_halfedge( Halfedge_handle h) const;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -11,29 +11,27 @@ declaration is best explained with the two following declarations,
|
||||||
essentially hiding an implementation dependent default setting:
|
essentially hiding an implementation dependent default setting:
|
||||||
|
|
||||||
`template <class Refs, class T = CGAL::Tag_true>`
|
`template <class Refs, class T = CGAL::Tag_true>`
|
||||||
|
<BR>
|
||||||
<span class="mbox"></span> `class HalfedgeDS_vertex_base;`
|
`class HalfedgeDS_vertex_base;`
|
||||||
|
|
||||||
`template <class Refs, class T, class Point>`
|
`template <class Refs, class T, class Point>`
|
||||||
|
<BR>
|
||||||
|
`class HalfedgeDS_vertex_base;`
|
||||||
|
|
||||||
<span class="mbox"></span> `class HalfedgeDS_vertex_base;`
|
Let us look at some instantiations
|
||||||
|
- `HalfedgeDS_vertex_base` defines a vertex including a reference to an incident halfedge.
|
||||||
`HalfedgeDS_vertex_base` defines a vertex including a reference to an incident halfedge.
|
- `HalfedgeDS_vertex_base<Refs,CGAL::Tag_false>` is a vertex
|
||||||
|
without a reference to an incident halfedge. It is empty besides the
|
||||||
`CGAL::HalfedgeDS_vertex_base<Refs,CGAL::Tag_false>` is a vertex
|
required type definitions. It can be used for deriving own vertex
|
||||||
without a reference to an incident halfedge. It is empty besides the
|
implementations. See also `CGAL::HalfedgeDS_vertex_min_base<Refs>`.
|
||||||
required type definitions. It can be used for deriving own vertex
|
- `HalfedgeDS_vertex_base<Refs,CGAL::Tag_true,Point>` is a vertex
|
||||||
implementations. See also `CGAL::HalfedgeDS_vertex_min_base<Refs>`.
|
with a reference to an incident halfedge and it stores a point of type
|
||||||
|
`Point`. It can be used as a vertex for a model of the
|
||||||
`CGAL::HalfedgeDS_vertex_base<Refs,CGAL::Tag_true,Point>` is a vertex
|
`PolyhedronItems_3` concept.
|
||||||
with a reference to an incident halfedge and it stores a point of type
|
- `HalfedgeDS_vertex_base<Refs,CGAL::Tag_false,Point>` is a vertex
|
||||||
`Point`. It can be used as a vertex for a model of the
|
without a reference to an incident halfedge and it stores a point of
|
||||||
`PolyhedronItems_3` concept.
|
type `Point`. It can be used as a vertex for a model of the
|
||||||
|
`PolyhedronItems_3` concept.
|
||||||
`CGAL::HalfedgeDS_vertex_base<Refs,CGAL::Tag_false,Point>` is a vertex
|
|
||||||
without a reference to an incident halfedge and it stores a point of
|
|
||||||
type `Point`. It can be used as a vertex for a model of the
|
|
||||||
`PolyhedronItems_3` concept.
|
|
||||||
|
|
||||||
\models ::HalfedgeDSVertex
|
\models ::HalfedgeDSVertex
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ namespace CGAL {
|
||||||
|
|
||||||
The class `HalfedgeDS_vertex_min_base` is a model of the `HalfedgeDSVertex`
|
The class `HalfedgeDS_vertex_min_base` is a model of the `HalfedgeDSVertex`
|
||||||
concept. `Refs` is an instantiation of a `HalfedgeDS`. It is
|
concept. `Refs` is an instantiation of a `HalfedgeDS`. It is
|
||||||
equivalent to `CGAL::HalfedgeDS_vertex_base< Refs, CGAL::Tag_false>`.
|
equivalent to `HalfedgeDS_vertex_base< Refs, CGAL::Tag_false>`.
|
||||||
It is empty besides the required type definitions. It can be used for deriving
|
It is empty besides the required type definitions. It can be used for deriving
|
||||||
own vertices.
|
own vertices.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@ for the incidences, the mandatory and optional member functions
|
||||||
possible for vertices, halfedges, and faces.
|
possible for vertices, halfedges, and faces.
|
||||||
|
|
||||||
\anchor figureOptionalMethods
|
\anchor figureOptionalMethods
|
||||||
\image html hds_optional_small.gif "The three classes `Vertex`, `Halfedge`, and `Face` of the halfedge data structure. Member functions with shaded background are mandatory. The others are optionally supported."
|
\image html hds_optional_small.gif "The three classes Vertex, Halfedge, and Face of the halfedge data structure. Member functions with shaded background are mandatory. The others are optionally supported."
|
||||||
|
|
||||||
A `HalfedgeDS` organizes the internal storage of its items. Examples
|
A `HalfedgeDS` organizes the internal storage of its items. Examples
|
||||||
are a list-based or a vector-based storage. The `HalfedgeDS` exhibits
|
are a list-based or a vector-based storage. The `HalfedgeDS` exhibits
|
||||||
|
|
@ -325,8 +325,10 @@ operator=( const HalfedgeDS<Traits,Items,Alloc>& hds2);
|
||||||
/*!
|
/*!
|
||||||
reserves storage for `v` vertices, `h` halfedges, and `f` faces.
|
reserves storage for `v` vertices, `h` halfedges, and `f` faces.
|
||||||
If all capacities are already greater or equal than the requested sizes
|
If all capacities are already greater or equal than the requested sizes
|
||||||
nothing happens. Otherwise, `hds` will be resized and all handles,
|
nothing happens. Otherwise, the halfedge data structure will be resized and all handles,
|
||||||
iterators and circulators invalidate. \pre If resizing is necessary `hds` contains no dangling handles.
|
iterators and circulators are invalid.
|
||||||
|
|
||||||
|
\pre If resizing is necessary the halfedge data structure contains no dangling handles.
|
||||||
*/
|
*/
|
||||||
void reserve( size_type v, size_type h, size_type f);
|
void reserve( size_type v, size_type h, size_type f);
|
||||||
|
|
||||||
|
|
@ -366,12 +368,12 @@ space reserved for faces.
|
||||||
Size capacity_of_faces() const;
|
Size capacity_of_faces() const;
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
bytes used for `hds`.
|
bytes used for the halfedge data structure.
|
||||||
*/
|
*/
|
||||||
size_t bytes() const;
|
size_t bytes() const;
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
bytes reserved for `hds`.
|
bytes reserved for the halfedge data structure.
|
||||||
*/
|
*/
|
||||||
size_t bytes_reserved() const;
|
size_t bytes_reserved() const;
|
||||||
|
|
||||||
|
|
@ -420,26 +422,26 @@ faces respectively.
|
||||||
/// @{
|
/// @{
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
appends a copy of `v` to `hds`. Returns a handle of the new vertex.
|
appends a copy of `v` to the halfedge data structure. Returns a handle of the new vertex.
|
||||||
*/
|
*/
|
||||||
Vertex_handle vertices_push_back( const Vertex& v);
|
Vertex_handle vertices_push_back( const Vertex& v);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
appends a copy of `h` and a copy of `g` to `hds` and makes them
|
appends a copy of `h` and a copy of `g` to the halfedge data structure and makes them
|
||||||
opposite to each other. Returns a handle of the copy of `h`.
|
opposite to each other. Returns a handle of the copy of `h`.
|
||||||
*/
|
*/
|
||||||
Halfedge_handle edges_push_back( const Halfedge& h,
|
Halfedge_handle edges_push_back( const Halfedge& h,
|
||||||
const Halfedge& g);
|
const Halfedge& g);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
appends a copy of `h` and a copy of `h->opposite()` to `hds` and
|
appends a copy of `h` and a copy of \link HalfedgeDSHalfedge::opposite() `h->opposite()`\endlink
|
||||||
makes them opposite to each other. Returns a handle of the copy of `h`.
|
to the halfedge data structure and makes them opposite to each other. Returns a handle of the copy of `h`.
|
||||||
\pre `h->opposite()` denotes a halfedge.
|
\pre \link HalfedgeDSHalfedge::opposite() `h->opposite()`\endlink denotes a halfedge.
|
||||||
*/
|
*/
|
||||||
Halfedge_handle edges_push_back( const Halfedge& h);
|
Halfedge_handle edges_push_back( const Halfedge& h);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
appends a copy of `f` to `hds`. Returns a handle of the new face.
|
appends a copy of `f` to the halfedge data structure. Returns a handle of the new face.
|
||||||
*/
|
*/
|
||||||
Face_handle faces_push_back( const Face& f);
|
Face_handle faces_push_back( const Face& f);
|
||||||
|
|
||||||
|
|
@ -447,9 +449,9 @@ Face_handle faces_push_back( const Face& f);
|
||||||
|
|
||||||
/*! \name Removal
|
/*! \name Removal
|
||||||
Erasing single elements is optional and indicated with the type tag
|
Erasing single elements is optional and indicated with the type tag
|
||||||
`Supports_removal`. The `pop_back` and the `clear` member
|
`Supports_removal`. The three `pop_back()` and the `clear()` member
|
||||||
functions are mandatory. If vertices or faces are not supported
|
functions are mandatory. If vertices or faces are not supported
|
||||||
for a `HalfedgeDS` the `pop_back` and the `clear` member
|
for a `HalfedgeDS` the three `pop_back()` and the `clear()` member
|
||||||
functions must be provided as null operations.
|
functions must be provided as null operations.
|
||||||
*/
|
*/
|
||||||
/// @{
|
/// @{
|
||||||
|
|
@ -496,7 +498,7 @@ void edges_pop_back();
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
|
||||||
removes the pair of halfedges `h` and `h->opposite()`
|
removes the pair of halfedges `h` and \link HalfedgeDSHalfedge::opposite() `h->opposite()`\endlink
|
||||||
if `Supports_removal` \f$ \equiv\f$ `CGAL::Tag_true`.
|
if `Supports_removal` \f$ \equiv\f$ `CGAL::Tag_true`.
|
||||||
*/
|
*/
|
||||||
void edges_erase( Halfedge_handle h);
|
void edges_erase( Halfedge_handle h);
|
||||||
|
|
@ -565,11 +567,11 @@ incident to an open region are called <I>border halfedges</I>. A
|
||||||
halfedge is a <I>border edge</I> if the halfedge itself or its
|
halfedge is a <I>border edge</I> if the halfedge itself or its
|
||||||
opposite halfedge is a border halfedge. The only requirement to work
|
opposite halfedge is a border halfedge. The only requirement to work
|
||||||
with border halfedges is that the
|
with border halfedges is that the
|
||||||
`Halfedge` class provides a member function `is_border()`
|
`Halfedge` class provides a member function `HalfedgeDSHalfedge::is_border()`
|
||||||
returning a `bool`. Usually, the halfedge data structure
|
returning a `bool`. Usually, the halfedge data structure
|
||||||
supports faces and the value of the default constructor of the face
|
supports faces and the value of the default constructor of the face
|
||||||
handle will indicate a border halfedge, but this may not be the only
|
handle will indicate a border halfedge, but this may not be the only
|
||||||
possibility. The `is_border()` predicate divides the edges into
|
possibility. The `HalfedgeDSHalfedge::is_border()` predicate divides the edges into
|
||||||
two classes, the border edges and the non-border edges. The
|
two classes, the border edges and the non-border edges. The
|
||||||
following normalization reorganizes the sequential storage of the
|
following normalization reorganizes the sequential storage of the
|
||||||
edges such that the non-border edges precede the border edges, and
|
edges such that the non-border edges precede the border edges, and
|
||||||
|
|
|
||||||
|
|
@ -115,7 +115,7 @@ Halfedge_handle halfedge();
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
|
||||||
incident halfedge that points to `f`.
|
incident halfedge that points to the face.
|
||||||
*/
|
*/
|
||||||
Halfedge_const_handle halfedge() const;
|
Halfedge_const_handle halfedge() const;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@ depicts the relationship between a halfedge and its incident
|
||||||
halfedges, vertices, and faces.
|
halfedges, vertices, and faces.
|
||||||
|
|
||||||
\anchor figureHalfedgeDSOptionalMethods
|
\anchor figureHalfedgeDSOptionalMethods
|
||||||
\image html hds_optional.gif "The three classes `Vertex`, `Halfedge`, and `Face` of the halfedge data structure. Member functions with shaded background are mandatory. The others are optionally supported."
|
\image html hds_optional.gif "The three classes Vertex, Halfedge, and Face of the halfedge data structure. Member functions with shaded background are mandatory. The others are optionally supported."
|
||||||
|
|
||||||
For the protection of the integrity of the data structure classes such
|
For the protection of the integrity of the data structure classes such
|
||||||
as `CGAL::Polyhedron_3` are allowed to redefine the modifying member
|
as `CGAL::Polyhedron_3` are allowed to redefine the modifying member
|
||||||
|
|
@ -104,18 +104,17 @@ typedef Hidden_type Halfedge_const_handle;
|
||||||
typedef Hidden_type Face_const_handle;
|
typedef Hidden_type Face_const_handle;
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
`CGAL::Tag_true` or
|
\link CGAL::Tag_true `CGAL::Tag_true`\endlink or \link CGAL::Tag_false `CGAL::Tag_false`\endlink.
|
||||||
`CGAL::Tag_false`.
|
|
||||||
*/
|
*/
|
||||||
typedef Hidden_type Supports_halfedge_prev;
|
typedef Hidden_type Supports_halfedge_prev;
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
~
|
\link CGAL::Tag_true `CGAL::Tag_true`\endlink or \link CGAL::Tag_false `CGAL::Tag_false`\endlink.
|
||||||
*/
|
*/
|
||||||
typedef Hidden_type Supports_halfedge_vertex;
|
typedef Hidden_type Supports_halfedge_vertex;
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
~
|
\link CGAL::Tag_true `CGAL::Tag_true`\endlink or \link CGAL::Tag_false `CGAL::Tag_false`\endlink.
|
||||||
*/
|
*/
|
||||||
typedef Hidden_type Supports_halfedge_face;
|
typedef Hidden_type Supports_halfedge_face;
|
||||||
|
|
||||||
|
|
@ -167,7 +166,7 @@ sets next halfedge to `h`.
|
||||||
void set_next( Halfedge_handle h);
|
void set_next( Halfedge_handle h);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
is true if `h` is a border halfedge.
|
is true if the halfedge is a border halfedge.
|
||||||
*/
|
*/
|
||||||
bool is_border() const;
|
bool is_border() const;
|
||||||
|
|
||||||
|
|
@ -222,7 +221,7 @@ void set_vertex( Vertex_handle v);
|
||||||
Face_handle face();
|
Face_handle face();
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
the incident face of `h`. If `h` is a border halfedge
|
the incident face of the halfedge. If the halfedge is a border halfedge
|
||||||
the result is default construction of the handle.
|
the result is default construction of the handle.
|
||||||
*/
|
*/
|
||||||
Face_const_handle face() const;
|
Face_const_handle face() const;
|
||||||
|
|
|
||||||
|
|
@ -13,9 +13,8 @@ uses the halfedge data structure as internal representation. `Traits`
|
||||||
is not used by the halfedge data structure itself. These three member
|
is not used by the halfedge data structure itself. These three member
|
||||||
class templates provide a local type named `Vertex`, `Halfedge`,
|
class templates provide a local type named `Vertex`, `Halfedge`,
|
||||||
and `Face` respectively. The requirements on these
|
and `Face` respectively. The requirements on these
|
||||||
types are described on page \ref HalfedgeDSVertex,
|
types are described on the manual pages of the concepts `HalfedgeDSVertex`,
|
||||||
page \ref HalfedgeDSHalfedge, and
|
`HalfedgeDSHalfedge`, and `HalfedgeDSFace` respectively.
|
||||||
page \ref HalfedgeDSFace respectively.
|
|
||||||
|
|
||||||
\hasModel CGAL::HalfedgeDS_min_items
|
\hasModel CGAL::HalfedgeDS_min_items
|
||||||
\hasModel CGAL::HalfedgeDS_items_2
|
\hasModel CGAL::HalfedgeDS_items_2
|
||||||
|
|
|
||||||
|
|
@ -114,7 +114,7 @@ Vertex();
|
||||||
Halfedge_handle halfedge();
|
Halfedge_handle halfedge();
|
||||||
/*!
|
/*!
|
||||||
|
|
||||||
incident halfedge that points to `v`.
|
incident halfedge that points to the vertex.
|
||||||
*/
|
*/
|
||||||
Halfedge_const_handle halfedge() const;
|
Halfedge_const_handle halfedge() const;
|
||||||
/*!
|
/*!
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ geometric interpretation is added by classes built on top of the
|
||||||
halfedge data structure. These classes might be more convenient to
|
halfedge data structure. These classes might be more convenient to
|
||||||
use than the halfedge data structure directly, since the halfedge data
|
use than the halfedge data structure directly, since the halfedge data
|
||||||
structure is meant as an implementation layer. See for example the
|
structure is meant as an implementation layer. See for example the
|
||||||
`CGAL::Polyhedron_3` class in Chapter \ref chapterPolyhedron.
|
`Polyhedron_3` class in Chapter \ref chapterPolyhedron "Polyhedral Surface".
|
||||||
|
|
||||||
The data structure provided here is also known as the
|
The data structure provided here is also known as the
|
||||||
FE-structure \cite w-ebdss-85, as
|
FE-structure \cite w-ebdss-85, as
|
||||||
|
|
@ -50,7 +50,7 @@ releases. Files and identifier names are disjoint with the old design
|
||||||
which allows for both versions to co-exists. However, classes using a
|
which allows for both versions to co-exists. However, classes using a
|
||||||
halfedge data structure can only use one design. For example the
|
halfedge data structure can only use one design. For example the
|
||||||
polyhedral surface `Polyhedron_3` uses by default the new
|
polyhedral surface `Polyhedron_3` uses by default the new
|
||||||
design. See Chapter \ref chapterPolyhedron for how to still select
|
design. See Chapter \ref chapterPolyhedron "Polyhedral Surface" for how to still select
|
||||||
the old implementation.
|
the old implementation.
|
||||||
|
|
||||||
# Software Design # {#HalfedgeDSSoftware}
|
# Software Design # {#HalfedgeDSSoftware}
|
||||||
|
|
@ -61,7 +61,7 @@ the old implementation.
|
||||||
|
|
||||||
Figure \ref figureHalfedgeDSDesign
|
Figure \ref figureHalfedgeDSDesign
|
||||||
illustrates the responsibilities of the three layers of the software
|
illustrates the responsibilities of the three layers of the software
|
||||||
design, with the `CGAL::Polyhedron_3` as an example for the top
|
design, with the `Polyhedron_3` as an example for the top
|
||||||
layer. The items provide the space for the information that is
|
layer. The items provide the space for the information that is
|
||||||
actually stored, i.e., with member variables and access member
|
actually stored, i.e., with member variables and access member
|
||||||
functions in `Vertex`, `Halfedge`, and `Face`
|
functions in `Vertex`, `Halfedge`, and `Face`
|
||||||
|
|
@ -85,7 +85,7 @@ also provided to serve as defaults; for polyhedra they provide all
|
||||||
optional incidences, a three-dimensional point in the vertex type and
|
optional incidences, a three-dimensional point in the vertex type and
|
||||||
a plane equation in the face type.
|
a plane equation in the face type.
|
||||||
|
|
||||||
The `Halfedge_data_structure`, concept `HalfedgeDS`, is
|
The Halfedge data structure concept `HalfedgeDS`, is
|
||||||
responsible for the storage organization of the items. Currently,
|
responsible for the storage organization of the items. Currently,
|
||||||
implementations using internally a bidirectional list or a
|
implementations using internally a bidirectional list or a
|
||||||
vector are provided. The `HalfedgeDS` defines the handles and iterators
|
vector are provided. The `HalfedgeDS` defines the handles and iterators
|
||||||
|
|
@ -109,11 +109,11 @@ example, the polyhedron. They add, for example, the Euler operations
|
||||||
and partial operations from which further Euler operations can be
|
and partial operations from which further Euler operations can be
|
||||||
built, such as inserting an edge into the ring of edges at a
|
built, such as inserting an edge into the ring of edges at a
|
||||||
vertex. Furthermore, the helper classes contain adaptive
|
vertex. Furthermore, the helper classes contain adaptive
|
||||||
functionality. For example, if the `prev()` member function is not
|
functionality. For example, if the `HalfedgeDSHalfedge::prev()` member function is not
|
||||||
provided for halfedges, the `find_prev()` member function of a helper
|
provided for halfedges, the `HalfedgeDS_items_decorator::find_prev()` member function of a helper
|
||||||
class searches in the positive direction along the face for the
|
class searches in the positive direction along the face for the
|
||||||
previous halfedge. But if the `prev()` member function is provided,
|
previous halfedge. But if the `HalfedgeDSHalfedge::prev()` member function is provided,
|
||||||
the `find_prev()` member function simply calls it. This distinction is
|
the `HalfedgeDS_items_decorator::find_prev()` member function simply calls it. This distinction is
|
||||||
resolved at compile time with a technique called <I>compile-time
|
resolved at compile time with a technique called <I>compile-time
|
||||||
tags</I>, similar to iterator tags in \cite cgal:sl-stl-95.
|
tags</I>, similar to iterator tags in \cite cgal:sl-stl-95.
|
||||||
|
|
||||||
|
|
@ -137,7 +137,7 @@ design.
|
||||||
|
|
||||||
\anchor sectionHdsExamples
|
\anchor sectionHdsExamples
|
||||||
|
|
||||||
## The Default Halfedge Data Structure ##
|
## The %Default Halfedge Data Structure ##
|
||||||
|
|
||||||
The following example program uses the default halfedge data structure
|
The following example program uses the default halfedge data structure
|
||||||
and the decorator class. The default halfedge data structure uses a
|
and the decorator class. The default halfedge data structure uses a
|
||||||
|
|
@ -153,7 +153,7 @@ of two halfedges, one vertex and two faces, and checks its validity.
|
||||||
## A Minimal Halfedge Data Structure ##
|
## A Minimal Halfedge Data Structure ##
|
||||||
|
|
||||||
The following program defines a minimal halfedge data structure using
|
The following program defines a minimal halfedge data structure using
|
||||||
the minimal items class `CGAL::HalfedgeDS_min_items` and a
|
the minimal items class `HalfedgeDS_min_items` and a
|
||||||
list-based halfedge data structure. The result is a data structure
|
list-based halfedge data structure. The result is a data structure
|
||||||
maintaining only halfedges with next and opposite pointers. No
|
maintaining only halfedges with next and opposite pointers. No
|
||||||
vertices or faces are stored. The data structure represents an <I>undirected graph</I>.
|
vertices or faces are stored. The data structure represents an <I>undirected graph</I>.
|
||||||
|
|
@ -174,7 +174,7 @@ in a consistent, i.e., <I>valid</I>, state.
|
||||||
|
|
||||||
\cgalexample{HalfedgeDS/hds_prog_vector.cpp}
|
\cgalexample{HalfedgeDS/hds_prog_vector.cpp}
|
||||||
|
|
||||||
## Example Adding Color to Faces ##
|
## Example Adding %Color to Faces ##
|
||||||
|
|
||||||
This example re-uses the base class available for faces and adds a
|
This example re-uses the base class available for faces and adds a
|
||||||
member variable `color`.
|
member variable `color`.
|
||||||
|
|
@ -203,9 +203,9 @@ store this bit as the least significant bit in the next halfedge
|
||||||
handle. Furthermore, we do not implement a pointer to the previous
|
handle. Furthermore, we do not implement a pointer to the previous
|
||||||
halfedge. What remains are three pointers per halfedge.
|
halfedge. What remains are three pointers per halfedge.
|
||||||
|
|
||||||
\advanced We use the static member function `halfedge_handle()` to convert
|
\advanced We use the static member function `HalfedgeDS::halfedge_handle()` to convert
|
||||||
from pointers to halfedge handles. The same solution can be applied to
|
from pointers to halfedge handles. The same solution can be applied to
|
||||||
the list-based halfedge data structure `CGAL::HalfedgeDS_list`,
|
the list-based halfedge data structure `HalfedgeDS_list`,
|
||||||
see <TT>examples/HalfedgeDS/hds_prog_compact2.cpp</TT>. Here is the
|
see <TT>examples/HalfedgeDS/hds_prog_compact2.cpp</TT>. Here is the
|
||||||
example for the vector-based data structure.
|
example for the vector-based data structure.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ matrix search.
|
||||||
### Implementation ###
|
### Implementation ###
|
||||||
|
|
||||||
All operations take constant time except for
|
All operations take constant time except for
|
||||||
`extract_all_even_rows` which needs time linear in the number
|
`extract_all_even_rows()` which needs time linear in the number
|
||||||
of rows.
|
of rows.
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
@ -33,7 +33,7 @@ public:
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
initializes
|
initializes
|
||||||
`d` to `m`. `m` is <I>not</I> copied, we only
|
the dynamic matrix to `m`. `m` is <I>not</I> copied, we only
|
||||||
store a reference.
|
store a reference.
|
||||||
*/
|
*/
|
||||||
Dynamic_matrix( const M& m);
|
Dynamic_matrix( const M& m);
|
||||||
|
|
@ -69,15 +69,15 @@ void replace_column( int old, int new);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
returns
|
returns
|
||||||
a new matrix consisting of all rows of `d` with even index,
|
a new matrix consisting of all rows of the dynmic matrix with even index,
|
||||||
(i.e.\ first row is row \f$ 0\f$ of `d`, second row is row \f$ 2\f$ of
|
(i.e.\ first row is row \f$ 0\f$ of the dynamic matrix, second row is row \f$ 2\f$ of
|
||||||
`d` etc.). \pre `number_of_rows()` \f$ > 0\f$.
|
the dynamic matrix, etc.). \pre `number_of_rows()` \f$ > 0\f$.
|
||||||
*/
|
*/
|
||||||
Matrix* extract_all_even_rows() const;
|
Matrix* extract_all_even_rows() const;
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
deletes the
|
deletes the
|
||||||
rightmost columns, such that `d` becomes quadratic.
|
rightmost columns, such that the dynamic matrix becomes quadratic.
|
||||||
\pre `number_of_columns()` \f$ \ge\f$ `number_of_rows()`. \post `number_of_rows()` \f$ ==\f$ `number_of_columns()`.
|
\pre `number_of_columns()` \f$ \ge\f$ `number_of_rows()`. \post `number_of_rows()` \f$ ==\f$ `number_of_columns()`.
|
||||||
*/
|
*/
|
||||||
void shrink_to_quadratic_size();
|
void shrink_to_quadratic_size();
|
||||||
|
|
|
||||||
|
|
@ -10,8 +10,8 @@ arbitrary feasibility test and matrix classes `F` resp.\ `M`.
|
||||||
|
|
||||||
\models ::SortedMatrixSearchTraits
|
\models ::SortedMatrixSearchTraits
|
||||||
|
|
||||||
\tparam `M` must be a model for `BasicMatrix`
|
\tparam M must be a model for `BasicMatrix`
|
||||||
\tparam `F` must define a copy constructor and a monotone `bool operator()( const Value&)`.
|
\tparam F must define a copy constructor and a monotone `bool operator()( const Value&)`.
|
||||||
|
|
||||||
*/
|
*/
|
||||||
template< typename F, typename M >
|
template< typename F, typename M >
|
||||||
|
|
@ -36,24 +36,24 @@ m);
|
||||||
/*!
|
/*!
|
||||||
typedef to `M`.
|
typedef to `M`.
|
||||||
*/
|
*/
|
||||||
typedef Hidden_type Matrix;
|
typedef M Matrix;
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
typedef to `Matrix::Value`.
|
typedef to `Matrix::Value`.
|
||||||
*/
|
*/
|
||||||
typedef Hidden_type Value;
|
typedef Matrix::Value Value;
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
typedef to
|
typedef to
|
||||||
`std::less<Value>`.
|
`std::less<Value>`.
|
||||||
*/
|
*/
|
||||||
typedef Hidden_type Compare_strictly;
|
typedef std::less<Value> Compare_strictly;
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
typedef to
|
typedef to
|
||||||
`std::less_equal<Value>`.
|
`std::less_equal<Value>`.
|
||||||
*/
|
*/
|
||||||
typedef Hidden_type Compare_non_strictly;
|
typedef std::less_equal<Value> Compare_non_strictly;
|
||||||
|
|
||||||
/// @}
|
/// @}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ namespace CGAL {
|
||||||
|
|
||||||
\author Michael Hoffmann
|
\author Michael Hoffmann
|
||||||
|
|
||||||
`CGAL::monotone_matrix_search` and `CGAL::sorted_matrix_search`
|
`monotone_matrix_search()` and `sorted_matrix_search()`
|
||||||
are techniques that deal with the problem of efficiently finding
|
are techniques that deal with the problem of efficiently finding
|
||||||
largest entries in matrices with certain structural properties. Many
|
largest entries in matrices with certain structural properties. Many
|
||||||
concrete problems can be modelled as matrix search problems, and for
|
concrete problems can be modelled as matrix search problems, and for
|
||||||
|
|
@ -21,10 +21,10 @@ computing rectangular \f$ p\f$-centers.
|
||||||
|
|
||||||
In the following program we build a random vector \f$ a =
|
In the following program we build a random vector \f$ a =
|
||||||
(a_i)_{i = 1,\,\ldots,\,5}\f$ (elements drawn uniformly from \f$ \{
|
(a_i)_{i = 1,\,\ldots,\,5}\f$ (elements drawn uniformly from \f$ \{
|
||||||
0,\,\ldots,\,99 \}\f$) and construct a Cartesian matrix \f$ M\f$
|
0,\,\ldots,\,99 \}\f$) and construct a %Cartesian matrix \f$ M\f$
|
||||||
containing as elements all sums \f$ a_i + a_j,\: i,\,j \in
|
containing as elements all sums \f$ a_i + a_j,\: i,\,j \in
|
||||||
\{1,\,\ldots,\,5\}\f$. If \f$ a\f$ is sorted, \f$ M\f$ is sorted as well. So
|
\{1,\,\ldots,\,5\}\f$. If \f$ a\f$ is sorted, \f$ M\f$ is sorted as well. So
|
||||||
we can apply `sorted_matrix_search` to compute the upper bound
|
we can apply `sorted_matrix_search()` to compute the upper bound
|
||||||
for the maximal entry of \f$ a\f$ in \f$ M\f$.
|
for the maximal entry of \f$ a\f$ in \f$ M\f$.
|
||||||
|
|
||||||
\cgalexample{Matrix_search/sorted_matrix_search.cpp}
|
\cgalexample{Matrix_search/sorted_matrix_search.cpp}
|
||||||
|
|
|
||||||
|
|
@ -12,8 +12,8 @@ namespace CGAL {
|
||||||
# Timers # {#MiscellanyTimers}
|
# Timers # {#MiscellanyTimers}
|
||||||
|
|
||||||
\cgal provides classes for measuring the user process time and the real time.
|
\cgal provides classes for measuring the user process time and the real time.
|
||||||
The class `CGAL::Timer` is the version for the user process time and
|
The class `Timer` is the version for the user process time and
|
||||||
the class `CGAL::Real_timer` is the version for the real time.
|
the class `Real_timer` is the version for the real time.
|
||||||
|
|
||||||
Instantiations of both classes are objects with a state. The state is
|
Instantiations of both classes are objects with a state. The state is
|
||||||
either <I>running</I> or it is <I>stopped</I>. The state of an object
|
either <I>running</I> or it is <I>stopped</I>. The state of an object
|
||||||
|
|
@ -29,7 +29,7 @@ first interval.
|
||||||
# Memory Size # {#MiscellanyMemory}
|
# Memory Size # {#MiscellanyMemory}
|
||||||
|
|
||||||
\cgal provides access to the memory size used by the program with the
|
\cgal provides access to the memory size used by the program with the
|
||||||
`CGAL::Memory_sizer` class. Both the virtual memory size and the
|
`Memory_sizer` class. Both the virtual memory size and the
|
||||||
resident size are available (the resident size does not account for
|
resident size are available (the resident size does not account for
|
||||||
swapped out memory nor for the memory which is not yet paged-in).
|
swapped out memory nor for the memory which is not yet paged-in).
|
||||||
|
|
||||||
|
|
@ -37,7 +37,7 @@ swapped out memory nor for the memory which is not yet paged-in).
|
||||||
|
|
||||||
\cgal provides a way to count the number of times a given line of code
|
\cgal provides a way to count the number of times a given line of code
|
||||||
is executed during the execution of a program. Such
|
is executed during the execution of a program. Such
|
||||||
`CGAL::Profile_counter` counters can be added at critical place in the
|
`Profile_counter` counters can be added at critical place in the
|
||||||
code, and at the end of the execution of a program, the count is printed on
|
code, and at the end of the execution of a program, the count is printed on
|
||||||
`std::cerr`. A macro `CGAL_PROFILER` can be used to conveniently place
|
`std::cerr`. A macro `CGAL_PROFILER` can be used to conveniently place
|
||||||
these counters anywhere. They are disabled by default and activated by the
|
these counters anywhere. They are disabled by default and activated by the
|
||||||
|
|
|
||||||
|
|
@ -3,28 +3,28 @@ namespace CGAL {
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\ingroup PkgModularArithmetic
|
\ingroup PkgModularArithmetic
|
||||||
|
|
||||||
\anchor Residue
|
\anchor Residue
|
||||||
|
|
||||||
The class `Residue` represents a finite field \f$ \Z{/p\Z}\f$,
|
\brief The class `Residue` represents a finite field \f$ \Z{/p\Z}\f$,
|
||||||
for some prime number \f$ p\f$.
|
for some prime number \f$ p\f$.
|
||||||
|
|
||||||
The prime number \f$ p\f$ is stored in a static member variable.
|
The prime number \f$ p\f$ is stored in a static member variable.
|
||||||
The class provides static member functions to change this value.
|
The class provides static member functions to change this value.
|
||||||
<B>Note that changing the prime invalidates already existing objects
|
|
||||||
of this type.</B>
|
|
||||||
However, already existing objects do not lose their value with respect to the
|
However, already existing objects do not lose their value with respect to the
|
||||||
old prime and can be reused after restoring the old prime.
|
old prime and can be reused after restoring the old prime.
|
||||||
Since the type is based on double
|
Since the type is based on double
|
||||||
arithmetic the prime is restricted to values less than \f$ 2^{26}\f$.
|
arithmetic the prime is restricted to values less than \f$ 2^{26}\f$.
|
||||||
The initial value of \f$ p\f$ is 67111067.
|
The initial value of \f$ p\f$ is 67111067.
|
||||||
|
|
||||||
Please note that the implementation of class `CGAL::Residue` requires a mantissa
|
\attention Note that changing the prime invalidates already existing objects
|
||||||
|
of this type.
|
||||||
|
|
||||||
|
Please note that the implementation of class `Residue` requires a mantissa
|
||||||
precision according to the IEEE Standard for Floating-Point Arithmetic (IEEE 754).
|
precision according to the IEEE Standard for Floating-Point Arithmetic (IEEE 754).
|
||||||
However, on some processors the traditional FPU uses an extended precision. Hence, it
|
However, on some processors the traditional FPU uses an extended precision. Hence, it
|
||||||
is indispensable that the proper mantissa length is enforced before performing
|
is indispensable that the proper mantissa length is enforced before performing
|
||||||
any arithmetic operations. Moreover, it is required that numbers are rounded to the
|
any arithmetic operations. Moreover, it is required that numbers are rounded to the
|
||||||
next nearest value. This can be ensured using `CGAL::Protect_FPU_rounding` with
|
next nearest value. This can be ensured using `Protect_FPU_rounding` with
|
||||||
`CGAL_FE_TONEAREST`, which also enforces the required precision as a side effect.
|
`CGAL_FE_TONEAREST`, which also enforces the required precision as a side effect.
|
||||||
|
|
||||||
In case the flag `CGAL_HAS_THREADS`
|
In case the flag `CGAL_HAS_THREADS`
|
||||||
|
|
@ -33,8 +33,9 @@ of the class, that is, `Residue` is not thread-safe in this case.
|
||||||
In case `CGAL_HAS_THREADS`
|
In case `CGAL_HAS_THREADS`
|
||||||
the implementation of the class is thread safe using
|
the implementation of the class is thread safe using
|
||||||
`boost::thread_specific_ptr`. However, this may cause some performance
|
`boost::thread_specific_ptr`. However, this may cause some performance
|
||||||
penalty. Hence, it may be advisable to configure `CGAL` with
|
penalty. Hence, it may be advisable to configure %CGAL with
|
||||||
`CGAL_HAS_NO_THREADS`.
|
`CGAL_HAS_NO_THREADS`. See Section \ref Preliminaries_thread_safety "Thread Safety"
|
||||||
|
in the preliminaries.
|
||||||
|
|
||||||
\models ::Field
|
\models ::Field
|
||||||
|
|
||||||
|
|
@ -47,22 +48,22 @@ public:
|
||||||
/// @{
|
/// @{
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
introduces a variable `x`, which is initialized with zero;
|
introduces a variable `x`, which is initialized with zero.
|
||||||
*/
|
*/
|
||||||
Residue();
|
Residue();
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
copy constructor;
|
copy constructor.
|
||||||
*/
|
*/
|
||||||
Residue(const Residue& m);
|
Residue(const Residue& m);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
introduces a variable `x`, which is initialized with \f$ i \% p\f$;
|
introduces a variable `x`, which is initialized with \f$ i \mod p\f$.
|
||||||
*/
|
*/
|
||||||
Residue(int i);
|
Residue(int i);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
introduces a variable `x`, which is initialized with \f$ i \% p\f$;
|
introduces a variable `x`, which is initialized with \f$ i \mod p\f$.
|
||||||
*/
|
*/
|
||||||
Residue(long i);
|
Residue(long i);
|
||||||
|
|
||||||
|
|
@ -73,9 +74,7 @@ Residue(long i);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
|
||||||
Static member function;
|
Static member function which sets the current prime to the given value and returns the old prime.
|
||||||
|
|
||||||
sets current prime to the given value and returns the old prime.
|
|
||||||
*/
|
*/
|
||||||
static int set_current_prime(int p);
|
static int set_current_prime(int p);
|
||||||
|
|
||||||
|
|
@ -90,7 +89,7 @@ static int get_current_prime();
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
|
||||||
Returns the unique representative of `x`within the range
|
Returns the unique representative of `x` within the range
|
||||||
\f$ [-p/2,p/2]\f$, where \f$ p\f$ is the current prime.
|
\f$ [-p/2,p/2]\f$, where \f$ p\f$ is the current prime.
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ with respect to a homomorphism \f$ \varphi\f$ from the
|
||||||
`ModularTraits::Type` into the `ModularTraits::Residue_type`.
|
`ModularTraits::Type` into the `ModularTraits::Residue_type`.
|
||||||
|
|
||||||
The homomorphism preserves the mapping of `int` into both types
|
The homomorphism preserves the mapping of `int` into both types
|
||||||
, i.e., \f$ \varphi(Type(i)) == Residue\_type(i)\f$.
|
, i.e., \f$ \varphi(\mathrm{Type}(i)) == \mathrm{Residue\_type}(i)\f$.
|
||||||
|
|
||||||
\refines `AdaptableUnaryFunction`
|
\refines `AdaptableUnaryFunction`
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -20,9 +20,9 @@ which can not be represented.
|
||||||
|
|
||||||
\hasModel `int`
|
\hasModel `int`
|
||||||
\hasModel `long`
|
\hasModel `long`
|
||||||
\hasModel `CORE::BigInt`
|
\hasModel `CGAL::CORE::BigInt`
|
||||||
\hasModel `CGAL::Gmpz`
|
\hasModel `CGAL::Gmpz`
|
||||||
\hasModel `leda::integer`
|
\hasModel `leda_integer`
|
||||||
\hasModel `mpz_class`
|
\hasModel `mpz_class`
|
||||||
|
|
||||||
The following types are `Modularizable` iff their template arguments are.
|
The following types are `Modularizable` iff their template arguments are.
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ correspondent with respect to one prime only.
|
||||||
|
|
||||||
# Residue and Modularizable # {#Modular_arithmetic_residue}
|
# Residue and Modularizable # {#Modular_arithmetic_residue}
|
||||||
|
|
||||||
First of all, this package introduces a type `CGAL::Residue`.
|
First of all, this package introduces a type `Residue`.
|
||||||
It represents \f$ \Z_{/p\Z}\f$ for some prime \f$ p\f$.
|
It represents \f$ \Z_{/p\Z}\f$ for some prime \f$ p\f$.
|
||||||
The prime number \f$ p\f$ is stored in a static member variable.
|
The prime number \f$ p\f$ is stored in a static member variable.
|
||||||
The class provides static member functions to change this value.
|
The class provides static member functions to change this value.
|
||||||
|
|
@ -36,15 +36,15 @@ The initial value of \f$ p\f$ is 67111067.
|
||||||
Moreover, the package introduces the concept `Modularizable`.
|
Moreover, the package introduces the concept `Modularizable`.
|
||||||
An algebraic structure `T` is considered as `Modularizable` if there
|
An algebraic structure `T` is considered as `Modularizable` if there
|
||||||
is a mapping from `T` into an algebraic structure that is based on
|
is a mapping from `T` into an algebraic structure that is based on
|
||||||
the type `CGAL::Residue`.
|
the type `Residue`.
|
||||||
For scalar types, e.g. Integers, this mapping is just the canonical
|
For scalar types, e.g. Integers, this mapping is just the canonical
|
||||||
homomorphism into \f$ \Z_{/p\Z}\f$ represented by `CGAL::Residue`.
|
homomorphism into \f$ \Z_{/p\Z}\f$ represented by `Residue`.
|
||||||
For compound types, e.g. Polynomials, the mapping is applied to the
|
For compound types, e.g. Polynomials, the mapping is applied to the
|
||||||
coefficients of the compound type.
|
coefficients of the compound type.
|
||||||
The mapping is provided by the class `CGAL::Modular_traits<T>`.
|
The mapping is provided by the class `Modular_traits<T>`.
|
||||||
The class `CGAL::Modular_traits<T>` is designed such that the concept
|
The class `Modular_traits<T>` is designed such that the concept
|
||||||
`Modularizable` can be considered as optional, i.e.,
|
`Modularizable` can be considered as optional, i.e.,
|
||||||
`CGAL::Modular_traits<T>` provides a tag that can be used for dispatching.
|
`Modular_traits<T>` provides a tag that can be used for dispatching.
|
||||||
|
|
||||||
## Example ## {#Modular_arithmetic_example}
|
## Example ## {#Modular_arithmetic_example}
|
||||||
|
|
||||||
|
|
@ -63,12 +63,12 @@ that the coefficient type is `Modularizable` and that it is not.
|
||||||
If the type is not `Modularizable` the filter is just not applied and the
|
If the type is not `Modularizable` the filter is just not applied and the
|
||||||
function returns true.
|
function returns true.
|
||||||
|
|
||||||
Further note that the implementation of class `CGAL::Residue` requires a mantissa
|
Further note that the implementation of class `Residue` requires a mantissa
|
||||||
precision according to the IEEE Standard for Floating-Point Arithmetic (IEEE 754).
|
precision according to the IEEE Standard for Floating-Point Arithmetic (IEEE 754).
|
||||||
However, on some processors the traditional FPU uses an extended precision. Hence, it
|
However, on some processors the traditional FPU uses an extended precision. Hence, it
|
||||||
is indispensable that the proper mantissa length is enforced before performing
|
is indispensable that the proper mantissa length is enforced before performing
|
||||||
any arithmetic operations. Moreover, it is required that numbers are rounded to the
|
any arithmetic operations. Moreover, it is required that numbers are rounded to the
|
||||||
next nearest value. This can be ensured using `CGAL::Protect_FPU_rounding` with
|
next nearest value. This can be ensured using `Protect_FPU_rounding` with
|
||||||
`CGAL_FE_TONEAREST`, which also enforces the required precision as a side effect.
|
`CGAL_FE_TONEAREST`, which also enforces the required precision as a side effect.
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -76,7 +76,7 @@ next nearest value. This can be ensured using `CGAL::Protect_FPU_rounding` with
|
||||||
|
|
||||||
# Design and Implementation History # {#Modular_arithmeticDesign}
|
# Design and Implementation History # {#Modular_arithmeticDesign}
|
||||||
|
|
||||||
The class `CGAL::Residue` is based on the C-code of Sylvain Pion et. al.
|
The class `Residue` is based on the C-code of Sylvain Pion et. al.
|
||||||
as it was presented in \cite bepp-sdrns-99.
|
as it was presented in \cite bepp-sdrns-99.
|
||||||
|
|
||||||
The remaining part of the package is the result of the integration process
|
The remaining part of the package is the result of the integration process
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
|
|
||||||
The concept `SnapRoundingTraits_2` lists the set of requirements that must be fulfilled by
|
The concept `SnapRoundingTraits_2` lists the set of requirements that must be fulfilled by
|
||||||
an instance of the `Traits` template-parameter of
|
an instance of the `Traits` template-parameter of
|
||||||
the function \ref CGAL::snap_rounding_2 "CGAL::snap_rounding_2<Traits,InputIterator,OutputContainer>()".
|
the function \ref CGAL::snap_rounding_2() "CGAL::snap_rounding_2<Traits,InputIterator,OutputContainer>()".
|
||||||
This concept provides the types of the geometric primitives used in
|
This concept provides the types of the geometric primitives used in
|
||||||
this class and some function object types for the required
|
this class and some function object types for the required
|
||||||
predicates on those primitives.
|
predicates on those primitives.
|
||||||
|
|
@ -14,9 +14,9 @@ predicates on those primitives.
|
||||||
\refines `Assignable`
|
\refines `Assignable`
|
||||||
\refines `CopyConstructible`
|
\refines `CopyConstructible`
|
||||||
\refines `SweepLineTraits_2`
|
\refines `SweepLineTraits_2`
|
||||||
\refines An instance of this concept is used as the traits class for the `CGAL::Sweep_line_2::get_intersection_points()` operation. The requirements listed below are induced by components of the `CGAL::snap_rounding_2` function other than the call to `CGAL::Sweep_line_2::get_intersection_points()`. Naturally, some of them may already be listed in `SweepLineTraits_2`.
|
\refines An instance of this concept is used as the traits class for the `CGAL::Sweep_line_2::get_intersection_points()` operation. The requirements listed below are induced by components of the `CGAL::snap_rounding_2()` function other than the call to `Sweep_line_2::get_intersection_points()`. Naturally, some of them may already be listed in `SweepLineTraits_2`.
|
||||||
|
|
||||||
\hasModel `CGAL::Snap_rounding_traits<Kernel>`
|
\hasModel `CGAL::Snap_rounding_traits_2<Kernel>`
|
||||||
|
|
||||||
\sa `CGAL::Snap_rounding_2<Kernel>`
|
\sa `CGAL::Snap_rounding_2<Kernel>`
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue