Merge remote-tracking branch 'cgal/master' into P3M3-Undocumented_polyhedral_domain_example-GF

This commit is contained in:
Mael Rouxel-Labbé 2022-11-18 16:47:07 +01:00
commit b10b84fb7f
460 changed files with 8396 additions and 11372 deletions

1
.github/install.sh vendored
View File

@ -1,5 +1,4 @@
#!/bin/bash
sudo add-apt-repository ppa:mikhailnov/pulseeffects -y
sudo apt-get update
sudo apt-get install -y libmpfr-dev \
libeigen3-dev qtbase5-dev libqt5sql5-sqlite libqt5opengl5-dev qtscript5-dev \

32
.github/workflows/Remove_labels.yml vendored Normal file
View File

@ -0,0 +1,32 @@
name: remove_labels
on:
pull_request_target:
types: [synchronize]
jobs:
remove_label:
runs-on: ubuntu-latest
if: contains(github.event.pull_request.labels.*.name, 'Tested')
name: remove label
steps:
- name: removelabel
uses: actions/github-script@v6
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
github.rest.issues.removeLabel({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
name: "Tested",
});
- name: Post address
uses: actions/github-script@v6
if: ${{ success() }}
with:
script: |
github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
body: "This pull-request was previously marked with the label `Tested`, but has been modified with new commits. That label has been removed."
})

View File

@ -51,12 +51,22 @@ jobs:
name: "checkout branch"
if: steps.get_round.outputs.result != 'stop'
with:
repository: ${{ github.repository }}
ref: refs/pull/${{ steps.get_pr_number.outputs.result }}/merge
token: ${{ secrets.PUSH_TO_CGAL_GITHUB_IO_TOKEN }}
fetch-depth: 2
repository: ${{ github.repository }}
ref: refs/pull/${{ steps.get_pr_number.outputs.result }}/merge
token: ${{ secrets.PUSH_TO_CGAL_GITHUB_IO_TOKEN }}
fetch-depth: 2
- name: Emoji-comment
uses: actions/github-script@v6
if: steps.get_round.outputs.result != 'stop'
with:
script: |
github.rest.reactions.createForIssueComment({
comment_id: ${{ github.event.comment.id }},
owner: context.repo.owner,
repo: context.repo.repo,
content: 'rocket'
})
- name: install dependencies
if: steps.get_round.outputs.result != 'stop'
run: |
@ -90,14 +100,17 @@ jobs:
#list impacted packages
LIST_OF_PKGS=$(git diff --name-only HEAD^1 HEAD |cut -s -d/ -f1 |sort -u | xargs -I {} echo {} && ls -d {}/package_info 2>/dev/null |cut -d/ -f1 |egrep -v Installation||true)
if [ "$LIST_OF_PKGS" = "" ]; then
echo "::set-output name=DoxygenError::No package affected."
echo "DoxygenError=No package affected." >> $GITHUB_OUTPUT
exit 1
fi
cd build_doc && make -j2 doc
make -j2 doc_with_postprocessing 2>tmp.log
if [ -s tmp.log ]; then
content=`cat ./tmp.log`
echo "::set-output name=DoxygenError::$(cat tmp.log)"
delimiter="$(openssl rand -hex 8)"
echo "DoxygenError<<${delimiter}" >> "${GITHUB_OUTPUT}"
cat tmp.log >> "${GITHUB_OUTPUT}"
echo "${delimiter}" >> "${GITHUB_OUTPUT}"
exit 1
fi
cd ..
@ -117,7 +130,7 @@ jobs:
mv tmp.html index.html
git add ${PR_NUMBER}/$ROUND index.html && git commit -q --amend -m "base commit" && git push -q -f -u origin master
else
echo "::set-output name=DoxygenError::This round already exists. Overwrite it with /force-build."
echo "DoxygenError=This round already exists. Overwrite it with /force-build." >> $GITHUB_OUTPUT
exit 1
fi

View File

@ -527,7 +527,6 @@ private:
{
CGAL::Timer timer;
timer.start();
int nb_test = 0;
while ( timer.time() < duration )
{
Point a = random_point_in<K>(m_tree.bbox());
@ -539,8 +538,6 @@ private:
test(segment, m_polyhedron, m_tree, m_naive);
test(ray, m_polyhedron, m_tree, m_naive);
test(line, m_polyhedron, m_tree, m_naive);
++nb_test;
}
timer.stop();

View File

@ -23,7 +23,6 @@
#include <CGAL/assertions.h>
#include <CGAL/basic.h>
#include <CGAL/triangulation_assertions.h>
#include <CGAL/Unique_hash_map.h>
#include <CGAL/utility.h>
@ -849,7 +848,7 @@ Alpha_shape_2<Dt,EACT>::initialize_interval_edge_map()
{
// both faces are infinite by definition unattached
// the edge is finite by construction
CGAL_triangulation_precondition((is_infinite(pNeighbor)
CGAL_precondition((is_infinite(pNeighbor)
&& is_infinite(pFace)));
interval = make_triple(squared_radius(pFace, i),
Infinity,
@ -859,7 +858,7 @@ Alpha_shape_2<Dt,EACT>::initialize_interval_edge_map()
else
{ // is_infinite(pNeighbor)
CGAL_triangulation_precondition((is_infinite(pNeighbor)
CGAL_precondition((is_infinite(pNeighbor)
&& !is_infinite(pFace)));
if (is_attached(pFace, i))
interval = make_triple(UNDEFINED,
@ -1109,7 +1108,7 @@ Alpha_shape_2<Dt,EACT>::update_alpha_shape_vertex_list()const {
// which might be infinity
// write the vertex
v = (*vertex_alpha_it).second;
CGAL_triangulation_assertion((classify(v) == REGULAR));
CGAL_assertion((classify(v) == REGULAR));
Alpha_shape_vertices_list.push_back(v);
}
}
@ -1122,7 +1121,7 @@ Alpha_shape_2<Dt,EACT>::update_alpha_shape_vertex_list()const {
++vertex_alpha_it)
{
v = (*vertex_alpha_it).second;
CGAL_triangulation_assertion((classify(v) == SINGULAR));
CGAL_assertion((classify(v) == SINGULAR));
Alpha_shape_vertices_list.push_back(v);
}
@ -1159,7 +1158,7 @@ Alpha_shape_2<Dt,EACT>::update_alpha_shape_edges_list() const
{
pInterval = &(*edge_alpha_it).first;
CGAL_triangulation_assertion(pInterval->second != Infinity);
CGAL_assertion(pInterval->second != Infinity);
// since this happens only for convex hull of dimension 2
// thus singular
@ -1171,9 +1170,9 @@ Alpha_shape_2<Dt,EACT>::update_alpha_shape_edges_list() const
// and alpha is smaller than the upper boundary
// which might be infinity
// visualize the boundary
CGAL_triangulation_assertion((classify((*edge_alpha_it).second.first,
(*edge_alpha_it).second.second)
== REGULAR));
CGAL_assertion((classify((*edge_alpha_it).second.first,
(*edge_alpha_it).second.second)
== REGULAR));
Alpha_shape_edges_list.push_back(Edge((*edge_alpha_it).second.first,
(*edge_alpha_it).second.second));
}
@ -1191,7 +1190,7 @@ Alpha_shape_2<Dt,EACT>::update_alpha_shape_edges_list() const
if (pInterval->first == UNDEFINED)
{
CGAL_triangulation_assertion(pInterval->second != Infinity);
CGAL_assertion(pInterval->second != Infinity);
// since this happens only for convex hull of dimension 2
// thus singular
@ -1203,9 +1202,9 @@ Alpha_shape_2<Dt,EACT>::update_alpha_shape_edges_list() const
// and alpha is smaller than the upper boundary
// which might be infinity
// visualize the boundary
CGAL_triangulation_assertion((classify((*edge_alpha_it).second.first,
(*edge_alpha_it).second.second)
== REGULAR));
CGAL_assertion((classify((*edge_alpha_it).second.first,
(*edge_alpha_it).second.second)
== REGULAR));
Alpha_shape_edges_list.push_back(Edge((*edge_alpha_it).second.first,
(*edge_alpha_it).second.second));
}
@ -1219,12 +1218,12 @@ Alpha_shape_2<Dt,EACT>::update_alpha_shape_edges_list() const
// if alpha is smaller than the upper boundary
// which might be infinity
// visualize the boundary
CGAL_triangulation_assertion(((classify((*edge_alpha_it).second.first,
(*edge_alpha_it).second.second)
== REGULAR)
|| (classify((*edge_alpha_it).second.first,
CGAL_assertion(((classify((*edge_alpha_it).second.first,
(*edge_alpha_it).second.second)
== SINGULAR)));
== REGULAR)
|| (classify((*edge_alpha_it).second.first,
(*edge_alpha_it).second.second)
== SINGULAR)));
Alpha_shape_edges_list.push_back(Edge((*edge_alpha_it).second.first,
(*edge_alpha_it).second.second));
}
@ -1324,7 +1323,7 @@ Alpha_shape_2<Dt,EACT>::number_of_solid_components(const Type_of_alpha& alpha) c
++face_it)
{
Face_handle pFace = face_it;
CGAL_triangulation_postcondition( pFace != nullptr);
CGAL_postcondition( pFace != nullptr);
if (classify(pFace, alpha) == INTERIOR){
Data& data = marked_face_set[pFace];
@ -1358,7 +1357,7 @@ Alpha_shape_2<Dt,EACT>::traverse(const Face_handle& pFace,
for (int i=0; i<3; i++)
{
pNeighbor = fh->neighbor(i);
CGAL_triangulation_assertion(pNeighbor != nullptr);
CGAL_assertion(pNeighbor != nullptr);
if (classify(pNeighbor, alpha) == INTERIOR){
Data& data = marked_face_set[pNeighbor];
if(data == false){
@ -1514,7 +1513,7 @@ Alpha_shape_2<Dt,EACT>::op_ostream(std::ostream& os) const
// write the vertex
v = (*vertex_alpha_it).second;
CGAL_triangulation_assertion((classify(v) ==
CGAL_assertion((classify(v) ==
Alpha_shape_2<Dt,EACT>::REGULAR));
// if we used Edelsbrunner and Muecke's definition
// regular means incident to a higher-dimensional face
@ -1536,7 +1535,7 @@ Alpha_shape_2<Dt,EACT>::op_ostream(std::ostream& os) const
{
pInterval = &(*edge_alpha_it).first;
CGAL_triangulation_assertion(pInterval->second != Infinity);
CGAL_assertion(pInterval->second != Infinity);
// since this happens only for convex hull of dimension 1
// thus singular
@ -1563,11 +1562,11 @@ Alpha_shape_2<Dt,EACT>::op_ostream(std::ostream& os) const
f = pNeighbor;
}
CGAL_triangulation_assertion((classify(f) ==
Alpha_shape_2<Dt,EACT>::INTERIOR));
CGAL_assertion((classify(f) ==
Alpha_shape_2<Dt,EACT>::INTERIOR));
CGAL_triangulation_assertion((classify(f, i) ==
Alpha_shape_2<Dt,EACT>::REGULAR));
CGAL_assertion((classify(f, i) ==
Alpha_shape_2<Dt,EACT>::REGULAR));
os << V[f->vertex(f->ccw(i))] << ' '
<< V[f->vertex(f->cw(i))] << std::endl;
@ -1595,8 +1594,7 @@ Alpha_shape_2<Dt,EACT>::op_ostream(std::ostream& os) const
// write the vertex
v = (*vertex_alpha_it).second;
CGAL_triangulation_assertion((classify(v) ==
Alpha_shape_2<Dt,EACT>::REGULAR));
CGAL_assertion((classify(v) == Alpha_shape_2<Dt,EACT>::REGULAR));
V[v] = number_of_vertices++;
os << v->point() << std::endl;
}
@ -1608,8 +1606,7 @@ Alpha_shape_2<Dt,EACT>::op_ostream(std::ostream& os) const
++vertex_alpha_it)
{
v = (*vertex_alpha_it).second;
CGAL_triangulation_assertion((classify(v) ==
Alpha_shape_2<Dt,EACT>::SINGULAR));
CGAL_assertion((classify(v) == Alpha_shape_2<Dt,EACT>::SINGULAR));
V[v] = number_of_vertices++;
os << v->point() << std::endl;
@ -1652,7 +1649,7 @@ Alpha_shape_2<Dt,EACT>::op_ostream(std::ostream& os) const
if (pInterval->second != Infinity &&
pInterval->second <= get_alpha())
{
CGAL_triangulation_assertion((classify(f, i) ==
CGAL_assertion((classify(f, i) ==
Alpha_shape_2<Dt,EACT>::REGULAR));
// assure that all vertices are in ccw order
if (classify(f) == Alpha_shape_2<Dt,EACT>::EXTERIOR)
@ -1665,7 +1662,7 @@ Alpha_shape_2<Dt,EACT>::op_ostream(std::ostream& os) const
f = pNeighbor;
}
CGAL_triangulation_assertion((classify(f) ==
CGAL_assertion((classify(f) ==
Alpha_shape_2<Dt,EACT>::INTERIOR));
os << V[f->vertex(f->ccw(i))] << ' '
@ -1680,7 +1677,7 @@ Alpha_shape_2<Dt,EACT>::op_ostream(std::ostream& os) const
// write the singular edges
if (pInterval->first != UNDEFINED)
{
CGAL_triangulation_assertion((classify(f, i) ==
CGAL_assertion((classify(f, i) ==
Alpha_shape_2<Dt,EACT>::SINGULAR));
os << V[f->vertex(f->ccw(i))] << ' '
<< V[f->vertex(f->cw(i))] << std::endl;
@ -1739,7 +1736,7 @@ Alpha_shape_2<Dt,EACT>::Output ()
// which might be infinity
// visualize the boundary
CGAL_triangulation_assertion((classify((*edge_alpha_it).second.first,
CGAL_assertion((classify((*edge_alpha_it).second.first,
(*edge_alpha_it).second.second) ==
REGULAR));
@ -1769,7 +1766,7 @@ Alpha_shape_2<Dt,EACT>::Output ()
if (pInterval->first == UNDEFINED)
{
CGAL_triangulation_assertion(pInterval->second != Infinity);
CGAL_assertion(pInterval->second != Infinity);
// since this happens only for convex hull of dimension 1
// thus singular
@ -1782,9 +1779,9 @@ Alpha_shape_2<Dt,EACT>::Output ()
// which might be infinity
// visualize the boundary
CGAL_triangulation_assertion((classify((*edge_alpha_it).second.first,
(*edge_alpha_it).second.second) ==
REGULAR));
CGAL_assertion((classify((*edge_alpha_it).second.first,
(*edge_alpha_it).second.second) ==
REGULAR));
L.push_back((this->segment((*edge_alpha_it).second.first,
(*edge_alpha_it).second.second))
.source());
@ -1802,12 +1799,12 @@ Alpha_shape_2<Dt,EACT>::Output ()
// which might be infinity
// visualize the boundary
CGAL_triangulation_assertion(((classify((*edge_alpha_it).second.first,
(*edge_alpha_it).second.second) ==
REGULAR) ||
(classify((*edge_alpha_it).second.first,
(*edge_alpha_it).second.second) ==
SINGULAR)));
CGAL_assertion(((classify((*edge_alpha_it).second.first,
(*edge_alpha_it).second.second) ==
REGULAR) ||
(classify((*edge_alpha_it).second.first,
(*edge_alpha_it).second.second) ==
SINGULAR)));
L.push_back((this->segment((*edge_alpha_it).second.first,
(*edge_alpha_it).second.second))
.source());

View File

@ -401,7 +401,7 @@ public:
// Returns the n-th alpha-value.
// n < size()
{
CGAL_triangulation_assertion( n > 0 &&
CGAL_assertion( n > 0 &&
n <= static_cast<int>(alpha_spectrum.size()) );
return alpha_spectrum[n-1];
}
@ -1713,7 +1713,7 @@ Alpha_shape_3<Dt,EACT>::number_of_solid_components(const NT& alpha) const
for( cell_it = finite_cells_begin(); cell_it != done; ++cell_it)
{
Cell_handle pCell = cell_it;
CGAL_triangulation_assertion(pCell != nullptr);
CGAL_assertion(pCell != nullptr);
if (classify(pCell, alpha) == INTERIOR){
Data& data = marked_cell_set[pCell];
@ -1745,7 +1745,7 @@ void Alpha_shape_3<Dt,EACT>::traverse(Cell_handle pCell,
for (int i=0; i<=3; i++)
{
pNeighbor = pCell->neighbor(i);
CGAL_triangulation_assertion(pNeighbor != nullptr);
CGAL_assertion(pNeighbor != nullptr);
if (classify(pNeighbor, alpha) == INTERIOR){
Data& data = marked_cell_set[pNeighbor];
if(data == false){

View File

@ -47,16 +47,9 @@ int main(int argc, char** argv)
const double offset = diag_length / relative_offset;
// Construct the wrap
using Oracle = CGAL::Alpha_wraps_3::internal::Triangle_mesh_oracle<K>;
Oracle oracle;
oracle.add_triangle_mesh(input);
CGAL::Real_timer t;
t.start();
Mesh wrap;
CGAL::Alpha_wraps_3::internal::Alpha_wrap_3<Oracle> aw3(oracle);
// There is no limit on how many seeds can be used.
// However, the algorithm automatically determines whether a seed can be used
// to initialize the refinement based on a few conditions (distance to the offset, value of alpha, etc.)
@ -66,7 +59,8 @@ int main(int argc, char** argv)
Point_3(0, 50, 0) // a point within the armadillo surface
};
aw3(alpha, offset, wrap, CGAL::parameters::seed_points(std::ref(seeds)));
Mesh wrap;
alpha_wrap_3(input, alpha, offset, wrap, CGAL::parameters::seed_points(std::ref(seeds)));
t.stop();
std::cout << "Result: " << num_vertices(wrap) << " vertices, " << num_faces(wrap) << " faces" << std::endl;

View File

@ -29,7 +29,7 @@
#include <CGAL/license/Alpha_wrap_3.h>
#include <CGAL/Alpha_wrap_3/internal/Alpha_wrap_AABB_traits.h>
#include <CGAL/Alpha_wrap_3/internal/Alpha_wrap_AABB_geom_traits.h>
#include <CGAL/Alpha_wrap_3/internal/gate_priority_queue.h>
#include <CGAL/Alpha_wrap_3/internal/geometry_utils.h>
#include <CGAL/Alpha_wrap_3/internal/oracles.h>
@ -229,11 +229,14 @@ private:
}
public:
template <typename OutputMesh, typename NamedParameters>
template <typename OutputMesh,
typename InputNamedParameters = parameters::Default_named_parameters,
typename OutputNamedParameters = parameters::Default_named_parameters>
void operator()(const double alpha, // = default_alpha()
const double offset, // = alpha / 30.
OutputMesh& output_mesh,
const NamedParameters& np)
const InputNamedParameters& in_np = parameters::default_values(),
const OutputNamedParameters& out_np = parameters::default_values())
{
namespace PMP = Polygon_mesh_processing;
@ -241,25 +244,25 @@ public:
using parameters::get_parameter_reference;
using parameters::choose_parameter;
using OVPM = typename CGAL::GetVertexPointMap<OutputMesh, NamedParameters>::type;
OVPM ovpm = choose_parameter(get_parameter(np, internal_np::vertex_point),
using OVPM = typename CGAL::GetVertexPointMap<OutputMesh, OutputNamedParameters>::type;
OVPM ovpm = choose_parameter(get_parameter(out_np, internal_np::vertex_point),
get_property_map(vertex_point, output_mesh));
typedef typename internal_np::Lookup_named_param_def <
internal_np::visitor_t,
NamedParameters,
InputNamedParameters,
Wrapping_default_visitor // default
>::reference Visitor;
Wrapping_default_visitor default_visitor;
Visitor visitor = choose_parameter(get_parameter_reference(np, internal_np::visitor), default_visitor);
Visitor visitor = choose_parameter(get_parameter_reference(in_np, internal_np::visitor), default_visitor);
std::vector<Point_3> no_seeds;
using Seeds = typename internal_np::Lookup_named_param_def<
internal_np::seed_points_t, NamedParameters, std::vector<Point_3> >::reference;
Seeds seeds = choose_parameter(get_parameter_reference(np, internal_np::seed_points), no_seeds);
internal_np::seed_points_t, InputNamedParameters, std::vector<Point_3> >::reference;
Seeds seeds = choose_parameter(get_parameter_reference(in_np, internal_np::seed_points), no_seeds);
const bool do_enforce_manifoldness = choose_parameter(get_parameter(np, internal_np::do_enforce_manifoldness), true);
const bool do_enforce_manifoldness = choose_parameter(get_parameter(in_np, internal_np::do_enforce_manifoldness), true);
#ifdef CGAL_AW3_TIMER
CGAL::Real_timer t;
@ -360,14 +363,6 @@ public:
}
// Convenience overloads
template <typename OutputMesh>
void operator()(const double alpha,
const double offset,
OutputMesh& output_mesh)
{
return operator()(alpha, offset, output_mesh, parameters::default_values());
}
template <typename OutputMesh>
void operator()(const double alpha,
OutputMesh& output_mesh)

View File

@ -13,8 +13,8 @@
// Andreas Fabri
// Michael Hemmer
//
#ifndef CGAL_ALPHA_WRAP_3_INTERNAL_ALPHA_WRAP_AABB_TRAITS_H
#define CGAL_ALPHA_WRAP_3_INTERNAL_ALPHA_WRAP_AABB_TRAITS_H
#ifndef CGAL_ALPHA_WRAP_3_INTERNAL_ALPHA_WRAP_AABB_GEOM_TRAITS_H
#define CGAL_ALPHA_WRAP_3_INTERNAL_ALPHA_WRAP_AABB_GEOM_TRAITS_H
#include <CGAL/license/Alpha_wrap_3.h>
@ -89,14 +89,14 @@ public:
};
template <typename GT>
class Alpha_wrap_AABB_traits
class Alpha_wrap_AABB_geom_traits
: public GT
{
public:
using Ball_3 = internal::Ball_3<GT>;
public:
Alpha_wrap_AABB_traits(const GT& gt = GT()) : GT(gt) { }
Alpha_wrap_AABB_geom_traits(const GT& gt = GT()) : GT(gt) { }
public:
class Construct_ball_3
@ -295,4 +295,4 @@ public:
} // namespace Alpha_wraps_3
} // namespace CGAL
#endif // CGAL_ALPHA_WRAP_3_INTERNAL_ALPHA_WRAP_AABB_TRAITS_H
#endif // CGAL_ALPHA_WRAP_3_INTERNAL_ALPHA_WRAP_AABB_GEOM_TRAITS_H

View File

@ -14,7 +14,7 @@
#include <CGAL/license/Alpha_wrap_3.h>
#include <CGAL/Alpha_wrap_3/internal/Alpha_wrap_AABB_traits.h>
#include <CGAL/Alpha_wrap_3/internal/Alpha_wrap_AABB_geom_traits.h>
#include <CGAL/Alpha_wrap_3/internal/Oracle_base.h>
#include <CGAL/AABB_primitive.h>
@ -38,7 +38,7 @@ namespace internal {
template <typename GT_>
struct PS_oracle_traits
{
using Geom_traits = Alpha_wrap_AABB_traits<GT_>; // Wrap the kernel to add Ball_3 + custom Do_intersect_3
using Geom_traits = Alpha_wrap_AABB_geom_traits<GT_>; // Wrap the kernel to add Ball_3 + custom Do_intersect_3
using Points = std::vector<typename GT_::Point_3>;
using PR_iterator = typename Points::const_iterator;

View File

@ -14,7 +14,7 @@
#include <CGAL/license/Alpha_wrap_3.h>
#include <CGAL/Alpha_wrap_3/internal/Alpha_wrap_AABB_traits.h>
#include <CGAL/Alpha_wrap_3/internal/Alpha_wrap_AABB_geom_traits.h>
#include <CGAL/Alpha_wrap_3/internal/Oracle_base.h>
#include <CGAL/AABB_traits.h>
@ -38,7 +38,7 @@ namespace internal {
template <typename GT_>
struct SS_oracle_traits
{
using Geom_traits = Alpha_wrap_AABB_traits<GT_>; // Wrap the kernel to add Ball_3 + custom Do_intersect_3
using Geom_traits = Alpha_wrap_AABB_geom_traits<GT_>; // Wrap the kernel to add Ball_3 + custom Do_intersect_3
using Segments = std::vector<typename GT_::Segment_3>;
using SR_iterator = typename Segments::const_iterator;

View File

@ -14,7 +14,7 @@
#include <CGAL/license/Alpha_wrap_3.h>
#include <CGAL/Alpha_wrap_3/internal/Alpha_wrap_AABB_traits.h>
#include <CGAL/Alpha_wrap_3/internal/Alpha_wrap_AABB_geom_traits.h>
#include <CGAL/Alpha_wrap_3/internal/Oracle_base.h>
#include <CGAL/Alpha_wrap_3/internal/splitting_helper.h>
@ -37,7 +37,7 @@ namespace internal {
template <typename GT_>
struct TM_oracle_traits
{
using Geom_traits = Alpha_wrap_AABB_traits<GT_>; // Wrap the kernel to add Ball_3 + custom Do_intersect_3
using Geom_traits = Alpha_wrap_AABB_geom_traits<GT_>; // Wrap the kernel to add Ball_3 + custom Do_intersect_3
using Point_3 = typename Geom_traits::Point_3;
using AABB_traits = typename AABB_tree_splitter_traits<Point_3, Geom_traits>::AABB_traits;

View File

@ -14,7 +14,7 @@
#include <CGAL/license/Alpha_wrap_3.h>
#include <CGAL/Alpha_wrap_3/internal/Alpha_wrap_AABB_traits.h>
#include <CGAL/Alpha_wrap_3/internal/Alpha_wrap_AABB_geom_traits.h>
#include <CGAL/Alpha_wrap_3/internal/Oracle_base.h>
#include <CGAL/Alpha_wrap_3/internal/splitting_helper.h>
@ -38,7 +38,7 @@ namespace internal {
template <typename GT_>
struct TS_oracle_traits
{
using Geom_traits = Alpha_wrap_AABB_traits<GT_>; // Wrap the kernel to add Ball_3 + custom Do_intersect_3
using Geom_traits = Alpha_wrap_AABB_geom_traits<GT_>; // Wrap the kernel to add Ball_3 + custom Do_intersect_3
using Point_3 = typename Geom_traits::Point_3;
using AABB_traits = typename AABB_tree_splitter_traits<Point_3, Geom_traits>::AABB_traits;
using AABB_tree = typename AABB_tree_splitter_traits<Point_3, Geom_traits>::AABB_tree;

View File

@ -14,7 +14,7 @@
#include <CGAL/license/Alpha_wrap_3.h>
#include <CGAL/Alpha_wrap_3/internal/Alpha_wrap_AABB_traits.h>
#include <CGAL/Alpha_wrap_3/internal/Alpha_wrap_AABB_geom_traits.h>
#include <CGAL/Alpha_wrap_3/internal/offset_intersection.h>
#include <CGAL/Alpha_wrap_3/internal/Triangle_mesh_oracle.h>

View File

@ -14,7 +14,7 @@
#include <CGAL/license/Alpha_wrap_3.h>
#include <CGAL/Alpha_wrap_3/internal/Alpha_wrap_AABB_traits.h>
#include <CGAL/Alpha_wrap_3/internal/Alpha_wrap_AABB_geom_traits.h>
#include <CGAL/AABB_tree/internal/AABB_traversal_traits.h>
#include <CGAL/AABB_primitive.h>

View File

@ -112,7 +112,7 @@ void alpha_wrap_3(const PointRange& points,
Oracle oracle(alpha, gt);
oracle.add_triangle_soup(points, faces, in_np);
AW3 alpha_wrap_builder(oracle);
alpha_wrap_builder(alpha, offset, alpha_wrap, out_np);
alpha_wrap_builder(alpha, offset, alpha_wrap, in_np, out_np);
}
// Convenience overloads
@ -261,7 +261,7 @@ void alpha_wrap_3(const TriangleMesh& tmesh,
Oracle oracle(alpha, gt);
oracle.add_triangle_mesh(tmesh, in_np);
AW3 alpha_wrap_builder(oracle);
alpha_wrap_builder(alpha, offset, alpha_wrap, out_np);
alpha_wrap_builder(alpha, offset, alpha_wrap, in_np, out_np);
}
// The convenience overloads are the same for triangle mesh & point set
@ -357,7 +357,7 @@ void alpha_wrap_3(const PointRange& points,
Oracle oracle(gt);
oracle.add_point_set(points, in_np);
AW3 alpha_wrap_builder(oracle);
alpha_wrap_builder(alpha, offset, alpha_wrap, out_np);
alpha_wrap_builder(alpha, offset, alpha_wrap, in_np, out_np);
}
// Convenience overloads, common to both mesh and point set

View File

@ -45,7 +45,6 @@ void alpha_wrap_triangle_manifoldness(Mesh& input_mesh,
Mesh nm_wrap;
CGAL::alpha_wrap_3(input_mesh, alpha, offset, nm_wrap,
CGAL::parameters::default_values(),
CGAL::parameters::do_enforce_manifoldness(false));
std::cout << "Result: " << vertices(nm_wrap).size() << " vertices, " << faces(nm_wrap).size() << " faces" << std::endl;
@ -67,7 +66,6 @@ void alpha_wrap_triangle_manifoldness(Mesh& input_mesh,
Mesh m_wrap;
CGAL::alpha_wrap_3(input_mesh, alpha, offset, m_wrap,
CGAL::parameters::default_values(),
CGAL::parameters::do_enforce_manifoldness(true));
// CGAL::IO::write_polygon_mesh("last.off", wrap, CGAL::parameters::stream_precision(17));

View File

@ -47,7 +47,6 @@ void alpha_wrap_triangle_mesh(Mesh& input_mesh,
Mesh wrap;
CGAL::alpha_wrap_3(input_mesh, alpha, offset, wrap,
CGAL::parameters::default_values(),
CGAL::parameters::do_enforce_manifoldness(enforce_manifoldness));
std::cout << "Result: " << vertices(wrap).size() << " vertices, " << faces(wrap).size() << " faces" << std::endl;

View File

@ -53,7 +53,7 @@ is_valid(bool verbose, int level) const
if (number_of_vertices() < 3) return true;
// CGAL_triangulation_assertion(result);
// CGAL_assertion(result);
for (All_edges_iterator eit = all_edges_begin();
eit != all_edges_end(); ++eit) {
@ -64,7 +64,7 @@ is_valid(bool verbose, int level) const
if ( !is_infinite(v) ) {
result = result &&
( incircle(f, v->site()) != NEGATIVE );
// CGAL_triangulation_assertion(result);
// CGAL_assertion(result);
}
Edge sym_e = sym_edge(e);
f = sym_e.first;
@ -72,7 +72,7 @@ is_valid(bool verbose, int level) const
if ( !is_infinite(v) ) {
result = result &&
( incircle(f, v->site()) != NEGATIVE );
// CGAL_triangulation_assertion(result);
// CGAL_assertion(result);
}
}
@ -83,7 +83,7 @@ is_valid(bool verbose, int level) const
std::cerr << "Apollonius diagram is NOT valid..." << std::flush;
}
// CGAL_triangulation_assertion(result);
// CGAL_assertion(result);
return result;
}
@ -100,7 +100,7 @@ typename Apollonius_graph_2<Gt,Agds,LTag>::Point_2
Apollonius_graph_2<Gt,Agds,LTag>::
circumcenter(const Face_handle& f) const
{
CGAL_triangulation_precondition (dimension()==2 || !is_infinite(f));
CGAL_precondition (dimension()==2 || !is_infinite(f));
return circumcenter(f->vertex(0)->site(),
f->vertex(1)->site(),
f->vertex(2)->site());
@ -122,7 +122,7 @@ typename Apollonius_graph_2<Gt,Agds,LTag>::Site_2
Apollonius_graph_2<Gt,Agds,LTag>::
circumcircle(const Face_handle& f) const
{
CGAL_triangulation_precondition (dimension()==2 || !is_infinite(f));
CGAL_precondition (dimension()==2 || !is_infinite(f));
return circumcircle(f->vertex(0)->site(),
f->vertex(1)->site(),
f->vertex(2)->site());
@ -178,7 +178,7 @@ typename Gt::Object_2
Apollonius_graph_2<Gt,Agds,LTag>::
dual(const Edge e) const
{
CGAL_triangulation_precondition( !is_infinite(e) );
CGAL_precondition( !is_infinite(e) );
if ( dimension() == 1 ) {
Site_2 p = (e.first)->vertex(cw(e.second))->site();
@ -207,16 +207,16 @@ dual(const Edge e) const
}
// only one of the adjacent faces is infinite
CGAL_triangulation_assertion( is_infinite( e.first ) ||
CGAL_assertion( is_infinite( e.first ) ||
is_infinite( e.first->neighbor(e.second) )
);
CGAL_triangulation_assertion( !(is_infinite( e.first ) &&
CGAL_assertion( !(is_infinite( e.first ) &&
is_infinite( e.first->neighbor(e.second) )
)
);
CGAL_triangulation_assertion
CGAL_assertion
( is_infinite( e.first->vertex(e.second) ) ||
is_infinite( tds().mirror_vertex(e.first, e.second) ) );
@ -246,7 +246,7 @@ primal(const Edge e) const
// typedef typename Geom_traits::Hyperbola_segment_2 Hyperbola_segment;
// typedef typename Geom_traits::Parabola_segment_2 Parabola_segment;
// CGAL_triangulation_precondition( !is_infinite(e) );
// CGAL_precondition( !is_infinite(e) );
if ( number_of_vertices() != 2 ) {
if ( is_infinite(e) ) {
@ -257,7 +257,7 @@ primal(const Edge e) const
Site_2 s = tds().mirror_vertex( e.first, e.second )->site();
ray = construct_Apollonius_primal_ray_2_object()(p,r,s);
} else {
CGAL_triangulation_assertion
CGAL_assertion
( is_infinite( e.first->vertex(ccw(e.second)) ) );
Site_2 q = e.first->vertex( cw(e.second) )->site();
Site_2 r = e.first->vertex( e.second )->site();
@ -317,11 +317,11 @@ typename Apollonius_graph_2<Gt,Agds,LTag>::Edge
Apollonius_graph_2<Gt,Agds,LTag>::
flip(Face_handle& f, int i)
{
CGAL_triangulation_precondition ( f != Face_handle() );
CGAL_triangulation_precondition (i == 0 || i == 1 || i == 2);
CGAL_triangulation_precondition( dimension()==2 );
CGAL_precondition ( f != Face_handle() );
CGAL_precondition (i == 0 || i == 1 || i == 2);
CGAL_precondition( dimension()==2 );
CGAL_triangulation_precondition( f->vertex(i) != tds().mirror_vertex(f,i) );
CGAL_precondition( f->vertex(i) != tds().mirror_vertex(f,i) );
this->_tds.flip(f, i);
@ -383,7 +383,7 @@ void
Apollonius_graph_2<Gt,Agds,LTag>::
remove_degree_2(Vertex_handle v)
{
CGAL_triangulation_precondition( is_degree_2(v) );
CGAL_precondition( is_degree_2(v) );
this->_tds.remove_degree_2( v );
}
@ -403,7 +403,7 @@ void
Apollonius_graph_2<Gt,Agds,LTag>::
remove_degree_3(Vertex_handle v, Face_handle f)
{
CGAL_triangulation_precondition( degree(v) == 3 );
CGAL_precondition( degree(v) == 3 );
this->_tds.remove_degree_3(v, f);
}
@ -416,7 +416,7 @@ typename Apollonius_graph_2<Gt,Agds,LTag>::Vertex_handle
Apollonius_graph_2<Gt,Agds,LTag>::
insert_first(const Site_2& p)
{
CGAL_triangulation_precondition(number_of_vertices() == 0);
CGAL_precondition(number_of_vertices() == 0);
Vertex_handle v = this->_tds.insert_second();
v->set_site(p);
return v;
@ -428,7 +428,7 @@ typename Apollonius_graph_2<Gt,Agds,LTag>::Vertex_handle
Apollonius_graph_2<Gt,Agds,LTag>::
insert_second(const Site_2& p)
{
CGAL_triangulation_precondition( number_of_vertices() == 1 );
CGAL_precondition( number_of_vertices() == 1 );
Vertex_handle vnew;
Vertex_handle v(finite_vertices_begin());
if ( is_hidden(v->site(), p) ) {
@ -439,7 +439,7 @@ insert_second(const Site_2& p)
v->set_site(p);
vnew = v;
} else {
CGAL_triangulation_precondition(number_of_vertices() == 1);
CGAL_precondition(number_of_vertices() == 1);
vnew = this->_tds.insert_dim_up(infinite_vertex(), true);
vnew->set_site(p);
// vnew = Delaunay_graph::insert_second(p);
@ -453,7 +453,7 @@ typename Apollonius_graph_2<Gt,Agds,LTag>::Vertex_handle
Apollonius_graph_2<Gt,Agds,LTag>::
insert_third(const Site_2& p)
{
CGAL_triangulation_precondition( number_of_vertices() == 2 );
CGAL_precondition( number_of_vertices() == 2 );
Face_handle f((*finite_edges_begin()).first);
Vertex_handle v1(f->vertex(0));
@ -592,7 +592,7 @@ insert_third(const Site_2& p)
}
}
// CGAL_triangulation_assertion( is_valid() );
// CGAL_assertion( is_valid() );
return v;
}
@ -1752,8 +1752,8 @@ void
Apollonius_graph_2<Gt,Agds,LTag>::
remove(Vertex_handle v)
{
CGAL_triangulation_precondition( v != Vertex_handle() );
CGAL_triangulation_precondition( !is_infinite(v) );
CGAL_precondition( v != Vertex_handle() );
CGAL_precondition( !is_infinite(v) );
// find a neighbor of v to use for point location of hidden sites to
// be re-inserted
@ -1900,7 +1900,7 @@ remove_degree_d_vertex(Vertex_handle v)
CGAL_assertion( found );
CGAL_USE(found);
}
CGAL_triangulation_precondition( degree(v) == 3 );
CGAL_precondition( degree(v) == 3 );
this->_tds.remove_degree_3( v, Face_handle() );

View File

@ -332,8 +332,8 @@ void
Apollonius_graph_hierarchy_2<Gt,Agds,LTag>::
remove(Vertex_handle v)
{
CGAL_triangulation_precondition( v != Vertex_handle());
CGAL_triangulation_precondition( !is_infinite(v));
CGAL_precondition( v != Vertex_handle());
CGAL_precondition( !is_infinite(v));
// get the hidden circles
typename Apollonius_graph_base::Site_list wp_list;

View File

@ -19,7 +19,6 @@
#include <list>
#include <CGAL/Triangulation_ds_vertex_base_2.h>
#include <CGAL/triangulation_assertions.h>
namespace CGAL {

View File

@ -48,12 +48,10 @@ ArrangementPainterOstream<CGAL::Arr_polyline_traits_2<SegmentTraits>>&
ArrangementPainterOstream<CGAL::Arr_polyline_traits_2<SegmentTraits>>::
operator<<(const X_monotone_curve_2& curve)
{
int cnt = 0;
for (typename X_monotone_curve_2::Subcurve_const_iterator it =
curve.subcurves_begin();
it != curve.subcurves_end(); ++it)
{
cnt++;
this->painterOstream << *it;
}
@ -200,7 +198,6 @@ ArrangementPainterOstream<CGAL::Arr_conic_traits_2<
auto p_curr = app_pts.begin();
auto end_pts = app_pts.end();
auto p_next = p_curr + 1;
int count = 0;
do
{
QPointF p1(p_curr->first, p_curr->second);
@ -208,7 +205,6 @@ ArrangementPainterOstream<CGAL::Arr_conic_traits_2<
this->qp->drawLine(p1, p2);
p_curr++;
p_next++;
++count;
} while (p_next != end_pts);
};

View File

@ -38,11 +38,12 @@ typename boost::graph_traits<Graph>::halfedge_descriptor
join_face(typename boost::graph_traits<Graph>::halfedge_descriptor h,
Graph& g)
{
typedef typename boost::graph_traits<Graph> Traits;
typedef typename boost::graph_traits<Graph> Traits;
typedef typename Traits::halfedge_descriptor halfedge_descriptor;
typedef typename Traits::face_descriptor face_descriptor;
CGAL_precondition(is_valid_halfedge_descriptor(h, g));
halfedge_descriptor hop = opposite(h,g);
halfedge_descriptor hprev = prev(h, g), gprev = prev(hop, g);
@ -73,17 +74,17 @@ join_face(typename boost::graph_traits<Graph>::halfedge_descriptor h,
remove_edge(edge(h, g), g);
return hprev;
}
} // namespace EulerImpl
/// \endcond
namespace Euler {
namespace Euler {
/// \ingroup PkgBGLEulerOperations
/// @{
/**
* joins the two vertices incident to `h`, (that is `source(h, g)` and
* `target(h, g)`) and removes `source(h,g)`. Returns the predecessor
@ -117,6 +118,8 @@ join_vertex(typename boost::graph_traits<Graph>::halfedge_descriptor h,
typedef typename Traits::vertex_descriptor vertex_descriptor;
typedef Halfedge_around_target_iterator<Graph> halfedge_around_vertex_iterator;
CGAL_precondition(is_valid_halfedge_descriptor(h, g));
halfedge_descriptor hop = opposite(h, g)
, hprev = prev(hop, g)
, gprev = prev(h, g)
@ -191,8 +194,9 @@ split_vertex(typename boost::graph_traits<Graph>::halfedge_descriptor h1,
typename boost::graph_traits<Graph>::halfedge_descriptor h2,
Graph& g)
{
CGAL_assertion(h1 != h2);
CGAL_assertion(target(h1, g) == target(h2, g));
CGAL_precondition(is_valid_halfedge_descriptor(h1, g) && is_valid_halfedge_descriptor(h2, g));
CGAL_precondition(h1 != h2);
CGAL_precondition(target(h1, g) == target(h2, g));
typename boost::graph_traits<Graph>::halfedge_descriptor
hnew = halfedge(add_edge(g), g),
@ -226,8 +230,11 @@ split_vertex(typename boost::graph_traits<Graph>::halfedge_descriptor h1,
template<typename Graph>
typename boost::graph_traits<Graph>::halfedge_descriptor
split_edge(typename boost::graph_traits<Graph>::halfedge_descriptor h, Graph& g)
{ return opposite(split_vertex(prev(h,g), opposite(h,g),g), g); }
{
CGAL_precondition(is_valid_halfedge_descriptor(h, g));
return opposite(split_vertex(prev(h,g), opposite(h,g),g), g);
}
/**
* joins the two faces incident to `h` and `opposite(h,g)`.
@ -260,8 +267,6 @@ join_face(typename boost::graph_traits<Graph>::halfedge_descriptor h,
return EulerImpl::join_face(h,g);
}
/**
* splits the face incident to `h1` and `h2`. Creates the opposite
* halfedges `h3` and `h4`, such that `next(h1,g) == h3` and `next(h2,g) == h4`.
@ -290,6 +295,12 @@ split_face(typename boost::graph_traits<Graph>::halfedge_descriptor h1,
typedef typename boost::graph_traits<Graph> Traits;
typedef typename Traits::halfedge_descriptor halfedge_descriptor;
typedef typename Traits::face_descriptor face_descriptor;
CGAL_precondition(is_valid_halfedge_descriptor(h1, g) && is_valid_halfedge_descriptor(h2, g));
CGAL_precondition(h1 != h2);
CGAL_precondition(face(h1, g) == face(h2, g));
CGAL_precondition(next(h1, g) != h2 && next(h2, g) != h1);
halfedge_descriptor hnew = halfedge(add_edge(g), g);
face_descriptor fnew = add_face(g);
internal::insert_tip( hnew, h2, g);
@ -298,6 +309,7 @@ split_face(typename boost::graph_traits<Graph>::halfedge_descriptor h1,
internal::set_face_in_face_loop(opposite(hnew,g), fnew, g);
set_halfedge(face(hnew,g), hnew, g);
set_halfedge(face(opposite(hnew,g),g), opposite(hnew,g), g);
return hnew;
}
@ -327,7 +339,9 @@ join_loop(typename boost::graph_traits<Graph>::halfedge_descriptor h1,
typedef typename boost::graph_traits<Graph> Traits;
typedef typename Traits::halfedge_descriptor halfedge_descriptor;
CGAL_precondition(is_valid_halfedge_descriptor(h1, g) && is_valid_halfedge_descriptor(h2, g));
CGAL_precondition( is_border(h1,g) || face(h1, g) != face(h2, g));
if (! is_border(h1,g))
remove_face(face(h1, g), g);
if (! is_border(h2,g))
@ -401,13 +415,18 @@ split_loop(typename boost::graph_traits<Graph>::halfedge_descriptor h1,
typedef typename Traits::halfedge_descriptor halfedge_descriptor;
typedef typename Traits::face_descriptor face_descriptor;
CGAL_precondition(is_valid_halfedge_descriptor(h1, g) &&
is_valid_halfedge_descriptor(h2, g) &&
is_valid_halfedge_descriptor(h3, g));
halfedge_descriptor h = h1, i = h2, j = h3;
CGAL_precondition( h != i);
CGAL_precondition( h != j);
CGAL_precondition( i != j);
CGAL_precondition( target(h,g) == target(opposite(i,g),g));
CGAL_precondition( target(i,g) == target(opposite(j,g),g));
CGAL_precondition( target(j,g) == target(opposite(h,g),g));
CGAL_precondition(h != i);
CGAL_precondition(h != j);
CGAL_precondition(i != j);
CGAL_precondition(target(h,g) == target(opposite(i,g),g));
CGAL_precondition(target(i,g) == target(opposite(j,g),g));
CGAL_precondition(target(j,g) == target(opposite(h,g),g));
// Create a copy of the triangle.
halfedge_descriptor hnew = internal::copy(h,g);
halfedge_descriptor inew = internal::copy(i,g);
@ -505,7 +524,9 @@ void remove_face(typename boost::graph_traits<Graph>::halfedge_descriptor h,
typedef typename Traits::halfedge_descriptor halfedge_descriptor;
typedef typename Traits::face_descriptor face_descriptor;
CGAL_precondition(is_valid_halfedge_descriptor(h, g));
CGAL_precondition(! is_border(h,g));
face_descriptor f = face(h, g);
halfedge_descriptor end = h;
@ -551,13 +572,15 @@ add_edge(typename boost::graph_traits<Graph>::vertex_descriptor s,
typename boost::graph_traits<Graph>::vertex_descriptor t,
Graph& g)
{
CGAL_precondition(is_valid_vertex_descriptor(s, g) && is_valid_vertex_descriptor(t, g));
typename boost::graph_traits<Graph>::edge_descriptor e = add_edge(g);
set_target(halfedge(e, g), t, g);
set_target(opposite(halfedge(e, g), g), s, g);
return e;
}
/**
* checks whether a new face defined by a range of vertices (identified by their descriptors,
* `boost::graph_traits<Graph>::%vertex_descriptor`) can be added.
@ -568,6 +591,9 @@ bool can_add_face(const VertexRange& vrange, const PMesh& sm)
typedef typename boost::graph_traits<PMesh>::vertex_descriptor vertex_descriptor;
typedef typename boost::graph_traits<PMesh>::halfedge_descriptor halfedge_descriptor;
CGAL_precondition_code(for(vertex_descriptor v : vrange))
CGAL_precondition(is_valid_vertex_descriptor(v, sm));
std::vector<typename boost::graph_traits<PMesh>::vertex_descriptor> face(vrange.begin(), vrange.end());
std::size_t N = face.size();
@ -697,6 +723,9 @@ add_face(const VertexRange& vr, Graph& g)
typedef typename boost::graph_traits<Graph>::face_descriptor face_descriptor;
typedef typename boost::graph_traits<Graph>::edge_descriptor edge_descriptor;
CGAL_precondition_code(for(vertex_descriptor v : vr))
CGAL_precondition(is_valid_vertex_descriptor(v, g));
std::vector<vertex_descriptor> vertices(vr.begin(), vr.end()); // quick and dirty copy
unsigned int n = (unsigned int)vertices.size();
//check that every vertex is unique
@ -1115,7 +1144,9 @@ void make_hole(typename boost::graph_traits<Graph>::halfedge_descriptor h,
typedef typename Traits::face_descriptor face_descriptor;
typedef Halfedge_around_face_iterator<Graph> halfedge_around_face_iterator;
CGAL_precondition(! is_border(h,g));
CGAL_precondition(is_valid_halfedge_descriptor(h, g));
CGAL_precondition(!is_border(h, g));
face_descriptor fd = face(h, g);
halfedge_around_face_iterator hafib, hafie;
for(boost::tie(hafib, hafie) = halfedges_around_face(h, g);
@ -1139,6 +1170,9 @@ void fill_hole(typename boost::graph_traits<Graph>::halfedge_descriptor h,
typedef typename Traits::face_descriptor face_descriptor;
typedef typename Traits::halfedge_descriptor halfedge_descriptor;
CGAL_precondition(is_valid_halfedge_descriptor(h, g));
CGAL_precondition(is_border(h, g));
face_descriptor f = add_face(g);
for(halfedge_descriptor hd : halfedges_around_face(h,g)){
set_face(hd, f,g);
@ -1179,6 +1213,9 @@ add_center_vertex(typename boost::graph_traits<Graph>::halfedge_descriptor h,
typedef typename Traits::halfedge_descriptor halfedge_descriptor;
typedef typename Traits::face_descriptor face_descriptor;
CGAL_precondition(is_valid_halfedge_descriptor(h, g));
CGAL_precondition(!is_border(h, g));
halfedge_descriptor hnew = halfedge(add_edge(g),g);
vertex_descriptor vnew = add_vertex(g);
internal::close_tip(hnew, vnew, g);
@ -1236,6 +1273,8 @@ remove_center_vertex(typename boost::graph_traits<Graph>::halfedge_descriptor h,
typedef typename boost::graph_traits<Graph> Traits;
typedef typename Traits::halfedge_descriptor halfedge_descriptor;
CGAL_precondition(is_valid_halfedge_descriptor(h, g));
// h points to the vertex that gets removed
halfedge_descriptor h2 = opposite(next(h, g), g);
halfedge_descriptor hret = prev(h, g);
@ -1283,14 +1322,28 @@ add_vertex_and_face_to_border(typename boost::graph_traits<Graph>::halfedge_desc
typename boost::graph_traits<Graph>::halfedge_descriptor h2,
Graph& g)
{
typename boost::graph_traits<Graph>::vertex_descriptor v = add_vertex(g);
typename boost::graph_traits<Graph>::face_descriptor f = add_face(g);
typename boost::graph_traits<Graph>::edge_descriptor e1 = add_edge(g);
typename boost::graph_traits<Graph>::edge_descriptor e2 = add_edge(g);
typename boost::graph_traits<Graph>::halfedge_descriptor he1= halfedge(e1, g);
typename boost::graph_traits<Graph>::halfedge_descriptor he2= halfedge(e2, g);
typename boost::graph_traits<Graph>::halfedge_descriptor ohe1= opposite(he1, g);
typename boost::graph_traits<Graph>::halfedge_descriptor ohe2= opposite(he2, g);
typedef typename boost::graph_traits<Graph>::vertex_descriptor vertex_descriptor;
typedef typename boost::graph_traits<Graph>::halfedge_descriptor halfedge_descriptor;
typedef typename boost::graph_traits<Graph>::edge_descriptor edge_descriptor;
typedef typename boost::graph_traits<Graph>::face_descriptor face_descriptor;
CGAL_precondition(is_valid_halfedge_descriptor(h1, g) && is_valid_halfedge_descriptor(h2, g));
CGAL_precondition(is_border(h1, g) && is_border(h2, g));
CGAL_precondition(h1 != h2);
CGAL_precondition_code(halfedge_descriptor h = h1;)
CGAL_precondition_code(const halfedge_descriptor done = h1;)
CGAL_precondition_code(do { if(h == h2) break; h = next(h, g); } while(h != done);)
CGAL_precondition(h != done);
vertex_descriptor v = add_vertex(g);
face_descriptor f = add_face(g);
edge_descriptor e1 = add_edge(g);
edge_descriptor e2 = add_edge(g);
halfedge_descriptor he1 = halfedge(e1, g);
halfedge_descriptor he2 = halfedge(e2, g);
halfedge_descriptor ohe1= opposite(he1, g);
halfedge_descriptor ohe2= opposite(he2, g);
set_next(ohe1, next(h1,g),g);
set_next(h1,he1,g);
@ -1340,6 +1393,7 @@ add_face_to_border(typename boost::graph_traits<Graph>::halfedge_descriptor h1,
typename boost::graph_traits<Graph>::halfedge_descriptor h2,
Graph& g)
{
CGAL_precondition(is_valid_halfedge_descriptor(h1, g) && is_valid_halfedge_descriptor(h2, g));
CGAL_precondition(is_border(h1,g) == true);
CGAL_precondition(is_border(h2,g) == true);
CGAL_precondition(h1 != h2);
@ -1409,6 +1463,8 @@ collapse_edge(typename boost::graph_traits<Graph>::edge_descriptor e,
typedef typename Traits::vertex_descriptor vertex_descriptor;
typedef typename Traits::halfedge_descriptor halfedge_descriptor;
CGAL_precondition(is_valid_edge_descriptor(e, g));
halfedge_descriptor pq = halfedge(e,g);
halfedge_descriptor qp = opposite(pq, g);
halfedge_descriptor pt = opposite(prev(pq, g), g);
@ -1520,15 +1576,17 @@ collapse_edge(typename boost::graph_traits<Graph>::edge_descriptor e,
template<typename Graph, typename EdgeIsConstrainedMap>
typename boost::graph_traits<Graph>::vertex_descriptor
collapse_edge(typename boost::graph_traits<Graph>::edge_descriptor v0v1,
Graph& g
, EdgeIsConstrainedMap Edge_is_constrained_map)
Graph& g,
EdgeIsConstrainedMap Edge_is_constrained_map)
{
typedef boost::graph_traits< Graph > Traits;
typedef typename Traits::vertex_descriptor vertex_descriptor;
typedef typename Traits::halfedge_descriptor halfedge_descriptor;
CGAL_precondition(is_valid_edge_descriptor(v0v1, g));
CGAL_precondition(!get(Edge_is_constrained_map, v0v1));
halfedge_descriptor pq = halfedge(v0v1,g);
CGAL_assertion( !get(Edge_is_constrained_map,v0v1) );
halfedge_descriptor qp = opposite(pq,g);
halfedge_descriptor pt = opposite(prev(pq,g),g);
@ -1666,6 +1724,8 @@ flip_edge(typename boost::graph_traits<Graph>::halfedge_descriptor h,
typedef typename Traits::halfedge_descriptor halfedge_descriptor;
typedef typename Traits::face_descriptor face_descriptor;
CGAL_precondition(is_valid_halfedge_descriptor(h, g));
vertex_descriptor s = source(h,g);
vertex_descriptor t = target(h,g);
halfedge_descriptor nh = next(h,g), nnh = next(nh,g), oh = opposite(h,g), noh = next(oh,g), nnoh = next(noh,g);
@ -1706,6 +1766,8 @@ does_satisfy_link_condition(typename boost::graph_traits<Graph>::edge_descriptor
typedef typename boost::graph_traits<Graph>::halfedge_descriptor halfedge_descriptor;
typedef CGAL::Halfedge_around_source_iterator<Graph> out_edge_iterator;
CGAL_precondition(is_valid_edge_descriptor(e, g));
halfedge_descriptor v0_v1 = halfedge(e,g);
halfedge_descriptor v1_v0 = opposite(v0_v1,g);
@ -1798,9 +1860,8 @@ does_satisfy_link_condition(typename boost::graph_traits<Graph>::edge_descriptor
#ifndef CGAL_NO_DEPRECATED_CODE
/// \cond SKIP_IN_MANUAL
template<typename Graph>
bool
satisfies_link_condition(typename boost::graph_traits<Graph>::edge_descriptor e,
const Graph& g)
bool satisfies_link_condition(typename boost::graph_traits<Graph>::edge_descriptor e,
const Graph& g)
{
return does_satisfy_link_condition(e, g);
}
@ -1808,9 +1869,8 @@ bool
#endif
/// @}
} // CGAL
} // CGAL
} // namespace Euler
} // namespace CGAL
#endif /* CGAL_EULER_OPERATIONS_H */

View File

@ -109,7 +109,7 @@ off_file_input( std::istream& is, Triangulation_data_structure_2<Vb,Fb>& tds, bo
tds.set_adjacency(fn, 2, inf_edge_map);
edge_map.erase(edge_map.begin());
}
CGAL_triangulation_assertion(inf_edge_map.empty());
CGAL_assertion(inf_edge_map.empty());
}

View File

@ -195,6 +195,11 @@ make_quad(typename boost::graph_traits<Graph>::vertex_descriptor v0,
typename boost::graph_traits<Graph>::vertex_descriptor v3,
Graph& g)
{
CGAL_precondition(is_valid_vertex_descriptor(v0, g) &&
is_valid_vertex_descriptor(v1, g) &&
is_valid_vertex_descriptor(v2, g) &&
is_valid_vertex_descriptor(v3, g));
typedef typename boost::graph_traits<Graph>::halfedge_descriptor halfedge_descriptor;
typedef typename boost::graph_traits<Graph>::face_descriptor face_descriptor;
halfedge_descriptor h0 = halfedge(add_edge(g), g);

File diff suppressed because it is too large Load Diff

View File

@ -11,14 +11,15 @@
#ifndef CGAL_BOOST_GRAPH_INTERNAL_HELPERS_H
#define CGAL_BOOST_GRAPH_INTERNAL_HELPERS_H
#include <boost/graph/graph_traits.hpp>
#include <boost/optional.hpp>
#include <CGAL/iterator.h>
#include <CGAL/property_map.h>
#include <CGAL/boost/graph/iterator.h>
#include <CGAL/Named_function_parameters.h>
#include <boost/iterator/function_output_iterator.hpp>
#include <tuple>
namespace CGAL {
// breaks a dependency loop between <CGAL/boost/graph/helpers.h>
@ -133,7 +134,7 @@ std::size_t
exact_num_vertices(const Graph& g)
{
typename boost::graph_traits<Graph>::vertex_iterator beg, end;
boost::tie(beg,end) = vertices(g);
std::tie(beg,end) = vertices(g);
return std::distance(beg,end);
}
@ -142,7 +143,7 @@ std::size_t
exact_num_halfedges(const Graph& g)
{
typename boost::graph_traits<Graph>::halfedge_iterator beg, end;
boost::tie(beg,end) = halfedges(g);
std::tie(beg,end) = halfedges(g);
return std::distance(beg,end);
}
@ -151,7 +152,7 @@ std::size_t
exact_num_edges(const Graph& g)
{
typename boost::graph_traits<Graph>::edge_iterator beg, end;
boost::tie(beg,end) = edges(g);
std::tie(beg,end) = edges(g);
return std::distance(beg,end);
}
@ -160,14 +161,14 @@ std::size_t
exact_num_faces(const Graph& g)
{
typename boost::graph_traits<Graph>::face_iterator beg, end;
boost::tie(beg,end) = faces(g);
std::tie(beg,end) = faces(g);
return std::distance(beg,end);
}
template<typename Graph>
bool
is_isolated(typename boost::graph_traits<Graph>::vertex_descriptor v,
Graph& g)
const Graph& g)
{
return halfedge(v, g) == boost::graph_traits<Graph>::null_halfedge();
}

View File

@ -202,7 +202,7 @@ public:
: sm_(pm.sm_)
{}
reference operator[](key_type v)
reference operator[](key_type v) const
{
#if defined(CGAL_USE_OM_POINTS)
return sm_->point(v);

View File

@ -207,13 +207,11 @@ struct Regularization_graph
prevent_unselection (prevent_unselection)
{
labels.reserve(num_faces(fg));
std::size_t nb_selected = 0;
for (fg_face_descriptor fd : faces(fg))
{
if (get(is_selected_map,fd))
{
labels.push_back(1);
++ nb_selected;
}
else
labels.push_back(0);
@ -486,7 +484,7 @@ reduce_face_selection(
\cgalParamNEnd
\cgalParamNBegin{prevent_unselection}
\cgalParamDescription{Boolean used to indicate if selection can be only expanded or if it can also be shrinked.}
\cgalParamDescription{Boolean used to indicate if selection can be only expanded or if it can also be shrunk.}
\cgalParamType{`bool`}
\cgalParamDefault{`false`}
\cgalParamExtra{The geometric traits class must be compatible with the vertex point type.}

View File

@ -1,129 +0,0 @@
// Copyright (c) 2014 GeometryFactory (France). All rights reserved.
//
// This file is part of CGAL (www.cgal.org)
//
// $URL$
// $Id$
// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial
//
//
// Author(s) : Andreas Fabri
#ifndef CGAL_BOOST_PARAMETER_H
#define CGAL_BOOST_PARAMETER_H
#include <CGAL/config.h>
#ifdef BOOST_PARAMETER_MAX_ARITY
# if (BOOST_PARAMETER_MAX_ARITY < 12)
# error "BOOST_PARAMETER_MAX_ARITY must be at least 12 for CGAL::Mesh_3"
# endif
#else
# define BOOST_PARAMETER_MAX_ARITY 12
#endif
#include <boost/parameter/name.hpp>
#if defined(__clang__) || defined(BOOST_GCC)
# define CGAL_IGNORE_UNUSED_VARIABLES \
_Pragma("GCC diagnostic ignored \"-Wunused-variable\"") \
_Pragma("GCC diagnostic ignored \"-Wunused-parameter\"")
#else
# define CGAL_IGNORE_UNUSED_VARIABLES
#endif
#if __has_warning("-Wunneeded-internal-declaration")
# define CGAL_IGNORE_UNUSED_INTERNAL_DECLARATION \
_Pragma("clang diagnostic ignored \"-Wunneeded-internal-declaration\"")
#else
# define CGAL_IGNORE_UNUSED_INTERNAL_DECLARATION
#endif
#define CGAL_IGNORE_BOOST_PARAMETER_NAME_WARNINGS \
CGAL_IGNORE_UNUSED_VARIABLES \
CGAL_IGNORE_UNUSED_INTERNAL_DECLARATION
namespace CGAL
{
namespace parameters
{
template <typename T>
struct Base
{
Base(T t) : t_(t) {}
T operator()() const { return t_; }
private:
T t_;
};
#define CGAL_BOOLEAN_PARAMETER(Class, function_true, function_false) \
struct Class : public Base<bool> { Class(bool b) : Base<bool>(b){} }; \
inline Class function_true() { return Class(true); } \
inline Class function_false() { return Class(false); }
#define CGAL_DOUBLE_PARAMETER(Class, function, precondition) \
struct Class : public Base<double> \
{ Class(double d) : Base<double>(d) { precondition(d); } }; \
inline Class function(double d) { return Class(d); }
// see <CGAL/config.h>
CGAL_PRAGMA_DIAG_PUSH
// see <CGAL/boost/parameter.h>
CGAL_IGNORE_BOOST_PARAMETER_NAME_WARNINGS
BOOST_PARAMETER_NAME( c3t3 )
BOOST_PARAMETER_NAME( domain )
BOOST_PARAMETER_NAME( criteria )
BOOST_PARAMETER_NAME( cdt )
BOOST_PARAMETER_NAME( (seeds_begin, tag) seeds_begin_)
BOOST_PARAMETER_NAME( (seeds_end, tag) seeds_end_)
BOOST_PARAMETER_NAME( (mark, tag) mark_)
BOOST_PARAMETER_NAME( (time_limit, tag) time_limit_ )
BOOST_PARAMETER_NAME( (convergence, tag) convergence_)
BOOST_PARAMETER_NAME( (max_iteration_number, tag) max_iteration_number_ )
BOOST_PARAMETER_NAME( (freeze_bound, tag) freeze_bound_)
BOOST_PARAMETER_NAME( (sliver_bound, tag) sliver_bound_)
BOOST_PARAMETER_NAME( (sliver_criterion, tag) sliver_criterion_)
BOOST_PARAMETER_NAME( (perturbation_vector, tag) perturbation_vector_)
BOOST_PARAMETER_NAME( (do_freeze, tag) do_freeze_)
BOOST_PARAMETER_NAME( (mesh_topology, tag) mesh_topology_)
BOOST_PARAMETER_NAME( (dump_after_init_prefix, tag ) dump_after_init_prefix_)
BOOST_PARAMETER_NAME( (dump_after_refine_surface_prefix, tag ) dump_after_refine_surface_prefix_)
BOOST_PARAMETER_NAME( (dump_after_refine_prefix, tag ) dump_after_refine_prefix_)
BOOST_PARAMETER_NAME( (dump_after_glob_opt_prefix, tag ) dump_after_glob_opt_prefix_)
BOOST_PARAMETER_NAME( (dump_after_perturb_prefix, tag ) dump_after_perturb_prefix_)
BOOST_PARAMETER_NAME( (dump_after_exude_prefix, tag ) dump_after_exude_prefix_)
BOOST_PARAMETER_NAME( (number_of_initial_points, tag) number_of_initial_points_)
BOOST_PARAMETER_NAME( (maximal_number_of_vertices, tag ) maximal_number_of_vertices_)
BOOST_PARAMETER_NAME( (nonlinear_growth_of_balls, tag ) nonlinear_growth_of_balls_)
BOOST_PARAMETER_NAME( (pointer_to_error_code, tag ) pointer_to_error_code_)
BOOST_PARAMETER_NAME( (pointer_to_stop_atomic_boolean, tag ) pointer_to_stop_atomic_boolean_)
// First used in <CGAL/Labeled_mesh_domain_3.h>
BOOST_PARAMETER_NAME( (function, tag ) function_)
BOOST_PARAMETER_NAME( (bounding_object, tag ) bounding_object_)
BOOST_PARAMETER_NAME( (relative_error_bound, tag ) relative_error_bound_)
BOOST_PARAMETER_NAME( (weights, tag) weights_)
BOOST_PARAMETER_NAME( (p_rng, tag ) p_rng_)
BOOST_PARAMETER_NAME( (null_subdomain_index, tag ) null_subdomain_index_)
BOOST_PARAMETER_NAME( (construct_surface_patch_index, tag ) construct_surface_patch_index_)
// First used in <CGAL/Gray_image_mesh_domain_3.h>
BOOST_PARAMETER_NAME( (image, tag ) image_)
BOOST_PARAMETER_NAME( (iso_value, tag) iso_value_)
BOOST_PARAMETER_NAME( (value_outside, tag) value_outside_)
BOOST_PARAMETER_NAME( (image_values_to_subdomain_indices, tag ) image_values_to_subdomain_indices_)
CGAL_PRAGMA_DIAG_POP
} // parameters
} // CGAL
#endif // CGAL_BOOST_PARAMETER_H

View File

@ -23,9 +23,9 @@ int main()
vertex_descriptor vs = CGAL::add_vertex(sm);
std::array<vertex_descriptor,0> face0;
assert( ! CGAL::Euler::can_add_face(face0,sm) );
std::array<vertex_descriptor,1> face1;
std::array<vertex_descriptor,1> face1 = { vp };
assert( ! CGAL::Euler::can_add_face(face1,sm) );
std::array<vertex_descriptor,2> face2;
std::array<vertex_descriptor,2> face2 = { vp, vq };
assert( ! CGAL::Euler::can_add_face(face2,sm) );
std::array<vertex_descriptor,3> face = { vp, vq, vr };
@ -56,5 +56,7 @@ int main()
assert( ! CGAL::Euler::can_add_face(face,sm) );
}
std::cout << "Done" << std::endl;
return 0;
}

View File

@ -20,12 +20,6 @@
\cgalPkgShortInfoEnd
\cgalPkgDescriptionEnd
\cgalCRPSection{Assertions}
The optimization code uses infix `OPTIMISATION` in the assertions,
e.g. defining the compiler flag
`CGAL_OPTIMISATION_NO_PRECONDITIONS` switches precondition
checking off, cf. Section \ref secchecks.
\cgalClassifedRefPages
@ -62,4 +56,3 @@ checking off, cf. Section \ref secchecks.
- `CGAL::Min_sphere_of_spheres_d<Traits>`
- `MinSphereOfSpheresTraits`
*/

View File

@ -325,7 +325,7 @@ public:
Support_point_iterator
support_points_begin() const {
CGAL_optimisation_assertion_msg(number_of_points() >= 2,
CGAL_assertion_msg(number_of_points() >= 2,
"support_points_begin: not enough points");
return Support_point_iterator(
solver->basic_original_variable_indices_begin(),
@ -334,7 +334,7 @@ public:
Support_point_iterator
support_points_end() const {
CGAL_optimisation_assertion_msg(number_of_points() >= 2,
CGAL_assertion_msg(number_of_points() >= 2,
"support_points_begin: not enough points");
return Support_point_iterator(
solver->basic_original_variable_indices_end(),
@ -401,27 +401,27 @@ public:
// NOTE: an implicit conversion from ET to RT must be available!
Point
center( ) const
{ CGAL_optimisation_precondition( ! is_empty());
{ CGAL_precondition( ! is_empty());
return tco.construct_point_d_object()( ambient_dimension(),
center_coordinates_begin(),
center_coordinates_end()); }
FT
squared_inner_radius( ) const
{ CGAL_optimisation_precondition( ! is_empty());
{ CGAL_precondition( ! is_empty());
return FT( squared_inner_radius_numerator()) /
FT( squared_radii_denominator()); }
FT
squared_outer_radius( ) const
{ CGAL_optimisation_precondition( ! is_empty());
{ CGAL_precondition( ! is_empty());
return FT( squared_outer_radius_numerator()) /
FT( squared_radii_denominator()); }
// predicates
CGAL::Bounded_side
bounded_side( const Point& p) const
{ CGAL_optimisation_precondition(
{ CGAL_precondition(
is_empty() || tco.access_dimension_d_object()( p) == d);
ET sqr_d = sqr_dist( p);
ET h_p_sqr = da_coord(p)[d] * da_coord(p)[d];
@ -431,7 +431,7 @@ public:
bool
has_on_bounded_side( const Point& p) const
{ CGAL_optimisation_precondition(
{ CGAL_precondition(
is_empty() || tco.access_dimension_d_object()( p) == d);
ET sqr_d = sqr_dist( p);
ET h_p_sqr = da_coord(p)[d] * da_coord(p)[d];
@ -440,7 +440,7 @@ public:
bool
has_on_boundary( const Point& p) const
{ CGAL_optimisation_precondition(
{ CGAL_precondition(
is_empty() || tco.access_dimension_d_object()( p) == d);
ET sqr_d = sqr_dist( p);
ET h_p_sqr = da_coord(p)[d] * da_coord(p)[d];
@ -449,7 +449,7 @@ public:
bool
has_on_unbounded_side( const Point& p) const
{ CGAL_optimisation_precondition(
{ CGAL_precondition(
is_empty() || tco.access_dimension_d_object()( p) == d);
ET sqr_d = sqr_dist( p);
ET h_p_sqr(da_coord(p)[d]);
@ -468,14 +468,14 @@ public:
{ if ( points.size() > 0) points.erase( points.begin(), points.end());
std::copy( first, last, std::back_inserter( points));
set_dimension();
CGAL_optimisation_precondition_msg( check_dimension(),
CGAL_precondition_msg( check_dimension(),
"Not all points have the same dimension.");
compute_min_annulus(); }
void
insert( const Point& p)
{ if ( is_empty()) d = tco.access_dimension_d_object()( p);
CGAL_optimisation_precondition(
CGAL_precondition(
tco.access_dimension_d_object()( p) == d);
points.push_back( p);
compute_min_annulus(); }
@ -483,10 +483,10 @@ public:
template < class InputIterator >
void
insert( InputIterator first, InputIterator last)
{ CGAL_optimisation_precondition_code( std::size_t old_n = points.size());
{ CGAL_precondition_code( std::size_t old_n = points.size());
points.insert( points.end(), first, last);
set_dimension();
CGAL_optimisation_precondition_msg( check_dimension( old_n),
CGAL_precondition_msg( check_dimension( old_n),
"Not all points have the same dimension.");
compute_min_annulus(); }
@ -645,7 +645,7 @@ private:
options.set_pricing_strategy(pricing_strategy(NT()));
delete solver;
solver = new Solver(lp, options);
CGAL_optimisation_assertion(solver->status() == QP_OPTIMAL);
CGAL_assertion(solver->status() == QP_OPTIMAL);
// compute center and squared radius
ET sqr_sum = 0;
@ -829,7 +829,7 @@ operator << ( std::ostream& os,
break;
default:
CGAL_optimisation_assertion_msg( false,
CGAL_assertion_msg( false,
"CGAL::IO::get_mode( os) invalid!");
break; }
@ -858,7 +858,7 @@ operator >> ( std::istream& is, CGAL::Min_annulus_d<Traits_>& min_annulus)
break;
default:
CGAL_optimisation_assertion_msg( false, "CGAL::IO::mode invalid!");
CGAL_assertion_msg( false, "CGAL::IO::mode invalid!");
break; }
return( is);

View File

@ -191,7 +191,7 @@ class Min_circle_2 {
const Point&
support_point( std::size_t i) const
{
CGAL_optimisation_precondition(i < number_of_support_points());
CGAL_precondition(i < number_of_support_points());
return( support_points[ i]);
}
// circle
@ -256,7 +256,7 @@ class Min_circle_2 {
tco.circle.set( );
break;
default:
CGAL_optimisation_assertion( n_support_points <= 3 ); }
CGAL_assertion( n_support_points <= 3 ); }
}
void
@ -334,7 +334,7 @@ class Min_circle_2 {
// initialize circle
tco.circle.set();
CGAL_optimisation_postcondition( is_empty());
CGAL_postcondition( is_empty());
}
// constructor for one point
@ -349,7 +349,7 @@ class Min_circle_2 {
support_points[ 0] = p;
tco.circle.set( p);
CGAL_optimisation_postcondition( is_degenerate());
CGAL_postcondition( is_degenerate());
}
// constructor for two points

View File

@ -293,7 +293,7 @@ operator << ( std::ostream& os,
break;
default:
CGAL_optimisation_assertion_msg( false,
CGAL_assertion_msg( false,
"CGAL::IO::get_mode( os) invalid!");
break; }
@ -323,7 +323,7 @@ operator >> ( std::istream& is,
break;
default:
CGAL_optimisation_assertion_msg( false,
CGAL_assertion_msg( false,
"CGAL::IO::mode invalid!");
break; }

View File

@ -332,7 +332,7 @@ operator << ( std::ostream& os,
break;
default:
CGAL_optimisation_assertion_msg( false,
CGAL_assertion_msg( false,
"CGAL::IO::get_mode( os) invalid!");
break; }
@ -363,7 +363,7 @@ operator >> ( std::istream& is,
break;
default:
CGAL_optimisation_assertion_msg( false,
CGAL_assertion_msg( false,
"CGAL::IO::mode invalid!");
break; }

View File

@ -60,7 +60,7 @@ operator << ( std::ostream& os,
break;
default:
CGAL_optimisation_assertion_msg( false,
CGAL_assertion_msg( false,
"CGAL::IO::get_mode( os) invalid!");
break; }
@ -89,7 +89,7 @@ operator >> ( std::istream& is, CGAL::Min_circle_2<Traits_>& min_circle)
break;
default:
CGAL_optimisation_assertion_msg( false, "CGAL::IO::mode invalid!");
CGAL_assertion_msg( false, "CGAL::IO::mode invalid!");
break; }
return( is);

View File

@ -11,7 +11,7 @@
// Author(s) : Sven Schoenherr <sven@inf.ethz.ch>, Bernd Gaertner
// includes
# include <CGAL/Optimisation/assertions.h>
# include <CGAL/assertions.h>
namespace CGAL {
@ -42,7 +42,7 @@ operator << ( std::ostream& os, const CGAL::Optimisation_circle_2<K_>& c)
break;
default:
CGAL_optimisation_assertion_msg( false,
CGAL_assertion_msg( false,
"CGAL::IO::get_mode( os) invalid!");
break; }
@ -79,7 +79,7 @@ operator >> ( std::istream& is, CGAL::Optimisation_circle_2<K_>& c)
break;
default:
CGAL_optimisation_assertion_msg( false,
CGAL_assertion_msg( false,
"CGAL::IO::get_mode( is) invalid!");
break; }

View File

@ -203,7 +203,7 @@ class Min_ellipse_2 {
const Point&
support_point( std::size_t i) const
{
CGAL_optimisation_precondition(i < number_of_support_points());
CGAL_precondition(i < number_of_support_points());
return( support_points[ i]);
}
// ellipse
@ -281,7 +281,7 @@ class Min_ellipse_2 {
tco.ellipse.set( );
break;
default:
CGAL_optimisation_assertion( ( n_support_points >= 0) &&
CGAL_assertion( ( n_support_points >= 0) &&
( n_support_points <= 5) ); }
}
@ -360,7 +360,7 @@ class Min_ellipse_2 {
// initialize ellipse
tco.ellipse.set();
CGAL_optimisation_postcondition( is_empty());
CGAL_postcondition( is_empty());
}
inline
@ -373,7 +373,7 @@ class Min_ellipse_2 {
// initialize ellipse
tco.ellipse.set();
CGAL_optimisation_postcondition( is_empty());
CGAL_postcondition( is_empty());
}
// constructor for one point
@ -388,7 +388,7 @@ class Min_ellipse_2 {
support_points[ 0] = p;
tco.ellipse.set( p);
CGAL_optimisation_postcondition( is_degenerate());
CGAL_postcondition( is_degenerate());
}
// constructor for two points
@ -409,7 +409,7 @@ class Min_ellipse_2 {
// compute me
me( points.end(), 0);
CGAL_optimisation_postcondition( is_degenerate());
CGAL_postcondition( is_degenerate());
}
// constructor for three points

View File

@ -18,7 +18,7 @@
// includes
# include <CGAL/Cartesian/ConicCPA2.h>
# include <CGAL/Optimisation/assertions.h>
# include <CGAL/assertions.h>
namespace CGAL {
@ -235,7 +235,7 @@ class _Min_ellipse_2_adapterC2__Ellipse {
int tau_star = c.vol_derivative( dr, ds, dt, du, dv, dw);
return( CGAL::Bounded_side( CGAL_NTS sign( tau_star))); } }
default:
CGAL_optimisation_assertion( ( n_boundary_points >= 0) &&
CGAL_assertion( ( n_boundary_points >= 0) &&
( n_boundary_points <= 5) ); }
// keeps g++ happy
return( CGAL::Bounded_side( 0));
@ -298,7 +298,7 @@ class _Min_ellipse_2_adapterC2__Ellipse {
|| ( ( conic1 == e.conic2)
&& ( conic2 == e.conic1)));
default:
CGAL_optimisation_assertion( ( n_boundary_points >= 0)
CGAL_assertion( ( n_boundary_points >= 0)
&& ( n_boundary_points <= 5)); }
// keeps g++ happy
return( false);
@ -341,7 +341,7 @@ operator << ( std::ostream& os,
case CGAL::IO::BINARY:
break;
default:
CGAL_optimisation_assertion_msg( false,
CGAL_assertion_msg( false,
"CGAL::IO::get_mode( os) invalid!");
break; }
@ -405,7 +405,7 @@ operator >> ( std::istream& is,
break;
default:
CGAL_optimisation_assertion_msg( false,
CGAL_assertion_msg( false,
"CGAL::IO::mode invalid!");
break; }

View File

@ -18,7 +18,7 @@
// includes
# include <CGAL/Homogeneous/ConicHPA2.h>
# include <CGAL/Optimisation/assertions.h>
# include <CGAL/assertions.h>
namespace CGAL {
@ -243,7 +243,7 @@ class _Min_ellipse_2_adapterH2__Ellipse {
int tau_star = c.vol_derivative( dr, ds, dt, du, dv, dw);
return( CGAL::Bounded_side( CGAL_NTS sign( tau_star))); } }
default:
CGAL_optimisation_assertion( ( n_boundary_points >= 0) &&
CGAL_assertion( ( n_boundary_points >= 0) &&
( n_boundary_points <= 5) ); }
// keeps g++ happy
return( CGAL::Bounded_side( 0));
@ -306,7 +306,7 @@ class _Min_ellipse_2_adapterH2__Ellipse {
|| ( ( conic1 == e.conic2)
&& ( conic2 == e.conic1)));
default:
CGAL_optimisation_assertion( ( n_boundary_points >= 0)
CGAL_assertion( ( n_boundary_points >= 0)
&& ( n_boundary_points <= 5)); }
// keeps g++ happy
return( false);
@ -349,7 +349,7 @@ operator << ( std::ostream& os,
case CGAL::IO::BINARY:
break;
default:
CGAL_optimisation_assertion_msg( false,
CGAL_assertion_msg( false,
"CGAL::IO::get_mode( os) invalid!");
break; }
@ -413,7 +413,7 @@ operator >> ( std::istream& is,
break;
default:
CGAL_optimisation_assertion_msg( false,
CGAL_assertion_msg( false,
"CGAL::IO::mode invalid!");
break; }

View File

@ -60,7 +60,7 @@ operator << ( std::ostream& os,
break;
default:
CGAL_optimisation_assertion_msg( false,
CGAL_assertion_msg( false,
"CGAL::IO::get_mode( os) invalid!");
break; }
@ -89,7 +89,7 @@ operator >> ( std::istream& is, CGAL::Min_ellipse_2<Traits_>& min_ellipse)
break;
default:
CGAL_optimisation_assertion_msg( false, "CGAL::IO::mode invalid!");
CGAL_assertion_msg( false, "CGAL::IO::mode invalid!");
break; }
return( is);

View File

@ -17,7 +17,7 @@
#include <CGAL/Conic_2.h>
#include <CGAL/Optimisation/assertions.h>
#include <CGAL/assertions.h>
#include <CGAL/Kernel/global_functions_2.h>
@ -131,7 +131,7 @@ class Optimisation_ellipse_2 {
set( const Point& p, const Point& q)
{
n_boundary_points = 2;
CGAL_optimisation_precondition(boundary_point1 == p); CGAL_USE(p);
CGAL_precondition(boundary_point1 == p); CGAL_USE(p);
boundary_point2 = q;
}
@ -139,20 +139,20 @@ class Optimisation_ellipse_2 {
set( const Point& p1, const Point& p2, const Point& p3)
{
n_boundary_points = 3;
CGAL_optimisation_precondition(boundary_point1 == p1);
CGAL_optimisation_precondition(boundary_point2 == p2);
CGAL_precondition(boundary_point1 == p1);
CGAL_precondition(boundary_point2 == p2);
boundary_point3 = p3;
helper_conic.set_ellipse( p1, p2, p3);
CGAL_optimisation_assertion(helper_conic.is_ellipse());
CGAL_assertion(helper_conic.is_ellipse());
}
void
set( const Point& p1, const Point& p2, const Point& p3, const Point& p4)
{
n_boundary_points = 4;
CGAL_optimisation_precondition(boundary_point1 == p1);
CGAL_optimisation_precondition(boundary_point2 == p2);
CGAL_optimisation_precondition(boundary_point3 == p3);
CGAL_precondition(boundary_point1 == p1);
CGAL_precondition(boundary_point2 == p2);
CGAL_precondition(boundary_point3 == p3);
boundary_point4 = p4;
Conic::set_two_linepairs( p1, p2, p3, p4, conic1, conic2);
@ -195,7 +195,7 @@ class Optimisation_ellipse_2 {
if (!helper_ellipse_set) {
helper_ellipse.set_ellipse( conic1, conic2);
helper_ellipse.analyse();
CGAL_optimisation_assertion (helper_ellipse.is_ellipse());
CGAL_assertion (helper_ellipse.is_ellipse());
helper_ellipse_set= true;
}
}
@ -211,14 +211,14 @@ class Optimisation_ellipse_2 {
// In that case, helper_conic is already correct,
// but in general, this optimization is NOT valid.
n_boundary_points = 5;
CGAL_optimisation_assertion(helper_conic.is_ellipse());
CGAL_assertion(helper_conic.is_ellipse());
// the following assertion is too strict if we run under
// double (which is sometimes the case, e.g. in demos)
// CGAL_optimisation_assertion(helper_conic.has_on_boundary(p5));
CGAL_optimisation_precondition(boundary_point1 == p1);
CGAL_optimisation_precondition(boundary_point2 == p2);
CGAL_optimisation_precondition(boundary_point3 == p3);
CGAL_optimisation_precondition(boundary_point4 == p4);
// CGAL_assertion(helper_conic.has_on_boundary(p5));
CGAL_precondition(boundary_point1 == p1);
CGAL_precondition(boundary_point2 == p2);
CGAL_precondition(boundary_point3 == p3);
CGAL_precondition(boundary_point4 == p4);
CGAL_USE(p1); CGAL_USE(p2); CGAL_USE(p3); CGAL_USE(p4);
boundary_point5 = p5;
}
@ -247,7 +247,7 @@ class Optimisation_ellipse_2 {
double &u, double &v, double &w) const
{
// just like double_conic, but we only get the coefficients
CGAL_optimisation_precondition( ! is_degenerate());
CGAL_precondition( ! is_degenerate());
if ( n_boundary_points == 4) {
set_e_values();
@ -297,7 +297,7 @@ class Optimisation_ellipse_2 {
|| ( ( conic1 == e.conic2)
&& ( conic2 == e.conic1)));
default:
CGAL_optimisation_assertion( ( n_boundary_points >= 0)
CGAL_assertion( ( n_boundary_points >= 0)
&& ( n_boundary_points <= 5)); }
// keeps g++ happy
return( false);
@ -343,7 +343,7 @@ class Optimisation_ellipse_2 {
helper_conic.vol_derivative( dr, ds, dt, du, dv, dw);
return( CGAL::Bounded_side( CGAL_NTS sign( tau_star))); } }
default:
CGAL_optimisation_assertion( ( n_boundary_points >= 0) &&
CGAL_assertion( ( n_boundary_points >= 0) &&
( n_boundary_points <= 5) ); }
// keeps g++ happy
return( CGAL::Bounded_side( 0));
@ -416,7 +416,7 @@ class Optimisation_ellipse_2 {
return (CGAL::ZERO == (c.vol_derivative(dr, ds, dt, du, dv, dw)));
}
default:
CGAL_optimisation_assertion( ( n_boundary_points >= 0) &&
CGAL_assertion( ( n_boundary_points >= 0) &&
( n_boundary_points <= 5) );
return false;
}

View File

@ -43,7 +43,7 @@ operator << ( std::ostream& os, const CGAL::Optimisation_ellipse_2<K_>& e)
case CGAL::IO::BINARY:
break;
default:
CGAL_optimisation_assertion_msg( false,
CGAL_assertion_msg( false,
"CGAL::IO::get_mode( os) invalid!");
break; }
@ -106,7 +106,7 @@ operator >> ( std::istream& is, CGAL::Optimisation_ellipse_2<K_>& e)
break;
default:
CGAL_optimisation_assertion_msg( false,
CGAL_assertion_msg( false,
"CGAL::IO::get_mode( is) invalid!");
break; }

View File

@ -18,7 +18,7 @@
#include <CGAL/basic.h>
#include <CGAL/Optimisation/assertions.h>
#include <CGAL/assertions.h>
#include <CGAL/Point_2.h>
#include <CGAL/Direction_2.h>
#include <CGAL/Polygon_2.h>
@ -303,36 +303,36 @@ public:
if (assign(tmp, tmpo)) {
*o++ = tmp;
} else {
CGAL_optimisation_assertion_code(bool test1 =)
CGAL_assertion_code(bool test1 =)
assign(tmpl, tmpo);
CGAL_optimisation_assertion(test1);
CGAL_assertion(test1);
*o++ = r.p1;
}
tmpo = isec(line(r.p3, r.d1), line(r.p2, r.d2));
if (assign(tmp, tmpo)) {
*o++ = tmp;
} else {
CGAL_optimisation_assertion_code(bool test1 =)
CGAL_assertion_code(bool test1 =)
assign(tmpl, tmpo);
CGAL_optimisation_assertion(test1);
CGAL_assertion(test1);
*o++ = r.p2;
}
tmpo = isec(line(r.p3, r.d1), line(r.p4, r.d2));
if (assign(tmp, tmpo)) {
*o++ = tmp;
} else {
CGAL_optimisation_assertion_code(bool test1 =)
CGAL_assertion_code(bool test1 =)
assign(tmpl, tmpo);
CGAL_optimisation_assertion(test1);
CGAL_assertion(test1);
*o++ = r.p3;
}
tmpo = isec(line(r.p1, r.d1), line(r.p4, r.d2));
if (assign(tmp, tmpo)) {
*o++ = tmp;
} else {
CGAL_optimisation_assertion_code(bool test1 =)
CGAL_assertion_code(bool test1 =)
assign(tmpl, tmpo);
CGAL_optimisation_assertion(test1);
CGAL_assertion(test1);
*o++ = r.p3;
}
return o;

View File

@ -26,7 +26,7 @@
# include <CGAL/basic.h>
# include <CGAL/Optimisation/assertions.h>
# include <CGAL/assertions.h>
# include <CGAL/Optimisation/basic.h>
@ -110,7 +110,7 @@ public:
#endif
if (points.size()>0) {
d = tco.access_dimension_d_object() (points.front());
CGAL_optimisation_precondition ((d>=0) && all_points_have_dim(d));
CGAL_precondition ((d>=0) && all_points_have_dim(d));
ms_basis.get_sphere(Rep_tag()).set_size (d);
pivot_ms();
}
@ -137,7 +137,7 @@ public:
#endif
if (points.size()>0) {
d = tco.access_dimension_d_object() (points.front());
CGAL_optimisation_precondition ((d>=0) && all_points_have_dim(d));
CGAL_precondition ((d>=0) && all_points_have_dim(d));
ms_basis.get_sphere(Rep_tag()).set_size (d);
pivot_ms();
}
@ -211,13 +211,13 @@ public:
Point center () const
{
CGAL_optimisation_precondition (!is_empty());
CGAL_precondition (!is_empty());
return ms_basis.get_sphere(Rep_tag()).center();
}
FT squared_radius () const
{
CGAL_optimisation_precondition (!is_empty());
CGAL_precondition (!is_empty());
return ms_basis.get_sphere(Rep_tag()).squared_radius();
}
@ -227,7 +227,7 @@ public:
if (d == -1)
return ON_UNBOUNDED_SIDE;
else {
CGAL_optimisation_precondition
CGAL_precondition
(d == tco.access_dimension_d_object()(p));
return (Bounded_side
(-CGAL::sign (ms_basis.get_sphere(Rep_tag()).excess (p))));
@ -239,7 +239,7 @@ public:
if (d == -1)
return false;
else {
CGAL_optimisation_precondition
CGAL_precondition
(d == tco.access_dimension_d_object()(p));
return (CGAL_NTS is_negative (ms_basis.get_sphere(Rep_tag()).excess (p)));
}
@ -250,7 +250,7 @@ public:
if (d == -1)
return true;
else {
CGAL_optimisation_precondition
CGAL_precondition
(d == tco.access_dimension_d_object()(p));
return (CGAL_NTS is_positive (ms_basis.get_sphere(Rep_tag()).excess (p)));
}
@ -261,7 +261,7 @@ public:
if (d == -1)
return false;
else {
CGAL_optimisation_precondition
CGAL_precondition
(d == tco.access_dimension_d_object()(p));
return (CGAL_NTS is_zero (ms_basis.get_sphere(Rep_tag()).excess (p)));
}
@ -296,7 +296,7 @@ public:
support_end = points.begin();
if (points.size()>0) {
d = tco.access_dimension_d_object() (points.front());
CGAL_optimisation_precondition ((d>=0) && all_points_have_dim (d));
CGAL_precondition ((d>=0) && all_points_have_dim (d));
ms_basis.get_sphere(Rep_tag()).set_size (d);
pivot_ms();
} else {
@ -310,7 +310,7 @@ public:
if (has_on_unbounded_side (p)) {
if (is_empty()) {
d = tco.access_dimension_d_object() (p);
CGAL_optimisation_precondition (d>=0);
CGAL_precondition (d>=0);
ms_basis.get_sphere(Rep_tag()).set_size (d);
}
// ensure precondition of pivot_ms

View File

@ -62,7 +62,7 @@ operator << ( std::ostream& os, const Min_sphere_d<Traits>& min_sphere)
break;
default:
CGAL_optimisation_assertion_msg
CGAL_assertion_msg
( false, "IO::get_mode( os) invalid!");
break; }
@ -93,7 +93,7 @@ operator >> ( std::istream& is, Min_sphere_d<Traits>& min_sphere)
} break;
default:
CGAL_optimisation_assertion_msg( false, "IO::mode invalid!");
CGAL_assertion_msg( false, "IO::mode invalid!");
break;
}

View File

@ -42,7 +42,7 @@ class Optimisation_sphere_d<Cartesian_tag, FT, RT, PT, Traits>;
#include <CGAL/Optimisation/basic.h>
#include <CGAL/Optimisation/assertions.h>
#include <CGAL/assertions.h>
namespace CGAL {
@ -188,7 +188,7 @@ class Optimisation_sphere_d<Cartesian_tag, FT, RT, PT, Traits>;
// compute z
FT z = FT_(2)*v_basis[m+1] - prod(v,x,m+1);
CGAL_optimisation_assertion (!CGAL_NTS is_zero (z));
CGAL_assertion (!CGAL_NTS is_zero (z));
FT inv_z = FT_(1)/z;
// set up A^{-1}_{B^m}
@ -461,7 +461,7 @@ class Optimisation_sphere_d<Cartesian_tag, FT, RT, PT, Traits>;
// compute \tilde{z}
RT old_denom = denom[m-1];
RT z = old_denom*RT_(2)*sqr_q_m - prod(v,x,m+1);
CGAL_optimisation_assertion (!CGAL_NTS is_zero (z));
CGAL_assertion (!CGAL_NTS is_zero (z));
// set up \tilde{A}^{-1}_{B^m}
RT** M = inv[m-1]; // \tilde{A}^{-1}_B, old matrix
@ -503,7 +503,7 @@ class Optimisation_sphere_d<Cartesian_tag, FT, RT, PT, Traits>;
// get h_p
RT h_p = *(i++);
CGAL_optimisation_precondition (!CGAL_NTS is_zero (h_p));
CGAL_precondition (!CGAL_NTS is_zero (h_p));
// compute (h_p h D)^2 (c-p)^2
RT sqr_dist(RT(0));

View File

@ -20,7 +20,7 @@
#include <CGAL/Iso_rectangle_2.h>
#include <CGAL/basic_constructions_2.h>
#include <CGAL/pierce_rectangles_2.h>
#include <CGAL/Optimisation/assertions.h>
#include <CGAL/assertions.h>
namespace CGAL {
@ -228,21 +228,21 @@ struct Rectangular_p_center_matrix_search_traits_2 {
bool operator()(FT v)
{
CGAL_optimisation_assertion(ld.size() == ld_size);
CGAL_assertion(ld.size() == ld_size);
ld.r = v / FT(2);
bool ok;
pf(ld, Wastebasket< Point_2 >(), ok);
CGAL_optimisation_assertion(ld.size() == ld_size);
CGAL_assertion(ld.size() == ld_size);
return ok;
}
template < class OutputIterator >
OutputIterator operator()(FT v, OutputIterator o, bool& ok)
{
CGAL_optimisation_assertion(ld.size() == ld_size);
CGAL_assertion(ld.size() == ld_size);
ld.r = v / FT(2);
OutputIterator n = pf(ld, o, ok);
CGAL_optimisation_assertion(ld.size() == ld_size);
CGAL_assertion(ld.size() == ld_size);
return n; //pf(ld, o, ok);
}
@ -250,7 +250,7 @@ protected:
// data members:
LD ld;
PiercingFunction pf;
CGAL_optimisation_assertion_code(typename LD::size_type ld_size;)
CGAL_assertion_code(typename LD::size_type ld_size;)
// copying this would be too inefficient
Rectangular_p_center_matrix_search_traits_2(

View File

@ -18,7 +18,7 @@
#include <CGAL/basic.h>
#include <CGAL/Optimisation/assertions.h>
#include <CGAL/assertions.h>
#include <iterator>
#include <functional>
@ -346,8 +346,8 @@ min_rectangle_2(
{
typedef Optimisation::Min_quadrilateral_traits_wrapper<BTraits> Traits;
Traits t(bt);
CGAL_optimisation_expensive_precondition(is_convex_2(f, l, t));
CGAL_optimisation_expensive_precondition(
CGAL_expensive_precondition(is_convex_2(f, l, t));
CGAL_expensive_precondition(
orientation_2(f, l, t) == COUNTERCLOCKWISE);
// check for trivial cases
@ -395,7 +395,7 @@ min_rectangle_2(
int yet_to_finish = 0;
for (int i1 = 0; i1 < 4; ++i1) {
CGAL_optimisation_assertion(limit[i1] != l);
CGAL_assertion(limit[i1] != l);
if (curr[i1] != limit[i1])
++yet_to_finish;
}
@ -448,7 +448,7 @@ min_parallelogram_2(ForwardIterator f,
{
typedef Optimisation::Min_quadrilateral_traits_wrapper<BTraits> Traits;
Traits t(bt);
CGAL_optimisation_expensive_precondition(is_convex_2(f, l, t));
CGAL_expensive_precondition(is_convex_2(f, l, t));
// types from the traits class
typedef typename Traits::Direction_2 Direction_2;
@ -630,7 +630,7 @@ min_strip_2(ForwardIterator f,
{
typedef Optimisation::Min_quadrilateral_traits_wrapper<BTraits> Traits;
Traits t(bt);
CGAL_optimisation_expensive_precondition(is_convex_2(f, l, t));
CGAL_expensive_precondition(is_convex_2(f, l, t));
// types from the traits class
typedef typename Traits::Direction_2 Direction_2;

View File

@ -16,7 +16,7 @@
#include <CGAL/license/Bounding_volumes.h>
#include <CGAL/Optimisation/assertions.h>
#include <CGAL/assertions.h>
#include <CGAL/circulator.h>
#include <CGAL/algorithm.h>
#include <algorithm>
@ -75,7 +75,7 @@ struct Loc_domain {
void
update(int j, Citerator i)
{
CGAL_optimisation_precondition(j >= 0 && j < 4);
CGAL_precondition(j >= 0 && j < 4);
if (j < 2)
if (j == 0) {
if (traits.less_x_2_object()(*i, minx)) minx = *i;
@ -106,9 +106,9 @@ struct Loc_domain {
maxy(pts.front()),
traits(t)
{
CGAL_optimisation_precondition(b != e);
CGAL_precondition(b != e);
Iterator i = pts.begin();
CGAL_optimisation_assertion(i != pts.end());
CGAL_assertion(i != pts.end());
while (++i != pts.end()) {
if (traits.less_x_2_object()(*i, minx)) minx = *i;
if (traits.less_x_2_object()(maxx, *i)) maxx = *i;
@ -124,7 +124,7 @@ struct Loc_domain {
operator[](int i) const
// return corner points (0 <-> bottom-left, 1 <-> bottom-right)
{
CGAL_optimisation_precondition(i >= 0 && i < 4);
CGAL_precondition(i >= 0 && i < 4);
if (i == 0)
return traits.construct_point_2_above_right_implicit_point_2_object()(
minx, miny, r);
@ -142,7 +142,7 @@ struct Loc_domain {
extreme(int i) const
// return extreme points (0 <-> left, 1 <-> bottom)
{
CGAL_optimisation_precondition(i >= 0 && i < 4);
CGAL_precondition(i >= 0 && i < 4);
if (i > 1) return i == 2 ? maxx : maxy;
return i == 0 ? minx : miny;
}
@ -151,7 +151,7 @@ struct Loc_domain {
extreme(int i)
// return extreme points (0 <-> left, 1 <-> bottom)
{
CGAL_optimisation_precondition(i >= 0 && i < 4);
CGAL_precondition(i >= 0 && i < 4);
if (i > 1) return i == 2 ? maxx : maxy;
return i == 0 ? minx : miny;
}
@ -177,13 +177,13 @@ struct Loc_domain {
void
check() const {
CGAL_optimisation_expensive_assertion_code(
CGAL_expensive_assertion_code(
Iterator i = pts.begin();
do {
CGAL_optimisation_assertion(!traits.less_x_2_object()(*i, minx));
CGAL_optimisation_assertion(!traits.less_x_2_object()(maxx, *i));
CGAL_optimisation_assertion(!traits.less_y_2_object()(*i, miny));
CGAL_optimisation_assertion(!traits.less_y_2_object()(maxy, *i));
CGAL_assertion(!traits.less_x_2_object()(*i, minx));
CGAL_assertion(!traits.less_x_2_object()(maxx, *i));
CGAL_assertion(!traits.less_y_2_object()(*i, miny));
CGAL_assertion(!traits.less_y_2_object()(maxy, *i));
} while (++i != end);
)
}
@ -463,7 +463,7 @@ inline OutputIterator
two_cover_points(
InputIC f, InputIC l, OutputIterator o, bool& ok, const Traits& t)
{
CGAL_optimisation_precondition(f != l);
CGAL_precondition(f != l);
// compute location domain:
Loc_domain< Traits > d(f, l, t);
@ -475,7 +475,7 @@ inline OutputIterator
three_cover_points(
InputIC f, InputIC l, OutputIterator o, bool& ok, const Traits& t)
{
CGAL_optimisation_precondition(f != l);
CGAL_precondition(f != l);
// compute location domain:
Loc_domain< Traits > d(f, l, t);
@ -487,7 +487,7 @@ inline OutputIterator
four_cover_points(
InputIC f, InputIC l, OutputIterator o, bool& ok, const Traits& t)
{
CGAL_optimisation_precondition(f != l);
CGAL_precondition(f != l);
// compute location domain:
Loc_domain< Traits > d(f, l, t);
@ -562,7 +562,7 @@ three_cover_points(
using std::less;
using std::iter_swap;
CGAL_optimisation_precondition(!d.empty());
CGAL_precondition(!d.empty());
// typedefs:
typedef typename Traits::Point_2 Point_2;
@ -583,7 +583,7 @@ three_cover_points(
// are all points already covered?
if (i == d.end()) {
CGAL_optimisation_assertion(k == 0);
CGAL_assertion(k == 0);
*o++ = d[0];
ok = true;
return o;
@ -620,11 +620,11 @@ three_cover_points(
// check disjoint for two-pierceability:
CGAL_optimisation_expensive_assertion(
CGAL_expensive_assertion(
save_end == find_if(d.end(), save_end,
[&d, &dist, &corner](const Point_2& p)
{ return d.r < dist(corner, p); }));
CGAL_optimisation_expensive_assertion(
CGAL_expensive_assertion(
d.end() == find_if(d.begin(), d.end(),
[&d,&dist, &corner](const Point_2& p)
{ return d.r >= dist(corner, p); }));
@ -721,7 +721,7 @@ four_cover_points(Staircases< Traits >& d, OutputIterator o, bool& ok)
// are all points already covered?
if (i == d.end()) {
CGAL_optimisation_assertion(k == 0);
CGAL_assertion(k == 0);
*o++ = d[0];
ok = true;
return o;
@ -758,11 +758,11 @@ four_cover_points(Staircases< Traits >& d, OutputIterator o, bool& ok)
// check disjoint for two-pierceability:
CGAL_optimisation_expensive_assertion(
CGAL_expensive_assertion(
save_end == find_if(d.end(), save_end,
[&d,&dist,&corner](const Point_2& p)
{ return d.r < dist(corner, p); }));
CGAL_optimisation_expensive_assertion(
CGAL_expensive_assertion(
d.end() == find_if(d.begin(), d.end(),
[&d,&dist,&corner](const Point_2& p)
{ return d.r >= dist(corner, p); }));

View File

@ -17,7 +17,7 @@
#include <CGAL/basic.h>
#include <CGAL/Optimisation/assertions.h>
#include <CGAL/assertions.h>
#include <CGAL/algorithm.h>
#include <CGAL/Rectangular_p_center_traits_2.h>
#include <algorithm>
@ -965,7 +965,7 @@ rectangular_3_center_2_type2(
(Q_r_empty || op.compute_y_distance(q_r, Q_r) <= op.delta()(*m))) {
boost::function1<bool,FT>
greater_delta_m = boost::bind(less< FT >(), op.delta()(*m));
CGAL_optimisation_assertion_code(RandomAccessIterator iii =)
CGAL_assertion_code(RandomAccessIterator iii =)
find_if(e,
l,
boost::bind(logical_and< bool >(),
@ -973,7 +973,7 @@ rectangular_3_center_2_type2(
boost::bind(op.distance(), q_t, _1)),
boost::bind(greater_delta_m,
boost::bind(op.distance(), q_r, _1))));
CGAL_optimisation_assertion(iii == l);
CGAL_assertion(iii == l);
}
// check whether the points in [f,s) are covered
{
@ -985,7 +985,7 @@ rectangular_3_center_2_type2(
boost::bind(le_delta_m, boost::bind(op.distance(), q_t, _1)));
iii = partition(iii, s,
boost::bind(le_delta_m, boost::bind(op.distance(), q_r, _1)));
CGAL_optimisation_assertion(iii == s);
CGAL_assertion(iii == s);
}
#endif // CGAL_3COVER_CHECK
@ -1052,7 +1052,7 @@ rectangular_3_center_2_type2(
}
// step (e) [not enough points in G]
CGAL_optimisation_assertion(b1 - (m + 1) >= 5 * cutoff);
CGAL_assertion(b1 - (m + 1) >= 5 * cutoff);
// compute the four cutting lines for R
std::nth_element(m + 1, m + 1 + cutoff, b1, less_x_2);
@ -1113,7 +1113,7 @@ rectangular_3_center_2_type2(
// now s_b corresponds to the first moment in [s, m+1)
// where q_t and q_r cover B
CGAL_optimisation_assertion_code(bool loopcheck = false;)
CGAL_assertion_code(bool loopcheck = false;)
CGAL_3CENTER_REPEAT_CHECK:
// place q_t and q_r
q_t = op.place_x_square(q_t_afap, r, op.delta()(*s_b));
@ -1142,9 +1142,9 @@ CGAL_3CENTER_REPEAT_CHECK:
// in degenerate situations it can happen that the number of
// points in R is too small => decrease radius and check again
--s_b;
CGAL_optimisation_assertion(!loopcheck);
CGAL_optimisation_assertion(s != s_b);
CGAL_optimisation_assertion_code(loopcheck = true;)
CGAL_assertion(!loopcheck);
CGAL_assertion(s != s_b);
CGAL_assertion_code(loopcheck = true;)
goto CGAL_3CENTER_REPEAT_CHECK;
}
s = b1;
@ -1166,7 +1166,7 @@ CGAL_3CENTER_REPEAT_CHECK:
// we still have a covering
if (s_b == s) {
CGAL_optimisation_expensive_assertion_code(
CGAL_expensive_assertion_code(
std::vector< Point > tmppts(f, l);
RandomAccessIterator ii =
partition(tmppts.begin(), tmppts.end(),
@ -1174,9 +1174,9 @@ CGAL_3CENTER_REPEAT_CHECK:
IP tmppos = min_max_element(ii, tmppts.end(),
op.compare_x(), op.compare_y());
)
CGAL_optimisation_expensive_assertion(
CGAL_expensive_assertion(
!op.compare_x()(*tmppos.first, q_t));
CGAL_optimisation_expensive_assertion(
CGAL_expensive_assertion(
!op.compare_y()(q_r, *tmppos.second));
// we are done
@ -1219,7 +1219,7 @@ CGAL_3CENTER_REPEAT_CHECK:
[&op, s_b](const Point& p){ return op.delta()(*s_b) != op.delta()(p); });
rho_max = op.delta()(*s_b);
q_t_at_rho_max = q_t, q_r_at_rho_max = q_r;
CGAL_optimisation_assertion(op.delta()(*next) < op.delta()(*s_b));
CGAL_assertion(op.delta()(*next) < op.delta()(*s_b));
q_t_afap = op.update_x_square(q_t_afap, *s_b);
q_r_afap = op.update_y_square(q_r_afap, *s_b);
q_t = op.place_x_square(q_t_afap, r, op.delta()(*next));
@ -1255,7 +1255,7 @@ CGAL_3CENTER_REPEAT_CHECK:
}
CGAL_optimisation_assertion(b3 - b1 >= cutoff);
CGAL_assertion(b3 - b1 >= cutoff);
e = b1;
// adjust Q_t
if (b1 != b2) {
@ -1299,7 +1299,7 @@ CGAL_3CENTER_REPEAT_CHECK:
rho_max = max BOOST_PREVENT_MACRO_SUBSTITUTION (op.compute_x_distance(q_t, Q_t),
op.compute_y_distance(q_r, Q_r));
#ifndef CGAL_3COVER_NO_CHECK_OPTIMUM_FIRST
CGAL_optimisation_assertion(rho_max <= rad);
CGAL_assertion(rho_max <= rad);
#endif // ! CGAL_3COVER_NO_CHECK_OPTIMUM_FIRST
rad = rho_max;
*o++ = op.construct_corner_square(r, rad / FT(2));
@ -1307,7 +1307,7 @@ CGAL_3CENTER_REPEAT_CHECK:
*o++ = op.construct_y_square(q_r, rad / FT(2));
return o;
}
CGAL_optimisation_assertion(s != e);
CGAL_assertion(s != e);
// find the first diameter where covering is possible
for (;;) {
@ -1324,7 +1324,7 @@ CGAL_3CENTER_REPEAT_CHECK:
// try the next possible diameter value
FT try_rho = op.delta()(*t);
CGAL_optimisation_assertion(t == s || try_rho < rho_max);
CGAL_assertion(t == s || try_rho < rho_max);
q_t = op.place_x_square(q_t_afap, r, try_rho);
q_r = op.place_y_square(q_r_afap, r, try_rho);
@ -1370,8 +1370,8 @@ CGAL_3CENTER_REPEAT_CHECK:
// - q_r_at_rho_max is the corr. position of q_r.
// try rho_min
CGAL_optimisation_assertion(rho_min <= rho_max);
CGAL_optimisation_assertion(rho_min >= 0);
CGAL_assertion(rho_min <= rho_max);
CGAL_assertion(rho_min >= 0);
FT rad_2 = q_t_q_r_cover_at_rho_min;
if (s_at_rho_min != e_at_rho_min) {
auto mydist = [&q_t_at_rho_min, &q_r_at_rho_min, &op](const Point& p)
@ -1384,7 +1384,7 @@ CGAL_3CENTER_REPEAT_CHECK:
[&mydist](const Point& p1, const Point& p2)
{ return mydist(p1) < mydist(p2); })));
}
CGAL_optimisation_assertion(rad_2 == 0 || rad_2 > rho_min);
CGAL_assertion(rad_2 == 0 || rad_2 > rho_min);
// if a covering with rho == 0 is possible,
// it will be catched in the type1 functions
@ -1397,7 +1397,7 @@ CGAL_3CENTER_REPEAT_CHECK:
q_t = q_t_at_rho_min, q_r = q_r_at_rho_min;
#ifndef CGAL_3COVER_NO_CHECK_OPTIMUM_FIRST
CGAL_optimisation_assertion(rad_2 <= rad);
CGAL_assertion(rad_2 <= rad);
#endif // ! CGAL_3COVER_NO_CHECK_OPTIMUM_FIRST
rad = rad_2;
*o++ = op.construct_corner_square(r, rad / FT(2));
@ -1414,7 +1414,7 @@ rectangular_3_center_2(
typename Traits::FT& r,
Traits& t)
{
CGAL_optimisation_precondition(f != l);
CGAL_precondition(f != l);
typedef typename Traits::FT FT;
typedef typename Traits::Point_2 Point;
typedef typename Traits::Iso_rectangle_2 Rectangle;

View File

@ -72,8 +72,8 @@ public:
Value
operator()( int r, int c) const
{
CGAL_optimisation_precondition( r >= 0 && r < number_of_rows());
CGAL_optimisation_precondition( c >= 0 && c < number_of_columns());
CGAL_precondition( r >= 0 && r < number_of_rows());
CGAL_precondition( c >= 0 && c < number_of_columns());
return Base::operator()( r, number_of_columns() - 1 - c);
}
};
@ -145,7 +145,7 @@ rectangular_p_center_2_binary_search(
// --------------
//
{
CGAL_optimisation_precondition( f != l);
CGAL_precondition( f != l);
// typedefs:
typedef typename Traits::FT FT;
@ -171,7 +171,7 @@ rectangular_p_center_2_binary_search(
c_diffs.push_back( CGAL_NTS abs( i->x() - j->x()));
c_diffs.push_back( CGAL_NTS abs( i->y() - j->y()));
}
CGAL_optimisation_assertion(
CGAL_assertion(
c_diffs.size() == pierce_it.number_of_points() *
(pierce_it.number_of_points() - 1));
@ -195,12 +195,12 @@ rectangular_p_center_2_binary_search(
b = c + 1;
}
} // while ( e > b)
CGAL_optimisation_assertion( e == b);
CGAL_assertion( e == b);
// return the result:
r = c_diffs[e];
OutputIterator o_return( pierce_it( r, o, ok));
CGAL_optimisation_assertion( ok);
CGAL_assertion( ok);
return o_return;
} // rectangular_p_center_2_binary_search( ... )
@ -221,7 +221,7 @@ rectangular_p_center_2_matrix_search(
const MatrixOperator& mop)
{
std::size_t number_of_points( iterator_distance( f, l));
CGAL_optimisation_precondition( number_of_points > 0);
CGAL_precondition( number_of_points > 0);
using std::minus;
using std::sort;
@ -296,7 +296,7 @@ rectangular_p_center_2_matrix_search(
// return result:
OutputIterator o_return(pierce_it(r, o, ok));
CGAL_optimisation_assertion(ok);
CGAL_assertion(ok);
return o_return;
} // P_center_matrix_search
@ -341,7 +341,7 @@ rectangular_p_center_matrix_search_2(
FT& r,
int p)
{
CGAL_optimisation_precondition(p >= 2 && p < 5);
CGAL_precondition(p >= 2 && p < 5);
typename std::iterator_traits<ForwardIterator>::value_type::R t;
if (p == 2)
return rectangular_p_center_2_matrix_search(
@ -401,7 +401,7 @@ rectangular_p_center_2(ForwardIterator f,
int p,
Traits& t)
{
CGAL_optimisation_precondition(p >= 2 && p < 5);
CGAL_precondition(p >= 2 && p < 5);
r=0;
if ( !internal::is_distance_greater_than_p(f,l,p) ) return std::copy(f,l,o);
@ -422,7 +422,7 @@ rectangular_p_center_2(ForwardIterator f,
FT& r,
int p)
{
CGAL_optimisation_precondition(p >= 2 && p < 5);
CGAL_precondition(p >= 2 && p < 5);
typedef typename
std::iterator_traits< ForwardIterator >::value_type::R R;
Rectangular_p_center_default_traits_2< R > t;

View File

@ -53,13 +53,11 @@ upper hull of a set of points.
\cgalCRPSection{Assertions}
The assertion flags for the convex hull and extreme point algorithms
use `CH` in their names (<I>e.g.</I>, `CGAL_CH_NO_POSTCONDITIONS`).
For the convex hull algorithms, the postcondition
check tests only convexity (if not disabled), but not containment of the
input points in the polygon or polyhedron defined by the output points.
The latter is considered an expensive checking and can be enabled by
defining `CGAL_CH_CHECK_EXPENSIVE`.
defining `CGAL_CHECK_EXPENSIVE`.
\cgalCRPSection{Concepts}
@ -105,4 +103,3 @@ defining `CGAL_CH_CHECK_EXPENSIVE`.
*/

View File

@ -20,7 +20,7 @@
#include <CGAL/convexity_check_2.h>
#endif // CGAL_CH_NO_POSTCONDITIONS
#include <CGAL/Convex_hull_2/ch_assertions.h>
#include <CGAL/assertions.h>
#include <CGAL/ch_selected_extreme_points_2.h>
#include <CGAL/ch_graham_andrew.h>
#include <CGAL/algorithm.h>
@ -252,7 +252,7 @@ ch_akl_toussaint(ForwardIterator first, ForwardIterator last,
region3.push_back( *e);
region4.push_back( *n);
CGAL_ch_postcondition_code( ForwardIterator save_first = first; )
CGAL_postcondition_code( ForwardIterator save_first = first; )
int duplicated_exteme_points = (std::get<0>(ranges)==std::get<1>(ranges)?1:0) +
(std::get<1>(ranges)==std::get<2>(ranges)?1:0) +
@ -323,12 +323,12 @@ ch_akl_toussaint(ForwardIterator first, ForwardIterator last,
res, ch_traits);
}
CGAL_ch_postcondition_code( first = save_first; )
CGAL_ch_postcondition( \
CGAL_postcondition_code( first = save_first; )
CGAL_postcondition( \
is_ccw_strongly_convex_2( res.output_so_far_begin(), \
res.output_so_far_end(), \
ch_traits));
CGAL_ch_expensive_postcondition( \
CGAL_expensive_postcondition( \
ch_brute_force_check_2( \
first, last, \
res.output_so_far_begin(), res.output_so_far_end(), \

View File

@ -1,341 +0,0 @@
// Copyright (c) 1999 Max-Planck-Institute Saarbruecken (Germany).
// All rights reserved.
//
// This file is part of CGAL (www.cgal.org).
//
// $URL$
// $Id$
// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial
//
//
// Author(s) : Geert-Jan Giezeman, Sven Schoenherr
//
// Generated from script create_assertions.sh
// Note that this header file is intentionnaly not protected with a
// macro (as <cassert>). Calling it a second time with another value
// for CGAL_NO_ASSERTIONS for example must make a difference.
#include <CGAL/assertions.h>
// macro definitions
// =================
// assertions
// ----------
#undef CGAL_ch_assertion
#undef CGAL_ch_assertion_msg
#undef CGAL_ch_assertion_code
#if defined(CGAL_CH_NO_ASSERTIONS) || defined(CGAL_NO_ASSERTIONS)
# define CGAL_ch_assertion(EX) (static_cast<void>(0))
#include <CGAL/license/Convex_hull_2.h>
# define CGAL_ch_assertion_msg(EX,MSG) (static_cast<void>(0))
# define CGAL_ch_assertion_code(CODE)
#else
# define CGAL_ch_assertion(EX) \
(CGAL::possibly(EX)?(static_cast<void>(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__))
# define CGAL_ch_assertion_msg(EX,MSG) \
(CGAL::possibly(EX)?(static_cast<void>(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__, MSG))
# define CGAL_ch_assertion_code(CODE) CODE
# define CGAL_ch_assertions 1
#endif // CGAL_CH_NO_ASSERTIONS
#undef CGAL_ch_exactness_assertion
#undef CGAL_ch_exactness_assertion_msg
#undef CGAL_ch_exactness_assertion_code
#if defined(CGAL_CH_NO_ASSERTIONS) || defined(CGAL_NO_ASSERTIONS) \
|| (!defined(CGAL_CH_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS))
# define CGAL_ch_exactness_assertion(EX) (static_cast<void>(0))
# define CGAL_ch_exactness_assertion_msg(EX,MSG) (static_cast<void>(0))
# define CGAL_ch_exactness_assertion_code(CODE)
#else
# define CGAL_ch_exactness_assertion(EX) \
(CGAL::possibly(EX)?(static_cast<void>(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__))
# define CGAL_ch_exactness_assertion_msg(EX,MSG) \
(CGAL::possibly(EX)?(static_cast<void>(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__, MSG))
# define CGAL_ch_exactness_assertion_code(CODE) CODE
# define CGAL_ch_exactness_assertions 1
#endif // CGAL_CH_NO_ASSERTIONS
#undef CGAL_ch_expensive_assertion
#undef CGAL_ch_expensive_assertion_msg
#undef CGAL_ch_expensive_assertion_code
#if defined(CGAL_CH_NO_ASSERTIONS) \
|| defined(CGAL_NO_ASSERTIONS) \
|| (!defined(CGAL_CH_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE))
# define CGAL_ch_expensive_assertion(EX) (static_cast<void>(0))
# define CGAL_ch_expensive_assertion_msg(EX,MSG) (static_cast<void>(0))
# define CGAL_ch_expensive_assertion_code(CODE)
#else
# define CGAL_ch_expensive_assertion(EX) \
(CGAL::possibly(EX)?(static_cast<void>(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__))
# define CGAL_ch_expensive_assertion_msg(EX,MSG) \
(CGAL::possibly(EX)?(static_cast<void>(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__, MSG))
# define CGAL_ch_expensive_assertion_code(CODE) CODE
# define CGAL_ch_expensive_assertions 1
#endif // CGAL_CH_NO_ASSERTIONS
#undef CGAL_ch_expensive_exactness_assertion
#undef CGAL_ch_expensive_exactness_assertion_msg
#undef CGAL_ch_expensive_exactness_assertion_code
#if defined(CGAL_CH_NO_ASSERTIONS) || defined(CGAL_NO_ASSERTIONS) \
|| (!defined(CGAL_CH_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS))\
|| (!defined(CGAL_CH_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE))
# define CGAL_ch_expensive_exactness_assertion(EX) (static_cast<void>(0))
# define CGAL_ch_expensive_exactness_assertion_msg(EX,MSG) (static_cast<void>(0))
# define CGAL_ch_expensive_exactness_assertion_code(CODE)
#else
# define CGAL_ch_expensive_exactness_assertion(EX) \
(CGAL::possibly(EX)?(static_cast<void>(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__))
# define CGAL_ch_expensive_exactness_assertion_msg(EX,MSG) \
(CGAL::possibly(EX)?(static_cast<void>(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__, MSG))
# define CGAL_ch_expensive_exactness_assertion_code(CODE) CODE
# define CGAL_ch_expensive_exactness_assertions 1
#endif // CGAL_CH_NO_ASSERTIONS
// preconditions
// -------------
#undef CGAL_ch_precondition
#undef CGAL_ch_precondition_msg
#undef CGAL_ch_precondition_code
#if defined(CGAL_CH_NO_PRECONDITIONS) || defined(CGAL_NO_PRECONDITIONS)
# define CGAL_ch_precondition(EX) (static_cast<void>(0))
# define CGAL_ch_precondition_msg(EX,MSG) (static_cast<void>(0))
# define CGAL_ch_precondition_code(CODE)
#else
# define CGAL_ch_precondition(EX) \
(CGAL::possibly(EX)?(static_cast<void>(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__))
# define CGAL_ch_precondition_msg(EX,MSG) \
(CGAL::possibly(EX)?(static_cast<void>(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__, MSG))
# define CGAL_ch_precondition_code(CODE) CODE
# define CGAL_ch_preconditions 1
#endif // CGAL_CH_NO_PRECONDITIONS
#undef CGAL_ch_exactness_precondition
#undef CGAL_ch_exactness_precondition_msg
#undef CGAL_ch_exactness_precondition_code
#if defined(CGAL_CH_NO_PRECONDITIONS) || defined(CGAL_NO_PRECONDITIONS) \
|| (!defined(CGAL_CH_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS))
# define CGAL_ch_exactness_precondition(EX) (static_cast<void>(0))
# define CGAL_ch_exactness_precondition_msg(EX,MSG) (static_cast<void>(0))
# define CGAL_ch_exactness_precondition_code(CODE)
#else
# define CGAL_ch_exactness_precondition(EX) \
(CGAL::possibly(EX)?(static_cast<void>(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__))
# define CGAL_ch_exactness_precondition_msg(EX,MSG) \
(CGAL::possibly(EX)?(static_cast<void>(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__, MSG))
# define CGAL_ch_exactness_precondition_code(CODE) CODE
# define CGAL_ch_exactness_preconditions 1
#endif // CGAL_CH_NO_PRECONDITIONS
#undef CGAL_ch_expensive_precondition
#undef CGAL_ch_expensive_precondition_msg
#undef CGAL_ch_expensive_precondition_code
#if defined(CGAL_CH_NO_PRECONDITIONS) || defined(CGAL_NO_PRECONDITIONS) \
|| (!defined(CGAL_CH_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE))
# define CGAL_ch_expensive_precondition(EX) (static_cast<void>(0))
# define CGAL_ch_expensive_precondition_msg(EX,MSG) (static_cast<void>(0))
# define CGAL_ch_expensive_precondition_code(CODE)
#else
# define CGAL_ch_expensive_precondition(EX) \
(CGAL::possibly(EX)?(static_cast<void>(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__))
# define CGAL_ch_expensive_precondition_msg(EX,MSG) \
(CGAL::possibly(EX)?(static_cast<void>(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__, MSG))
# define CGAL_ch_expensive_precondition_code(CODE) CODE
# define CGAL_ch_expensive_preconditions 1
#endif // CGAL_CH_NO_PRECONDITIONS
#undef CGAL_ch_expensive_exactness_precondition
#undef CGAL_ch_expensive_exactness_precondition_msg
#undef CGAL_ch_expensive_exactness_precondition_code
#if defined(CGAL_CH_NO_PRECONDITIONS) || defined(CGAL_NO_PRECONDITIONS) \
|| (!defined(CGAL_CH_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS))\
|| (!defined(CGAL_CH_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE))
# define CGAL_ch_expensive_exactness_precondition(EX) (static_cast<void>(0))
# define CGAL_ch_expensive_exactness_precondition_msg(EX,MSG) (static_cast<void>(0))
# define CGAL_ch_expensive_exactness_precondition_code(CODE)
#else
# define CGAL_ch_expensive_exactness_precondition(EX) \
(CGAL::possibly(EX)?(static_cast<void>(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__))
# define CGAL_ch_expensive_exactness_precondition_msg(EX,MSG) \
(CGAL::possibly(EX)?(static_cast<void>(0)): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__, MSG))
# define CGAL_ch_expensive_exactness_precondition_code(CODE) CODE
# define CGAL_ch_expensive_exactness_preconditions 1
#endif // CGAL_CH_NO_PRECONDITIONS
// postconditions
// --------------
#undef CGAL_ch_postcondition
#undef CGAL_ch_postcondition_msg
#undef CGAL_ch_postcondition_code
#if defined(CGAL_CH_NO_POSTCONDITIONS) || defined(CGAL_NO_POSTCONDITIONS)
# define CGAL_ch_postcondition(EX) (static_cast<void>(0))
# define CGAL_ch_postcondition_msg(EX,MSG) (static_cast<void>(0))
# define CGAL_ch_postcondition_code(CODE)
#else
# define CGAL_ch_postcondition(EX) \
(CGAL::possibly(EX)?(static_cast<void>(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__))
# define CGAL_ch_postcondition_msg(EX,MSG) \
(CGAL::possibly(EX)?(static_cast<void>(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__, MSG))
# define CGAL_ch_postcondition_code(CODE) CODE
# define CGAL_ch_postconditions 1
#endif // CGAL_CH_NO_POSTCONDITIONS
#undef CGAL_ch_exactness_postcondition
#undef CGAL_ch_exactness_postcondition_msg
#undef CGAL_ch_exactness_postcondition_code
#if defined(CGAL_CH_NO_POSTCONDITIONS) || defined(CGAL_NO_POSTCONDITIONS) \
|| (!defined(CGAL_CH_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS))
# define CGAL_ch_exactness_postcondition(EX) (static_cast<void>(0))
# define CGAL_ch_exactness_postcondition_msg(EX,MSG) (static_cast<void>(0))
# define CGAL_ch_exactness_postcondition_code(CODE)
#else
# define CGAL_ch_exactness_postcondition(EX) \
(CGAL::possibly(EX)?(static_cast<void>(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__))
# define CGAL_ch_exactness_postcondition_msg(EX,MSG) \
(CGAL::possibly(EX)?(static_cast<void>(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__, MSG))
# define CGAL_ch_exactness_postcondition_code(CODE) CODE
# define CGAL_ch_exactness_postconditions 1
#endif // CGAL_CH_NO_POSTCONDITIONS
#undef CGAL_ch_expensive_postcondition
#undef CGAL_ch_expensive_postcondition_msg
#undef CGAL_ch_expensive_postcondition_code
#if defined(CGAL_CH_NO_POSTCONDITIONS) || defined(CGAL_NO_POSTCONDITIONS) \
|| (!defined(CGAL_CH_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE))
# define CGAL_ch_expensive_postcondition(EX) (static_cast<void>(0))
# define CGAL_ch_expensive_postcondition_msg(EX,MSG) (static_cast<void>(0))
# define CGAL_ch_expensive_postcondition_code(CODE)
#else
# define CGAL_ch_expensive_postcondition(EX) \
(CGAL::possibly(EX)?(static_cast<void>(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__))
# define CGAL_ch_expensive_postcondition_msg(EX,MSG) \
(CGAL::possibly(EX)?(static_cast<void>(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__, MSG))
# define CGAL_ch_expensive_postcondition_code(CODE) CODE
# define CGAL_ch_expensive_postconditions 1
#endif // CGAL_CH_NO_POSTCONDITIONS
#undef CGAL_ch_expensive_exactness_postcondition
#undef CGAL_ch_expensive_exactness_postcondition_msg
#undef CGAL_ch_expensive_exactness_postcondition_code
#if defined(CGAL_CH_NO_POSTCONDITIONS) || defined(CGAL_NO_POSTCONDITIONS) \
|| (!defined(CGAL_CH_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS))\
|| (!defined(CGAL_CH_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE))
# define CGAL_ch_expensive_exactness_postcondition(EX) (static_cast<void>(0))
# define CGAL_ch_expensive_exactness_postcondition_msg(EX,MSG) (static_cast<void>(0))
# define CGAL_ch_expensive_exactness_postcondition_code(CODE)
#else
# define CGAL_ch_expensive_exactness_postcondition(EX) \
(CGAL::possibly(EX)?(static_cast<void>(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__))
# define CGAL_ch_expensive_exactness_postcondition_msg(EX,MSG) \
(CGAL::possibly(EX)?(static_cast<void>(0)): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__, MSG))
# define CGAL_ch_expensive_exactness_postcondition_code(CODE) CODE
# define CGAL_ch_expensive_exactness_postconditions 1
#endif // CGAL_CH_NO_POSTCONDITIONS
// warnings
// --------
#undef CGAL_ch_warning
#undef CGAL_ch_warning_msg
#undef CGAL_ch_warning_code
#if defined(CGAL_CH_NO_WARNINGS) || defined(CGAL_NO_WARNINGS)
# define CGAL_ch_warning(EX) (static_cast<void>(0))
# define CGAL_ch_warning_msg(EX,MSG) (static_cast<void>(0))
# define CGAL_ch_warning_code(CODE)
#else
# define CGAL_ch_warning(EX) \
(CGAL::possibly(EX)?(static_cast<void>(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__))
# define CGAL_ch_warning_msg(EX,MSG) \
(CGAL::possibly(EX)?(static_cast<void>(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__, MSG))
# define CGAL_ch_warning_code(CODE) CODE
# define CGAL_ch_warnings 1
#endif // CGAL_CH_NO_WARNINGS
#undef CGAL_ch_exactness_warning
#undef CGAL_ch_exactness_warning_msg
#undef CGAL_ch_exactness_warning_code
#if defined(CGAL_CH_NO_WARNINGS) || defined(CGAL_NO_WARNINGS) \
|| (!defined(CGAL_CH_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS))
# define CGAL_ch_exactness_warning(EX) (static_cast<void>(0))
# define CGAL_ch_exactness_warning_msg(EX,MSG) (static_cast<void>(0))
# define CGAL_ch_exactness_warning_code(CODE)
#else
# define CGAL_ch_exactness_warning(EX) \
(CGAL::possibly(EX)?(static_cast<void>(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__))
# define CGAL_ch_exactness_warning_msg(EX,MSG) \
(CGAL::possibly(EX)?(static_cast<void>(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__, MSG))
# define CGAL_ch_exactness_warning_code(CODE) CODE
# define CGAL_ch_exactness_warnings 1
#endif // CGAL_CH_NO_WARNINGS
#undef CGAL_ch_expensive_warning
#undef CGAL_ch_expensive_warning_msg
#undef CGAL_ch_expensive_warning_code
#if defined(CGAL_CH_NO_WARNINGS) || defined(CGAL_NO_WARNINGS) \
|| (!defined(CGAL_CH_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE))
# define CGAL_ch_expensive_warning(EX) (static_cast<void>(0))
# define CGAL_ch_expensive_warning_msg(EX,MSG) (static_cast<void>(0))
# define CGAL_ch_expensive_warning_code(CODE)
#else
# define CGAL_ch_expensive_warning(EX) \
(CGAL::possibly(EX)?(static_cast<void>(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__))
# define CGAL_ch_expensive_warning_msg(EX,MSG) \
(CGAL::possibly(EX)?(static_cast<void>(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__, MSG))
# define CGAL_ch_expensive_warning_code(CODE) CODE
# define CGAL_ch_expensive_warnings 1
#endif // CGAL_CH_NO_WARNINGS
#undef CGAL_ch_expensive_exactness_warning
#undef CGAL_ch_expensive_exactness_warning_msg
#undef CGAL_ch_expensive_exactness_warning_code
#if defined(CGAL_CH_NO_WARNINGS) || defined(CGAL_NO_WARNINGS) \
|| (!defined(CGAL_CH_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS))\
|| (!defined(CGAL_CH_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE))
# define CGAL_ch_expensive_exactness_warning(EX) (static_cast<void>(0))
# define CGAL_ch_expensive_exactness_warning_msg(EX,MSG) (static_cast<void>(0))
# define CGAL_ch_expensive_exactness_warning_code(CODE)
#else
# define CGAL_ch_expensive_exactness_warning(EX) \
(CGAL::possibly(EX)?(static_cast<void>(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__))
# define CGAL_ch_expensive_exactness_warning_msg(EX,MSG) \
(CGAL::possibly(EX)?(static_cast<void>(0)): ::CGAL::warning_fail( # EX , __FILE__, __LINE__, MSG))
# define CGAL_ch_expensive_exactness_warning_code(CODE) CODE
# define CGAL_ch_expensive_exactness_warnings 1
#endif // CGAL_CH_NO_WARNINGS

View File

@ -20,7 +20,7 @@
#include <CGAL/convexity_check_2.h>
#endif // CGAL_CH_NO_POSTCONDITIONS
#include <CGAL/Convex_hull_2/ch_assertions.h>
#include <CGAL/assertions.h>
#include <CGAL/ch_selected_extreme_points_2.h>
#include <CGAL/ch_graham_andrew.h>
#include <CGAL/algorithm.h>
@ -116,11 +116,11 @@ ch_bykat(InputIterator first, InputIterator last,
r = R.back(); R.pop_back();
}
}
CGAL_ch_postcondition( \
CGAL_postcondition( \
is_ccw_strongly_convex_2( res.output_so_far_begin(), \
res.output_so_far_end(), \
ch_traits));
CGAL_ch_expensive_postcondition( \
CGAL_expensive_postcondition( \
ch_brute_force_check_2( \
P.begin(), P.end(), \
res.output_so_far_begin(), res.output_so_far_end(), \
@ -255,11 +255,11 @@ ch_bykat_with_threshold(InputIterator first, InputIterator last,
r = R.back(); R.pop_back();
}
}
CGAL_ch_postcondition( \
CGAL_postcondition( \
is_ccw_strongly_convex_2( res.output_so_far_begin(), \
res.output_so_far_end(), \
ch_traits));
CGAL_ch_expensive_postcondition( \
CGAL_expensive_postcondition( \
ch_brute_force_check_2( \
Pbegin, Pend, \
res.output_so_far_begin(), res.output_so_far_end(), \

View File

@ -20,7 +20,7 @@
#include <CGAL/convexity_check_2.h>
#endif // CGAL_CH_NO_POSTCONDITIONS
#include <CGAL/Convex_hull_2/ch_assertions.h>
#include <CGAL/assertions.h>
#include <CGAL/ch_selected_extreme_points_2.h>
#include <CGAL/algorithm.h>
#include <list>
@ -44,7 +44,7 @@ ch__recursive_eddy(List& L,
Left_turn_2 left_turn = ch_traits.left_turn_2_object();
Less_xy_2 less_xy = ch_traits.less_xy_2_object();
CGAL_ch_precondition( \
CGAL_precondition( \
std::find_if(a_it, b_it, \
[&left_turn, a_it, b_it](const Point_2& p)
{ return left_turn(*b_it, *a_it, p); }) \
@ -137,9 +137,9 @@ ch_eddy(InputIterator first, InputIterator last,
ch__recursive_eddy( L, e, w, ch_traits);
CGAL_ch_postcondition( \
CGAL_postcondition( \
is_ccw_strongly_convex_2( L.begin(), w, ch_traits) );
CGAL_ch_expensive_postcondition( \
CGAL_expensive_postcondition( \
ch_brute_force_check_2( first, last, \
L.begin(), w, ch_traits ) );

View File

@ -21,7 +21,7 @@
#include <CGAL/convexity_check_2.h>
#endif // CGAL_CH_NO_POSTCONDITIONS
#include <CGAL/Convex_hull_2/ch_assertions.h>
#include <CGAL/assertions.h>
#include <CGAL/algorithm.h>
#include <CGAL/IO/Tee_for_output_iterator.h>
#include <vector>
@ -42,11 +42,11 @@ ch_graham_andrew_scan( BidirectionalIterator first,
BidirectionalIterator alpha;
BidirectionalIterator beta;
BidirectionalIterator iter;
CGAL_ch_precondition( first != last );
CGAL_ch_precondition( std::next(first) != last );
CGAL_precondition( first != last );
CGAL_precondition( std::next(first) != last );
--last;
CGAL_ch_precondition( *first != *last );
CGAL_precondition( *first != *last );
S.push_back( last );
S.push_back( first );
Left_turn left_turn = ch_traits.left_turn_2_object();
@ -78,7 +78,7 @@ ch_graham_andrew_scan( BidirectionalIterator first,
alpha = beta;
stack_rev_iter = S.rbegin();
beta = *++stack_rev_iter;
CGAL_ch_assertion(S.size() >= 2);
CGAL_assertion(S.size() >= 2);
}
S.push_back( iter );
beta = alpha;
@ -98,11 +98,11 @@ ch_graham_andrew_scan( BidirectionalIterator first,
#endif // no postconditions ...
for ( ++stack_iter; stack_iter != S.end(); ++stack_iter)
{ *res = **stack_iter; ++res; }
CGAL_ch_postcondition( \
CGAL_postcondition( \
is_ccw_strongly_convex_2( res.output_so_far_begin(), \
res.output_so_far_end(), \
ch_traits));
CGAL_ch_expensive_postcondition( \
CGAL_expensive_postcondition( \
ch_brute_force_chain_check_2( \
first, last, \
res.output_so_far_begin(), res.output_so_far_end(), \
@ -123,7 +123,7 @@ ch__ref_graham_andrew_scan( BidirectionalIterator first,
{
typedef typename Traits::Left_turn_2 Left_turn;
CGAL_ch_precondition_code(
CGAL_precondition_code(
typedef typename Traits::Equal_2 Equal_2;
Equal_2 equal_points = ch_traits.equal_2_object();
)
@ -134,11 +134,11 @@ ch__ref_graham_andrew_scan( BidirectionalIterator first,
BidirectionalIterator alpha;
BidirectionalIterator beta;
BidirectionalIterator iter;
CGAL_ch_precondition( first != last );
CGAL_ch_precondition( std::next(first) != last );
CGAL_precondition( first != last );
CGAL_precondition( std::next(first) != last );
--last;
CGAL_ch_precondition(! equal_points(*first,*last) );
CGAL_precondition(! equal_points(*first,*last) );
S.push_back( last );
S.push_back( first );
@ -168,7 +168,7 @@ ch__ref_graham_andrew_scan( BidirectionalIterator first,
alpha = beta;
stack_rev_iter = S.rbegin();
beta = *++stack_rev_iter;
CGAL_ch_assertion(S.size() >= 2);
CGAL_assertion(S.size() >= 2);
}
S.push_back( iter );
beta = alpha;
@ -213,11 +213,11 @@ ch_graham_andrew( InputIterator first,
#endif // no postconditions ...
ch__ref_graham_andrew_scan( V.begin(), V.end(), res, ch_traits);
ch__ref_graham_andrew_scan( V.rbegin(), V.rend(), res, ch_traits);
CGAL_ch_postcondition( \
CGAL_postcondition( \
is_ccw_strongly_convex_2( res.output_so_far_begin(), \
res.output_so_far_end(), \
ch_traits));
CGAL_ch_expensive_postcondition( \
CGAL_expensive_postcondition( \
ch_brute_force_check_2( \
V.begin(), V.end(), \
res.output_so_far_begin(), res.output_so_far_end(), \

View File

@ -21,7 +21,7 @@
#endif // CGAL_CH_NO_POSTCONDITIONS
#include <CGAL/IO/Tee_for_output_iterator.h>
#include <CGAL/Convex_hull_2/ch_assertions.h>
#include <CGAL/assertions.h>
#include <CGAL/ch_selected_extreme_points_2.h>
#include <algorithm>
@ -48,16 +48,16 @@ ch_jarvis_march(ForwardIterator first, ForwardIterator last,
typedef typename Traits::Point_2 Point_2;
Tee_for_output_iterator<OutputIterator,Point_2> res(result);
#endif // no postconditions ...
CGAL_ch_assertion_code( \
CGAL_assertion_code( \
int count_points = 0; )
CGAL_ch_assertion_code( \
CGAL_assertion_code( \
for (ForwardIterator fit = first; fit!= last; ++fit) ++count_points; )
Less_rotate_ccw
rotation_predicate = ch_traits.less_rotate_ccw_2_object( );
*res = start_p; ++res;
CGAL_ch_assertion_code( \
CGAL_assertion_code( \
int constructed_points = 1; )
CGAL_ch_exactness_assertion_code( \
CGAL_exactness_assertion_code( \
Point previous_point = start_p; )
ForwardIterator it = std::min_element( first, last,
@ -65,26 +65,26 @@ ch_jarvis_march(ForwardIterator first, ForwardIterator last,
{return rotation_predicate(start_p, p1, p2);} );
while (! equal_points(*it, stop_p) )
{
CGAL_ch_exactness_assertion( \
CGAL_exactness_assertion( \
*it != previous_point );
CGAL_ch_exactness_assertion_code( \
CGAL_exactness_assertion_code( \
previous_point = *it; )
*res = *it; ++res;
CGAL_ch_assertion_code( \
CGAL_assertion_code( \
++constructed_points;)
CGAL_ch_assertion( \
CGAL_assertion( \
constructed_points <= count_points + 1 );
it = std::min_element( first, last,
[it, &rotation_predicate](const Point& p1, const Point& p2)
{return rotation_predicate(*it, p1, p2);} );
}
CGAL_ch_postcondition( \
CGAL_postcondition( \
is_ccw_strongly_convex_2( res.output_so_far_begin(), \
res.output_so_far_end(), \
ch_traits));
CGAL_ch_expensive_postcondition( \
CGAL_expensive_postcondition( \
ch_brute_force_check_2(
first, last, \
res.output_so_far_begin(), res.output_so_far_end(), \

View File

@ -19,7 +19,7 @@
#include <CGAL/convexity_check_2.h>
#endif // CGAL_CH_NO_POSTCONDITIONS
#include <CGAL/Convex_hull_2/ch_assertions.h>
#include <CGAL/assertions.h>
#include <algorithm>
#include <deque>
@ -37,19 +37,19 @@ ch_melkman( InputIterator first, InputIterator last,
typename Traits::Left_turn_2 left_turn = ch_traits.left_turn_2_object();
Equal_2 equal_points = ch_traits.equal_2_object();
CGAL_ch_assertion_code( \
CGAL_assertion_code( \
typename Traits::Less_xy_2 less = ch_traits.less_xy_2_object(); )
std::deque< Point> Q;
CGAL_ch_expensive_postcondition_code( std::deque< Point> IN; )
CGAL_expensive_postcondition_code( std::deque< Point> IN; )
if (first == last) return result; // 0 elements
Point p = *first;
CGAL_ch_expensive_postcondition_code( IN.push_back(p); )
CGAL_expensive_postcondition_code( IN.push_back(p); )
if (++first == last)
{ *result = p; ++result; return result; } // 1 element
Point q = *first;
CGAL_ch_expensive_postcondition_code( IN.push_back(q); )
CGAL_expensive_postcondition_code( IN.push_back(q); )
if (++first == last) // 2 elements
{
*result = p; ++result;
@ -63,11 +63,11 @@ ch_melkman( InputIterator first, InputIterator last,
while (first != last)
{
r = *first;
CGAL_ch_expensive_postcondition_code( IN.push_back(r); )
CGAL_expensive_postcondition_code( IN.push_back(r); )
// visited input sequence = p,..., q, r
if ( left_turn(p,q,r)) { Q.push_back( q); break; }
if ( left_turn(q,p,r)) { Q.push_front( q); break; }
CGAL_ch_assertion( less( p, q) ? less (p, r) : less( r, p));
CGAL_assertion( less( p, q) ? less (p, r) : less( r, p));
q = r;
++first;
}
@ -84,7 +84,7 @@ ch_melkman( InputIterator first, InputIterator last,
while ( ++first != last)
{
r = *first;
CGAL_ch_expensive_postcondition_code( IN.push_back(r); )
CGAL_expensive_postcondition_code( IN.push_back(r); )
if (left_turn( current, r, Q.front()) ||
left_turn( Q.back(), r, current))
// r outside cone Q.front(), current, Q.back() <=>
@ -110,9 +110,9 @@ ch_melkman( InputIterator first, InputIterator last,
Q.push_back( current); // add last point to Q
CGAL_ch_postcondition( \
CGAL_postcondition( \
is_ccw_strongly_convex_2( Q.begin(), Q.end(), ch_traits));
CGAL_ch_expensive_postcondition( \
CGAL_expensive_postcondition( \
ch_brute_force_check_2( IN.begin(),IN.end(), Q.begin(),Q.end(), ch_traits));
std::copy( Q.begin(), Q.end(), result);
return result;

View File

@ -52,13 +52,11 @@ points in is strongly convex or not. This chapter describes the functions
available for three dimensions.
\cgalCRPSection{Assertions}
The assertion flags for the convex hull and extreme point algorithms
use `CH` in their names (<I>e.g.</I>, `CGAL_CH_NO_POSTCONDITIONS`).
For the convex hull algorithms, the postcondition
check tests only convexity (if not disabled), but not containment of the
input points in the polygon or polyhedron defined by the output points.
The latter is considered an expensive checking and can be enabled by
defining `CGAL_CH_CHECK_EXPENSIVE`.
defining `CGAL_CHECK_EXPENSIVE`.
\cgalClassifedRefPages

View File

@ -73,7 +73,6 @@ namespace CGAL
std::unordered_map <Facet_const_handle, vertex_descriptor> primal_vertices;
size_t n = 0;
// First, computing the primal vertices
for(Facet_const_handle fd : faces(_dual)){
@ -111,7 +110,6 @@ namespace CGAL
vertex_descriptor vd = add_vertex(primal);
primal_vertices[fd] = vd;
put(vpm, vd, ppp);
++n;
}
// Then, add facets to the primal polyhedron
@ -283,4 +281,3 @@ namespace CGAL
#include <CGAL/enable_warnings.h>
#endif // CGAL_HALFSPACE_INTERSECTION_3_H

View File

@ -20,7 +20,7 @@
#include <CGAL/algorithm.h>
#include <CGAL/convex_hull_2.h>
#include <CGAL/Convex_hull_traits_3.h>
#include <CGAL/Convex_hull_2/ch_assertions.h>
#include <CGAL/assertions.h>
#include <CGAL/Convex_hull_face_base_2.h>
#include <CGAL/Convex_hull_vertex_base_2.h>
#include <CGAL/Projection_traits_xy_3.h>
@ -565,7 +565,7 @@ farthest_outside_point(Face_handle f, std::list<Point>& outside_set,
{
typedef typename std::list<Point>::iterator Outside_set_iterator;
CGAL_ch_assertion(!outside_set.empty());
CGAL_assertion(!outside_set.empty());
typename Traits::Plane_3 plane =
traits.construct_plane_3_object()(f->vertex(0)->point(),
@ -682,7 +682,7 @@ ch_quickhull_3_scan(TDS_2& tds,
border.erase(it);
while(! border.empty()){
it = border.find(e.first->vertex(TDS_2::ccw(e.second)));
CGAL_ch_assertion(it != border.end());
CGAL_assertion(it != border.end());
e = it->second;
e.first->info() = 0;
edges.push_back(e);
@ -758,9 +758,9 @@ void non_coplanar_quickhull_3(std::list<typename Traits::Point_3>& points,
ch_quickhull_3_scan(tds, pending_facets, traits);
//std::cout << "|V(tds)| = " << tds.number_of_vertices() << std::endl;
// CGAL_ch_expensive_postcondition(all_points_inside(points.begin(),
// CGAL_expensive_postcondition(all_points_inside(points.begin(),
// points.end(),P,traits));
// CGAL_ch_postcondition(is_strongly_convex_3(P, traits));
// CGAL_postcondition(is_strongly_convex_3(P, traits));
}
template <class InputIterator, class PolygonMesh, class Traits>

View File

@ -22,7 +22,6 @@
#include <CGAL/Simple_cartesian.h>
#include <CGAL/Polyhedron_3.h>
#include <CGAL/Convex_hull_2/ch_assertions.h>
#include <CGAL/convex_hull_3.h>
#include <vector>
#include <fstream>

View File

@ -145,64 +145,19 @@ To disable all checks in the library, the flag `CGAL_NDEBUG` can be set.
Note that the standard flag `NDEBUG` sets `CGAL_NDEBUG`,
but it also affects the `assert` macro.
To enable expensive and exactness checks, respectively, the compile-time
flags `CGAL_CHECK_EXPENSIVE`
and `CGAL_CHECK_EXACTNESS`
have to be supplied. However, exactness checks should only be turned on if
To enable expensive and exactness checks, respectively, the preprocessor macros
`CGAL_CHECK_EXPENSIVE` and `CGAL_CHECK_EXACTNESS`
have to be defined. However, exactness checks should only be turned on if
the computation is done with some exact number type.
\section secchecks_controlling Controlling checks at a finer granularity
The macros and related compile-time flags described so far all operate
on the whole library. Sometimes the user may want to have a more
selective control. \cgal offers the possibility to turn checks on
and off on a per-package basis. Therefore a package-specific term is
inserted in the macro names directly after the \cgal prefix,
<I>e.g.</I>, `CGAL_kernel_assertion(<Cond>)`. Similarly, the uppercase
term is used for the compile-time flags;
<I>e.g.</I>, `CGAL_KERNEL_NO_WARNINGS` switches off the warnings
in <I>only</I> the kernel. Other packages have their own specific
terms as documented in the corresponding chapters of the
reference manual.
For a new package you will first have to create a suitable header file
with all macro definitions. This is done with the shell script
<TT>cgal_create_assertions.sh</TT>, to be found in the
<TT>scripts</TT> directory.
The following command will create a file <TT>optimisation_assertions.h</TT>:
<CENTER>
<TT>sh cgal_create_assertions.sh optimisation</TT>
</CENTER>
You should place the generated file in the proper directory (and possibly
rename it). Then you can use the checks in the following fashion.
\code{.cpp}
#include <CGAL/Optimisation/assertions.h>
void optimisation_foo( int i)
{
CGAL_optimisation_precondition_msg( i == 42, "Only 42 allowed!");
// ...
}
\endcode
The documentation of your new package has to name the term chosen to be
part of the package-specific macros in
order to enable the user to selectively turn off and on the checks of
your package. For example, in the documentation of the optimisation
package you can find a sentence similar to the following.
<BLOCKQUOTE>
The optimisation code uses the term OPTIMISATION for the checks;
<I>e.g.</I>, setting the compile time flag
`CGAL_OPTIMISATION_NO_PRECONDITIONS` switches off precondition
checking in the optimisation code.
</BLOCKQUOTE>
on the whole library. \cgal offers the possibility to turn checks on
and off just for the kernel. Kernel assertions are stated using the
macro `CGAL_kernel_assertion(<Cond>)`, and they can be disabled by defining
the macros `CGAL_KERNEL_NO_ASSERTIONS` or `CGAL_NO_ASSERTIONS`.
See \ref secchecks "the section Checks in STL Extensions", for details.
\section secchecks_cgal_assume Suppress warnings using CGAL_assume.

View File

@ -349,7 +349,10 @@ ALIASES = "cgal=%CGAL" \
"cgalParamType{1}=<li><b>Type: </b>\1</li>" \
"cgalParamDefault{1}=<li><b>%Default: </b>\1</li>" \
"cgalParamExtra{1}=<li><b>Extra: </b>\1</li>" \
"cgalParamNEnd=</ul> \htmlonly[block] </div> \endhtmlonly </td><td></td></tr>"
"cgalParamNEnd=</ul> \htmlonly[block] </div> \endhtmlonly </td><td></td></tr>" \
"cgalParamSectionBegin{1}=\cgalParamNBegin{\1}" \
"cgalParamSectionEnd=\cgalParamNEnd" \
"cgalParamPrecondition{1}=<li><b>Precondition: </b>\1</li>"
# This tag can be used to specify a number of word-keyword mappings (TCL only).
# A mapping has the form "name=value". For example adding "class=itcl::class"

View File

@ -350,7 +350,10 @@ ALIASES = "cgal=%CGAL" \
"cgalParamType{1}=<li><b>Type: </b>\1</li>" \
"cgalParamDefault{1}=<li><b>%Default: </b>\1</li>" \
"cgalParamExtra{1}=<li><b>Extra: </b>\1</li>" \
"cgalParamNEnd=</ul> \htmlonly[block] </div> \endhtmlonly </td><td></td></tr>"
"cgalParamNEnd=</ul> \htmlonly[block] </div> \endhtmlonly </td><td></td></tr>" \
"cgalParamSectionBegin{1}=\cgalParamNBegin{\1}" \
"cgalParamSectionEnd=\cgalParamNEnd" \
"cgalParamPrecondition{1}=<li><b>Precondition: </b>\1</li>"
# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources
# only. Doxygen will then generate output that is more tailored for C. For

View File

@ -372,7 +372,11 @@ ALIASES = "cgal=%CGAL" \
"cgalParamType{1}=<li><b>Type: </b>\1</li>" \
"cgalParamDefault{1}=<li><b>%Default: </b>\1</li>" \
"cgalParamExtra{1}=<li><b>Extra: </b>\1</li>" \
"cgalParamNEnd=</ul> \htmlonly[block] </div> \endhtmlonly </td><td></td></tr>"
"cgalParamNEnd=</ul> \htmlonly[block] </div> \endhtmlonly </td><td></td></tr>" \
"cgalParamSectionBegin{1}=\cgalParamNBegin{\1}" \
"cgalParamSectionEnd=\cgalParamNEnd" \
"cgalParamPrecondition{1}=<li><b>Precondition: </b>\1</li>"
# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources
# only. Doxygen will then generate output that is more tailored for C. For

View File

@ -356,6 +356,10 @@ ALIASES+= "cgalParamType{1}=<li><b>Type: </b>\1</li>"
ALIASES+= "cgalParamDefault{1}=<li><b>%Default: </b>\1</li>"
ALIASES+= "cgalParamExtra{1}=<li><b>Extra: </b>\1</li>"
ALIASES+= "cgalParamNEnd=</ul> \htmlonly[block] </div> \endhtmlonly </td><td></td></tr>"
ALIASES+= "cgalParamSectionBegin{1}=\cgalParamNBegin{\1}"
ALIASES+= "cgalParamSectionEnd=\cgalParamNEnd"
ALIASES+= "cgalParamPrecondition{1}=<li><b>Precondition: </b>\1</li>"
# This tag can be used to specify a number of word-keyword mappings (TCL only).
# A mapping has the form "name=value". For example adding

View File

@ -372,7 +372,10 @@ ALIASES = "cgal=%CGAL" \
"cgalParamType{1}=<li><b>Type: </b>\1</li>" \
"cgalParamDefault{1}=<li><b>%Default: </b>\1</li>" \
"cgalParamExtra{1}=<li><b>Extra: </b>\1</li>" \
"cgalParamNEnd=</ul> \htmlonly[block] </div> \endhtmlonly </td><td></td></tr>"
"cgalParamNEnd=</ul> \htmlonly[block] </div> \endhtmlonly </td><td></td></tr>" \
"cgalParamSectionBegin{1}=\cgalParamNBegin{\1}" \
"cgalParamSectionEnd=\cgalParamNEnd" \
"cgalParamPrecondition{1}=<li><b>Precondition: </b>\1</li>"
# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources
# only. Doxygen will then generate output that is more tailored for C. For

View File

@ -18,7 +18,7 @@ Two kinds of point generators are provided: first, random point
generators and second deterministic point generators. Most random
point generators and a few deterministic point generators are provided
as input iterators. The input iterators model an infinite sequence of
points. The function `CGAL::copy_n()` can be used to copy a
points. The algorithm `std::copy_n` can be used to copy a
finite sequence. The iterator adaptor
`Counting_iterator` can be used to create finite iterator
ranges.

View File

@ -21,7 +21,7 @@
#include <CGAL/disable_warnings.h>
#include <CGAL/enum.h>
#include <CGAL/Polygon_2/polygon_assertions.h>
#include <CGAL/assertions.h>
#include <set>
#include <vector>
#include <algorithm>
@ -156,9 +156,9 @@ less_than_in_tree(Vertex_index new_edge, Vertex_index tree_edge) const
#if defined(CGAL_POLY_GENERATOR_DEBUG)
std::cout << "less_than_in_tree; new: " << new_edge.as_int() << " tree edge: " << tree_edge.as_int() << std::endl;
#endif
CGAL_polygon_precondition(
CGAL_precondition(
m_vertex_data->edges[tree_edge.as_int()].is_in_tree);
CGAL_polygon_precondition(
CGAL_precondition(
!m_vertex_data->edges[new_edge.as_int()].is_in_tree);
Vertex_index left, mid, right;
m_vertex_data->left_and_right_index(left, right, tree_edge);
@ -172,10 +172,10 @@ less_than_in_tree(Vertex_index new_edge, Vertex_index tree_edge) const
case RIGHT_TURN: return false;
case COLLINEAR: break;
}
CGAL_polygon_assertion(m_vertex_data->less_xy_2(
CGAL_assertion(m_vertex_data->less_xy_2(
m_vertex_data->point(left),
m_vertex_data->point(mid)));
CGAL_polygon_assertion( m_vertex_data->less_xy_2(
CGAL_assertion( m_vertex_data->less_xy_2(
m_vertex_data->point(mid),
m_vertex_data->point(right)));
m_vertex_data->is_simple_result = false;
@ -321,23 +321,23 @@ insertion_event(Tree *tree, Vertex_index prev_vt,
std::pair<typename Tree::iterator, bool> result;
if (left_turn) {
result = tree->insert(prev_vt);
// CGAL_polygon_assertion(result.second)
// CGAL_assertion(result.second)
td_prev.tree_it = result.first;
td_prev.is_in_tree = true;
if (!this->is_simple_result) return false;
result = tree->insert(mid_vt);
// CGAL_polygon_assertion(result.second)
// CGAL_assertion(result.second)
td_mid.tree_it = result.first;
td_mid.is_in_tree = true;
if (!this->is_simple_result) return false;
} else {
result = tree->insert(mid_vt);
// CGAL_polygon_assertion(result.second)
// CGAL_assertion(result.second)
td_mid.tree_it = result.first;
td_mid.is_in_tree = true;
if (!this->is_simple_result) return false;
result = tree->insert(prev_vt);
// CGAL_polygon_assertion(result.second)
// CGAL_assertion(result.second)
td_prev.tree_it = result.first;
td_prev.is_in_tree = true;
if (!this->is_simple_result) return false;
@ -374,7 +374,7 @@ replacement_event(Tree *tree, Vertex_index cur_edge, Vertex_index next_edge)
// check if continuation point is on the right side of neighbor segments
typedef typename Tree::iterator It;
Edge_data &td = edges[cur_edge.as_int()];
CGAL_polygon_assertion(td.is_in_tree);
CGAL_assertion(td.is_in_tree);
It cur_seg = td.tree_it;
Vertex_index cur_vt = (td.is_left_to_right) ? next_edge : cur_edge;
if (cur_seg != tree->begin()) {
@ -613,7 +613,7 @@ void make_simple_polygon(Iterator points_begin, Iterator points_end,
#if defined(CGAL_POLY_GENERATOR_DEBUG)
std::cout << "To swap: " << swap_interval.first << " "
<< swap_interval.second << std::endl;
CGAL_polygon_assertion(swap_interval.first >= -1 &&
CGAL_assertion(swap_interval.first >= -1 &&
swap_interval.second >= -1 &&
swap_interval.first < size &&
swap_interval.second < size);

View File

@ -961,9 +961,7 @@ MainWindow::on_actionLloyd_optimization_triggered()
}
CGAL::lloyd_optimize_mesh_2(cdt,
max_iteration_number = nb,
seeds_begin = m_seeds.begin(),
seeds_end = m_seeds.end());
CGAL::parameters::number_of_iterations(nb).seeds(m_seeds));
// default cursor
QApplication::restoreOverrideCursor();

View File

@ -795,8 +795,7 @@ public:
Assert_compile_time_tag(Supports_vertex_halfedge(), Tag_true());
Assert_compile_time_tag(Supports_halfedge_vertex(), Tag_true());
unsigned int nb_erased_components = 0,
nb_isolated_vertices = 0;
unsigned int nb_erased_components = 0;
// Gets list of connected components, ordered by size (i.e. number of vertices)
std::vector<Vertex_handle> components;
@ -818,13 +817,9 @@ public:
else // if isolated vertex
{
vertices_erase(vertex);
nb_isolated_vertices++;
}
}
// if (nb_isolated_vertices > 0)
// std::cerr << " Erased " << nb_isolated_vertices << " isolated vertices\n";
return nb_erased_components;
}

View File

@ -1,13 +1,12 @@
// The Heat Method
/// \defgroup PkgHeatMethod Heat Method Reference
/// \defgroup PkgHeatMethodRef Heat Method Reference
/// \defgroup PkgHeatMethodConcepts Concepts
/// \ingroup PkgHeatMethod
/// \ingroup PkgHeatMethodRef
/*!
\addtogroup PkgHeatMethod
\addtogroup PkgHeatMethodRef
\cgalPkgDescriptionBegin{The Heat Method,PkgHeatMethod}
\cgalPkgPicture{heat-method-small.png}
@ -17,8 +16,8 @@
\cgalPkgDesc{The package provides an algorithm that solves the single- or
multiple-source shortest path problem by returning an approximation of the geodesic distance
for all vertices of a triangle mesh to the closest vertex in a given set of
source vertices. }
\cgalPkgManuals{Chapter_HeatMethod,PkgHeatMethod}
source vertices.}
\cgalPkgManuals{Chapter_HeatMethod,PkgHeatMethodRef}
\cgalPkgSummaryEnd
\cgalPkgShortInfoBegin
\cgalPkgSince{4.14}

View File

@ -21,9 +21,9 @@
#include <CGAL/property_map.h>
#include <CGAL/double.h>
#include <CGAL/boost/graph/properties.h>
#include <CGAL/Default.h>
#include <CGAL/Dynamic_property_map.h>
#include <CGAL/squared_distance_3.h>
#include <CGAL/Polygon_mesh_processing/measure.h>
#include <CGAL/number_utils.h>
#ifdef CGAL_EIGEN3_ENABLED
#include <CGAL/Eigen_solver_traits.h>
@ -90,58 +90,56 @@ protected:
Face_id_map face_id_map;
public:
/*!
\brief Constructor
*/
Surface_mesh_geodesic_distances_3(const TriangleMesh& tm,
VertexPointMap vpm)
: vertex_id_map(get(Vertex_property_tag(), tm)),
face_id_map(get(Face_property_tag(), tm)),
v2v(tm),
tm(tm),
vpm(vpm)
{
build();
}
/*!
\brief Constructor
*/
Surface_mesh_geodesic_distances_3(const TriangleMesh& tm)
: vertex_id_map(get(Vertex_property_tag(),tm)), face_id_map(get(Face_property_tag(),tm)), v2v(tm), tm(tm), vpm(get(vertex_point,tm))
: Surface_mesh_geodesic_distances_3(tm, get(vertex_point, tm))
{
build();
}
/*!
\brief Constructor
*/
Surface_mesh_geodesic_distances_3(const TriangleMesh& tm, VertexPointMap vpm)
: vertex_id_map(get(Vertex_property_tag(),tm)), face_id_map(get(Face_property_tag(),tm)), v2v(tm), tm(tm), vpm(vpm)
{
build();
}
/**
* returns the triangle mesh the algorithm is running on.
*/
const TriangleMesh& triangle_mesh() const{
const TriangleMesh& triangle_mesh() const
{
return tm;
}
private:
const Matrix&
mass_matrix() const
{
return m_mass_matrix;
}
const Matrix&
cotan_matrix() const
{
return m_cotan_matrix;
}
const VertexPointMap&
vertex_point_map() const
{
return vpm;
}
const Vertex_id_map&
get_vertex_id_map() const
{
@ -149,7 +147,6 @@ private:
}
public:
/**
* adds `vd` to the source set, returning `false` iff `vd` is already in the set.
*/
@ -176,7 +173,6 @@ public:
}
}
/**
* removes `vd` from the source set, returning `true` iff `vd` was in the set.
*/
@ -188,7 +184,6 @@ public:
return (m_sources.erase(v2v(vd)) == 1);
}
/**
* clears the current source set.
*/
@ -203,7 +198,6 @@ public:
/**
* returns the set of source vertices.
*/
const Vertex_const_range&
sources() const
{
@ -211,7 +205,6 @@ public:
}
private:
double
summation_of_edges() const
{
@ -237,14 +230,12 @@ private:
return edge_sum;
}
double
time_step() const
{
return m_time_step;
}
void
update_kronecker_delta()
{
@ -263,14 +254,12 @@ private:
m_kronecker.swap(K);
}
const Matrix&
kronecker_delta() const
{
return m_kronecker;
}
void factor_cotan_laplace()
{
Matrix A, A0;
@ -293,7 +282,6 @@ private:
}
}
void
compute_unit_gradient()
{
@ -352,7 +340,6 @@ private:
}
}
void
compute_divergence()
{
@ -400,7 +387,6 @@ private:
indexD.swap(m_index_divergence);
}
// modifies m_solved_phi
void
value_at_source_set(const Vector& phi)
@ -432,7 +418,6 @@ private:
m_solved_phi.swap(source_set_val);
}
void
factor_phi()
{
@ -443,7 +428,6 @@ private:
}
}
void
solve_phi()
{
@ -456,7 +440,6 @@ private:
value_at_source_set(phi);
}
// this function returns a (number of vertices)x1 vector where
// the ith index has the distance from the first vertex to the ith vertex
const Vector&
@ -466,7 +449,6 @@ private:
}
public:
/**
* Updates the distance property map after changes in the source set.
**/
@ -494,7 +476,6 @@ public:
}
private:
void
build()
{
@ -507,13 +488,16 @@ private:
}
m_source_change_flag = false;
CGAL_precondition(is_triangle_mesh(tm));
Index i = 0;
for(vertex_descriptor vd : vertices(tm)){
put(vertex_id_map, vd, i++);
}
Index face_i = 0;
for(face_descriptor fd : faces(tm)){
// Do not use BGL's version because `tm` is not a valid halfedge graph due to its weird vertex descriptor:
// it fails checks such as halfedge(target(h, g), g) == h
CGAL_assertion_code(halfedge_descriptor hd = halfedge(fd, tm);)
CGAL_assertion(hd == next(next(next(hd,tm),tm),tm));
put(face_id_map, fd, face_i++);
}
dimension = static_cast<int>(num_vertices(tm));
@ -714,7 +698,7 @@ struct Base_helper<TriangleMesh, Traits, Intrinsic_Delaunay, LA, VertexPointMap>
/**
* \ingroup PkgHeatMethod
* \ingroup PkgHeatMethodRef
*
* Class `Surface_mesh_geodesic_distances_3` computes estimated geodesic distances for a set of source vertices where sources can be added and removed.
* The class performs a preprocessing step that only depends on the mesh, so that the distance computation takes less
@ -788,6 +772,7 @@ class Surface_mesh_geodesic_distances_3
typedef typename Default::Get<
VertexPointMap,
typename boost::property_map< TriangleMesh, vertex_point_t>::const_type>::type Vertex_point_map;
typedef
typename Default::Get<Traits,
typename Kernel_traits<
@ -808,7 +793,6 @@ class Surface_mesh_geodesic_distances_3
}
public:
/// Vertex descriptor type
typedef typename boost::graph_traits<TriangleMesh>::vertex_descriptor vertex_descriptor;
#ifndef DOXYGEN_RUNNING
@ -906,7 +890,7 @@ public:
};
#if defined(DOXYGEN_RUNNING) || defined(CGAL_EIGEN3_ENABLED)
/// \ingroup PkgHeatMethod
/// \ingroup PkgHeatMethodRef
/// computes for each vertex of the triangle mesh `tm` the estimated geodesic distance to a given source vertex.
/// This function is provided only if \ref thirdpartyEigen "Eigen" 3.3 (or greater) is available and `CGAL_EIGEN3_ENABLED` is defined.
/// \tparam TriangleMesh a triangulated surface mesh, model of `FaceListGraph` and `HalfedgeListGraph`.
@ -947,7 +931,7 @@ estimate_geodesic_distances(const TriangleMesh& tm,
#endif
/// \ingroup PkgHeatMethod
/// \ingroup PkgHeatMethodRef
/// computes for each vertex of the triangle mesh `tm` the estimated geodesic distance to a given set of source vertices.
/// This function is provided only if \ref thirdpartyEigen "Eigen" 3.3 (or greater) is available and `CGAL_EIGEN3_ENABLED` is defined.
/// \tparam TriangleMesh a triangulated surface mesh, model of `FaceListGraph` and `HalfedgeListGraph`

View File

@ -57,7 +57,6 @@ namespace internal {
template<typename TriangleMesh, typename Traits>
bool has_degenerate_faces(const TriangleMesh& tm, const Traits& traits)
{
typedef typename Traits::Point_3 Point;
typedef typename Traits::Vector_3 Vector_3;
typename Traits::Construct_vector_3
construct_vector = traits.construct_vector_3_object();
@ -66,13 +65,16 @@ bool has_degenerate_faces(const TriangleMesh& tm, const Traits& traits)
typename Traits::Construct_cross_product_vector_3
cross_product = traits.construct_cross_product_vector_3_object();
typename boost::property_map< TriangleMesh, boost::vertex_point_t>::const_type
vpm = get(boost::vertex_point, tm);
typedef typename boost::property_map< TriangleMesh, boost::vertex_point_t>::const_type VPM;
typedef typename boost::property_traits<VPM>::reference Point_ref;
VPM vpm = get(boost::vertex_point, tm);
for (typename boost::graph_traits<TriangleMesh>::face_descriptor f : faces(tm))
{
const Point p1 = get(vpm, target(halfedge(f, tm), tm));
const Point p2 = get(vpm, target(next(halfedge(f, tm), tm), tm));
const Point p3 = get(vpm, target(next(next(halfedge(f, tm), tm), tm), tm));
const Point_ref p1 = get(vpm, target(halfedge(f, tm), tm));
const Point_ref p2 = get(vpm, target(next(halfedge(f, tm), tm), tm));
const Point_ref p3 = get(vpm, target(next(next(halfedge(f, tm), tm), tm), tm));
Vector_3 v = cross_product(construct_vector(p1, p2), construct_vector(p1, p3));
if(scalar_product(v, v) == 0.)
return true;
@ -82,7 +84,8 @@ bool has_degenerate_faces(const TriangleMesh& tm, const Traits& traits)
}
template <class TriangleMesh>
struct Intrinsic_Delaunay_triangulation_3_vertex_descriptor {
struct Intrinsic_Delaunay_triangulation_3_vertex_descriptor
{
typedef typename boost::graph_traits<TriangleMesh>::halfedge_descriptor halfedge_descriptor;
typedef typename boost::graph_traits<TriangleMesh>::vertex_descriptor vertex_descriptor;
halfedge_descriptor hd;
@ -99,6 +102,16 @@ struct Intrinsic_Delaunay_triangulation_3_vertex_descriptor {
explicit Intrinsic_Delaunay_triangulation_3_vertex_descriptor(const vertex_descriptor vd, const TriangleMesh& tm)
: hd(halfedge(vd,tm))
{}
bool operator==(const Intrinsic_Delaunay_triangulation_3_vertex_descriptor& other) const
{
return hd == other.hd;
}
bool operator!=(const Intrinsic_Delaunay_triangulation_3_vertex_descriptor& other) const
{
return ! (*this == other);
}
};
template <class TriangleMesh>
@ -121,7 +134,7 @@ struct Intrinsic_Delaunay_triangulation_3_vertex_iterator_functor
};
/**
* \ingroup PkgHeatMethod
* \ingroup PkgHeatMethodRef
*
* Class `Intrinsic_Delaunay_triangulation_3` is a remeshing algorithm to improve the approximation of the `Surface_mesh_geodesic_distances_3`.
* It internally makes a copy of the triangle mesh, performs edge flips, and computes 2D vertex coordinates per face
@ -267,7 +280,7 @@ private:
}
//returns true if edge is locally Delaunay (opposing angles are less than pi):
//returns `true` if edge is locally Delaunay (opposing angles are less than pi):
//Two ways of doing this: taking angles directly (not good with virtual edges)
//OR: taking edge length and using law of cosines,
//The second way checks cotan weights
@ -340,7 +353,6 @@ private:
void
loop_over_edges(edge_stack stack, std::vector<int>& marked_edges)
{
int a = 0;
while(!stack.empty()) {
edge_descriptor ed = stack.top();
stack.pop();
@ -351,7 +363,6 @@ private:
//if the edge itself is not locally delaunay, go back
if(!(is_edge_locally_delaunay(ed))) {
if(!(is_border(ed,m_intrinsic_tm))) {
a++;
change_edge_length(edge_i,ed);
halfedge_descriptor hd = (halfedge(ed, m_intrinsic_tm));
CGAL::Euler::flip_edge(hd, m_intrinsic_tm);
@ -393,7 +404,8 @@ private:
void
build(VertexPointMap vpm)
{
CGAL_precondition(is_triangle_mesh(m_intrinsic_tm));
CGAL_precondition(is_empty(m_intrinsic_tm));
CGAL_precondition(is_triangle_mesh(m_input_tm));
typename Traits::Compute_squared_distance_3 squared_distance = Traits().compute_squared_distance_3_object();
@ -549,6 +561,8 @@ struct graph_traits<CGAL::Heat_method_3::Intrinsic_Delaunay_triangulation_3<TM,T
typedef typename boost::graph_traits<TM>::vertices_size_type vertices_size_type;
static vertex_descriptor null_vertex() { return vertex_descriptor(boost::graph_traits<TM>::null_halfedge()); }
static halfedge_descriptor null_halfedge() { return boost::graph_traits<TM>::null_halfedge(); }
static face_descriptor null_face() { return boost::graph_traits<TM>::null_face(); }
};
@ -589,7 +603,7 @@ template <typename TM,
typename T>
Iterator_range<typename boost::graph_traits<Intrinsic_Delaunay_triangulation_3<TM,T> >::vertex_iterator>
vertices(const Intrinsic_Delaunay_triangulation_3<TM,T>& idt)
{
{
std::pair<typename boost::graph_traits<TM>::vertex_iterator,
typename boost::graph_traits<TM>::vertex_iterator> p = vertices(idt.triangle_mesh());
@ -597,7 +611,7 @@ vertices(const Intrinsic_Delaunay_triangulation_3<TM,T>& idt)
Fct fct(idt.triangle_mesh());
return make_range(boost::make_transform_iterator(p.first, fct),
boost::make_transform_iterator(p.second,fct));
}
}
template <typename TM,
@ -622,9 +636,9 @@ template <typename TM,
typename T>
Iterator_range<typename boost::graph_traits<TM>::face_iterator>
faces(const Intrinsic_Delaunay_triangulation_3<TM,T>& idt)
{
return make_range( faces(idt.triangle_mesh()) );
}
{
return make_range( faces(idt.triangle_mesh()) );
}
template <typename TM,
typename T>
@ -659,7 +673,7 @@ template <typename TM,
typename T>
typename boost::graph_traits<Intrinsic_Delaunay_triangulation_3<TM,T> >::halfedge_descriptor
halfedge(typename boost::graph_traits<Intrinsic_Delaunay_triangulation_3<TM,T> >::edge_descriptor ed,
const Intrinsic_Delaunay_triangulation_3<TM,T>& idt)
const Intrinsic_Delaunay_triangulation_3<TM,T>& idt)
{
return halfedge(ed, idt.triangle_mesh());
}
@ -684,6 +698,23 @@ next(typename boost::graph_traits<Intrinsic_Delaunay_triangulation_3<TM,T> >::ha
return next(hd, idt.triangle_mesh());
}
template <typename TM,
typename T>
typename boost::graph_traits<Intrinsic_Delaunay_triangulation_3<TM,T> >::halfedge_descriptor
prev(typename boost::graph_traits<Intrinsic_Delaunay_triangulation_3<TM,T> >::halfedge_descriptor hd,
const Intrinsic_Delaunay_triangulation_3<TM,T>& idt)
{
return prev(hd, idt.triangle_mesh());
}
template <typename TM,
typename T>
typename boost::graph_traits<Intrinsic_Delaunay_triangulation_3<TM,T> >::edge_descriptor
edge(typename boost::graph_traits<Intrinsic_Delaunay_triangulation_3<TM,T> >::halfedge_descriptor hd,
const Intrinsic_Delaunay_triangulation_3<TM,T>& idt)
{
return edge(hd, idt.triangle_mesh());
}
template <typename TM,
typename T>
@ -766,11 +797,11 @@ struct IDT_vertex_distance_property_map {
friend void put(IDT_vertex_distance_property_map<IDT,PM> idtpm,
key_type vd,
value_type v)
value_type val)
{
typename boost::graph_traits<TM>::vertex_descriptor tm_vd = target(vd.hd, idtpm.idt.triangle_mesh());
put(idtpm.pm, idtpm.idt.v2v.at(tm_vd), v);
put(idtpm.pm, idtpm.idt.v2v.at(tm_vd), val);
}
};

View File

@ -4,14 +4,12 @@ Cartesian_kernel
Circulator
Distance_2
Distance_3
Filtered_kernel
Heat_method_3
Installation
Interval_support
Kernel_23
Modular_arithmetic
Number_types
Polygon_mesh_processing
Profiling_tools
Property_map
Random_numbers

View File

@ -8,7 +8,7 @@ class Construct_hyperbolic_bisector_2
Hyperbolic_segment_2 operator()(Point_2 p, Point_2 q, Point_2 r)
at the end
the following lines are giving the wrong arc (wrong orientation), aren't they?
CGAL_triangulation_assertion(assign(pair,inters[1]));
CGAL_assertion(assign(pair,inters[1]));
if ( Orientation_2()(approx_c,approx_a,approx_pinf) == POSITIVE )
return Circular_arc_2( *c_pq, pair.first, a);
return Circular_arc_2( *c_pq, a, pair.first);

View File

@ -559,6 +559,8 @@ private:
Oriented_side side_of_hyperbolic_triangle(const Point& p, const Point& q, const Point& r,
const Point& query, Locate_type &lt, int& li) const
{
// The triangle (p,q,r) must be Delaunay hyperbolic
CGAL_precondition(geom_traits().is_Delaunay_hyperbolic_2_object()(p, q, r));
CGAL_precondition(query != p && query != q && query != r);

View File

@ -20,7 +20,7 @@
#include <CGAL/Algebraic_kernel_for_circles_2_2.h>
#include <CGAL/Circular_kernel_2/Intersection_traits.h>
#include <CGAL/Circular_kernel_2.h>
#include <CGAL/triangulation_assertions.h>
#include <CGAL/assertions.h>
#include <CGAL/determinant.h>
#include <boost/tuple/tuple.hpp>
@ -77,13 +77,13 @@ namespace internal {
std::vector< Intersection_result > inters;
intersection(*c_pq, *c_qr, std::back_inserter(inters));
CGAL_triangulation_assertion(assign(pair, inters[0]));
CGAL_assertion(assign(pair, inters[0]));
if(pair.second == 1)
{
if(_gt.has_on_bounded_side_2_object()(l_inf, pair.first))
return pair.first;
CGAL_triangulation_assertion(assign(pair, inters[1]));
CGAL_assertion(assign(pair, inters[1]));
return pair.first;
}
return pair.first;
@ -104,13 +104,13 @@ namespace internal {
std::vector< Intersection_result > inters;
intersection(*l, *c, std::back_inserter(inters));
CGAL_triangulation_assertion(assign(pair,inters[0]));
CGAL_assertion(assign(pair,inters[0]));
if(pair.second == 1)
{
if(_gt.has_on_bounded_side_2_object()(l_inf, pair.first))
return pair.first;
CGAL_triangulation_assertion(assign(pair, inters[1]));
CGAL_assertion(assign(pair, inters[1]));
return pair.first;
}
return pair.first;
@ -177,9 +177,9 @@ namespace internal {
const Hyperbolic_point_2& r,
const Hyperbolic_point_2& s) const
{
CGAL_triangulation_precondition((_gt.orientation_2_object()(p, q, r) == ON_POSITIVE_SIDE) &&
CGAL_precondition((_gt.orientation_2_object()(p, q, r) == ON_POSITIVE_SIDE) &&
(_gt.orientation_2_object()(p, s, q) == ON_POSITIVE_SIDE));
CGAL_triangulation_precondition((_gt.side_of_oriented_circle_2_object()(p, q, r,s) == ON_NEGATIVE_SIDE) &&
CGAL_precondition((_gt.side_of_oriented_circle_2_object()(p, q, r,s) == ON_NEGATIVE_SIDE) &&
(_gt.side_of_oriented_circle_2_object()(p, s, q, r) == ON_NEGATIVE_SIDE));
Construct_circle_or_line_supporting_bisector<Traits> cclsb(_gt);
@ -218,7 +218,7 @@ namespace internal {
const Hyperbolic_point_2& q,
const Hyperbolic_point_2& r) const
{
CGAL_triangulation_precondition(_gt.orientation_2_object()(p, q, r) == POSITIVE);
CGAL_precondition(_gt.orientation_2_object()(p, q, r) == POSITIVE);
Construct_circle_or_line_supporting_bisector<Traits> cclsb(_gt);
Construct_hyperbolic_circumcenter_CK_2<Traits> chc(_gt);
@ -240,13 +240,13 @@ namespace internal {
intersection(bis_pq, l_inf, std::back_inserter(inters));
std::pair<Circular_arc_point_2, unsigned> pair;
CGAL_triangulation_assertion(assign(pair,inters[0]));
CGAL_triangulation_assertion(pair.second == 1);
CGAL_assertion(assign(pair,inters[0]));
CGAL_assertion(pair.second == 1);
if(_gt.less_y_2_object()(p, q))
return Line_arc_2(bis_pq,a,pair.first);
CGAL_triangulation_assertion(assign(pair,inters[1]));
CGAL_triangulation_assertion(pair.second == 1);
CGAL_assertion(assign(pair,inters[1]));
CGAL_assertion(pair.second == 1);
return Line_arc_2(bis_pq,a,pair.first);
}
@ -261,8 +261,8 @@ namespace internal {
intersection(*c_pq, l_inf, std::back_inserter(inters));
std::pair<Circular_arc_point_2, unsigned> pair;
CGAL_triangulation_assertion(assign(pair,inters[0]));
CGAL_triangulation_assertion(pair.second == 1);
CGAL_assertion(assign(pair,inters[0]));
CGAL_assertion(pair.second == 1);
Hyperbolic_point_2 approx_pinf(to_double(pair.first.x()), to_double(pair.first.y()));
Hyperbolic_point_2 approx_c(to_double(c_pq->center().x()),
@ -275,7 +275,7 @@ namespace internal {
return Circular_arc_2(*c_pq, pair.first, a);
}
CGAL_triangulation_assertion(assign(pair,inters[1]));
CGAL_assertion(assign(pair,inters[1]));
if(_gt.orientation_2_object()(approx_c,approx_a,approx_pinf) == POSITIVE)
return Circular_arc_2(*c_pq, pair.first, a);

View File

@ -24,7 +24,7 @@
#include <CGAL/Hyperbolic_triangulation_2/internal/Exact_complex.h>
#include <CGAL/Origin.h>
#include <CGAL/predicates_on_points_2.h>
#include <CGAL/triangulation_assertions.h>
#include <CGAL/assertions.h>
#include <CGAL/utility.h>
#include <boost/tuple/tuple.hpp>
@ -365,9 +365,9 @@ public:
const Hyperbolic_point_2& r,
const Hyperbolic_point_2& s) const
{
CGAL_triangulation_precondition((_gt.orientation_2_object()(p, q, r) == ON_POSITIVE_SIDE) &&
CGAL_precondition((_gt.orientation_2_object()(p, q, r) == ON_POSITIVE_SIDE) &&
(_gt.orientation_2_object()(p, s, q) == ON_POSITIVE_SIDE));
CGAL_triangulation_precondition((_gt.side_of_oriented_circle_2_object()(p, q, r,s) == ON_NEGATIVE_SIDE) &&
CGAL_precondition((_gt.side_of_oriented_circle_2_object()(p, q, r,s) == ON_NEGATIVE_SIDE) &&
(_gt.side_of_oriented_circle_2_object()(p, s, q, r) == ON_NEGATIVE_SIDE));
Construct_hyperbolic_circumcenter_2<Traits> chc(_gt);
@ -405,7 +405,7 @@ public:
const Hyperbolic_point_2& q,
const Hyperbolic_point_2& r) const
{
CGAL_triangulation_precondition(_gt.orientation_2_object()(p, q, r) == POSITIVE);
CGAL_precondition(_gt.orientation_2_object()(p, q, r) == POSITIVE);
Construct_circle_or_line_supporting_bisector<Traits> cclsb(_gt);
Construct_hyperbolic_circumcenter_2<Traits> chc(_gt);

View File

@ -16,7 +16,6 @@
#include <CGAL/license/Hyperbolic_triangulation_2.h>
#include <CGAL/basic.h>
#include <CGAL/triangulation_assertions.h>
#include <CGAL/Triangulation_ds_face_base_2.h>
#include <CGAL/Object.h>

View File

@ -22,18 +22,11 @@
\cgalPkgDescriptionEnd
\cgalCRPSection{Assertions}
The optimization code uses infix `OPTIMISATION` in the assertions,
e.g. defining the compiler flag
`CGAL_OPTIMISATION_NO_PRECONDITIONS` switches precondition
checking off, cf. Section \ref secchecks.
\cgalClassifedRefPages
- `CGAL::maximum_area_inscribed_k_gon_2`
- `CGAL::maximum_perimeter_inscribed_k_gon_2`
- `CGAL::extremal_polygon_2`
- `CGAL::maximum_area_inscribed_k_gon_2()`
- `CGAL::maximum_perimeter_inscribed_k_gon_2()`
- `CGAL::extremal_polygon_2()`
- `CGAL::Largest_empty_iso_rectangle_2<T>`
- `CGAL::Extremal_polygon_area_traits_2<K>`
- `CGAL::Extremal_polygon_perimeter_traits_2<K>`
@ -41,4 +34,3 @@ checking off, cf. Section \ref secchecks.
- `LargestEmptyIsoRectangleTraits_2`
*/

View File

@ -16,7 +16,7 @@
#include <CGAL/license/Inscribed_areas.h>
#include <CGAL/Optimisation/assertions.h>
#include <CGAL/assertions.h>
#include <CGAL/squared_distance_2.h>
#include <CGAL/Polygon_2.h>
#include <boost/function.hpp>
@ -83,7 +83,7 @@ struct Extremal_polygon_area_traits_2 {
int number_of_points(
static_cast<int>(iterator_distance( points_begin,
points_end)));
CGAL_optimisation_precondition( number_of_points > min_k());
CGAL_precondition( number_of_points > min_k());
// this gives the area of the triangle of two points with
// the root:
@ -136,7 +136,7 @@ protected:
};
} //namespace CGAL
#include <CGAL/Optimisation/assertions.h>
#include <cmath>
#ifdef CGAL_USE_LEDA
#include <CGAL/leda_real.h>
@ -221,11 +221,11 @@ struct Extremal_polygon_perimeter_traits_2 {
using std::less;
using std::max_element;
CGAL_optimisation_precondition_code(
CGAL_precondition_code(
int number_of_points(
static_cast<int>(iterator_distance( points_begin,
points_end)));)
CGAL_optimisation_precondition( number_of_points > min_k());
CGAL_precondition( number_of_points > min_k());
// kind of messy, but first we have to have something
// like Distance (function object) ...

View File

@ -16,7 +16,7 @@
#include <CGAL/license/Inscribed_areas.h>
#include <CGAL/Optimisation/assertions.h>
#include <CGAL/assertions.h>
#include <CGAL/monotone_matrix_search.h>
#include <CGAL/Dynamic_matrix.h>
#include <CGAL/Transform_iterator.h>
@ -76,7 +76,7 @@ public:
RandomAccessIC_object begin_col,
RandomAccessIC_object end_col,
RandomAccessIC_value begin_value,
RandomAccessIC_value CGAL_optimisation_precondition_code(end_value),
RandomAccessIC_value CGAL_precondition_code(end_value),
const Operation& o)
// initialization with two ranges [begin_row, end_row) and
// [begin_col, end_col) of Objects, a range [begin_value, end_value)
@ -92,9 +92,9 @@ public:
n_rows( static_cast<int>(iterator_distance( begin_row, end_row))),
n_cols( static_cast<int>(iterator_distance( begin_col, end_col)))
{
CGAL_optimisation_precondition(
CGAL_precondition(
iterator_distance( begin_value, end_value) == n_cols);
CGAL_optimisation_assertion( n_rows > 0 && n_cols > 0);
CGAL_assertion( n_rows > 0 && n_cols > 0);
}
int
@ -108,8 +108,8 @@ public:
Value
operator()( int r, int c) const
{
CGAL_optimisation_precondition( r >= 0 && r < n_rows);
CGAL_optimisation_precondition( c >= 0 && c < n_cols);
CGAL_precondition( r >= 0 && r < n_rows);
CGAL_precondition( c >= 0 && c < n_cols);
return begin_value_[c] + op( begin_row_[r], begin_col_[c]);
}
@ -181,11 +181,11 @@ CGAL_maximum_inscribed_rooted_k_gon_2(
// returns the past-the-end iterator of that sequence.
{
// check preconditions:
CGAL_optimisation_precondition( k >= t.min_k());
CGAL_precondition( k >= t.min_k());
int number_of_points(
static_cast<int>(iterator_distance( points_begin,
points_end)));
CGAL_optimisation_precondition( number_of_points > k);
CGAL_precondition( number_of_points > k);
typedef std::vector< int > Index_cont;
@ -203,7 +203,7 @@ CGAL_maximum_inscribed_rooted_k_gon_2(
points_begin, points_end, max_area, gon.rbegin() + k + 1 - i);
for (;;) {
CGAL_optimisation_assertion( gon[0] == 0);
CGAL_assertion( gon[0] == 0);
gon[i] = number_of_points - 1;
if ( ++i >= k)
break;
@ -243,7 +243,7 @@ CGAL_maximum_inscribed_rooted_k_gon_2(
RandomAccessIC_point points_end,
int root,
RandomAccessIC_int left_c_begin,
RandomAccessIC_int CGAL_optimisation_precondition_code(left_c_end),
RandomAccessIC_int CGAL_precondition_code(left_c_end),
RandomAccessIC_int right_c_begin,
RandomAccessIC_int right_c_end,
typename Traits::FT& max_area,
@ -294,26 +294,26 @@ CGAL_maximum_inscribed_rooted_k_gon_2(
right_c_end));
// check preconditions:
CGAL_optimisation_precondition( number_of_points > t.min_k());
CGAL_optimisation_precondition( size_of_gon >= t.min_k() - 1);
CGAL_optimisation_precondition(
CGAL_precondition( number_of_points > t.min_k());
CGAL_precondition( size_of_gon >= t.min_k() - 1);
CGAL_precondition(
iterator_distance( left_c_begin, left_c_end) ==
iterator_distance( right_c_begin, right_c_end));
CGAL_optimisation_precondition( left_c_begin[0] >= 0);
CGAL_optimisation_precondition( right_c_begin[0] >= 0);
CGAL_optimisation_precondition(
CGAL_precondition( left_c_begin[0] >= 0);
CGAL_precondition( right_c_begin[0] >= 0);
CGAL_precondition(
left_c_begin[size_of_gon-1] < number_of_points);
CGAL_optimisation_precondition(
CGAL_precondition(
right_c_begin[size_of_gon-1] < number_of_points);
CGAL_optimisation_expensive_precondition_code(
CGAL_expensive_precondition_code(
for ( i = 0; i < size_of_gon; ++i) {
CGAL_optimisation_expensive_precondition( left_c_begin[i] >= 0);
CGAL_optimisation_expensive_precondition( right_c_begin[i] >= 0);
CGAL_optimisation_expensive_precondition(
CGAL_expensive_precondition( left_c_begin[i] >= 0);
CGAL_expensive_precondition( right_c_begin[i] >= 0);
CGAL_expensive_precondition(
left_c_begin[i] < number_of_points);
CGAL_optimisation_expensive_precondition(
CGAL_expensive_precondition(
right_c_begin[i] < number_of_points);
CGAL_optimisation_expensive_precondition(
CGAL_expensive_precondition(
left_c_begin[i] <= right_c_begin[i]);
})
@ -426,12 +426,12 @@ extremal_polygon_2(
// returns the past-the-end iterator of that sequence.
{
// check preconditions:
CGAL_optimisation_precondition_code(
CGAL_precondition_code(
int number_of_points(
static_cast<int>(iterator_distance( points_begin,
points_end)));)
CGAL_optimisation_precondition( number_of_points >= t.min_k());
CGAL_optimisation_expensive_precondition(
CGAL_precondition( number_of_points >= t.min_k());
CGAL_expensive_precondition(
is_convex_2( points_begin, points_end, t));
typedef typename Traits::Point_2 Point_2;
@ -491,11 +491,11 @@ CGAL_maximum_inscribed_k_gon_2(
// returns the past-the-end iterator of that sequence.
{
// check preconditions:
CGAL_optimisation_precondition( k >= t.min_k());
CGAL_precondition( k >= t.min_k());
int number_of_points(
static_cast<int>(iterator_distance( points_begin,
points_end)));
CGAL_optimisation_precondition( number_of_points > 0);
CGAL_precondition( number_of_points > 0);
using std::copy;
@ -518,7 +518,7 @@ CGAL_maximum_inscribed_k_gon_2(
P_0.rbegin() + 1,
t);
P_0[k] = number_of_points - 1;
CGAL_optimisation_assertion( P_0[0] == 0);
CGAL_assertion( P_0[0] == 0);
// compute k-gon rooted at points_begin[P_0[1]]
Index_cont P_1( k);
FT area_1;
@ -535,7 +535,7 @@ CGAL_maximum_inscribed_k_gon_2(
P_1.rbegin(),
t);
CGAL_optimisation_assertion( P_1[0] == P_0[1]);
CGAL_assertion( P_1[0] == P_0[1]);
// start recursive computation:
@ -630,29 +630,29 @@ CGAL_maximum_inscribed_k_gon_2(
using std::copy;
// check preconditions:
CGAL_optimisation_precondition( k >= t.min_k());
CGAL_optimisation_precondition( left_index <= right_index);
CGAL_optimisation_precondition( left_index >= 0);
CGAL_optimisation_precondition( right_index >= 0);
CGAL_optimisation_precondition_code(
CGAL_precondition( k >= t.min_k());
CGAL_precondition( left_index <= right_index);
CGAL_precondition( left_index >= 0);
CGAL_precondition( right_index >= 0);
CGAL_precondition_code(
int number_of_points(
static_cast<int>(iterator_distance( points_begin,
points_end)));)
CGAL_optimisation_precondition( left_index < number_of_points);
CGAL_optimisation_precondition( right_index < number_of_points);
CGAL_optimisation_precondition(
CGAL_precondition( left_index < number_of_points);
CGAL_precondition( right_index < number_of_points);
CGAL_precondition(
iterator_distance( left_c_begin, left_c_end) == k - 1);
CGAL_optimisation_precondition(
CGAL_precondition(
iterator_distance( right_c_begin, right_c_end) == k - 1);
CGAL_optimisation_expensive_precondition_code(
CGAL_expensive_precondition_code(
for ( int i( 0); i < k - 1; ++i) {
CGAL_optimisation_expensive_precondition( left_c_begin[i] >= 0);
CGAL_optimisation_expensive_precondition( right_c_begin[i] >= 0);
CGAL_optimisation_expensive_precondition(
CGAL_expensive_precondition( left_c_begin[i] >= 0);
CGAL_expensive_precondition( right_c_begin[i] >= 0);
CGAL_expensive_precondition(
left_c_begin[i] < number_of_points);
CGAL_optimisation_expensive_precondition(
CGAL_expensive_precondition(
right_c_begin[i] < number_of_points);
CGAL_optimisation_expensive_precondition(
CGAL_expensive_precondition(
left_c_begin[i] <= right_c_begin[i]);
})
@ -671,7 +671,7 @@ CGAL_maximum_inscribed_k_gon_2(
area_middle,
P_m.rbegin(),
t);
CGAL_optimisation_assertion( P_m[0] == middle_index);
CGAL_assertion( P_m[0] == middle_index);
// left recursive branch:
FT area_left( 0);
Index_cont P_l( k);

View File

@ -8,7 +8,6 @@ Kernel_23
Matrix_search
Modular_arithmetic
Number_types
Optimisation_basic
Polygon
Profiling_tools
STL_Extension

View File

@ -4,7 +4,11 @@ Release History
[Release 5.6](https://github.com/CGAL/cgal/releases/tag/v5.6)
-----------
Release date: December 2022
Release date: June 2023
### General Changes
- **Breaking change**: The per package assertions, pre- and postconditions are no longer supported.
### [Combinatorial Maps](https://doc.cgal.org/5.6/Manual/packages.html#PkgCombinatorialMaps) [Generalized Maps](https://doc.cgal.org/5.6/Manual/packages.html#PkgGeneralizedMaps) [Linear Cell Complex](https://doc.cgal.org/5.6/Manual/packages.html#PkgLinearCellComplex)
@ -38,8 +42,15 @@ CGAL tetrahedral Delaunay refinement algorithm.
### [2D Conforming Triangulations and Meshes](https://doc.cgal.org/5.6/Manual/packages.html#PkgMesh2)
- Deprecated usage of boost parameters in favor of function named parameters in `CGAL::lloyd_optimize_mesh_2()`.
- Deprecated two overloads of Function `refine_Delaunay_mesh()` and replaced them with versions using function named parameters.
- Add overloads of function `write_VTU()` with property maps for specifying the domain.
- Add overloads of function `write_VTU()` with property maps for specifying the domain.
### [3D Mesh Generation](https://doc.cgal.org/5.6/Manual/packages.html#PkgMesh3)
- Deprecated usage of boost parameters in favor of function named parameters.
### [3D Periodic Mesh Generation](https://doc.cgal.org/5.6/Manual/packages.html#PkgPeriodic3Mesh3)
- Deprecated usage of boost parameters in favor of function named parameters.
### [2D Hyperbolic Triangulations](https://doc.cgal.org/5.6/Manual/packages.html#PkgHyperbolicTriangulation2)

View File

@ -1200,8 +1200,6 @@ ${CMAKE_CURRENT_SOURCE_DIR}/../${package}/include/${header}"
endif()
endforeach() # loop on packages
#Now check that a cpp file including all documented headers compiles
file(WRITE ${CGAL_BINARY_DIR}/test_headers.cpp
"#define BOOST_PARAMETER_MAX_ARITY 12 \n")
foreach(header ${list_of_headers_to_test})
file(APPEND ${CGAL_BINARY_DIR}/test_headers.cpp "#include <${header}>\n")
endforeach() #loop on headers to include in test file

View File

@ -112,17 +112,6 @@
#endif
#endif
// Macro used by Boost Parameter. Mesh_3 needs at least 12, before the
// Boost Parameter headers are included: <boost/parameter/config.hpp>
// defines the value to 8, if it is not yet defined.
// The CGAL BGL properties mechanism includes
// <boost/graph/named_function_params.hpp>, that includes
// <boost/parameter/name.hpp>, and maybe other Boost libraries may use
// Boost Parameter as well.
// That is why that is important to define that macro as early as possible,
// in <CGAL/config.h>
#define BOOST_PARAMETER_MAX_ARITY 12
// The following header file defines among other things BOOST_PREVENT_MACRO_SUBSTITUTION
#include <boost/config.hpp>
#include <boost/version.hpp>

View File

@ -18,7 +18,7 @@
#include <CGAL/tags.h>
#include <CGAL/iterator.h>
#include <CGAL/utility.h>
#include <CGAL/triangulation_assertions.h>
#include <CGAL/assertions.h>
#include <CGAL/number_utils.h>
#include <algorithm>
@ -79,7 +79,7 @@ laplace_natural_neighbor_coordinates_3(const Dt& dt,
typedef typename Dt::Locate_type Locate_type;
typedef typename Gt::FT Coord_type;
CGAL_triangulation_precondition (dt.dimension() == 3);
CGAL_precondition (dt.dimension() == 3);
Locate_type lt;
int li, lj;
@ -119,9 +119,9 @@ laplace_natural_neighbor_coordinates_3(const Dt& dt,
if (dt.is_infinite(cc1))
return make_triple(nn_out, norm_coeff=Coord_type(1), false);//point outside the convex-hull
CGAL_triangulation_assertion_code(Cell_handle cc2 = cc1->neighbor(f1.second);)
CGAL_triangulation_assertion(std::find(cells.begin(),cells.end(),cc1) != cells.end());//TODO : Delete
CGAL_triangulation_assertion(std::find(cells.begin(),cells.end(),cc2) == cells.end());//TODO : Delete
CGAL_assertion_code(Cell_handle cc2 = cc1->neighbor(f1.second);)
CGAL_assertion(std::find(cells.begin(),cells.end(),cc1) != cells.end());//TODO : Delete
CGAL_assertion(std::find(cells.begin(),cells.end(),cc2) == cells.end());//TODO : Delete
Point C_1 = construct_circumcenter<Dt>(f1, Q, dt.geom_traits());
for(int j=1; j<4; j++)
@ -137,7 +137,7 @@ laplace_natural_neighbor_coordinates_3(const Dt& dt,
Cell_handle next = cc3->neighbor(num_next);
while (std::find(cells.begin(),cells.end(),next) != cells.end())
{
CGAL_triangulation_assertion( next != cc1 );
CGAL_assertion( next != cc1 );
cc3 = next;
num_next = dt.next_around_edge(cc3->index(vR),cc3->index(vP));
next = cc3->neighbor(num_next);
@ -181,7 +181,7 @@ sibson_natural_neighbor_coordinates_3(const Dt& dt,
typedef typename Dt::Locate_type Locate_type;
typedef typename Gt::FT Coord_type;
CGAL_triangulation_precondition (dt.dimension()== 3);
CGAL_precondition (dt.dimension()== 3);
Locate_type lt;
int li, lj;
@ -215,7 +215,7 @@ sibson_natural_neighbor_coordinates_3(const Dt& dt,
{
// for each cell cc1 in conflict
Cell_handle cc1 = *cit;
CGAL_triangulation_assertion(std::find(cells.begin(),cells.end(),cc1)!=cells.end());//TODO : Delete
CGAL_assertion(std::find(cells.begin(),cells.end(),cc1)!=cells.end());//TODO : Delete
if (dt.is_infinite(cc1))
return make_triple(nn_out,norm_coeff=Coord_type(1), false);//point outside the convex-hull
@ -245,7 +245,7 @@ sibson_natural_neighbor_coordinates_3(const Dt& dt,
while (std::find(cells.begin(),cells.end(),next) != cells.end())
{ //next is in conflict
CGAL_triangulation_assertion( next != cc1 );
CGAL_assertion( next != cc1 );
cc3 = next;
num_next = dt.next_around_edge(cc3->index(vR),cc3->index(vP));
next = cc3->neighbor(num_next);
@ -269,7 +269,7 @@ sibson_natural_neighbor_coordinates_3(const Dt& dt,
}
else // cc2 in the conflict cavity
{
CGAL_triangulation_assertion(std::find(cells.begin(),cells.end(),cc2)!=cells.end());//TODO : Delete
CGAL_assertion(std::find(cells.begin(),cells.end(),cc2)!=cells.end());//TODO : Delete
if (dt.is_infinite(cc2))
{
//point outside the convex-hull
@ -352,12 +352,12 @@ construct_circumcenter(const typename DT::Facet& f,
const typename DT::Geom_traits::Point_3& Q,
const typename DT::Geom_traits& gt /* = typename DT::Geom_traits() */ )
{
CGAL_triangulation_precondition(//&3 in place of %4
!gt.coplanar_3_object()(
f.first->vertex((f.second+1)&3)->point(),
f.first->vertex((f.second+2)&3)->point(),
f.first->vertex((f.second+3)&3)->point(),
Q));
CGAL_precondition(//&3 in place of %4
!gt.coplanar_3_object()(
f.first->vertex((f.second+1)&3)->point(),
f.first->vertex((f.second+2)&3)->point(),
f.first->vertex((f.second+3)&3)->point(),
Q));
// else the facet is not on the enveloppe of the conflict cavity associated to P
return gt.construct_circumcenter_3_object()(
f.first->vertex((f.second+1)&3)->point(),

View File

@ -14,12 +14,9 @@
//
// Author(s) : Geert-Jan Giezeman, Sven Schoenherr
//
// Generated from script create_assertions.sh
// Note that this header file is intentionnaly not protected with a
// macro (as <cassert>). Calling it a second time with another value
// for CGAL_NO_ASSERTIONS for example must make a difference.
#ifndef CGAL_KERNEL_ASSERTIONS_H
#define CGAL_KERNEL_ASSERTIONS_H
#include <CGAL/assertions.h>
@ -28,9 +25,6 @@
// assertions
// ----------
#undef CGAL_kernel_assertion
#undef CGAL_kernel_assertion_msg
#undef CGAL_kernel_assertion_code
#if defined(CGAL_KERNEL_NO_ASSERTIONS) || defined(CGAL_NO_ASSERTIONS)
# define CGAL_kernel_assertion(EX) (static_cast<void>(0))
@ -46,9 +40,6 @@
#endif // CGAL_KERNEL_NO_ASSERTIONS
#undef CGAL_kernel_exactness_assertion
#undef CGAL_kernel_exactness_assertion_msg
#undef CGAL_kernel_exactness_assertion_code
#if defined(CGAL_KERNEL_NO_ASSERTIONS) || defined(CGAL_NO_ASSERTIONS) \
|| (!defined(CGAL_KERNEL_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS))
@ -65,9 +56,6 @@
#endif // CGAL_KERNEL_NO_ASSERTIONS
#undef CGAL_kernel_expensive_assertion
#undef CGAL_kernel_expensive_assertion_msg
#undef CGAL_kernel_expensive_assertion_code
#if defined(CGAL_KERNEL_NO_ASSERTIONS) \
|| defined(CGAL_NO_ASSERTIONS) \
@ -85,9 +73,6 @@
#endif // CGAL_KERNEL_NO_ASSERTIONS
#undef CGAL_kernel_expensive_exactness_assertion
#undef CGAL_kernel_expensive_exactness_assertion_msg
#undef CGAL_kernel_expensive_exactness_assertion_code
#if defined(CGAL_KERNEL_NO_ASSERTIONS) || defined(CGAL_NO_ASSERTIONS) \
|| (!defined(CGAL_KERNEL_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS))\
@ -108,9 +93,6 @@
// preconditions
// -------------
#undef CGAL_kernel_precondition
#undef CGAL_kernel_precondition_msg
#undef CGAL_kernel_precondition_code
#if defined(CGAL_KERNEL_NO_PRECONDITIONS) || defined(CGAL_NO_PRECONDITIONS)
# define CGAL_kernel_precondition(EX) (static_cast<void>(0))
@ -126,9 +108,6 @@
#endif // CGAL_KERNEL_NO_PRECONDITIONS
#undef CGAL_kernel_exactness_precondition
#undef CGAL_kernel_exactness_precondition_msg
#undef CGAL_kernel_exactness_precondition_code
#if defined(CGAL_KERNEL_NO_PRECONDITIONS) || defined(CGAL_NO_PRECONDITIONS) \
|| (!defined(CGAL_KERNEL_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS))
@ -145,9 +124,6 @@
#endif // CGAL_KERNEL_NO_PRECONDITIONS
#undef CGAL_kernel_expensive_precondition
#undef CGAL_kernel_expensive_precondition_msg
#undef CGAL_kernel_expensive_precondition_code
#if defined(CGAL_KERNEL_NO_PRECONDITIONS) || defined(CGAL_NO_PRECONDITIONS) \
|| (!defined(CGAL_KERNEL_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE))
@ -164,9 +140,6 @@
#endif // CGAL_KERNEL_NO_PRECONDITIONS
#undef CGAL_kernel_expensive_exactness_precondition
#undef CGAL_kernel_expensive_exactness_precondition_msg
#undef CGAL_kernel_expensive_exactness_precondition_code
#if defined(CGAL_KERNEL_NO_PRECONDITIONS) || defined(CGAL_NO_PRECONDITIONS) \
|| (!defined(CGAL_KERNEL_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS))\
@ -187,9 +160,6 @@
// postconditions
// --------------
#undef CGAL_kernel_postcondition
#undef CGAL_kernel_postcondition_msg
#undef CGAL_kernel_postcondition_code
#if defined(CGAL_KERNEL_NO_POSTCONDITIONS) || defined(CGAL_NO_POSTCONDITIONS)
# define CGAL_kernel_postcondition(EX) (static_cast<void>(0))
@ -205,9 +175,6 @@
#endif // CGAL_KERNEL_NO_POSTCONDITIONS
#undef CGAL_kernel_exactness_postcondition
#undef CGAL_kernel_exactness_postcondition_msg
#undef CGAL_kernel_exactness_postcondition_code
#if defined(CGAL_KERNEL_NO_POSTCONDITIONS) || defined(CGAL_NO_POSTCONDITIONS) \
|| (!defined(CGAL_KERNEL_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS))
@ -224,9 +191,6 @@
#endif // CGAL_KERNEL_NO_POSTCONDITIONS
#undef CGAL_kernel_expensive_postcondition
#undef CGAL_kernel_expensive_postcondition_msg
#undef CGAL_kernel_expensive_postcondition_code
#if defined(CGAL_KERNEL_NO_POSTCONDITIONS) || defined(CGAL_NO_POSTCONDITIONS) \
|| (!defined(CGAL_KERNEL_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE))
@ -243,9 +207,6 @@
#endif // CGAL_KERNEL_NO_POSTCONDITIONS
#undef CGAL_kernel_expensive_exactness_postcondition
#undef CGAL_kernel_expensive_exactness_postcondition_msg
#undef CGAL_kernel_expensive_exactness_postcondition_code
#if defined(CGAL_KERNEL_NO_POSTCONDITIONS) || defined(CGAL_NO_POSTCONDITIONS) \
|| (!defined(CGAL_KERNEL_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS))\
@ -266,9 +227,6 @@
// warnings
// --------
#undef CGAL_kernel_warning
#undef CGAL_kernel_warning_msg
#undef CGAL_kernel_warning_code
#if defined(CGAL_KERNEL_NO_WARNINGS) || defined(CGAL_NO_WARNINGS)
# define CGAL_kernel_warning(EX) (static_cast<void>(0))
@ -284,9 +242,6 @@
#endif // CGAL_KERNEL_NO_WARNINGS
#undef CGAL_kernel_exactness_warning
#undef CGAL_kernel_exactness_warning_msg
#undef CGAL_kernel_exactness_warning_code
#if defined(CGAL_KERNEL_NO_WARNINGS) || defined(CGAL_NO_WARNINGS) \
|| (!defined(CGAL_KERNEL_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS))
@ -303,9 +258,6 @@
#endif // CGAL_KERNEL_NO_WARNINGS
#undef CGAL_kernel_expensive_warning
#undef CGAL_kernel_expensive_warning_msg
#undef CGAL_kernel_expensive_warning_code
#if defined(CGAL_KERNEL_NO_WARNINGS) || defined(CGAL_NO_WARNINGS) \
|| (!defined(CGAL_KERNEL_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE))
@ -322,9 +274,6 @@
#endif // CGAL_KERNEL_NO_WARNINGS
#undef CGAL_kernel_expensive_exactness_warning
#undef CGAL_kernel_expensive_exactness_warning_msg
#undef CGAL_kernel_expensive_exactness_warning_code
#if defined(CGAL_KERNEL_NO_WARNINGS) || defined(CGAL_NO_WARNINGS) \
|| (!defined(CGAL_KERNEL_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS))\
@ -340,3 +289,5 @@
# define CGAL_kernel_expensive_exactness_warning_code(CODE) CODE
# define CGAL_kernel_expensive_exactness_warnings 1
#endif // CGAL_KERNEL_NO_WARNINGS
#endif // CGAL_KERNEL_ASSERTIONS_H

View File

@ -47,6 +47,7 @@ class Sphere_d_rep {
public:
Sphere_d_rep() : cp(0) {}
Sphere_d_rep(int d) : P(d), cp(0) {}
Sphere_d_rep(int d, Orientation orient) : P(d), orient(orient), cp(0) {}
template <class ForwardIterator>
Sphere_d_rep(int d, ForwardIterator first, ForwardIterator last) :
@ -109,14 +110,13 @@ typedef typename std::vector< Point_d >::const_iterator point_iterator;
/*{\Mcreation 4}*/
Sphere_d(int d = 0) : Base( Rep(d+1) )
Sphere_d(int d = 0) : Base( Rep(d+1, ZERO) )
/*{\Mcreate introduces a variable |\Mvar| of type |\Mname|. |\Mvar|
is initialized to the empty sphere centered at the origin of
$d$-dimensional space. }*/
{
Point_d p(d);
for (int i = 0; i <= d; i++) ptr()->P[i] = p;
ptr()->orient = ZERO;
ptr()->cp = new Point_d(p);
}

View File

@ -134,11 +134,10 @@ subdivide_lcc_3 (LCC & m)
// 2) We subdivide each facet.
m.negate_mark (treated); // All the darts are marked in O(1).
unsigned int nb = 0;
for (LCC::Dart_range::iterator it (m.darts().begin ());
m.number_of_marked_darts (treated) > 0; ++it)
{
++nb;
if (m.is_marked (it, treated))
{
// We unmark the darts of the facet to process only once dart/facet.

View File

@ -23,24 +23,17 @@
This chapter describes concepts, classes, and functions for
monotone and sorted matrix search.
\cgalCRPSection{Assertions}
The optimization code uses infix `OPTIMISATION` in the assertions,
e.g. defining the compiler flag
`CGAL_OPTIMISATION_NO_PRECONDITIONS` switches precondition
checking off, cf. Section \ref secchecks "Checks" in the chapter on STL extensions.
\cgalClassifedRefPages
- `CGAL::monotone_matrix_search`
- `CGAL::monotone_matrix_search()`
- `CGAL::Dynamic_matrix<M>`
- `MonotoneMatrixSearchTraits`
- `BasicMatrix`
- `CGAL::sorted_matrix_search`
- `CGAL::sorted_matrix_search()`
- `CGAL::Sorted_matrix_search_traits_adaptor<F,M>`
- `SortedMatrixSearchTraits`
*/

View File

@ -17,7 +17,7 @@
#include <CGAL/basic.h>
#include <CGAL/Optimisation/assertions.h>
#include <CGAL/assertions.h>
#include <type_traits>
namespace CGAL {
@ -67,8 +67,8 @@ public:
Value
operator()(int r, int c) const
{
CGAL_optimisation_precondition(r >= 0 && r < number_of_rows());
CGAL_optimisation_precondition(c >= 0 && c < number_of_columns());
CGAL_precondition(r >= 0 && r < number_of_rows());
CGAL_precondition(c >= 0 && c < number_of_columns());
return op(row_vec[r], column_vec[c]);
}

View File

@ -18,7 +18,7 @@
#include <vector>
#include <utility>
#include <CGAL/Optimisation/assertions.h>
#include <CGAL/assertions.h>
namespace CGAL {
@ -56,8 +56,8 @@ public:
Value
operator()( int r, int c) const
{
CGAL_optimisation_precondition( r >= 0 && r < number_of_rows());
CGAL_optimisation_precondition( c >= 0 && c < number_of_columns());
CGAL_precondition( r >= 0 && r < number_of_rows());
CGAL_precondition( c >= 0 && c < number_of_columns());
return (*matrix)( r << row_power, column_indices[c]);
}
@ -70,18 +70,18 @@ public:
void
replace_column( int o, int n)
{
CGAL_optimisation_precondition( o >= 0 && o < number_of_columns());
CGAL_optimisation_precondition( n >= 0 && n < number_of_columns());
CGAL_precondition( o >= 0 && o < number_of_columns());
CGAL_precondition( n >= 0 && n < number_of_columns());
column_indices[o] = column_indices[n];
}
void
shrink_to_quadratic_size()
{
CGAL_optimisation_precondition( number_of_columns() >= number_of_rows());
CGAL_precondition( number_of_columns() >= number_of_rows());
column_indices.erase( column_indices.begin() + number_of_rows(),
column_indices.end());
CGAL_optimisation_postcondition( number_of_columns() == number_of_rows());
CGAL_postcondition( number_of_columns() == number_of_rows());
}
private:

View File

@ -16,7 +16,6 @@
#include <CGAL/license/Matrix_search.h>
#include <CGAL/Optimisation/assertions.h>
#include <CGAL/circulator_bases.h>
#include <iterator>

View File

@ -16,7 +16,7 @@
#include <CGAL/license/Matrix_search.h>
#include <CGAL/Optimisation/assertions.h>
#include <CGAL/assertions.h>
#include <vector>
#include <functional>
@ -57,9 +57,9 @@ monotone_matrix_search(
// ------
// get even rows of M:
Matrix* M_new = M.extract_all_even_rows();
CGAL_optimisation_assertion(
CGAL_assertion(
M_new->number_of_columns() == M.number_of_columns());
CGAL_optimisation_assertion(
CGAL_assertion(
M_new->number_of_rows() == 0 ||
M_new->number_of_rows() == ( M.number_of_rows() + 1) >> 1);
@ -75,7 +75,7 @@ monotone_matrix_search(
reduction_table[M_new->number_of_rows()] =
M.number_of_columns() - 1;
_reduce_matrix( *M_new, reduction_table, compare_strictly);
CGAL_optimisation_assertion(
CGAL_assertion(
M_new->number_of_columns() == M_new->number_of_rows());
} // if ( M_new->number_of_rows() < M_new->number_of_columns())
@ -92,7 +92,7 @@ monotone_matrix_search(
// recursion:
CGAL_optimisation_assertion(
CGAL_assertion(
M_new->number_of_rows() >= M_new->number_of_columns());
// table to store the rmax values of M_new:
@ -160,7 +160,7 @@ _reduce_matrix(
// and returns for each column of the resulting
// matrix its column index in the original matrix
{
CGAL_optimisation_precondition(
CGAL_precondition(
M.number_of_columns() >= M.number_of_rows());
// active columns are 0, ..., j1, j2, ..., M.x_dim()-1
int j1( 0), j2( 1);
@ -191,7 +191,7 @@ _reduce_matrix(
// have been deleted, now move columns
// j2 .. M.number_of_columns()-1 to the first part
while ( j1 < M.number_of_rows() - 1) {
CGAL_optimisation_assertion( j2 < M.number_of_columns());
CGAL_assertion( j2 < M.number_of_columns());
M.replace_column( ++j1, j2);
*(t+j1) = j2++;
}

Some files were not shown because too many files have changed in this diff Show More