Merge remote-tracking branch 'cgal/master' into STL_extension-Fix_Prevent_deref-GF

This commit is contained in:
Laurent Rineau 2023-09-19 16:22:49 +02:00
commit aa09a28df8
2568 changed files with 79282 additions and 65082 deletions

View File

@ -60,7 +60,7 @@ jobs:
content: 'rocket'
})
- uses: actions/checkout@v3
- uses: actions/checkout@v4
name: "checkout branch"
if: steps.get_round.outputs.result != 'stop'
with:
@ -75,7 +75,7 @@ jobs:
sudo apt-get update && sudo apt-get install -y graphviz ssh bibtex2html
sudo pip install lxml
sudo pip install pyquery
wget --no-verbose -O doxygen_exe https://cgal.geometryfactory.com/~cgaltest/doxygen_1_8_13_patched/doxygen
wget --no-verbose -O doxygen_exe https://cgal.geometryfactory.com/~cgaltest/doxygen_1_9_6_patched/doxygen
sudo mv doxygen_exe /usr/bin/doxygen
sudo chmod +x /usr/bin/doxygen
git config --global user.email "cgal@geometryfactory.com"
@ -160,7 +160,7 @@ jobs:
script: |
const error = process.env.ERRORMSG
const job_url = `${context.serverUrl}/CGAL/cgal/actions/runs/${context.runId}`
const msg = "There was an error while building the doc: \n"+error + "\n" + job_url
const msg = "There was an error while building the doc: \n```\n"+error + "\n```\n" + job_url
github.rest.issues.createComment({
owner: "CGAL",
repo: "cgal",

View File

@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: install dependencies
run: |
.github/install.sh

View File

@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: install dependencies
run: sudo apt-get install -y libboost-dev libboost-program-options-dev libmpfr-dev libeigen3-dev
- name: configure all
@ -25,7 +25,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: install dependencies
run: sudo bash -e .github/install.sh
- name: configure all

View File

@ -14,7 +14,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: delete directory
run: |
set -x

View File

@ -9,7 +9,7 @@ jobs:
batch_1:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: install dependencies
run: .github/install.sh
- name: run1
@ -17,7 +17,7 @@ jobs:
batch_2:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: install dependencies
run: .github/install.sh
- name: run2
@ -25,7 +25,7 @@ jobs:
batch_3:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: install dependencies
run: .github/install.sh
- name: run3
@ -33,7 +33,7 @@ jobs:
batch_4:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: install dependencies
run: .github/install.sh
- name: run4

View File

@ -12,7 +12,7 @@
messages: ${{ steps.cat_output.outputs.message }}
steps:
- name: checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: run script
run: |
chmod +x ./Scripts/developer_scripts/list_cgal_workflows_last_run.sh

35
.github/workflows/reuse.yml vendored Normal file
View File

@ -0,0 +1,35 @@
# SPDX-FileCopyrightText: 2020 Free Software Foundation Europe e.V. <https://fsfe.org>
#
# SPDX-License-Identifier: GPL-3.0-or-later
name: REUSE Compliance Check
on: [push, pull_request]
jobs:
reuse:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: REUSE version
uses: fsfe/reuse-action@v2
with:
args: --version
- name: REUSE lint
uses: fsfe/reuse-action@v2
with:
args: --include-submodules lint
- name: REUSE SPDX SBOM
uses: fsfe/reuse-action@v2
with:
args: spdx
- name: install dependencies
run: sudo apt-get install -y cmake
- name: Create CGAL internal release
run: |
mkdir -p ./release
cmake -DDESTINATION=./release -DCGAL_VERSION=9.9 -P ./Scripts/developer_scripts/cgal_create_release_with_cmake.cmake
- name: REUSE lint release tarball
uses: fsfe/reuse-action@v2
with:
args: --root ./release/CGAL-9.9 --include-submodules lint

1
.gitignore vendored
View File

@ -1212,3 +1212,4 @@ gmon.*
Polygonal_surface_reconstruction/examples/build*
Polygonal_surface_reconstruction/test/build*
Solver_interface/examples/build*
/Mesh_3/examples/Mesh_3/indicator_0.inr.gz

12
.reuse/dep5 Normal file
View File

@ -0,0 +1,12 @@
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: CGAL
Upstream-Contact: CGAL Editorial Board <info@cgal.org>
Source: https://github.com/CGAL/cgal
Files: .* *.cmake *.md .github/* Maintenance/* */TODO */doc/* */deb/* */applications/* */doc_html/* */scripts/* */developer_scripts/* */demo/* */examples/* */src/* */test/* */benchmarks/* */benchmark/* */package_info/* */data/* */cmake/*
Copyright: 1995-2023 The CGAL Project
License: CC0-1.0
Files: CMakeLists.txt GraphicsView/include/CGAL/Qt/ImageInterface.ui GraphicsView/include/CGAL/Qt/resources/qglviewer-icon.xpm Installation/AUTHORS Installation/CMakeLists.txt Installation/README Installation/auxiliary/cgal_create_cmake_script.1 Installation/auxiliary/gmp/README Installation/include/CGAL/license/gpl_package_list.txt MacOSX/auxiliary/cgal_app.icns copyright
Copyright: 1995-2023 The CGAL Project
License: CC0-1.0

View File

@ -24,7 +24,7 @@ include_directories(BEFORE ./ ./include)
find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt5)
# Find Qt5 itself
find_package(Qt5 QUIET COMPONENTS Script OpenGL Gui Svg)
find_package(Qt5 QUIET COMPONENTS Widgets OpenGL)
if(CGAL_Qt5_FOUND AND Qt5_FOUND)
@ -53,7 +53,7 @@ if(CGAL_Qt5_FOUND AND Qt5_FOUND)
#${CGAL_Qt5_MOC_FILES}
)
# Link with Qt libraries
target_link_libraries(AABB_demo PRIVATE Qt5::OpenGL Qt5::Gui
target_link_libraries(AABB_demo PRIVATE Qt5::Widgets Qt5::OpenGL
CGAL::CGAL CGAL::CGAL_Qt5)
add_to_cached_list(CGAL_EXECUTABLE_TARGETS AABB_demo)

View File

@ -11,7 +11,9 @@ and the primitives stored in the AABB tree.
\cgalRefines{SearchGeomTraits_3}
\cgalHasModel All models of the concept `Kernel`
\cgalHasModelsBegin
\cgalHasModelsBare{All models of the concept `Kernel`}
\cgalHasModelsEnd
\sa `CGAL::AABB_traits<AABBGeomTraits,AABBPrimitive>`
\sa `CGAL::AABB_tree<AABBTraits>`
@ -47,7 +49,7 @@ Provides the operator:
`return_type operator()(const Query& q, const Primitive::Datum& d)`,
which computes the intersection between `q` and `d`. The type of the returned object
must be a `boost::optional` of a `boost::variant` of the possible intersection types.
must be a `std::optional` of a `std::variant` of the possible intersection types.
*/
typedef unspecified_type Intersect_3;

View File

@ -12,11 +12,13 @@ The concept `AABBPrimitive` describes the requirements for the primitives stored
The `Primitive` type can be, e.g., a wrapper around a `Handle`. Assume for instance that the input objects are the triangle faces of a mesh stored as a `CGAL::Polyhedron_3`. The `Datum` would be a `Triangle_3` and the `Id` would be a polyhedron `Face_handle`. Method `datum()` can return either a `Triangle_3` constructed on the fly from the face handle or a `Triangle_3` stored internally. This provides a way for the user to trade memory for efficiency.
\cgalHasModel `CGAL::AABB_primitive<Id,ObjectPropertyMap,PointPropertyMap,Tag_false,CacheDatum>`
\cgalHasModel `CGAL::AABB_segment_primitive<Iterator,CacheDatum>`
\cgalHasModel `CGAL::AABB_triangle_primitive<Iterator,CacheDatum>`
\cgalHasModel `CGAL::AABB_halfedge_graph_segment_primitive<HalfedgeGraph,VertexPointPMap,Tag_false,CacheDatum>`
\cgalHasModel `CGAL::AABB_face_graph_triangle_primitive<FaceGraph,VertexPointPMap,Tag_false,CacheDatum>`
\cgalHasModelsBegin
\cgalHasModels{CGAL::AABB_primitive<Id,ObjectPropertyMap,PointPropertyMap,Tag_false,CacheDatum>}
\cgalHasModels{CGAL::AABB_segment_primitive<Iterator,CacheDatum>}
\cgalHasModels{CGAL::AABB_triangle_primitive<Iterator,CacheDatum>}
\cgalHasModels{CGAL::AABB_halfedge_graph_segment_primitive<HalfedgeGraph,VertexPointPMap,Tag_false,CacheDatum>}
\cgalHasModels{CGAL::AABB_face_graph_triangle_primitive<FaceGraph,VertexPointPMap,Tag_false,CacheDatum>}
\cgalHasModelsEnd
*/
class AABBPrimitive {

View File

@ -21,9 +21,11 @@ The `Datum` would be a `Triangle_3` and the `Id` a `std::size_t`. The shared dat
`std::vector<Triangle_3>`.
The method `datum(const Shared_data&)` then returns a triangle from the vector.
\cgalHasModel `CGAL::AABB_primitive<Id,ObjectPropertyMap,PointPropertyMap,Tag_true,CacheDatum>`
\cgalHasModel `CGAL::AABB_halfedge_graph_segment_primitive<HalfedgeGraph,VertexPointPMap,Tag_true,CacheDatum>`
\cgalHasModel `CGAL::AABB_face_graph_triangle_primitive<FaceGraph,VertexPointPMap,Tag_true,CacheDatum>`
\cgalHasModelsBegin
\cgalHasModels{CGAL::AABB_primitive<Id,ObjectPropertyMap,PointPropertyMap,Tag_true,CacheDatum>}
\cgalHasModels{CGAL::AABB_halfedge_graph_segment_primitive<HalfedgeGraph,VertexPointPMap,Tag_true,CacheDatum>}
\cgalHasModels{CGAL::AABB_face_graph_triangle_primitive<FaceGraph,VertexPointPMap,Tag_true,CacheDatum>}
\cgalHasModelsEnd
*/
class AABBPrimitiveWithSharedData {

View File

@ -9,7 +9,9 @@ define the Intersection_distance functor.
\cgalRefines{AABBGeomTraits}
\cgalHasModel All models of the concept `Kernel`
\cgalHasModelsBegin
\cgalHasModelsBare{All models of the concept `Kernel`}
\cgalHasModelsEnd
\sa `CGAL::AABB_traits<AABBGeomTraits,AABBPrimitive>`
\sa `CGAL::AABB_tree<AABBTraits>`

View File

@ -7,7 +7,9 @@ The concept `AABBRayIntersectionTraits` is a refinement of the concept
`AABBTraits` it also requires function objects to calculate the
distance of an intersection along a ray.
\cgalHasModel `CGAL::AABB_traits<AABBGeomTraits,AABBPrimitive>`
\cgalHasModelsBegin
\cgalHasModels{CGAL::AABB_traits<AABBGeomTraits,AABBPrimitive>}
\cgalHasModelsEnd
\sa `CGAL::AABB_tree<AABBTraits>`
\sa `AABBPrimitive`
@ -25,15 +27,15 @@ public:
/*!
A functor object to compute the distance between the source of a ray and its
closest intersection point between the ray and a primitive or a bounding box.
An empty `boost::optional` is returned, if there is no intersection.
An empty `std::optional` is returned, if there is no intersection.
When there is an intersection, an object of type `FT` is returned such that
if `i1` and `i2` are two intersection points, then `i1` is closer to the source
of the ray than `i2` iff `n1 < n2`, `n1` and `n2` being the numbers returned for `i1` and `i2`
respectively.
Provides the operators:
`boost::optional<FT> operator()(const Ray_3& r, const Bounding_box& bbox)`.
`boost::optional<std::pair<FT, Intersection_and_primitive_id<Ray_3>::%Type > >
`std::optional<FT> operator()(const Ray_3& r, const Bounding_box& bbox)`.
`std::optional<std::pair<FT, Intersection_and_primitive_id<Ray_3>::%Type > >
operator()(const Ray_3& r, const Primitive& primitive)`.
A common algorithm to compute the intersection between a bounding box and a ray is <A

View File

@ -5,7 +5,9 @@
The concept `AABBTraits` provides the geometric primitive types and methods for the class `CGAL::AABB_tree<AABBTraits>`.
\cgalHasModel `CGAL::AABB_traits<AABBGeomTraits,AABBPrimitive>`
\cgalHasModelsBegin
\cgalHasModels{CGAL::AABB_traits<AABBGeomTraits,AABBPrimitive>}
\cgalHasModelsEnd
\cgalRefines{SearchGeomTraits_3}
@ -119,10 +121,10 @@ typedef unspecified_type Do_intersect;
/*!
A functor object to compute the intersection of a query and a primitive. Provides the operator:
`boost::optional<Intersection_and_primitive_id<Query>::%Type > operator()(const Query & q, const Primitive& primitive);` which returns the intersection as a pair composed of an object and a primitive id, iff the query intersects the primitive.
`std::optional<Intersection_and_primitive_id<Query>::%Type > operator()(const Query & q, const Primitive& primitive);` which returns the intersection as a pair composed of an object and a primitive id, iff the query intersects the primitive.
\cgalHeading{Note on Backward Compatibility}
Before the release 4.3 of \cgal, the return type of this function used to be `boost::optional<Object_and_primitive_id>`.
Before the release 4.3 of \cgal, the return type of this function used to be `std::optional<Object_and_primitive_id>`.
*/
typedef unspecified_type Intersection;

View File

@ -19,8 +19,8 @@ typedef CGAL::Polyhedron_3<K> Polyhedron;
typedef CGAL::AABB_face_graph_triangle_primitive<Polyhedron> Primitive;
typedef CGAL::AABB_traits<K, Primitive> Traits;
typedef CGAL::AABB_tree<Traits> Tree;
typedef boost::optional< Tree::Intersection_and_primitive_id<Segment>::Type > Segment_intersection;
typedef boost::optional< Tree::Intersection_and_primitive_id<Plane>::Type > Plane_intersection;
typedef std::optional< Tree::Intersection_and_primitive_id<Segment>::Type > Segment_intersection;
typedef std::optional< Tree::Intersection_and_primitive_id<Plane>::Type > Plane_intersection;
typedef Tree::Primitive_id Primitive_id;
int main()
@ -57,7 +57,7 @@ int main()
if(intersection)
{
// gets intersection object
const Point* p = boost::get<Point>(&(intersection->first));
const Point* p = std::get_if<Point>(&(intersection->first));
if(p)
std::cout << "intersection object is a point " << *p << std::endl;
@ -81,7 +81,7 @@ int main()
if(plane_intersection)
{
if(boost::get<Segment>(&(plane_intersection->first)))
if(std::get_if<Segment>(&(plane_intersection->first)))
std::cout << "intersection object is a segment" << std::endl;
}

View File

@ -23,7 +23,7 @@ typedef boost::graph_traits<Mesh>::halfedge_descriptor halfedge_descriptor;
typedef CGAL::AABB_face_graph_triangle_primitive<Mesh> Primitive;
typedef CGAL::AABB_traits<K, Primitive> Traits;
typedef CGAL::AABB_tree<Traits> Tree;
typedef boost::optional<Tree::Intersection_and_primitive_id<Ray>::Type> Ray_intersection;
typedef std::optional<Tree::Intersection_and_primitive_id<Ray>::Type> Ray_intersection;
struct Skip
{
@ -70,8 +70,8 @@ int main(int argc, char* argv[])
Ray_intersection intersection = tree.first_intersection(ray, skip);
if(intersection)
{
if(boost::get<Point>(&(intersection->first))){
const Point* p = boost::get<Point>(&(intersection->first) );
if(std::get_if<Point>(&(intersection->first))){
const Point* p = std::get_if<Point>(&(intersection->first) );
std::cout << *p << std::endl;
}
}

View File

@ -33,7 +33,7 @@ namespace CGAL {
* while the AABB tree holding the primitive is in use.
* The triangle type of the primitive (`Datum`) is `CGAL::Kernel_traits< boost::property_traits< VertexPointPMap >::%value_type >::%Kernel::Triangle_3`.
*
* \cgalModels `AABBPrimitiveWithSharedData`
* \cgalModels{AABBPrimitiveWithSharedData}
*
*\tparam FaceGraph is a model of the face graph concept.
*\tparam VertexPointPMap is a property map with `boost::graph_traits<FaceGraph>::%vertex_descriptor`

View File

@ -24,7 +24,6 @@
#include <iterator>
#include <boost/mpl/and.hpp>
#include <CGAL/type_traits/is_iterator.h>
#include <boost/type_traits/is_convertible.hpp>
#include <boost/mpl/if.hpp>
#include <CGAL/Default.h>
@ -34,7 +33,7 @@ namespace CGAL {
/*!
* \ingroup PkgAABBTreeRef
* Primitive type for a edge of a polyhedral surface.
* Primitive type for an edge of a polyhedral surface.
* It wraps an `edge_descriptor` into a 3D segment.
* The class model of `HalfedgeGraph` from which the primitive is built should not be deleted
* while the AABB tree holding the primitive is in use.
@ -42,8 +41,10 @@ namespace CGAL {
* of `VertexPointPMap` (using the `Kernel_traits` mechanism).
* The segment type of the primitive (`Datum`) is `CGAL::Kernel_traits< boost::property_traits< VertexPointPMap >::%value_type >::%Kernel::Segment_3`.
*
* \cgalModels `AABBPrimitive` if `OneHalfedgeGraphPerTree` is `CGAL::Tag_false`,
* and `AABBPrimitiveWithSharedData` if `OneHalfedgeGraphPerTree` is `CGAL::Tag_true`.
* \cgalModelsBareBegin
* \cgalModelsBare{`AABBPrimitive` if `OneHalfedgeGraphPerTree` is `CGAL::Tag_false`}
* \cgalModelsBare{`AABBPrimitiveWithSharedData` if `OneHalfedgeGraphPerTree` is `CGAL::Tag_true`}
* \cgalModelsBareEnd
*
* \tparam HalfedgeGraph is a model of the halfedge graph concept.
* as key type and a \cgal Kernel `Point_3` as value type.

View File

@ -42,7 +42,7 @@ namespace CGAL {
/// AABB tree is built should not be deleted while the AABB tree
/// is in use.
///
/// \cgalModels `AABBPrimitive`
/// \cgalModels{AABBPrimitive}
/// \tparam GeomTraits must provide a \c %Point_3
/// type, used as \c Point, and a \c %Segment_3 type, used as \c
/// Datum and constructible from two arguments of type \c

View File

@ -35,7 +35,7 @@ namespace CGAL {
/// the polyhedron from which the AABB tree is built should not be
/// deleted while the AABB tree is in use.
///
/// \cgalModels `AABBPrimitive`
/// \cgalModels{AABBPrimitive}
/// \tparam GeomTraits must provides a \c %Point_3
/// type, used as \c Point, and a \c %Triangle_3 type, used as \c
/// Datum and constructible from three arguments of type \c

View File

@ -53,8 +53,10 @@ public:
* The two property maps which are template parameters of the class enable to get the datum and the reference point of
* the primitive from the identifier. The last template parameter controls whether the primitive class holds a copy of the datum.
*
* \cgalModels `AABBPrimitive` if `ExternalPropertyMaps` is `CGAL::Tag_false`.
* \cgalModels `AABBPrimitiveWithSharedData` if `ExternalPropertyMaps` is `CGAL::Tag_true`.
* \cgalModelsBareBegin
* \cgalModelsBare{`AABBPrimitive` if `ExternalPropertyMaps` is `CGAL::Tag_false`}
* \cgalModelsBare{`AABBPrimitiveWithSharedData` if `ExternalPropertyMaps` is `CGAL::Tag_true`}
* \cgalModelsBareEnd
*
* \tparam ObjectPropertyMap is a model of `ReadablePropertyMap` with `Id` as
* `key_type`. It must be a model of `CopyConstructible`, `DefaultConstructible`, and `CopyAssignable`.

View File

@ -54,7 +54,7 @@ namespace internal {
* The iterator from which the primitive is built should not be invalided
* while the AABB tree holding the primitive is in use.
*
* \cgalModels `AABBPrimitive`
* \cgalModels{AABBPrimitive}
*
* \tparam GeomTraits is a traits class providing the nested type `Point_3` and `Segment_3`.
* It also provides the functor `Construct_source_3` that has an operator taking a `Segment_3`

View File

@ -27,7 +27,7 @@
#include <CGAL/Kernel_23/internal/Has_boolean_tags.h>
#include <boost/optional.hpp>
#include <optional>
/// \file AABB_traits.h
@ -39,7 +39,7 @@ template <class T>
struct Remove_optional { typedef T type; };
template <class T>
struct Remove_optional< ::boost::optional<T> > { typedef T type; };
struct Remove_optional< ::std::optional<T> > { typedef T type; };
//helper controlling whether extra data should be stored in the AABB_tree traits class
template <class Primitive, bool has_shared_data=Has_nested_type_Shared_data<Primitive>::value>
@ -85,7 +85,7 @@ struct AABB_traits_base_2<GeomTraits,true>{
typedef typename CGAL::Bbox_3 Bounding_box;
struct Intersection_distance {
boost::optional<FT> operator()(const Ray_3& ray, const Bounding_box& bbox) const {
std::optional<FT> operator()(const Ray_3& ray, const Bounding_box& bbox) const {
FT t_near = -DBL_MAX; // std::numeric_limits<FT>::lowest(); C++1903
FT t_far = DBL_MAX;
@ -101,7 +101,7 @@ struct AABB_traits_base_2<GeomTraits,true>{
for(int i = 0; i < 3; ++i, ++source_iter, ++direction_iter) {
if(*direction_iter == 0) {
if((*source_iter < (bbox.min)(i)) || (*source_iter > (bbox.max)(i))) {
return boost::none;
return std::nullopt;
}
} else {
FT t1 = ((bbox.min)(i) - *source_iter) / *direction_iter;
@ -118,7 +118,7 @@ struct AABB_traits_base_2<GeomTraits,true>{
// t_far = t2;
if(t_near > t_far || t_far < FT(0.))
return boost::none;
return std::nullopt;
}
}
@ -149,9 +149,8 @@ class AABB_tree;
/// computations, and it handles points as query type for distance
/// queries.
///
/// \cgalModels AABBTraits
/// \cgalModels AABBRayIntersectionTraits
/// \cgalModels{AABBTraits,AABBRayIntersectionTraits}
///
/// \tparam GeomTraits must be a model of the concept \ref AABBGeomTraits,
/// and provide the geometric types as well as the intersection tests and computations.
/// \tparam Primitive provide the type of primitives stored in the AABB_tree.
@ -193,7 +192,7 @@ public:
/// `Intersection_and_primitive_id<Query>::%Type::first_type` is found according to
/// the result type of `GeomTraits::Intersect_3::operator()`. If it is
/// `boost::optional<T>` then it is `T`, and the result type otherwise.
/// `std::optional<T>` then it is `T`, and the result type otherwise.
template<typename Query>
struct Intersection_and_primitive_id {
typedef decltype(
@ -364,12 +363,12 @@ public:
Intersection(const AABB_traits<GeomTraits,AABBPrimitive,BboxMap>& traits)
:m_traits(traits) {}
template<typename Query>
boost::optional< typename Intersection_and_primitive_id<Query>::Type >
std::optional< typename Intersection_and_primitive_id<Query>::Type >
operator()(const Query& query, const typename AT::Primitive& primitive) const {
auto inter_res = GeomTraits().intersect_3_object()(query, internal::Primitive_helper<AT>::get_datum(primitive,m_traits));
if (!inter_res)
return boost::none;
return boost::make_optional( std::make_pair(*inter_res, primitive.id()) );
return std::nullopt;
return std::make_optional( std::make_pair(*inter_res, primitive.id()) );
}
};

View File

@ -26,8 +26,7 @@
#include <CGAL/AABB_tree/internal/AABB_search_tree.h>
#include <CGAL/AABB_tree/internal/Has_nested_type_Shared_data.h>
#include <CGAL/AABB_tree/internal/Primitive_helper.h>
#include <boost/optional.hpp>
#include <boost/lambda/lambda.hpp>
#include <optional>
#ifdef CGAL_HAS_THREADS
#include <CGAL/mutex.h>
@ -143,7 +142,7 @@ namespace CGAL {
/// An explicit call to `build()` must be made to ensure that the next call to
/// a query function will not trigger the construction of the data structure.
/// A call to `AABBTraits::set_shared_data(t...)` is made using the internally stored traits.
/// This procedure has a complexity of \f$O(n log(n))\f$, where \f$n\f$ is the number of
/// This procedure has a complexity of \cgalBigO{n log(n)}, where \f$n\f$ is the number of
/// primitives of the tree.
template<typename ... T>
void build(T&& ...);
@ -271,7 +270,7 @@ public:
/// \tparam Query must be a type for which `Do_intersect` operators are
/// defined in the traits class `AABBTraits`.
template <typename Query>
boost::optional<Primitive_id> any_intersected_primitive(const Query& query) const;
std::optional<Primitive_id> any_intersected_primitive(const Query& query) const;
///@}
/// \name Intersections
@ -294,7 +293,7 @@ public:
/// \tparam Query must be a type for which `Do_intersect` and `Intersection` operators are
/// defined in the traits class `AABBTraits`.
template <typename Query>
boost::optional< typename Intersection_and_primitive_id<Query>::Type >
std::optional< typename Intersection_and_primitive_id<Query>::Type >
any_intersection(const Query& query) const;
@ -318,15 +317,15 @@ public:
/// `AABBTraits` must be a model of `AABBRayIntersectionTraits` to
/// call this member function.
template<typename Ray, typename SkipFunctor>
boost::optional< typename Intersection_and_primitive_id<Ray>::Type >
std::optional< typename Intersection_and_primitive_id<Ray>::Type >
first_intersection(const Ray& query, const SkipFunctor& skip) const;
/// \cond
template<typename Ray>
boost::optional< typename Intersection_and_primitive_id<Ray>::Type >
std::optional< typename Intersection_and_primitive_id<Ray>::Type >
first_intersection(const Ray& query) const
{
return first_intersection(query, boost::lambda::constant(false));
return first_intersection(query, [](Primitive_id){ return false; });
}
/// \endcond
@ -343,15 +342,15 @@ public:
/// `AABBTraits` must be a model of `AABBRayIntersectionTraits` to
/// call this member function.
template<typename Ray, typename SkipFunctor>
boost::optional<Primitive_id>
std::optional<Primitive_id>
first_intersected_primitive(const Ray& query, const SkipFunctor& skip) const;
/// \cond
template<typename Ray>
boost::optional<Primitive_id>
std::optional<Primitive_id>
first_intersected_primitive(const Ray& query) const
{
return first_intersected_primitive(query, boost::lambda::constant(false));
return first_intersected_primitive(query, [](Primitive_id){ return false; });
}
/// \endcond
///@}
@ -964,7 +963,7 @@ public:
template <typename Tr>
template <typename Query>
boost::optional< typename AABB_tree<Tr>::template Intersection_and_primitive_id<Query>::Type >
std::optional< typename AABB_tree<Tr>::template Intersection_and_primitive_id<Query>::Type >
AABB_tree<Tr>::any_intersection(const Query& query) const
{
using namespace CGAL::internal::AABB_tree;
@ -976,7 +975,7 @@ public:
template <typename Tr>
template <typename Query>
boost::optional<typename AABB_tree<Tr>::Primitive_id>
std::optional<typename AABB_tree<Tr>::Primitive_id>
AABB_tree<Tr>::any_intersected_primitive(const Query& query) const
{
using namespace CGAL::internal::AABB_tree;

View File

@ -19,8 +19,7 @@
#include <functional>
#include <type_traits>
#include <boost/optional.hpp>
#include <boost/variant/apply_visitor.hpp>
#include <optional>
# if defined(BOOST_MSVC)
# pragma warning(push)
# pragma warning(disable: 4996)
@ -43,7 +42,7 @@ class AABB_ray_intersection {
public:
AABB_ray_intersection(const AABBTree& tree) : tree_(tree) {}
boost::optional< Ray_intersection_and_primitive_id >
std::optional< Ray_intersection_and_primitive_id >
ray_intersection(const Ray& query, SkipFunctor skip) const {
// We hit the root, now continue on the children. Keep track of
// nb_primitives through a variable in each Node on the stack. In
@ -63,7 +62,7 @@ public:
Heap_type pq;
// pq.reserve(tree_.size() / 2);
boost::optional< Ray_intersection_and_primitive_id >
std::optional< Ray_intersection_and_primitive_id >
intersection, /* the temporary for calculating the result */
p; /* the current best intersection */
@ -84,7 +83,7 @@ public:
if(!skip(current.node->left_data().id()) /* && do_intersect_obj(query, current.node->left_data()) */) {
intersection = intersection_obj(query, current.node->left_data());
if(intersection) {
FT ray_distance = boost::apply_visitor(param_visitor, intersection->first);
FT ray_distance = std::visit(param_visitor, intersection->first);
if(ray_distance < t) {
t = ray_distance;
p = intersection;
@ -96,7 +95,7 @@ public:
if(!skip(current.node->right_data().id()) /* && do_intersect_obj(query, current.node->right_data()) */) {
intersection = intersection_obj(query, current.node->right_data());
if(intersection) {
FT ray_distance = boost::apply_visitor(param_visitor, intersection->first);
FT ray_distance = std::visit(param_visitor, intersection->first);
if(ray_distance < t) {
t = ray_distance;
p = intersection;
@ -111,7 +110,7 @@ public:
if(!skip(current.node->left_data().id()) /* && do_intersect_obj(query, current.node->left_data()) */) {
intersection = intersection_obj(query, current.node->left_data());
if(intersection) {
FT ray_distance = boost::apply_visitor(param_visitor, intersection->first);
FT ray_distance = std::visit(param_visitor, intersection->first);
if(ray_distance < t) {
t = ray_distance;
p = intersection;
@ -121,7 +120,7 @@ public:
// right child
const Node* child = &(current.node->right_child());
boost::optional< FT > dist = intersection_distance_obj(query, child->bbox());
std::optional< FT > dist = intersection_distance_obj(query, child->bbox());
if(dist)
pq.push(Node_ptr_with_ft(child, *dist, 2));
@ -130,7 +129,7 @@ public:
default: // Children both inner nodes
{
const Node* child = &(current.node->left_child());
boost::optional<FT> dist = intersection_distance_obj(query, child->bbox());
std::optional<FT> dist = intersection_distance_obj(query, child->bbox());
if(dist)
pq.push(Node_ptr_with_ft(child, *dist, current.nb_primitives/2));
@ -198,10 +197,10 @@ private:
template<typename AABBTraits>
template<typename Ray, typename SkipFunctor>
boost::optional< typename AABB_tree<AABBTraits>::template Intersection_and_primitive_id<Ray>::Type >
std::optional< typename AABB_tree<AABBTraits>::template Intersection_and_primitive_id<Ray>::Type >
AABB_tree<AABBTraits>::first_intersection(const Ray& query,
const SkipFunctor& skip) const {
CGAL_static_assertion_msg((std::is_same<Ray, typename AABBTraits::Ray_3>::value),
static_assert(std::is_same<Ray, typename AABBTraits::Ray_3>::value,
"Ray and Ray_3 must be the same type");
switch(size()) // copy-paste from AABB_tree::traversal
@ -219,22 +218,22 @@ AABB_tree<AABBTraits>::first_intersection(const Ray& query,
break;
}
}
return boost::none;
return std::nullopt;
}
template<typename AABBTraits>
template<typename Ray, typename SkipFunctor>
boost::optional<typename AABB_tree<AABBTraits>::Primitive_id>
std::optional<typename AABB_tree<AABBTraits>::Primitive_id>
AABB_tree<AABBTraits>::first_intersected_primitive(const Ray& query,
const SkipFunctor& skip) const
{
boost::optional<
std::optional<
typename AABB_tree<AABBTraits>::
template Intersection_and_primitive_id<Ray>::Type > res =
first_intersection(query, skip);
if ( (bool) res )
return boost::make_optional( res->second );
return boost::none;
return std::make_optional( res->second );
return std::nullopt;
}
}

View File

@ -17,7 +17,7 @@
#include <CGAL/AABB_tree/internal/AABB_node.h>
#include <boost/optional.hpp>
#include <optional>
namespace CGAL {
@ -69,7 +69,7 @@ class First_intersection_traits
public:
typedef
boost::optional< typename AABBTraits::template Intersection_and_primitive_id<Query>::Type >
std::optional< typename AABBTraits::template Intersection_and_primitive_id<Query>::Type >
Result;
public:
First_intersection_traits(const AABBTraits& traits)
@ -124,7 +124,7 @@ public:
void intersection(const Query& query, const Primitive& primitive)
{
boost::optional< typename AABBTraits::template Intersection_and_primitive_id<Query>::Type >
std::optional< typename AABBTraits::template Intersection_and_primitive_id<Query>::Type >
intersection = m_traits.intersection_object()(query, primitive);
if(intersection)
@ -211,7 +211,7 @@ public:
{
if( m_traits.do_intersect_object()(query, primitive) )
{
m_result = boost::optional<typename Primitive::Id>(primitive.id());
m_result = std::optional<typename Primitive::Id>(primitive.id());
m_is_found = true;
}
}
@ -221,12 +221,12 @@ public:
return m_traits.do_intersect_object()(query, node.bbox());
}
boost::optional<typename Primitive::Id> result() const { return m_result; }
std::optional<typename Primitive::Id> result() const { return m_result; }
bool is_intersection_found() const { return m_is_found; }
private:
bool m_is_found;
boost::optional<typename Primitive::Id> m_result;
std::optional<typename Primitive::Id> m_result;
const AABBTraits& m_traits;
};

View File

@ -55,7 +55,7 @@ namespace internal {
* The iterator from which the primitive is built should not be invalided
* while the AABB tree holding the primitive is in use.
*
* \cgalModels `AABBPrimitive`
* \cgalModels{AABBPrimitive}
*
* \tparam GeomTraits is a traits class providing the nested type `Point_3` and `Triangle_3`.
* It also provides the functor `Construct_vertex_3` that has an operator taking a `Triangle_3`

View File

@ -28,7 +28,7 @@ namespace CGAL {
// the TriangleMesh from which the AABB tree is built should not be
// deleted while the AABB tree is in use.
//
// \cgalModels `AABBPrimitive`
// \cgalModels{AABBPrimitive}
// \tparam GeomTraits must provides a \c %Point_3
// type, used as \c Point, and a \c %Triangle_3 type, used as \c
// Datum and constructible from three arguments of type \c

View File

@ -95,20 +95,23 @@ void test_all_intersection_query_types(Tree& tree)
tree.all_intersected_primitives(segment,std::back_inserter(primitives));
// any_intersection
boost::optional< typename Tree::AABB_traits::template Intersection_and_primitive_id<Ray>::Type > r = tree.any_intersection(ray);
boost::optional< typename Tree::AABB_traits::template Intersection_and_primitive_id<Line>::Type > l = tree.any_intersection(line);
boost::optional< typename Tree::AABB_traits::template Intersection_and_primitive_id<Segment>::Type > s = tree.any_intersection(segment);
std::optional< typename Tree::AABB_traits::template Intersection_and_primitive_id<Ray>::Type > r = tree.any_intersection(ray);
std::optional< typename Tree::AABB_traits::template Intersection_and_primitive_id<Line>::Type > l = tree.any_intersection(line);
std::optional< typename Tree::AABB_traits::template Intersection_and_primitive_id<Segment>::Type > s = tree.any_intersection(segment);
CGAL_USE(r);
CGAL_USE(l);
CGAL_USE(s);
// any_intersected_primitive
boost::optional<typename Primitive::Id> optional_primitive;
std::optional<typename Primitive::Id> optional_primitive;
optional_primitive = tree.any_intersected_primitive(ray);
optional_primitive = tree.any_intersected_primitive(line);
optional_primitive = tree.any_intersected_primitive(segment);
// all_intersections
std::list< boost::optional< typename Tree::AABB_traits::template Intersection_and_primitive_id<Ray>::Type > > intersections_r;
std::list< boost::optional< typename Tree::AABB_traits::template Intersection_and_primitive_id<Line>::Type > > intersections_l;
std::list< boost::optional< typename Tree::AABB_traits::template Intersection_and_primitive_id<Segment>::Type > > intersections_s;
std::list< std::optional< typename Tree::AABB_traits::template Intersection_and_primitive_id<Ray>::Type > > intersections_r;
std::list< std::optional< typename Tree::AABB_traits::template Intersection_and_primitive_id<Line>::Type > > intersections_l;
std::list< std::optional< typename Tree::AABB_traits::template Intersection_and_primitive_id<Segment>::Type > > intersections_s;
tree.all_intersections(ray,std::back_inserter(intersections_r));
tree.all_intersections(line,std::back_inserter(intersections_l));
tree.all_intersections(segment,std::back_inserter(intersections_s));
@ -322,7 +325,7 @@ class Naive_implementations
typedef typename Traits::Point_3 Point;
typedef typename Traits::Point_and_primitive_id Point_and_primitive_id;
typedef boost::optional<Object_and_primitive_id> Intersection_result;
typedef std::optional<Object_and_primitive_id> Intersection_result;
const Traits& m_traits;
public:
@ -380,7 +383,7 @@ public:
Polyhedron_primitive_iterator it = Pr_generator().begin(p);
for ( ; it != Pr_generator().end(p) ; ++it )
{
boost::optional< typename Traits::template Intersection_and_primitive_id<Query>::Type >
std::optional< typename Traits::template Intersection_and_primitive_id<Query>::Type >
intersection = m_traits.intersection_object()(query, Pr(it,p));
if ( intersection )
*out++ = *intersection;
@ -653,7 +656,7 @@ private:
}
// any_intersected_primitive test (do not count time here)
typedef boost::optional<typename Primitive::Id> Any_primitive;
typedef std::optional<typename Primitive::Id> Any_primitive;
Any_primitive primitive = tree.any_intersected_primitive(query);
// Check: verify we do get the result by naive method
@ -723,7 +726,7 @@ private:
}
// Any intersection test (do not count time here)
boost::optional< typename Tree::AABB_traits::template Intersection_and_primitive_id<Query>::Type >
std::optional< typename Tree::AABB_traits::template Intersection_and_primitive_id<Query>::Type >
intersection = tree.any_intersection(query);
// Check: verify we do get the result by naive method

View File

@ -46,7 +46,7 @@ std::size_t intersect(ForwardIterator b, ForwardIterator e, const Tree& tree, lo
v.reserve(elements);
for(; b != e; ++b) {
tree.all_intersections(*b, std::back_inserter(v));
boost::optional<Obj_type> o = tree.any_intersection(*b);
std::optional<Obj_type> o = tree.any_intersection(*b);
if(o)
++counter;
}

View File

@ -65,7 +65,7 @@ int test()
return EXIT_FAILURE;
}
boost::optional<Object_and_primitive_id> any;
std::optional<Object_and_primitive_id> any;
any = tree.any_intersection(pq);
if(!any)
{

View File

@ -26,16 +26,16 @@ int main()
{
using namespace CGAL::internal::AABB_tree;
CGAL_static_assertion_msg(
static_assert(
(Is_ray_intersection_geomtraits<CGAL::Epeck>::value),
"CGAL::Epeck should be a RayIntersectionGeomTraits");
CGAL_static_assertion_msg(
static_assert(
(Is_ray_intersection_geomtraits< CGAL::Simple_cartesian<double> >::value),
"CGAL::Epeck should be a RayIntersectionGeomTraits");
CGAL_static_assertion_msg(
static_assert(
(!Is_ray_intersection_geomtraits<AABBGeomTraits>::value),
"Pure AABBGeomTraits shouldn't be a RayIntersectionGeomTraits");
CGAL_static_assertion_msg(
static_assert(
(!Is_ray_intersection_geomtraits<nope>::value),
"The empty struct shouldn't be a RayIntersectionGeomTraits");

View File

@ -3,7 +3,6 @@
#include <iterator>
#include <boost/functional/value_factory.hpp>
#include <boost/array.hpp>
#include <CGAL/algorithm.h>
#include <CGAL/point_generators_3.h>

View File

@ -3,7 +3,6 @@
#include <iterator>
#include <boost/functional/value_factory.hpp>
#include <boost/array.hpp>
#include <CGAL/assertions.h>
#include <CGAL/algorithm.h>
@ -36,7 +35,7 @@ FT point_on_ray_dist(const Ray& ray, const Point& point) {
std::size_t accum = 0;
boost::optional<
std::optional<
Tree::Intersection_and_primitive_id<Ray>::Type
>
min_intersection(const Tree& tree, const Ray& ray) {
@ -46,12 +45,12 @@ min_intersection(const Tree& tree, const Ray& ray) {
tree.all_intersections(ray, std::back_inserter(all_intersections));
accum += all_intersections.size();
Tree::FT min_distance = DBL_MAX;
boost::optional<
std::optional<
Tree::Intersection_and_primitive_id<Ray>::Type
> mini = boost::none;
> mini = std::nullopt;
for(IntersectionVector::iterator it2 = all_intersections.begin(); it2 != all_intersections.end(); ++it2) {
if(Point* point = boost::get<Point>(&(it2->first))) {
if(Point* point = std::get_if<Point>(&(it2->first))) {
Vector i_ray(*point, ray.source());
Tree::FT new_distance = i_ray.squared_length();
if(new_distance < min_distance) {
@ -92,7 +91,7 @@ int main()
Vector bbox_center((bbox.xmin() + bbox.xmax()) / 2,
(bbox.ymin() + bbox.ymax()) / 2,
(bbox.zmin() + bbox.zmax()) / 2);
boost::array<double, 3> extents;
std::array<double, 3> extents;
extents[0] = bbox.xmax() - bbox.xmin();
extents[1] = bbox.ymax() - bbox.ymin();
extents[2] = bbox.zmax() - bbox.zmin();
@ -125,7 +124,7 @@ int main()
rays.reserve(NB_RAYS);
std::transform(v1.begin(), v1.end(), v2.begin(),
std::back_inserter(rays), boost::value_factory<Ray>());
std::vector< boost::optional<Tree::Intersection_and_primitive_id<Ray>::Type > > primitives1, primitives2;
std::vector< std::optional<Tree::Intersection_and_primitive_id<Ray>::Type > > primitives1, primitives2;
primitives1.reserve(NB_RAYS); primitives2.reserve(NB_RAYS);
@ -140,7 +139,7 @@ int main()
}
assert(primitives1.size() == primitives2.size()); // Different amount of primitives intersected
assert(std::equal(primitives1.begin(), primitives1.end(), primitives2.begin())); // Primitives mismatch
std::size_t c = primitives1.size() - std::count(primitives1.begin(), primitives1.end(), boost::none);
std::size_t c = primitives1.size() - std::count(primitives1.begin(), primitives1.end(), std::nullopt);
std::cout << "Intersected " << c << " primitives with " << NB_RAYS << " rays" << std::endl;
std::cout << "Primitive method had to sort " << accum/NB_RAYS
<< " intersections on average." << std::endl;

View File

@ -11,7 +11,9 @@ together with a few geometric predicates and constructions on these objects.
\cgalRefines{DelaunayTriangulationTraits_3}
\cgalHasModel All models of `Kernel`.
\cgalHasModelsBegin
\cgalHasModelsBare{All models of the concept `Kernel`}
\cgalHasModelsEnd
*/
class AdvancingFrontSurfaceReconstructionTraits_3
{

View File

@ -169,8 +169,8 @@ Every \cgal `Kernel` comes with two <I>real number types</I>
(number types embeddable into the real numbers). One of them is a
`FieldNumberType`, and the other a `RingNumberType`. The
coordinates of the basic kernel objects (points, vectors, etc.) come
from one of these types (the `FieldNumberType` in case of Cartesian
kernels, and the `RingNumberType` for Homogeneous kernels).
from one of these types (the `FieldNumberType` in case of %Cartesian
kernels, and the `RingNumberType` for %Homogeneous kernels).
The concept `FieldNumberType` combines the requirements of the
concepts `Field` and `RealEmbeddable`, while
@ -277,4 +277,3 @@ subsequent chapters.
*/
} /* namespace CGAL */

View File

@ -5,7 +5,7 @@ namespace CGAL {
An instance of `Algebraic_structure_traits` is a model of `AlgebraicStructureTraits`, where <span class="textsc">T</span> is the associated type.
\cgalModels `AlgebraicStructureTraits`
\cgalModels{AlgebraicStructureTraits}
*/
template< typename T >
@ -22,7 +22,7 @@ namespace CGAL {
Tag indicating that a type is a model of the
`EuclideanRing` concept.
\cgalModels `DefaultConstructible`
\cgalModels{DefaultConstructible}
\sa `EuclideanRing`
\sa `AlgebraicStructureTraits`
@ -38,7 +38,7 @@ struct Euclidean_ring_tag : public Unique_factorization_domain_tag {
Tag indicating that a type is a model of the `Field` concept.
\cgalModels `DefaultConstructible`
\cgalModels{DefaultConstructible}
\sa `Field`
\sa `AlgebraicStructureTraits`
@ -54,7 +54,7 @@ struct Field_tag : public Integral_domain_tag {
Tag indicating that a type is a model of the `FieldWithKthRoot` concept.
\cgalModels `DefaultConstructible`
\cgalModels{DefaultConstructible}
\sa `FieldWithKthRoot`
\sa `AlgebraicStructureTraits`
@ -70,7 +70,7 @@ struct Field_with_kth_root_tag : public Field_with_sqrt_tag {
Tag indicating that a type is a model of the `FieldWithRootOf` concept.
\cgalModels `DefaultConstructible`
\cgalModels{DefaultConstructible}
\sa `FieldWithRootOf`
\sa `AlgebraicStructureTraits`
@ -86,7 +86,7 @@ struct Field_with_root_of_tag : public Field_with_kth_root_tag {
Tag indicating that a type is a model of the `FieldWithSqrt` concept.
\cgalModels `DefaultConstructible`
\cgalModels{DefaultConstructible}
\sa `FieldWithSqrt`
\sa `AlgebraicStructureTraits`
@ -102,7 +102,7 @@ struct Field_with_sqrt_tag : public Field_tag {
Tag indicating that a type is a model of the `IntegralDomain` concept.
\cgalModels `DefaultConstructible`
\cgalModels{DefaultConstructible}
\sa `IntegralDomain`
\sa `AlgebraicStructureTraits`
@ -118,7 +118,7 @@ struct Integral_domain_tag : public Integral_domain_without_division_tag {
Tag indicating that a type is a model of the `IntegralDomainWithoutDivision` concept.
\cgalModels `DefaultConstructible`
\cgalModels{DefaultConstructible}
\sa `IntegralDomainWithoutDivision`
@ -133,7 +133,7 @@ struct Integral_domain_without_division_tag {
Tag indicating that a type is a model of the `UniqueFactorizationDomain` concept.
\cgalModels `DefaultConstructible`
\cgalModels{DefaultConstructible}
\sa `UniqueFactorizationDomain`
\sa `AlgebraicStructureTraits`

View File

@ -6,7 +6,7 @@ namespace CGAL {
An instance of `Fraction_traits` is a model of `FractionTraits`,
where `T` is the associated type.
\cgalModels `FractionTraits`
\cgalModels{FractionTraits}
*/
template< typename T >

View File

@ -6,7 +6,7 @@ namespace CGAL {
An instance of `Real_embeddable_traits` is a model of `RealEmbeddableTraits`, where <span class="textsc">T</span> is the associated type.
\cgalModels `RealEmbeddableTraits`
\cgalModels{RealEmbeddableTraits}
*/
template< typename T >

View File

@ -28,7 +28,9 @@ algebraic operations within that structure.
\sa `CGAL::Field_with_kth_root_tag`
\sa `CGAL::Field_with_root_of_tag`
\cgalHasModel `CGAL::Algebraic_structure_traits<T>`
\cgalHasModelsBegin
\cgalHasModels{CGAL::Algebraic_structure_traits<T>}
\cgalHasModelsEnd
*/
@ -139,7 +141,7 @@ typedef unspecified_type Is_numerical_sensitive;
This type specifies the return type of the predicates provided
by this traits. The type must be convertible to `bool` and
typically the type indeed maps to `bool`. However, there are also
cases such as interval arithmetic, in which it is `Uncertain<bool>`
cases such as interval arithmetic, in which it is `CGAL::Uncertain<bool>`
or some similar type.
*/
@ -300,4 +302,3 @@ typedef unspecified_type Root_of;
/// @}
}; /* end AlgebraicStructureTraits */

View File

@ -3,7 +3,7 @@
\ingroup PkgAlgebraicFoundationsAlgebraicStructuresConcepts
\cgalConcept
A model of `EuclideanRing` represents an euclidean ring (or Euclidean domain).
A model of `EuclideanRing` represents a Euclidean ring (or Euclidean domain).
It is an `UniqueFactorizationDomain` that affords a suitable notion of minimality of remainders
such that given \f$ x\f$ and \f$ y \neq 0\f$ we obtain an (almost) unique solution to
\f$ x = qy + r \f$ by demanding that a solution \f$ (q,r)\f$ is chosen to minimize \f$ r\f$.

View File

@ -5,20 +5,22 @@
The concept `FieldNumberType` combines the requirements of the concepts
`Field` and `RealEmbeddable`.
A model of `FieldNumberType` can be used as a template parameter
for Cartesian kernels.
for %Cartesian kernels.
\cgalRefines{Field,RealEmbeddable}
\cgalHasModel float
\cgalHasModel double
\cgalHasModel `CGAL::Gmpq`
\cgalHasModel `CGAL::Interval_nt`
\cgalHasModel `CGAL::Interval_nt_advanced`
\cgalHasModel `CGAL::Lazy_exact_nt<FieldNumberType>`
\cgalHasModel `CGAL::Quotient<RingNumberType>`
\cgalHasModel `leda_rational`
\cgalHasModel `leda_bigfloat`
\cgalHasModel `leda_real`
\cgalHasModelsBegin
\cgalHasModels{float}
\cgalHasModels{double}
\cgalHasModels{CGAL::Gmpq}
\cgalHasModels{CGAL::Interval_nt}
\cgalHasModels{CGAL::Interval_nt_advanced}
\cgalHasModels{CGAL::Lazy_exact_nt<FieldNumberType>}
\cgalHasModels{CGAL::Quotient<RingNumberType>}
\cgalHasModels{leda_rational}
\cgalHasModels{leda_bigfloat}
\cgalHasModels{leda_real}
\cgalHasModelsEnd
\sa `RingNumberType`
\sa `Kernel`
@ -32,4 +34,3 @@ public:
/// @}
}; /* end FieldNumberType */

View File

@ -8,7 +8,9 @@ A model of `FractionTraits` is associated with a type `Type`.
In case the associated type is a `Fraction`, a model of `FractionTraits` provides the relevant functionality for decomposing and re-composing as well
as the numerator and denominator type.
\cgalHasModel `CGAL::Fraction_traits<T>`
\cgalHasModelsBegin
\cgalHasModels{CGAL::Fraction_traits<T>}
\cgalHasModelsEnd
\sa `FractionTraits_::Decompose`
\sa `FractionTraits_::Compose`

View File

@ -6,9 +6,11 @@
A model of the concept `FromIntConstructible` is required
to be constructible from int.
\cgalHasModel int
\cgalHasModel long
\cgalHasModel double
\cgalHasModelsBegin
\cgalHasModels{int}
\cgalHasModels{long}
\cgalHasModels{double}
\cgalHasModelsEnd
*/

View File

@ -7,7 +7,9 @@ A model of `RealEmbeddableTraits` is associated to a number type
`Type` and reflects the properties of this type with respect
to the concept `RealEmbeddable`.
\cgalHasModel `CGAL::Real_embeddable_traits<T>`
\cgalHasModelsBegin
\cgalHasModels{CGAL::Real_embeddable_traits<T>}
\cgalHasModelsEnd
*/
class RealEmbeddableTraits {

View File

@ -6,23 +6,25 @@
The concept `RingNumberType` combines the requirements of the concepts
`IntegralDomainWithoutDivision` and `RealEmbeddable`.
A model of `RingNumberType` can be used as a template parameter
for Homogeneous kernels.
for homogeneous kernels.
\cgalRefines{IntegralDomainWithoutDivision,RealEmbeddable}
\cgalHasModel \cpp built-in number types
\cgalHasModel `CGAL::Gmpq`
\cgalHasModel `CGAL::Gmpz`
\cgalHasModel `CGAL::Interval_nt`
\cgalHasModel `CGAL::Interval_nt_advanced`
\cgalHasModel `CGAL::Lazy_exact_nt<RingNumberType>`
\cgalHasModel `CGAL::MP_Float`
\cgalHasModel `CGAL::Gmpzf`
\cgalHasModel `CGAL::Quotient<RingNumberType>`
\cgalHasModel `leda_integer`
\cgalHasModel `leda_rational`
\cgalHasModel `leda_bigfloat`
\cgalHasModel `leda_real`
\cgalHasModelsBegin
\cgalHasModelsBare{\cpp built-in number types}
\cgalHasModels{CGAL::Gmpq}
\cgalHasModels{CGAL::Gmpz}
\cgalHasModels{CGAL::Interval_nt}
\cgalHasModels{CGAL::Interval_nt_advanced}
\cgalHasModels{CGAL::Lazy_exact_nt<RingNumberType>}
\cgalHasModels{CGAL::MP_Float}
\cgalHasModels{CGAL::Gmpzf}
\cgalHasModels{CGAL::Quotient<RingNumberType>}
\cgalHasModels{leda_integer}
\cgalHasModels{leda_rational}
\cgalHasModels{leda_bigfloat}
\cgalHasModels{leda_real}
\cgalHasModelsEnd
\sa `FieldNumberType`
@ -32,4 +34,3 @@ class RingNumberType {
public:
}; /* end RingNumberType */

View File

@ -9,8 +9,8 @@ int main(){
typedef FT::Numerator_type Numerator_type;
typedef FT::Denominator_type Denominator_type;
CGAL_static_assertion((std::is_same<Numerator_type,CGAL::Gmpz>::value));
CGAL_static_assertion((std::is_same<Denominator_type,CGAL::Gmpz>::value));
static_assert(std::is_same<Numerator_type,CGAL::Gmpz>::value);
static_assert(std::is_same<Denominator_type,CGAL::Gmpz>::value);
Numerator_type numerator;
Denominator_type denominator;

View File

@ -9,7 +9,7 @@ binary_func(const A& a , const B& b){
typedef CGAL::Coercion_traits<A,B> CT;
// check for explicit interoperability
CGAL_static_assertion((CT::Are_explicit_interoperable::value));
static_assert(CT::Are_explicit_interoperable::value);
// CT::Cast is used to to convert both types into the coercion type
typename CT::Cast cast;

View File

@ -353,8 +353,7 @@ class Algebraic_structure_traits_base< Type_,
typedef Coercion_traits< NT1, NT2 > CT;
typedef typename CT::Type Coercion_type_NT1_NT2;
CGAL_USE_TYPE(Coercion_type_NT1_NT2);
CGAL_static_assertion((
::std::is_same<Coercion_type_NT1_NT2 , Type >::value));
static_assert(::std::is_same<Coercion_type_NT1_NT2 , Type >::value);
typename Coercion_traits< NT1, NT2 >::Cast cast;
operator()( cast(x), cast(y), q, r );

View File

@ -35,9 +35,9 @@
#define CGAL_IMPLICIT_INTEROPERABLE_BINARY_OPERATOR_WITH_RT( NT, Result_type ) \
template < class CT_Type_1, class CT_Type_2 > \
Result_type operator()( const CT_Type_1& x, const CT_Type_2& y ) const { \
CGAL_static_assertion((::std::is_same< \
static_assert(::std::is_same< \
typename Coercion_traits< CT_Type_1, CT_Type_2 >::Type, NT \
>::value)); \
>::value) ; \
\
typename Coercion_traits< CT_Type_1, CT_Type_2 >::Cast cast; \
return operator()( cast(x), cast(y) ); \

View File

@ -85,13 +85,13 @@ public:
// determine extractable scalar factor
Scalar operator () (const NT& a) {
CGAL_static_assertion(( ::std::is_same< NT,Scalar >::value));
static_assert(::std::is_same< NT,Scalar >::value);
typedef typename Algebraic_structure_traits<NT>::Algebraic_category SAT;
return scalar_factor(a, SAT());
}
// determine extractable scalar factor
Scalar operator () (const NT& a, const Scalar& d) {
CGAL_static_assertion(( ::std::is_same< NT,Scalar >::value));
static_assert(::std::is_same< NT,Scalar >::value);
typedef typename Algebraic_structure_traits<NT>::Algebraic_category SAT;
return scalar_factor(a,d,SAT());
}

View File

@ -44,7 +44,7 @@
template <typename AdaptableFunctor, typename ResultType>
void check_result_type(AdaptableFunctor, ResultType){
typedef typename AdaptableFunctor::result_type result_type;
CGAL_static_assertion((::std::is_same<result_type,ResultType>::value));
static_assert(::std::is_same<result_type,ResultType>::value);
CGAL_USE_TYPE(result_type);
}
// check nothing for CGAL::Null_functor
@ -122,12 +122,11 @@ void test_algebraic_structure_intern( const CGAL::Integral_domain_tag& ) {
CGAL_SNAP_AST_FUNCTORS(AST);
using CGAL::Null_functor;
CGAL_static_assertion(
(!::std::is_same< Integral_division, Null_functor >::value));
CGAL_static_assertion((!::std::is_same< Divides, Null_functor >::value));
CGAL_static_assertion((!::std::is_same< Is_zero, Null_functor >::value));
CGAL_static_assertion((!::std::is_same< Is_one, Null_functor >::value));
CGAL_static_assertion((!::std::is_same< Square, Null_functor >::value));
static_assert(!::std::is_same< Integral_division, Null_functor >::value);
static_assert(!::std::is_same< Divides, Null_functor >::value);
static_assert(!::std::is_same< Is_zero, Null_functor >::value);
static_assert(!::std::is_same< Is_one, Null_functor >::value);
static_assert(!::std::is_same< Square, Null_functor >::value);
// functor
const Is_zero is_zero = Is_zero();
@ -206,7 +205,7 @@ void test_algebraic_structure_intern(
CGAL_SNAP_AST_FUNCTORS(AST);
using CGAL::Null_functor;
CGAL_static_assertion((!::std::is_same< Gcd, Null_functor>::value));
static_assert(!::std::is_same< Gcd, Null_functor>::value);
const Gcd gcd = Gcd();
assert( gcd( AS ( 0), AS ( 0)) == unit_normal( AS (0) ) );
@ -268,9 +267,9 @@ void test_algebraic_structure_intern( const CGAL::Euclidean_ring_tag&) {
CGAL_SNAP_AST_FUNCTORS(AST);
using CGAL::Null_functor;
CGAL_static_assertion((!::std::is_same< Div, Null_functor>::value));
CGAL_static_assertion((!::std::is_same< Mod, Null_functor>::value));
CGAL_static_assertion((!::std::is_same< Div_mod, Null_functor>::value));
static_assert(!::std::is_same< Div, Null_functor>::value);
static_assert(!::std::is_same< Mod, Null_functor>::value);
static_assert(!::std::is_same< Div_mod, Null_functor>::value);
const Div div=Div();
const Mod mod=Mod();
@ -387,7 +386,7 @@ void test_algebraic_structure_intern( const CGAL::Field_with_sqrt_tag& ) {
CGAL_SNAP_AST_FUNCTORS(AST);
CGAL_static_assertion((!::std::is_same< Sqrt, Null_functor>::value));
static_assert(!::std::is_same< Sqrt, Null_functor>::value);
const Sqrt sqrt =Sqrt();
AS a(4);
@ -613,11 +612,9 @@ class Test_is_square {
CGAL_USE_TYPE(First_argument_type);
CGAL_USE_TYPE(Second_argument_type);
CGAL_static_assertion(
( ::std::is_same< AS , First_argument_type>::value));
CGAL_static_assertion(
( ::std::is_same< AS& , Second_argument_type>::value));
//CGAL_static_assertion(( ::std::is_same< bool , Result_type>::value));
static_assert(::std::is_same< AS , First_argument_type>::value);
static_assert(::std::is_same< AS& , Second_argument_type>::value);
//static_assert(::std::is_same< bool , Result_type>::value);
bool b = Result_type(true); CGAL_USE(b);
AS test_number = AS(3)*AS(3);
@ -649,8 +646,8 @@ public:
typedef typename Sqrt::result_type Result_type;
CGAL_USE_TYPE(Argument_type);
CGAL_USE_TYPE(Result_type);
CGAL_static_assertion(( ::std::is_same< AS , Argument_type>::value));
CGAL_static_assertion(( ::std::is_same< AS , Result_type>::value));
static_assert(::std::is_same< AS , Argument_type>::value);
static_assert(::std::is_same< AS , Result_type>::value);
typedef Algebraic_structure_traits<AS> AST;
typedef typename AST::Is_exact Is_exact;
assert( !Is_exact::value || AS (3) == sqrt( AS (9)));
@ -675,12 +672,9 @@ public:
CGAL_USE_TYPE(First_argument_type);
CGAL_USE_TYPE(Second_argument_type);
CGAL_USE_TYPE(Result_type);
CGAL_static_assertion(
( ::std::is_same<int, First_argument_type>::value));
CGAL_static_assertion(
( ::std::is_same< AS , Second_argument_type>::value));
CGAL_static_assertion(
( ::std::is_same< AS , Result_type>::value));
static_assert(::std::is_same<int, First_argument_type>::value);
static_assert(::std::is_same< AS , Second_argument_type>::value);
static_assert(::std::is_same< AS , Result_type>::value);
AS epsilon(1);
assert( test_equality_epsilon( AS (2),
root( 4, AS (16) ), epsilon ) );
@ -803,7 +797,7 @@ void test_algebraic_structure(){
typedef CGAL::Algebraic_structure_traits< AS > AST;
CGAL_SNAP_AST_FUNCTORS(AST);
CGAL_static_assertion((::std::is_same<AS,typename AST::Type>::value));
static_assert(::std::is_same<AS,typename AST::Type>::value);
typedef typename AST::Boolean Boolean;
assert(!Boolean());
@ -816,14 +810,13 @@ void test_algebraic_structure(){
using CGAL::Integral_domain_without_division_tag;
using CGAL::Null_functor;
// Test for desired exactness
CGAL_static_assertion(
( ::std::is_same< typename AST::Is_exact, Is_exact >::value));
static_assert(::std::is_same< typename AST::Is_exact, Is_exact >::value);
static_assert(::std::is_convertible< Tag,
Integral_domain_without_division_tag >::value );
static_assert(::std::is_same< Tag, Algebraic_category>::value);
static_assert(!::std::is_same< Simplify, Null_functor>::value);
static_assert(!::std::is_same< Unit_part, Null_functor>::value);
CGAL_static_assertion(( ::boost::is_convertible< Tag,
Integral_domain_without_division_tag >::value ));
CGAL_static_assertion(( ::std::is_same< Tag, Algebraic_category>::value));
CGAL_static_assertion((!::std::is_same< Simplify, Null_functor>::value));
CGAL_static_assertion((!::std::is_same< Unit_part, Null_functor>::value));
const Simplify simplify=Simplify();;
const Unit_part unit_part= Unit_part();
@ -943,8 +936,7 @@ void test_algebraic_structure( const AS & a, const AS & b, const AS & c) {
typedef CGAL::Algebraic_structure_traits<AS> AST;
typedef typename AST::Is_numerical_sensitive Is_numerical_sensitive;
CGAL_static_assertion(
!(::std::is_same<Is_numerical_sensitive, CGAL::Null_tag>::value));
static_assert(!::std::is_same<Is_numerical_sensitive, CGAL::Null_tag>::value);
CGAL_USE_TYPE(Is_numerical_sensitive);
}

View File

@ -326,7 +326,7 @@ void test_implicit_interoperable_one_way() {
typedef typename CT::Type C;
typedef typename CT::Are_implicit_interoperable Are_implicit_interoperable;
CGAL_static_assertion(
static_assert(
(::std::is_same<Are_implicit_interoperable, CGAL::Tag_true>::value));
assert((::std::is_same<Are_implicit_interoperable, CGAL::Tag_true>::value));
@ -346,9 +346,9 @@ void test_explicit_interoperable_one_way(){
typedef typename CT::Cast Cast;
typedef typename Cast::result_type result_type;
CGAL_USE_TYPE(result_type);
CGAL_static_assertion((::std::is_same<result_type,Type>::value));
CGAL_static_assertion((::std::is_same< typename CT::Are_explicit_interoperable,CGAL::Tag_true>::value));
CGAL_static_assertion((::std::is_same<Type,RT>::value));
static_assert(::std::is_same<result_type,Type>::value);
static_assert(::std::is_same< typename CT::Are_explicit_interoperable,CGAL::Tag_true>::value);
static_assert(::std::is_same<Type,RT>::value);
typename CT::Cast cast;
A a(3);

View File

@ -37,11 +37,11 @@ void test_fraction_traits(){
typedef typename FT::Compose Compose;
CGAL_USE_TYPE(Is_fraction);
CGAL_static_assertion( (::std::is_same<Type,T>::value));
CGAL_static_assertion( (::std::is_same<Is_fraction,Tag_true>::value));
CGAL_static_assertion(!(::std::is_same<Common_factor,Null_functor>::value));
CGAL_static_assertion(!(::std::is_same<Decompose,Null_functor>::value));
CGAL_static_assertion(!(::std::is_same<Compose,Null_functor>::value));
static_assert(::std::is_same<Type,T>::value);
static_assert(::std::is_same<Is_fraction,Tag_true>::value);
static_assert(!::std::is_same<Common_factor,Null_functor>::value);
static_assert(!::std::is_same<Decompose,Null_functor>::value);
static_assert(!::std::is_same<Compose,Null_functor>::value);
// Decompose

View File

@ -29,7 +29,7 @@ void test_rational_traits(){
typedef Rational_traits<Rational> Rational_traits;
typedef typename Rational_traits::RT RT;
CGAL_static_assertion((::std::is_same<RT,RT>::value));
static_assert(::std::is_same<RT,RT>::value);
assert( Rational_traits().numerator(x) == RT(7));
assert( Rational_traits().denominator(x) == RT(2));

View File

@ -48,9 +48,9 @@ namespace CGAL {
void operator() (const ToDouble& to_double) {
typedef typename ToDouble::argument_type Argument_type;
typedef typename ToDouble::result_type Result_type;
CGAL_static_assertion(( ::std::is_same<Type, Argument_type>::value));
static_assert( ::std::is_same<Type, Argument_type>::value);
CGAL_USE_TYPE(Argument_type);
CGAL_static_assertion(( ::std::is_same<double, Result_type>::value));
static_assert( ::std::is_same<double, Result_type>::value);
CGAL_USE_TYPE(Result_type);
assert(42.0 == to_double(Type(42)));
}
@ -71,9 +71,9 @@ namespace CGAL {
typedef typename To_interval::argument_type Argument_type;
typedef typename To_interval::result_type Result_type;
typedef std::pair<double,double> Interval_type;
CGAL_static_assertion(( ::std::is_same<Type, Argument_type>::value));
static_assert( ::std::is_same<Type, Argument_type>::value);
CGAL_USE_TYPE(Argument_type);
CGAL_static_assertion(( ::std::is_same<Interval_type, Result_type>::value));
static_assert( ::std::is_same<Interval_type, Result_type>::value);
CGAL_USE_TYPE(Result_type); CGAL_USE_TYPE(Interval_type);
// assert(NiX::in(42.0,to_Interval(Type(42))));
@ -139,7 +139,7 @@ void test_real_embeddable() {
CGAL_SNAP_RET_FUNCTORS(RET);
typedef typename RET::Is_real_embeddable Is_real_embeddable;
using CGAL::Tag_true;
CGAL_static_assertion(( ::std::is_same< Is_real_embeddable, Tag_true>::value));
static_assert(::std::is_same< Is_real_embeddable, Tag_true>::value);
CGAL_USE_TYPE(Is_real_embeddable);
typedef typename RET::Boolean Boolean;
@ -246,7 +246,7 @@ void test_not_real_embeddable() {
typedef CGAL::Real_embeddable_traits<Type> RET;
typedef typename RET::Is_real_embeddable Is_real_embeddable;
using CGAL::Tag_false;
CGAL_static_assertion(( ::std::is_same< Is_real_embeddable, Tag_false>::value));
static_assert(::std::is_same< Is_real_embeddable, Tag_false>::value);
CGAL_USE_TYPE(Is_real_embeddable);
}
@ -254,13 +254,13 @@ void test_not_real_embeddable() {
//template <class Type, class CeilLog2Abs>
//void test_rounded_log2_abs(Type zero, CGAL::Null_functor, CeilLog2Abs) {
// typedef CGAL::Null_functor Null_functor;
// CGAL_static_assertion(( ::std::is_same< CeilLog2Abs, Null_functor>::value));
// static_assert(::std::is_same< CeilLog2Abs, Null_functor>::value);
//}
//
//template <class Type, class FloorLog2Abs, class CeilLog2Abs>
//void test_rounded_log2_abs(Type zero, FloorLog2Abs fl_log, CeilLog2Abs cl_log) {
// typedef CGAL::Null_functor Null_functor;
// CGAL_static_assertion((!::std::is_same< CeilLog2Abs, Null_functor>::value));
// static_assert(!::std::is_same< CeilLog2Abs, Null_functor>::value);
//
// assert( fl_log(Type( 7)) == 2 );
// assert( cl_log(Type( 7)) == 3 );

View File

@ -9,21 +9,21 @@ int main(){
typedef AET::Type Type;
CGAL_USE_TYPE(Type);
CGAL_static_assertion((::std::is_same<int,Type>::value));
static_assert(::std::is_same<int,Type>::value);
typedef AET::Is_extended Is_extended;
CGAL_USE_TYPE(Is_extended);
CGAL_static_assertion(
static_assert(
(::std::is_same<CGAL::Tag_false,Is_extended>::value));
typedef AET::Normalization_factor Normalization_factor;
{
typedef Normalization_factor::argument_type argument_type;
CGAL_USE_TYPE(argument_type);
CGAL_static_assertion((::std::is_same<argument_type,int>::value));
static_assert(::std::is_same<argument_type,int>::value);
typedef Normalization_factor::result_type result_type;
CGAL_USE_TYPE(result_type);
CGAL_static_assertion((::std::is_same<result_type,int>::value));
static_assert(::std::is_same<result_type,int>::value);
Normalization_factor nfac;
assert(nfac(3)==1);
}
@ -31,10 +31,10 @@ int main(){
{
typedef DFAI::argument_type argument_type;
CGAL_USE_TYPE(argument_type);
CGAL_static_assertion((::std::is_same<argument_type,int>::value));
static_assert(::std::is_same<argument_type,int>::value);
typedef DFAI::result_type result_type;
CGAL_USE_TYPE(result_type);
CGAL_static_assertion((::std::is_same<result_type,int>::value));
static_assert(::std::is_same<result_type,int>::value);
DFAI dfai;
assert(dfai(3)==1);
}
@ -45,21 +45,21 @@ int main(){
typedef AET::Type Type;
CGAL_USE_TYPE(Type);
CGAL_static_assertion((::std::is_same<EXT,Type>::value));
static_assert(::std::is_same<EXT,Type>::value);
typedef AET::Is_extended Is_extended;
CGAL_USE_TYPE(Is_extended);
CGAL_static_assertion(
static_assert(
(::std::is_same<CGAL::Tag_true,Is_extended>::value));
typedef AET::Normalization_factor Normalization_factor;
{
typedef Normalization_factor::argument_type argument_type;
CGAL_USE_TYPE(argument_type);
CGAL_static_assertion((::std::is_same<argument_type,EXT>::value));
static_assert(::std::is_same<argument_type,EXT>::value);
typedef Normalization_factor::result_type result_type;
CGAL_USE_TYPE(result_type);
CGAL_static_assertion((::std::is_same<result_type,EXT>::value));
static_assert(::std::is_same<result_type,EXT>::value);
Normalization_factor nfac;
assert(nfac(EXT(3))==1);
assert(nfac(EXT(3,0,5))==1);
@ -69,10 +69,10 @@ int main(){
{
typedef DFAI::argument_type argument_type;
CGAL_USE_TYPE(argument_type);
CGAL_static_assertion((::std::is_same<argument_type,EXT>::value));
static_assert(::std::is_same<argument_type,EXT>::value);
typedef DFAI::result_type result_type;
CGAL_USE_TYPE(result_type);
CGAL_static_assertion((::std::is_same<result_type,EXT>::value));
static_assert(::std::is_same<result_type,EXT>::value);
DFAI dfai;
assert(dfai(EXT(3))==1);
assert(dfai(EXT(3,0,5))==1);

View File

@ -7,7 +7,7 @@
{ \
typedef AST::NAME NAME; \
CGAL_USE_TYPE(NAME); \
CGAL_static_assertion( \
static_assert( \
(::std::is_same<CGAL::Null_functor,NAME>::value)); \
}
@ -16,19 +16,19 @@ int main(){
typedef AST::Type Type;
CGAL_USE_TYPE(Type);
CGAL_static_assertion((::std::is_same<void,Type>::value));
static_assert(::std::is_same<void,Type>::value);
typedef AST::Algebraic_category Algebraic_category;
CGAL_USE_TYPE(Algebraic_category);
CGAL_static_assertion(
static_assert(
(::std::is_same<CGAL::Null_tag,Algebraic_category>::value));
typedef AST::Is_exact Is_exact;
CGAL_USE_TYPE(Is_exact);
CGAL_static_assertion((::std::is_same<CGAL::Null_tag,Is_exact>::value));
static_assert(::std::is_same<CGAL::Null_tag,Is_exact>::value);
typedef AST::Is_numerical_sensitive Is_sensitive;
CGAL_USE_TYPE(Is_sensitive);
CGAL_static_assertion((::std::is_same<CGAL::Null_tag,Is_sensitive>::value));
static_assert(::std::is_same<CGAL::Null_tag,Is_sensitive>::value);
CGAL_IS_AST_NULL_FUNCTOR ( Simplify);
CGAL_IS_AST_NULL_FUNCTOR ( Unit_part);

View File

@ -6,22 +6,17 @@ int main(){
{
typedef CGAL::Coercion_traits<int,int> CT;
CGAL_USE_TYPE(CT);
CGAL_static_assertion(( std::is_same<CT::Type,int>::value));
CGAL_static_assertion(
( std::is_same<CT::Are_implicit_interoperable,CGAL::Tag_true>::value));
CGAL_static_assertion(
( std::is_same<CT::Are_explicit_interoperable,CGAL::Tag_true>::value));
static_assert( std::is_same<CT::Type,int>::value);
static_assert( std::is_same<CT::Are_implicit_interoperable,CGAL::Tag_true>::value);
static_assert( std::is_same<CT::Are_explicit_interoperable,CGAL::Tag_true>::value);
assert( 5 == CT::Cast()(5));
}
{
typedef CGAL::Coercion_traits<CGAL::Tag_true,CGAL::Tag_false> CT;
CGAL_USE_TYPE(CT);
// CGAL_static_assertion(( std::is_same<CT::Type,CGAL::Null_type>::value));
CGAL_static_assertion(
( std::is_same<CT::Are_implicit_interoperable,CGAL::Tag_false>::value));
CGAL_static_assertion(
( std::is_same<CT::Are_explicit_interoperable,CGAL::Tag_false>::value));
CGAL_static_assertion(
( std::is_same<CT::Cast,CGAL::Null_functor>::value));
// static_assert( std::is_same<CT::Type,CGAL::Null_type>::value);
static_assert(std::is_same<CT::Are_implicit_interoperable,CGAL::Tag_false>::value);
static_assert(std::is_same<CT::Are_explicit_interoperable,CGAL::Tag_false>::value);
static_assert(std::is_same<CT::Cast,CGAL::Null_functor>::value);
}
}

View File

@ -7,7 +7,7 @@
{ \
typedef RET::NAME NAME; \
CGAL_USE_TYPE(NAME); \
CGAL_static_assertion( \
static_assert( \
(::std::is_same<CGAL::Null_functor,NAME>::value)); \
}
@ -16,11 +16,11 @@ int main(){
typedef RET::Type Type;
CGAL_USE_TYPE(Type);
CGAL_static_assertion((::std::is_same<void,Type>::value));
static_assert(::std::is_same<void,Type>::value);
typedef RET::Is_real_embeddable Is_real_embeddable;
CGAL_USE_TYPE(Is_real_embeddable);
CGAL_static_assertion((::std::is_same<CGAL::Tag_false,Is_real_embeddable>::value));
static_assert(::std::is_same<CGAL::Tag_false,Is_real_embeddable>::value);
CGAL_IS_RET_NULL_FUNCTOR(Abs);
CGAL_IS_RET_NULL_FUNCTOR(Sgn);

View File

@ -7,33 +7,31 @@
int main(){
typedef CGAL::Scalar_factor_traits<int> SFT;
CGAL_USE_TYPE(SFT);
CGAL_static_assertion((::std::is_same<int, SFT::Type>::value));
CGAL_static_assertion((::std::is_same<int, SFT::Scalar>::value));
static_assert(::std::is_same<int, SFT::Type>::value);
static_assert(::std::is_same<int, SFT::Scalar>::value);
typedef SFT::Scalar_factor Scalar_factor;
{
typedef Scalar_factor::result_type result_type;
CGAL_USE_TYPE(result_type);
CGAL_static_assertion((::std::is_same<int, result_type>::value));
static_assert(::std::is_same<int, result_type>::value);
typedef Scalar_factor::argument_type argument_type;
CGAL_USE_TYPE(argument_type);
CGAL_static_assertion((::std::is_same<int, argument_type>::value));
static_assert(::std::is_same<int, argument_type>::value);
}
typedef SFT::Scalar_div Scalar_div;
{
typedef Scalar_div::result_type result_type;
CGAL_USE_TYPE(result_type);
CGAL_static_assertion((::std::is_same<void, result_type>::value));
static_assert(::std::is_same<void, result_type>::value);
typedef Scalar_div::first_argument_type first_argument_type;
CGAL_USE_TYPE(first_argument_type);
CGAL_static_assertion(
(::std::is_same<int&, first_argument_type>::value));
static_assert(::std::is_same<int&, first_argument_type>::value);
typedef Scalar_div::second_argument_type second_argument_type;
CGAL_USE_TYPE(second_argument_type);
CGAL_static_assertion(
(::std::is_same<int, second_argument_type>::value));
static_assert(::std::is_same<int, second_argument_type>::value);
}
int i;

View File

@ -27,7 +27,7 @@ approximation of an algebraic real root is a slightly modified
(filtered) version of the one presented in \cgalCite{abbott-qir-06}. The
method has quadratic convergence.
\cgalModels `AlgebraicKernel_d_1`
\cgalModels{AlgebraicKernel_d_1}
\sa `AlgebraicKernel_d_1`
\sa `Polynomial_d`

View File

@ -47,7 +47,7 @@ above. `ROOT` should be one of the integer types. See also the
documentation of `Sqrt_extension<NT,ROOT>`.
\cgalAdvancedEnd
\cgalModels `AlgebraicKernel_d_2`
\cgalModels{AlgebraicKernel_d_2}
\sa `AlgebraicKernel_d_1`
\sa `AlgebraicKernel_d_2`

View File

@ -12,7 +12,7 @@ rational univariate polynomial root isolation. It is a model of the
isolate integer polynomials, the operations of this kernel have the
overhead of converting the polynomials to integer.
\cgalModels `AlgebraicKernel_d_1`
\cgalModels{AlgebraicKernel_d_1}
\sa `Algebraic_kernel_rs_gmpz_d_1`

View File

@ -10,7 +10,7 @@ This univariate algebraic kernel uses the Rs library to perform
integer univariate polynomial root isolation. It is a model of the
`AlgebraicKernel_d_1` concept.
\cgalModels `AlgebraicKernel_d_1`
\cgalModels{AlgebraicKernel_d_1}
\sa `Algebraic_kernel_rs_gmpz_d_1`

View File

@ -8,8 +8,10 @@ algebraic functionalities on univariate polynomials of general degree \f$ d\f$.
\cgalRefines{CopyConstructible,Assignable}
\cgalHasModel `CGAL::Algebraic_kernel_rs_gmpz_d_1`
\cgalHasModel `CGAL::Algebraic_kernel_rs_gmpq_d_1`
\cgalHasModelsBegin
\cgalHasModels{CGAL::Algebraic_kernel_rs_gmpz_d_1}
\cgalHasModels{CGAL::Algebraic_kernel_rs_gmpq_d_1}
\cgalHasModelsEnd
\sa `AlgebraicKernel_d_2`

View File

@ -27,7 +27,7 @@
#include <type_traits>
#include <CGAL/iterator.h>
#include <CGAL/assertions.h>
#include <boost/optional.hpp>
#include <optional>
#include <CGAL/basic.h>
#include <CGAL/config.h>
@ -359,7 +359,7 @@ public:
Unary_compose(const Unary_compose& other) = default;
Unary_compose& operator=(const Unary_compose& other) = default;
Unary_compose() : _inner(::boost::none),_outer(::boost::none) {}
Unary_compose() : _inner(::std::nullopt),_outer(::std::nullopt) {}
typedef typename InnerFunctor::argument_type argument_type;
typedef typename OuterFunctor::result_type result_type;
@ -368,11 +368,11 @@ public:
result_type operator() (const argument_type& arg) const {
CGAL_assertion(bool(_inner));
CGAL_assertion(bool(_outer));
return _outer.get()(_inner.get()(arg));
return _outer.value()(_inner.value()(arg));
}
private:
::boost::optional<InnerFunctor> _inner;
::boost::optional<OuterFunctor> _outer;
::std::optional<InnerFunctor> _inner;
::std::optional<OuterFunctor> _outer;
};
template<typename InnerFunctor,typename OuterFunctor>
@ -481,18 +481,18 @@ public:
Curve_analysis_2 _construct_defining_polynomial_from(Bound b) const {
typedef CGAL::Fraction_traits<Bound> FT;
// We rely on the fact that the Bound is a fraction
CGAL_static_assertion((::std::is_same<typename FT::Is_fraction,
CGAL::Tag_true>::value));
static_assert(::std::is_same<typename FT::Is_fraction,
CGAL::Tag_true>::value);
typedef typename FT::Numerator_type Numerator;
typedef typename FT::Denominator_type Denominator;
typedef CGAL::Coercion_traits<Numerator,Coefficient> Num_coercion;
CGAL_static_assertion((::std::is_same
static_assert(::std::is_same
<Coefficient,
typename Num_coercion::Type>::value));
typename Num_coercion::Type>::value);
typedef CGAL::Coercion_traits<Denominator,Coefficient> Denom_coercion;
CGAL_static_assertion((::std::is_same
static_assert(::std::is_same
<Coefficient,
typename Denom_coercion::Type>::value));
typename Denom_coercion::Type>::value);
typename Num_coercion::Cast num_cast;
typename Denom_coercion::Cast denom_cast;
typename FT::Decompose decompose;
@ -2541,18 +2541,18 @@ public:
Polynomial_1 operator() (const Polynomial_2& f, Bound b) const {
typedef CGAL::Fraction_traits<Bound> FT;
// We rely on the fact that the Bound is a fraction
CGAL_static_assertion((::std::is_same<typename FT::Is_fraction,
CGAL::Tag_true>::value));
static_assert(::std::is_same<typename FT::Is_fraction,
CGAL::Tag_true>::value);
typedef typename FT::Numerator_type Numerator;
typedef typename FT::Denominator_type Denominator;
typedef CGAL::Coercion_traits<Numerator,Coefficient> Num_coercion;
CGAL_static_assertion((::std::is_same
static_assert(::std::is_same
<Coefficient,
typename Num_coercion::Type>::value));
typename Num_coercion::Type>::value);
typedef CGAL::Coercion_traits<Denominator,Coefficient> Denom_coercion;
CGAL_static_assertion((::std::is_same
static_assert(::std::is_same
<Coefficient,
typename Denom_coercion::Type>::value));
typename Denom_coercion::Type>::value);
typename Num_coercion::Cast num_cast;
typename Denom_coercion::Cast denom_cast;
typename FT::Decompose decompose;

View File

@ -71,7 +71,7 @@ class Algebraic_real_d_1 :
public ::CGAL::Handle_with_policy< AlgebraicRealRep_d_1, HandlePolicy > {
// currently Rational is the only supported Bound type.
CGAL_static_assertion(
static_assert(
( ::std::is_same <Rational_,
typename Get_arithmetic_kernel<Coefficient_>::Arithmetic_kernel::Rational>::value));
@ -174,7 +174,7 @@ public:
long old_precision = get_precision( BFI() );
set_precision( BFI(), 53 );
std::pair<double, double> interval = CGAL::to_interval( convert_to_bfi( (*this)));
this->ptr()->interval_option = boost::optional< std::pair<double, double> >(interval);
this->ptr()->interval_option = std::optional< std::pair<double, double> >(interval);
set_precision( BFI(), old_precision );
return *(this->ptr()->interval_option);
}

View File

@ -86,10 +86,10 @@ private:
CGAL::Polynomial_traits_d<Poly>::template Rebind<BFI,1>
::Other::Type BFI_polynomial;
mutable boost::optional
mutable std::optional
< BFI_polynomial > f_bfi_;
mutable boost::optional<BFI> low_bfi_, f_low_bfi_,
mutable std::optional<BFI> low_bfi_, f_low_bfi_,
high_bfi_, f_high_bfi_;
mutable long N;
@ -113,8 +113,8 @@ private:
low_bfi_ = CGAL::convert_to_bfi(this->low());
high_bfi_ = CGAL::convert_to_bfi(this->high());
f_low_bfi_ = f_bfi_.get().evaluate(low_bfi_.get());
f_high_bfi_ = f_bfi_.get().evaluate(high_bfi_.get());
f_low_bfi_ = f_bfi_.value().evaluate(low_bfi_.value());
f_high_bfi_ = f_bfi_.value().evaluate(high_bfi_.value());
}
@ -125,7 +125,7 @@ private:
}
m_bfi = CGAL::convert_to_bfi(m);
f_m_bfi = f_bfi_.get().evaluate(m_bfi);
f_m_bfi = f_bfi_.value().evaluate(m_bfi);
if(CGAL::zero_in(f_m_bfi)) {
@ -229,21 +229,21 @@ protected:
bool poly_changed = (P!=this->polynomial());
if(poly_changed) {
f_bfi_ = boost::none;
f_bfi_ = std::nullopt;
}
if(poly_changed || LOW != this->low()) {
f_low_bfi_ = low_bfi_ = boost::none;
f_low_bfi_ = low_bfi_ = std::nullopt;
}
if(poly_changed || HIGH != this->high()) {
f_high_bfi_ = high_bfi_ = boost::none;
f_high_bfi_ = high_bfi_ = std::nullopt;
}
Base::set_implicit_rep(P,LOW,HIGH,dummy_bool);
}
virtual void set_explicit_rep(const Field& m) const {
f_bfi_ = boost::none;
f_low_bfi_ = low_bfi_ = boost::none;
f_high_bfi_ = high_bfi_ = boost::none;
f_bfi_ = std::nullopt;
f_low_bfi_ = low_bfi_ = std::nullopt;
f_high_bfi_ = high_bfi_ = std::nullopt;
Base::set_explicit_rep(m);
}
@ -256,13 +256,13 @@ public:
if(this->is_rational()) return;
if(old_low_!=this->low_) {
f_low_bfi_ = low_bfi_ = boost::none;
f_low_bfi_ = low_bfi_ = std::nullopt;
}
if(old_high_!=this->high_) {
f_high_bfi_ = high_bfi_ = boost::none;
f_high_bfi_ = high_bfi_ = std::nullopt;
}
if(old_pol != this->polynomial()) {
f_bfi_ = boost::none;
f_bfi_ = std::nullopt;
}
}
@ -329,25 +329,25 @@ private:
low_bfi_ = CGAL::convert_to_bfi(this->low());
}
if(! f_low_bfi_) {
f_low_bfi_ = f_bfi_.get().evaluate(low_bfi_.get());
f_low_bfi_ = f_bfi_.value().evaluate(low_bfi_.value());
}
if(! high_bfi_) {
high_bfi_ = CGAL::convert_to_bfi(this->high());
}
if(! f_high_bfi_) {
f_high_bfi_ = f_bfi_.get().evaluate(high_bfi_.get());
f_high_bfi_ = f_bfi_.value().evaluate(high_bfi_.value());
}
Integer i;
while(true) {
if(CGAL::zero_in(f_low_bfi_.get() - f_high_bfi_.get())) {
if(CGAL::zero_in(f_low_bfi_.value() - f_high_bfi_.value())) {
_set_prec(2*prec_);
continue;
}
BFI denom = f_low_bfi_.get()-f_high_bfi_.get();
BFI denom = f_low_bfi_.value()-f_high_bfi_.value();
BFI z = f_low_bfi_.get() / denom;
BFI z = f_low_bfi_.value() / denom;
std::pair<Integer, Integer> int_pair = _to_integer_interval(z,N);
Integer i_low = int_pair.first;
@ -458,7 +458,7 @@ protected:
f_bfi_ = _convert_polynomial_to_bfi(this->polynomial());
}
BFI eval = f_bfi_.get().evaluate(convert_to_bfi(m));
BFI eval = f_bfi_.value().evaluate(convert_to_bfi(m));
CGAL::Sign s = CGAL::sign(CGAL::lower(eval));
@ -490,7 +490,7 @@ public:
Poly f_old = this->polynomial();
Base::simplify();
if(f_old != this->polynomial()) {
f_bfi_ = boost::none;
f_bfi_ = std::nullopt;
}
}
};

View File

@ -23,7 +23,7 @@
#include <CGAL/basic.h>
#include <CGAL/Polynomial_type_generator.h>
#include <CGAL/Polynomial_traits_d.h>
#include <boost/optional.hpp>
#include <optional>
namespace CGAL {
@ -56,7 +56,7 @@ private:
typedef Algebraic_real_rep <Coefficient,Rational> Self;
public:
typedef boost::optional< std::pair<double, double> > Interval_option;
typedef std::optional< std::pair<double, double> > Interval_option;
mutable Poly polynomial_; //!< square free polynomial
mutable Rational low_; //!< lower endpoint of interval

View File

@ -31,7 +31,7 @@
#include <CGAL/Random.h>
#include <CGAL/tss.h>
#include <boost/optional.hpp>
#include <optional>
/*
* AUXILIARY CLASSES AND FUNCTIONS

View File

@ -23,7 +23,6 @@
#include <type_traits>
#include <boost/mpl/has_xxx.hpp>
#include <boost/type_traits/is_base_of.hpp>
#include <boost/mpl/and.hpp>
#include <boost/mpl/logical.hpp>
@ -66,14 +65,14 @@ namespace internal {
template<typename Comparable,bool has_template_typedefs>
struct Is_derived_from_Handle_with_policy {
typedef boost::false_type Tag;
typedef std::false_type Tag;
};
template<typename Comparable>
struct Is_derived_from_Handle_with_policy<Comparable,true> {
typedef typename
boost::is_base_of< CGAL::Handle_with_policy
std::is_base_of< CGAL::Handle_with_policy
< typename Comparable::T,
typename Comparable::Handle_policy,
typename Comparable::Allocator >,
@ -90,7 +89,7 @@ template<typename Comparable,typename Tag> struct Compare_for_vert_line_map_
};
template<typename Comparable>
struct Compare_for_vert_line_map_<Comparable,boost::true_type> {
struct Compare_for_vert_line_map_<Comparable,std::true_type> {
bool operator() (const Comparable& a, const Comparable& b) const {
return CGAL::Handle_id_less_than< Comparable >()(a,b);
@ -197,7 +196,7 @@ private:
size_type index_of_content_root;
size_type mult_of_prim_lcoeff_root;
size_type index_of_prim_lcoeff_root;
boost::optional<Status_line_1> stack;
std::optional<Status_line_1> stack;
};
// Functor to get the X_coordinate of an Event_coordinate
@ -211,14 +210,14 @@ private:
//! The object holding the information about events, as an optional
mutable boost::optional<std::vector<Event_coordinate_1> >
mutable std::optional<std::vector<Event_coordinate_1> >
event_coordinates;
//! The algebraic kernel to use
Algebraic_kernel_with_analysis_2* _m_kernel;
//! The polynomial defining the curve
boost::optional<Polynomial_2> f;
std::optional<Polynomial_2> f;
//! How degenerate situations are handled
CGAL::Degeneracy_strategy degeneracy_strategy;
@ -231,24 +230,24 @@ private:
* \c f/cont(f). The corresponding curve is equal to the curve of \c f,
* only without vertical line components.
*/
mutable boost::optional<Polynomial_2> f_primitive;
mutable std::optional<Polynomial_2> f_primitive;
//! the polynomial containing all roots of the resultant of the primitive
//! part of f and its y-derivative
mutable boost::optional<Polynomial_1>
mutable std::optional<Polynomial_1>
resultant_of_primitive_and_derivative_y;
//! the polynomial containing all roots of the resultant of the primitive
//! part of f and its x-derivative
mutable boost::optional<Polynomial_1>
mutable std::optional<Polynomial_1>
resultant_of_primitive_and_derivative_x;
//! The Sturm-Habicht polynomials of f
mutable boost::optional<std::vector<Polynomial_2> >
mutable std::optional<std::vector<Polynomial_2> >
sturm_habicht_of_primitive;
//! The content of f
mutable boost::optional<Polynomial_1> content;
mutable std::optional<Polynomial_1> content;
//! The non-working shear factors, as far as known
mutable std::set<Integer> bad_shears;
@ -257,10 +256,10 @@ private:
mutable std::map<Integer,Handle> sheared_curves;
//! Has the curve vertical line components
mutable boost::optional<bool> has_vertical_component;
mutable std::optional<bool> has_vertical_component;
//! The intermediate values
mutable boost::optional<std::vector<boost::optional<Bound> > >
mutable std::optional<std::vector<std::optional<Bound> > >
intermediate_values;
//! stores Y_values at rational coordinate
@ -273,7 +272,7 @@ private:
* are asymptotic to y=beta,
* or go to +/- infty also in y-direction
*/
mutable boost::optional<std::vector<CGAL::Object> >
mutable std::optional<std::vector<CGAL::Object> >
horizontal_asymptotes_left, horizontal_asymptotes_right;
//! friends
@ -547,7 +546,7 @@ private:
if(! this->ptr()->intermediate_values) {
this->ptr()->intermediate_values
= std::vector<boost::optional<Bound> >
= std::vector<std::optional<Bound> >
(number_of_status_lines_with_event()+1);
}
@ -584,7 +583,7 @@ public:
*/
void set_f(Polynomial_2 f) {
CGAL_precondition(! has_defining_polynomial());
if((! this->ptr()->f) || f!=this->ptr()->f.get()) {
if((! this->ptr()->f) || f!=this->ptr()->f.value()) {
this->copy_on_write();
this->ptr()->f=f;
}
@ -631,7 +630,7 @@ public:
event_coordinates();
CGAL_assertion(this->ptr()->has_vertical_component);
}
return this->ptr()->has_vertical_component.get();
return this->ptr()->has_vertical_component.value();
}
public:
@ -639,7 +638,7 @@ public:
//! Returns the defining polynomial
Polynomial_2 polynomial_2() const {
CGAL_precondition(bool(this->ptr()->f));
return this->ptr()->f.get();
return this->ptr()->f.value();
}
public:
@ -714,8 +713,8 @@ public:
= event_line;
event_coordinates()[i].stack = event_line;
}
CGAL_postcondition(event_coordinates()[i].stack.get().is_event());
return event_coordinates()[i].stack.get();
CGAL_postcondition(event_coordinates()[i].stack.value().is_event());
return event_coordinates()[i].stack.value();
}
public:
@ -1349,7 +1348,7 @@ public:
}
}
}
return intermediate_values()[i].get();
return intermediate_values()[i].value();
}
@ -1370,7 +1369,7 @@ public:
if(! this->ptr()->content) {
compute_content_and_primitive_part();
}
return this->ptr()->content.get();
return this->ptr()->content.value();
}
public:
@ -1389,7 +1388,7 @@ public:
if(! this->ptr()->f_primitive) {
compute_content_and_primitive_part();
}
return this->ptr()->f_primitive.get();
return this->ptr()->f_primitive.value();
}
Algebraic_kernel_with_analysis_2* kernel() const {
@ -1437,7 +1436,7 @@ private:
if(! this->ptr()->sturm_habicht_of_primitive) {
compute_sturm_habicht_of_primitive();
}
return this->ptr()->sturm_habicht_of_primitive.get();
return this->ptr()->sturm_habicht_of_primitive.value();
}
public:
@ -1558,7 +1557,7 @@ private:
if(! this->ptr()->resultant_of_primitive_and_derivative_y) {
this->ptr()->resultant_of_primitive_and_derivative_y = stha[0][0];
if(this->ptr()->resultant_of_primitive_and_derivative_y.
get().is_zero()) {
value().is_zero()) {
throw internal::Zero_resultant_exception<Polynomial_2>
(polynomial_2());
}
@ -1582,7 +1581,7 @@ private:
if(! this->ptr()->resultant_of_primitive_and_derivative_y) {
compute_resultant_of_primitive_and_derivative_y();
}
return this->ptr()->resultant_of_primitive_and_derivative_y.get();
return this->ptr()->resultant_of_primitive_and_derivative_y.value();
}
private:
@ -1593,7 +1592,7 @@ private:
if(! this->ptr()->resultant_of_primitive_and_derivative_x) {
compute_resultant_of_primitive_and_derivative_x();
}
return this->ptr()->resultant_of_primitive_and_derivative_x.get();
return this->ptr()->resultant_of_primitive_and_derivative_x.value();
}
private:
@ -1714,20 +1713,20 @@ private:
if(! this->ptr()->event_coordinates) {
compute_event_coordinates();
}
return this->ptr()->event_coordinates.get();
return this->ptr()->event_coordinates.value();
}
private:
// Returns the intermediate values for intervals between events
std::vector<boost::optional<Bound> >& intermediate_values() const
std::vector<std::optional<Bound> >& intermediate_values() const
{
if(! this->ptr()->intermediate_values) {
// This is created during event_coordiantes()
event_coordinates();
CGAL_assertion(bool(this->ptr()->intermediate_values));
}
return this->ptr()->intermediate_values.get();
return this->ptr()->intermediate_values.value();
}
@ -1916,7 +1915,7 @@ private:
static_cast<size_type>(content_roots.size()));
this->ptr()->intermediate_values
= std::vector<boost::optional<Bound> >
= std::vector<std::optional<Bound> >
(event_coordinate_vector.size()+1);
this->ptr()->event_coordinates = event_coordinate_vector;
@ -2111,7 +2110,7 @@ public:
compute_horizontal_asymptotes();
}
std::vector<Asymptote_y>& asym_info
= this->ptr()->horizontal_asymptotes_left.get();
= this->ptr()->horizontal_asymptotes_left.value();
CGAL_precondition(arcno>=0 &&
arcno<static_cast<size_type>(asym_info.size()));
return asym_info[arcno];
@ -2121,7 +2120,7 @@ public:
compute_horizontal_asymptotes();
}
std::vector<Asymptote_y>& asym_info
= this->ptr()->horizontal_asymptotes_right.get();
= this->ptr()->horizontal_asymptotes_right.value();
CGAL_precondition(arcno>=0 &&
arcno<static_cast<size_type>(asym_info.size()));
return asym_info[arcno];

View File

@ -22,7 +22,7 @@
#include <vector>
#include <algorithm>
#include <boost/optional.hpp>
#include <optional>
#include <CGAL/Handle_with_policy.h>
#include <CGAL/boost/iterator/transform_iterator.hpp>
@ -136,9 +136,9 @@ public:
typedef std::vector<Slice_element> Slice_info;
typedef boost::optional<Slice_info> Lazy_slice_info;
typedef std::optional<Slice_info> Lazy_slice_info;
typedef boost::optional<Bound> Lazy_bound;
typedef std::optional<Bound> Lazy_bound;
typedef CGAL::internal::Event_indices<size_type> Event_indices;
@ -151,11 +151,11 @@ public:
typedef std::vector<std::vector<Intersection_info> >
Intersection_info_container;
typedef boost::optional<Intersection_info_container>
typedef std::optional<Intersection_info_container>
Lazy_intersection_info_container;
// For lazy evaluation of Status_line_CPA_1s.
typedef boost::optional<Status_line_CPA_1> Lazy_status_line_CPA_1;
typedef std::optional<Status_line_CPA_1> Lazy_status_line_CPA_1;
//! @}
@ -191,31 +191,31 @@ private:
Polynomial_2 g;
mutable boost::optional<std::vector<Polynomial_2> > subresultants;
mutable std::optional<std::vector<Polynomial_2> > subresultants;
mutable boost::optional<std::vector<Polynomial_1> >
mutable std::optional<std::vector<Polynomial_1> >
principal_subresultants;
mutable boost::optional<std::vector<Polynomial_1> >
mutable std::optional<std::vector<Polynomial_1> >
coprincipal_subresultants;
mutable boost::optional<Polynomial_1> resultant;
mutable std::optional<Polynomial_1> resultant;
mutable boost::optional<std::vector<Algebraic_real_1> > resultant_roots;
mutable boost::optional<std::vector<Algebraic_real_1> >
mutable std::optional<std::vector<Algebraic_real_1> > resultant_roots;
mutable std::optional<std::vector<Algebraic_real_1> >
event_x_coordinates;
mutable boost::optional<std::vector<size_type> >
mutable std::optional<std::vector<size_type> >
multiplicities_of_resultant_roots;
mutable boost::optional<std::vector<Bound> > stripe_values;
mutable std::optional<std::vector<Bound> > stripe_values;
mutable std::vector< Lazy_status_line_CPA_1 > event_slices;
mutable boost::optional<std::vector< Lazy_bound > > intermediate_values;
mutable std::optional<std::vector< Lazy_bound > > intermediate_values;
mutable boost::optional< std::vector< Lazy_status_line_CPA_1 > >
mutable std::optional< std::vector< Lazy_status_line_CPA_1 > >
intermediate_slices;
mutable boost::optional<std::vector<Event_indices> > event_indices;
mutable std::optional<std::vector<Event_indices> > event_indices;
mutable Lazy_intersection_info_container intersection_info_container;
@ -530,7 +530,7 @@ private:
/*
* \brief Computes the intermediate x-coordinates and their status lines
*
* In fact, it only fills the data fields with boost::none instances,
* In fact, it only fills the data fields with std::nullopt instances,
* according to the lazy philosophy of the whole class.
*/
void compute_intermediate_values_and_slices() const;
@ -547,7 +547,7 @@ public:
compute_resultant();
}
CGAL_assertion(bool(this->ptr()->resultant));
return this->ptr()->resultant.get();
return this->ptr()->resultant.value();
}
std::vector<Algebraic_real_1>& resultant_roots() const {
@ -555,7 +555,7 @@ public:
compute_resultant_roots_with_multiplicities();
}
CGAL_assertion(bool(this->ptr()->resultant_roots));
return this->ptr()->resultant_roots.get();
return this->ptr()->resultant_roots.value();
}
Algebraic_real_1& resultant_roots(size_type i) const {
@ -569,7 +569,7 @@ public:
compute_resultant_roots_with_multiplicities();
}
CGAL_assertion(bool(this->ptr()->multiplicities_of_resultant_roots));
return this->ptr()->multiplicities_of_resultant_roots.get();
return this->ptr()->multiplicities_of_resultant_roots.value();
}
size_type multiplicities_of_resultant_roots(size_type i) const {
@ -586,10 +586,10 @@ public:
(kernel(),
resultant_roots().begin(),
resultant_roots().end(),
std::back_inserter(this->ptr()->stripe_values.get()));
std::back_inserter(this->ptr()->stripe_values.value()));
}
CGAL_assertion(bool(this->ptr()->stripe_values));
return this->ptr()->stripe_values.get();
return this->ptr()->stripe_values.value();
}
std::vector<Algebraic_real_1>& event_x_coordinates() const {
@ -597,7 +597,7 @@ public:
compute_event_x_coordinates_with_event_indices();
}
CGAL_assertion(bool(this->ptr()->event_x_coordinates));
return this->ptr()->event_x_coordinates.get();
return this->ptr()->event_x_coordinates.value();
}
std::vector<Event_indices>& event_indices() const {
@ -605,7 +605,7 @@ public:
compute_event_x_coordinates_with_event_indices();
}
CGAL_assertion(bool(this->ptr()->event_indices));
return this->ptr()->event_indices.get();
return this->ptr()->event_indices.value();
}
public:
@ -613,7 +613,7 @@ public:
/*
* \brief returns the indices of the <tt>i</tt>th event value
*
* Returns a Event_indices <tt>(fg,ffy,ggy)</tt> such that
* Returns an `Event_indices` <tt>(fg,ffy,ggy)</tt> such that
* the <tt>i</tt>th event root is the <tt>fg</tt>th root of the
* resultant of \c f and \c g, the <tt>ffy</tt>th root of the
* discriminant of \c f, and the <tt>ggy</tt>th root of the
@ -633,7 +633,7 @@ private:
compute_intermediate_values_and_slices();
}
CGAL_assertion(bool(this->ptr()->intermediate_values));
return this->ptr()->intermediate_values.get();
return this->ptr()->intermediate_values.value();
}
std::vector<Lazy_status_line_CPA_1>& intermediate_slices() const {
@ -641,7 +641,7 @@ private:
compute_intermediate_values_and_slices();
}
CGAL_assertion(bool(this->ptr()->intermediate_slices));
return this->ptr()->intermediate_slices.get();
return this->ptr()->intermediate_slices.value();
}
@ -652,7 +652,7 @@ private:
compute_subresultants();
}
CGAL_assertion(bool(this->ptr()->subresultants));
return this->ptr()->subresultants.get();
return this->ptr()->subresultants.value();
}
Polynomial_2& subresultants(size_type i) const {
@ -666,7 +666,7 @@ private:
compute_subresultants();
}
CGAL_assertion(bool(this->ptr()->principal_subresultants));
return this->ptr()->principal_subresultants.get();
return this->ptr()->principal_subresultants.value();
}
Polynomial_1& principal_subresultants(size_type i) const {
@ -681,7 +681,7 @@ private:
compute_subresultants();
}
CGAL_assertion(bool(this->ptr()->coprincipal_subresultants));
return this->ptr()->coprincipal_subresultants.get();
return this->ptr()->coprincipal_subresultants.value();
}
Polynomial_1& coprincipal_subresultants(size_type i) const {
@ -1030,7 +1030,7 @@ public:
this->ptr()->event_slices[i] = create_event_slice(i);
}
CGAL_assertion(bool(this->ptr()->event_slices[i]));
return this->ptr()->event_slices[i].get();
return this->ptr()->event_slices[i].value();
}
@ -1045,7 +1045,7 @@ public:
}
return intermediate_slices()[i].get();
return intermediate_slices()[i].value();
}
//! Returns bound representative value at the <tt>i</tt>th interval
@ -1074,7 +1074,7 @@ public:
}
}
CGAL_assertion(bool(intermediate_values()[i]));
return intermediate_values()[i].get();
return intermediate_values()[i].value();
}
@ -1312,11 +1312,11 @@ void Curve_pair_analysis_2<AlgebraicKernelWithAnalysis_2>::compute_resultant()
compute_subresultants();
this->ptr()->resultant
= this->ptr()->principal_subresultants.get()[0];
= this->ptr()->principal_subresultants.value()[0];
}
if(this->ptr()->resultant.get().is_zero()) {
if(this->ptr()->resultant.value().is_zero()) {
throw CGAL::internal::Zero_resultant_exception<Polynomial_2>
(this->ptr()->f,
this->ptr()->g);
@ -1345,8 +1345,8 @@ compute_resultant_roots_with_multiplicities() const {
solve_1(resultant(), std::back_inserter(res_pairs));
for(int i=0; i < static_cast<int>(res_pairs.size()); i++ ) {
this->ptr()->resultant_roots.get().push_back(res_pairs[i].first);
this->ptr()->multiplicities_of_resultant_roots.get()
this->ptr()->resultant_roots.value().push_back(res_pairs[i].first);
this->ptr()->multiplicities_of_resultant_roots.value()
.push_back(res_pairs[i].second);
}
@ -1357,13 +1357,13 @@ compute_resultant_roots_with_multiplicities() const {
#if CGAL_ACK_DEBUG_FLAG
for(size_type i = 0;
i<static_cast<size_type>
(this->ptr()->resultant_roots.get().size());
(this->ptr()->resultant_roots.value().size());
i++) {
CGAL_ACK_DEBUG_PRINT
<< "Root at "
<< CGAL::to_double(this->ptr()->resultant_roots.get()[i])
<< CGAL::to_double(this->ptr()->resultant_roots.value()[i])
<< " with multiplicity "
<< this->ptr()->multiplicities_of_resultant_roots.get()[i]
<< this->ptr()->multiplicities_of_resultant_roots.value()[i]
<< std::endl;
}
#endif
@ -1401,18 +1401,18 @@ compute_event_x_coordinates_with_event_indices() const {
one_curve_events.end(),
resultant_roots().begin(),
resultant_roots().end(),
std::back_inserter(this->ptr()->event_x_coordinates.get()),
std::back_inserter(this->ptr()->event_x_coordinates.value()),
std::back_inserter(events_type),
compare);
std::vector<Algebraic_real_1>& events
= this->ptr()->event_x_coordinates.get();
= this->ptr()->event_x_coordinates.value();
typename std::vector<CGAL::internal::Three_valued>::iterator one_curve_it
=one_curve_events_type.begin();
size_type inter_count=0, f_count=0,g_count=0;
this->ptr()->event_indices = std::vector<Event_indices>();
std::vector<Event_indices>& event_indices
= this->ptr()->event_indices.get();
= this->ptr()->event_indices.value();
for(size_type i=0;i<static_cast<size_type>(events.size());i++) {
/*
#if CGAL_ACK_DEBUG_FLAG
@ -1519,8 +1519,8 @@ compute_intermediate_values_and_slices() const {
std::size_t size = event_x_coordinates().size()+1;
this->ptr()->intermediate_values=std::vector<Lazy_bound>();
this->ptr()->intermediate_slices=std::vector<Lazy_status_line_CPA_1>();
this->ptr()->intermediate_values.get().resize(size);
this->ptr()->intermediate_slices.get().resize(size);
this->ptr()->intermediate_values.value().resize(size);
this->ptr()->intermediate_slices.value().resize(size);
#if CGAL_ACK_DEBUG_FLAG
CGAL_ACK_DEBUG_PRINT << "done" << std::endl;
#endif
@ -1539,25 +1539,25 @@ compute_subresultants() const {
if(CGAL::degree(f,1)<CGAL::degree(g,1)) {
#if CGAL_ACK_USE_BEZOUT_MATRIX_FOR_SUBRESULTANTS
CGAL::internal::bezout_polynomial_subresultants
(g,f,std::back_inserter(this->ptr()->subresultants.get()));
(g,f,std::back_inserter(this->ptr()->subresultants.value()));
#else
typename CGAL::Polynomial_traits_d<Polynomial_2>
::Polynomial_subresultants()
(g,f,std::back_inserter(this->ptr()->subresultants.get()));
(g,f,std::back_inserter(this->ptr()->subresultants.value()));
#endif
} else {
#if CGAL_ACK_USE_BEZOUT_MATRIX_FOR_SUBRESULTANTS
CGAL::internal::bezout_polynomial_subresultants
(f,g,std::back_inserter(this->ptr()->subresultants.get()));
(f,g,std::back_inserter(this->ptr()->subresultants.value()));
#else
typename CGAL::Polynomial_traits_d<Polynomial_2>
::Polynomial_subresultants()
(f,g,std::back_inserter(this->ptr()->subresultants.get()));
(f,g,std::back_inserter(this->ptr()->subresultants.value()));
#endif
}
std::vector<Polynomial_2>& subresultants
= this->ptr()->subresultants.get();
= this->ptr()->subresultants.value();
size_type n = static_cast<size_type>(subresultants.size());
@ -1584,11 +1584,11 @@ compute_subresultants() const {
// This must be corrected, if f and g have same degree:
if(CGAL::degree(f,1) == CGAL::degree(g,1)) {
if(n>=1) {
this->ptr()->principal_subresultants.get()[n-1]
this->ptr()->principal_subresultants.value()[n-1]
= Polynomial_1(CGAL::leading_coefficient(g));
}
if(n>=2) {
this->ptr()->coprincipal_subresultants.get()[n-2]
this->ptr()->coprincipal_subresultants.value()[n-2]
= Polynomial_1(g[CGAL::degree(g,1)-1]);
}
}

View File

@ -127,7 +127,7 @@ public:
//Arc_pair _m_num_arcs;
//! sequence of arcs crossing this status line (valid only event lines)
mutable boost::optional<Arc_container> _m_arcs;
mutable std::optional<Arc_container> _m_arcs;
//! number of arcs intersecting this status line
mutable int _m_total_arcs;
@ -160,10 +160,10 @@ public:
std::vector< int > multiplicities_;*/
// stores algebraic real over the vertical line
mutable std::vector<boost::optional< Algebraic_real_2 > >_m_xy_coords;
mutable std::vector<std::optional< Algebraic_real_2 > >_m_xy_coords;
// stores the isolator instance
mutable boost::optional<Bitstream_descartes> isolator;
mutable std::optional<Bitstream_descartes> isolator;
// befriending the handle
friend class Status_line_CA_1<Curve_analysis_2, Self>;
@ -555,7 +555,7 @@ public:
//! Returns the isolator instance
Bitstream_descartes& isolator() const {
CGAL_assertion(bool(this->ptr()->isolator));
return this->ptr()->isolator.get();
return this->ptr()->isolator.value();
}
//! Returns whether an isolator has been given for that status line

View File

@ -75,7 +75,7 @@ public:
// represents x-coordinate of event of rational value over interval
// computed only by demand
mutable boost::optional<Algebraic_real_1> _m_x;
mutable std::optional<Algebraic_real_1> _m_x;
// for each event point stores a pair of arcnos of the 1st and 2nd curve
// or -1 if respective curve is not involved

View File

@ -81,10 +81,10 @@ public:
mutable int _m_arcno;
// y-coordinate
mutable boost::optional< Algebraic_real_1 > _m_y;
mutable std::optional< Algebraic_real_1 > _m_y;
//! A bounding box for the given point
mutable boost::optional< std::pair<double,Bbox_2> > _m_bbox_2_pair;
mutable std::optional< std::pair<double,Bbox_2> > _m_bbox_2_pair;
};
@ -254,7 +254,7 @@ public:
/*!
* \brief y-coordinate of this point
*
* Note: In general, this method results in a extremely large polynomial
* Note: In general, this method results in an extremely large polynomial
* for the y-coordinate. It is recommended to use it carefully,
* and using get_approximation_y() instead whenever approximations suffice.
*/

View File

@ -186,7 +186,7 @@ template<typename AlgebraicKernel_1,
InputIterator start,
InputIterator end,
OutputIterator output) {
CGAL_static_assertion
static_assert
((::std::is_same
<typename AlgebraicKernel_1::Algebraic_real_1,
typename std::iterator_traits<InputIterator>::value_type >::value));
@ -224,14 +224,14 @@ template<typename Poly_coer_1,typename Polynomial_1>
void cast_back_utcf(const Poly_coer_1& p,Polynomial_1& q) {
// We can assume that both template arguments are polynomial types
typedef CGAL::Fraction_traits<Poly_coer_1> FT;
CGAL_static_assertion((::std::is_same<typename FT::Is_fraction,
CGAL::Tag_true>::value));
static_assert(::std::is_same<typename FT::Is_fraction,
CGAL::Tag_true>::value);
typedef typename FT::Numerator_type Numerator;
typedef typename FT::Denominator_type Denominator;
typedef CGAL::Coercion_traits<Numerator,Polynomial_1> Num_coercion;
CGAL_static_assertion((::std::is_same
static_assert(::std::is_same
<Polynomial_1,
typename Num_coercion::Type>::value));
typename Num_coercion::Type>::value);
Numerator p_num;
Denominator p_denom;
typename FT::Decompose()(p,p_num,p_denom);

View File

@ -66,7 +66,7 @@ int descartes(Polynomial& p, const Field& low,const Field& high){
}
/*! \ingroup \NiX_univariate_polynomial_utils
* \brief refine isolating interval for \c p w.r.t \c q
* \brief refine isolating interval for \c p w.r.t. \c q
*
* This function refines the interval ]<TT>low</TT>, <TT>high</TT>[
* such that it does not contain any zero of \c q different from the

View File

@ -47,8 +47,8 @@ void test_real_embeddable_extension(const NT_&){
typedef typename Floor::result_type Result_type;
CGAL_USE_TYPE(Argument_type);
CGAL_USE_TYPE(Result_type);
CGAL_static_assertion(( ::std::is_same<NT, Argument_type>::value));
CGAL_static_assertion(( ::std::is_same<Integer, Result_type>::value));
static_assert(::std::is_same<NT, Argument_type>::value);
static_assert(::std::is_same<Integer, Result_type>::value);
assert(Integer(42) == floor(NT(42)));
assert(Integer(-42) == floor(NT(-42)));
}
@ -59,8 +59,8 @@ void test_real_embeddable_extension(const NT_&){
typedef typename Floor_log2_abs::result_type Result_type;
CGAL_USE_TYPE(Argument_type);
CGAL_USE_TYPE(Result_type);
CGAL_static_assertion(( ::std::is_same<NT, Argument_type>::value));
CGAL_static_assertion(( ::std::is_same<long, Result_type>::value));
static_assert(::std::is_same<NT, Argument_type>::value);
static_assert(::std::is_same<long, Result_type>::value);
assert(long(0) == floor_log2_abs(NT(1)));
assert(long(0) == floor_log2_abs(NT(-1)));
@ -86,8 +86,8 @@ void test_real_embeddable_extension(const NT_&){
typedef typename Ceil::result_type Result_type;
CGAL_USE_TYPE(Argument_type);
CGAL_USE_TYPE(Result_type);
CGAL_static_assertion(( ::std::is_same<NT, Argument_type>::value));
CGAL_static_assertion(( ::std::is_same<Integer, Result_type>::value));
static_assert(::std::is_same<NT, Argument_type>::value);
static_assert(::std::is_same<Integer, Result_type>::value);
assert(Integer(42) == ceil(NT(42)));
assert(Integer(-42) == ceil(NT(-42)));
}
@ -98,8 +98,8 @@ void test_real_embeddable_extension(const NT_&){
typedef typename Ceil_log2_abs::result_type Result_type;
CGAL_USE_TYPE(Argument_type);
CGAL_USE_TYPE(Result_type);
CGAL_static_assertion(( ::std::is_same<NT, Argument_type>::value));
CGAL_static_assertion(( ::std::is_same<long, Result_type>::value));
static_assert(::std::is_same<NT, Argument_type>::value);
static_assert(::std::is_same<long, Result_type>::value);
assert(long(0) == ceil_log2_abs(NT(1)));
assert(long(0) == ceil_log2_abs(NT(-1)));

View File

@ -62,20 +62,20 @@ void test_algebraic_curve_kernel_2() {
typedef AlgebraicCurveKernel_2 AK_2;
/* CGAL_static_assertion( (::std::is_same<
Algebraic_real_1, typename AK::Algebraic_real_1 >::value) );
/* static_assert(::std::is_same<
Algebraic_real_1, typename AK::Algebraic_real_1 >::value);
CGAL_static_assertion((::std::is_same<
static_assert(::std::is_same<
Isolator,
typename AK::Isolator >::value) );
typename AK::Isolator >::value);
CGAL_static_assertion((::std::is_same<
static_assert(::std::is_same<
Coefficient,
typename AK::Coefficient >::value));
typename AK::Coefficient >::value);
CGAL_static_assertion((::std::is_same<
static_assert(::std::is_same<
Polynomial_1,
typename AK::Polynomial_1 >::value));*/
typename AK::Polynomial_1 >::value);*/
typedef typename AK_2::Polynomial_2 Poly_2;
typedef typename AK_2::Curve_analysis_2 Curve_analysis_2;

View File

@ -109,8 +109,8 @@ void test_algebraic_kernel_1(const AlgebraicKernel_d_1& ak_1){
typedef typename Name::result_type RT_; \
CGAL_USE_TYPE(AT_); \
CGAL_USE_TYPE(RT_); \
{CGAL_static_assertion(( ::std::is_same<AT,AT_>::value));} \
{CGAL_static_assertion(( ::std::is_same<RT,RT_>::value));} \
{static_assert(::std::is_same<AT,AT_>::value);} \
{static_assert(::std::is_same<RT,RT_>::value);} \
}
#define CGAL_CHECK_BFUNCTION(Name,AT1,AT2,RT) \
{ \
@ -120,9 +120,9 @@ void test_algebraic_kernel_1(const AlgebraicKernel_d_1& ak_1){
CGAL_USE_TYPE(AT1_); \
CGAL_USE_TYPE(AT2_); \
CGAL_USE_TYPE(RT_); \
{CGAL_static_assertion(( ::std::is_same<AT1,AT1_>::value));} \
{CGAL_static_assertion(( ::std::is_same<AT2,AT2_>::value));} \
{CGAL_static_assertion(( ::std::is_same<RT,RT_>::value));} \
{static_assert(::std::is_same<AT1,AT1_>::value);} \
{static_assert(::std::is_same<AT2,AT2_>::value);} \
{static_assert(::std::is_same<RT,RT_>::value);} \
}
// TODO: missing check for Construct_algebraic_real_1

View File

@ -93,8 +93,8 @@ void test_algebraic_kernel_2(const AlgebraicKernel_2& ak_2) {
typedef typename Name::result_type RT_; \
CGAL_USE_TYPE(AT_); \
CGAL_USE_TYPE(RT_); \
{CGAL_static_assertion(( ::std::is_same<AT,AT_>::value));} \
{CGAL_static_assertion(( ::std::is_same<RT,RT_>::value));} \
{static_assert(::std::is_same<AT,AT_>::value);} \
{static_assert(::std::is_same<RT,RT_>::value);} \
}
#define CGAL_CHECK_BFUNCTION(Name,AT1,AT2,RT) \
{ \
@ -104,22 +104,22 @@ void test_algebraic_kernel_2(const AlgebraicKernel_2& ak_2) {
CGAL_USE_TYPE(AT1_); \
CGAL_USE_TYPE(AT2_); \
CGAL_USE_TYPE(RT_); \
{CGAL_static_assertion(( ::std::is_same<AT1,AT1_>::value));} \
{CGAL_static_assertion(( ::std::is_same<AT2,AT2_>::value));} \
{CGAL_static_assertion(( ::std::is_same<RT,RT_>::value));} \
{static_assert(::std::is_same<AT1,AT1_>::value);} \
{static_assert(::std::is_same<AT2,AT2_>::value);} \
{static_assert(::std::is_same<RT,RT_>::value);} \
}
CGAL_static_assertion(( ::std::is_same
static_assert(::std::is_same
<Algebraic_real_2,
typename Construct_algebraic_real_2::result_type>
::value));
::value);
CGAL_CHECK_UFUNCTION(Is_square_free_2,Polynomial_2,bool);
CGAL_CHECK_UFUNCTION(Make_square_free_2,Polynomial_2,Polynomial_2);
// TODO: missing check for Square_free_factorize_2
CGAL_CHECK_BFUNCTION(Is_coprime_2,Polynomial_2,Polynomial_2,bool);
CGAL_static_assertion(( ::std::is_same
<bool,typename Make_coprime_2::result_type>::value));
static_assert(::std::is_same
<bool,typename Make_coprime_2::result_type>::value);
CGAL_CHECK_BFUNCTION(Number_of_solutions_2,Polynomial_2,Polynomial_2,
size_type);
CGAL_CHECK_UFUNCTION(Compute_x_2,Algebraic_real_2,Algebraic_real_1);
@ -128,8 +128,8 @@ void test_algebraic_kernel_2(const AlgebraicKernel_2& ak_2) {
CGAL_CHECK_UFUNCTION(Compute_polynomial_y_2,Algebraic_real_2,Polynomial_1);
CGAL_CHECK_BFUNCTION(Isolate_x_2,Algebraic_real_2,Polynomial_1,BInterval);
CGAL_CHECK_BFUNCTION(Isolate_y_2,Algebraic_real_2,Polynomial_1,BInterval);
CGAL_static_assertion(( ::std::is_same
< BArray,typename Isolate_2::result_type>::value));
static_assert(::std::is_same
< BArray,typename Isolate_2::result_type>::value);
CGAL_CHECK_BFUNCTION(Sign_at_2,Polynomial_2,Algebraic_real_2,Sign);
CGAL_CHECK_BFUNCTION(Is_zero_at_2,Polynomial_2,Algebraic_real_2,bool);
CGAL_CHECK_BFUNCTION(Compare_x_2,Algebraic_real_2,Algebraic_real_2,Sign);

View File

@ -39,8 +39,8 @@ namespace internal {
void operator() (ToDouble to_double) {
typedef typename ToDouble::argument_type Argument_type;
typedef typename ToDouble::result_type Result_type;
CGAL_static_assertion((::std::is_same<NT, Argument_type>::value));
CGAL_static_assertion((::std::is_same<double, Result_type>::value));
static_assert(::std::is_same<NT, Argument_type>::value);
static_assert(::std::is_same<double, Result_type>::value);
assert(42.0 == to_double(NT(42)));
}
};
@ -59,8 +59,8 @@ namespace internal {
void operator() (ToInterval to_Interval) {
typedef typename ToInterval::argument_type Argument_type;
typedef typename ToInterval::result_type Result_type;
CGAL_static_assertion((::std::is_same<NT, Argument_type>::value));
CGAL_static_assertion((::std::is_same< typename Argument_type::Interval, Result_type>::value));
static_assert(::std::is_same<NT, Argument_type>::value);
static_assert(::std::is_same< typename Argument_type::Interval, Result_type>::value);
// TODO: NiX::in not available!?
//assert(NiX::in(42.0,to_Interval(NT(42))));
@ -99,7 +99,7 @@ void test_real_comparable() {
typedef CGAL::Real_embeddable_traits<NT> Traits;
typedef typename Traits::Is_real_embeddable Is_real_comparable;
using ::CGAL::Tag_true;
CGAL_static_assertion((::std::is_same< Is_real_comparable, Tag_true>::value));
static_assert(::std::is_same< Is_real_comparable, Tag_true>::value);
typename Traits::Compare compare;
typename Traits::Sign sign;
typename Traits::Abs abs;
@ -168,20 +168,20 @@ void test_not_real_comparable() {
typedef CGAL::Real_embeddable_traits<NT> Traits;
typedef typename Traits::Is_real_embeddable Is_real_comparable;
using ::CGAL::Tag_false;
CGAL_static_assertion((::std::is_same< Is_real_comparable, Tag_false>::value));
static_assert(::std::is_same< Is_real_comparable, Tag_false>::value);
}
template <class NT, class CeilLog2Abs>
void test_rounded_log2_abs(NT zero, ::CGAL::Null_functor, CeilLog2Abs) {
typedef ::CGAL::Null_functor Nulltype;
CGAL_static_assertion((::std::is_same< CeilLog2Abs, Nulltype>::value));
static_assert(::std::is_same< CeilLog2Abs, Nulltype>::value);
}
template <class NT, class FloorLog2Abs, class CeilLog2Abs>
void test_rounded_log2_abs(NT zero, FloorLog2Abs fl_log, CeilLog2Abs cl_log) {
typedef ::CGAL::Null_functor Null_functor;
CGAL_static_assertion((!::std::is_same< CeilLog2Abs, Null_functor>::value));
static_assert(!::std::is_same< CeilLog2Abs, Null_functor>::value);
assert( fl_log(NT( 7)) == 2 );
assert( cl_log(NT( 7)) == 3 );

View File

@ -80,7 +80,7 @@ use binary search.
`Alpha_shape_2::number_of_solid_components()` performs a graph traversal and takes time
linear in the number of faces of the underlying triangulation.
`Alpha_shape_2::find_optimal_alpha()` uses binary search and takes time
\f$ O(n \log n)\f$, where \f$ n\f$ is the number of points.
\cgalBigO{n \log n}, where \f$ n\f$ is the number of points.
*/
template< typename Dt, typename ExactAlphaComparisonTag >

View File

@ -16,7 +16,7 @@ if `Alpha_shape_face_base_2` is intended to be used with an alpha-shape class ba
\link Tag_true `Tag_true`\endlink, triggers exact comparisons between alpha values. See the description
provided in the documentation of `Alpha_shape_2` for more details. The default value is \link Tag_false `Tag_false`\endlink.
\cgalModels `AlphaShapeFace_2`
\cgalModels{AlphaShapeFace_2}
\sa `Triangulation_face_base_2`
\sa `Regular_triangulation_face_base_2`

View File

@ -17,7 +17,7 @@ if `Alpha_shape_vertex_base_2` is intended to be used with an alpha-shape class
\link Tag_true `Tag_true`\endlink, triggers exact comparisons between alpha values. See the description
provided in the documentation of `Alpha_shape_2` for more details. The default value is \link Tag_false `Tag_false`\endlink.
\cgalModels `AlphaShapeVertex_2`
\cgalModels{AlphaShapeVertex_2}
\sa `Triangulation_vertex_base_2`
\sa `Regular_triangulation_vertex_base_2`

View File

@ -9,7 +9,9 @@ The concept `AlphaShapeFace_2` describes the requirements for the base face of a
RegularTriangulationFaceBase_2 if the underlying triangulation of the alpha shape is a regular triangulation,
Periodic_2TriangulationFaceBase_2 if the underlying triangulation of the alpha shape is a periodic triangulation}
\cgalHasModel `CGAL::Alpha_shape_face_base_2` (templated with the appropriate triangulation face base class).
\cgalHasModelsBegin
\cgalHasModels{CGAL::Alpha_shape_face_base_2 (templated with the appropriate triangulation face base class)}
\cgalHasModelsEnd
*/
class AlphaShapeFace_2 {

View File

@ -9,8 +9,10 @@ class of the underlying Delaunay triangulation of a basic alpha shape.
\cgalRefines{DelaunayTriangulationTraits_2 if the underlying triangulation of the alpha shape is a Delaunay triangulation,
Periodic_2DelaunayTriangulationTraits_2 if the underlying triangulation of the alpha shape is a periodic Delaunay triangulation}
\cgalHasModel All models of `Kernel`.
\cgalHasModel Projection traits such as `CGAL::Projection_traits_xy_3<K>`.
\cgalHasModelsBegin
\cgalHasModelsBare{All models of `Kernel`}
\cgalHasModelsBare{Projection traits such as `CGAL::Projection_traits_xy_3<K>`}
\cgalHasModelsEnd
\sa `CGAL::Exact_predicates_inexact_constructions_kernel` (recommended kernel)
*/

View File

@ -9,7 +9,9 @@ The concept `AlphaShapeVertex_2` describes the requirements for the base vertex
RegularTriangulationVertexBase_2 if the underlying triangulation of the alpha shape is a regular triangulation,
Periodic_2TriangulationVertexBase_2 if the underlying triangulation of the alpha shape is a periodic triangulation}
\cgalHasModel `CGAL::Alpha_shape_vertex_base_2` (templated with the appropriate triangulation vertex base class).
\cgalHasModelsBegin
\cgalHasModelsBare{`CGAL::Alpha_shape_vertex_base_2` (templated with the appropriate triangulation vertex base class)}
\cgalHasModelsEnd
*/
class AlphaShapeVertex_2 {
public:

View File

@ -9,8 +9,10 @@ of the underlying regular triangulation of a weighted alpha shape.
\cgalRefines{RegularTriangulationTraits_2 if the underlying triangulation of the alpha shape is a regular triangulation.}
\cgalHasModel All models of `Kernel`.
\cgalHasModel Projection traits such as `CGAL::Projection_traits_xy_3<K>`.
\cgalHasModelsBegin
\cgalHasModelsBare{All models of `Kernel`,}
\cgalHasModelsBare{Projection traits such as `CGAL::Projection_traits_xy_3<K>`}
\cgalHasModelsEnd
\sa `CGAL::Exact_predicates_inexact_constructions_kernel` (recommended kernel)
*/

View File

@ -61,7 +61,7 @@ public:
// because the periodic triangulations' point() function returns a temporary
// value while the lazy predicate evaluations that are used when the Exact tag
// is set to true rely on a permanent and safe access to the points.
CGAL_static_assertion(
static_assert(
(std::is_same<ExactAlphaComparisonTag, Tag_false>::value) ||
(std::is_same<typename Dt::Periodic_tag, Tag_false>::value));
@ -76,8 +76,8 @@ public:
typedef Type_of_alpha FT;
// check that simplices are correctly instantiated
CGAL_static_assertion( (std::is_same<NT, typename Dt::Face::NT>::value) );
CGAL_static_assertion( (std::is_same<NT, typename Dt::Vertex::NT>::value) );
static_assert(std::is_same<NT, typename Dt::Face::NT>::value);
static_assert(std::is_same<NT, typename Dt::Vertex::NT>::value);
typedef typename Dt::Point Point;

View File

@ -19,6 +19,7 @@
#include <utility>
#include <CGAL/Triangulation_vertex_base_2.h>
#include <CGAL/Alpha_shapes_2/internal/Lazy_alpha_nt_2.h>
#include <CGAL/Default.h>
//-------------------------------------------------------------------
namespace CGAL {

View File

@ -148,8 +148,8 @@ class Lazy_alpha_nt_2
Approx_point to_approx(const Input_point& wp) const
{
// The traits class' Point_2 must be convertible using the Cartesian converter
CGAL_static_assertion((Is_traits_point_convertible_2<
Input_traits, Kernel_approx, Kernel_exact, Weighted_tag>::value));
static_assert(Is_traits_point_convertible_2<
Input_traits, Kernel_approx, Kernel_exact, Weighted_tag>::value);
To_approx converter;
return converter(wp);
@ -158,8 +158,8 @@ class Lazy_alpha_nt_2
Exact_point to_exact(const Input_point& wp) const
{
// The traits class' Point_2 must be convertible using the Cartesian converter
CGAL_static_assertion((Is_traits_point_convertible_2<
Input_traits, Kernel_approx, Kernel_exact, Weighted_tag>::value));
static_assert(Is_traits_point_convertible_2<
Input_traits, Kernel_approx, Kernel_exact, Weighted_tag>::value);
To_exact converter;
return converter(wp);
@ -167,7 +167,7 @@ class Lazy_alpha_nt_2
//members
//the members can be updated when calling method exact()
mutable boost::optional<NT_exact> exact_;
mutable std::optional<NT_exact> exact_;
mutable NT_approx approx_;
//private functions
@ -235,7 +235,7 @@ public:
const NT_exact& exact() const
{
if (exact_ == boost::none) {
if (exact_ == std::nullopt) {
update_exact();
approx_=to_interval(*exact_);
}
@ -448,7 +448,7 @@ struct Alpha_nt_selector_2
GeomTraits,
// If the base traits is already exact then we don't need to do anything,
// and we can simply directly use the traits class
Boolean_tag<boost::is_floating_point<typename GeomTraits::FT>::value &&
Boolean_tag<std::is_floating_point<typename GeomTraits::FT>::value &&
ExactAlphaComparisonTag::value >,
Weighted_tag>
{ };

View File

@ -2,7 +2,6 @@ Algebraic_foundations
Alpha_shapes_2
Arithmetic_kernel
Cartesian_kernel
Filtered_kernel
Hash_map
Homogeneous_kernel
Installation

View File

@ -19,7 +19,7 @@ endif()
find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt5)
find_package(Qt5 QUIET COMPONENTS Script OpenGL Svg)
find_package(Qt5 QUIET COMPONENTS Widgets OpenGL)
if(CGAL_Qt5_FOUND AND Qt5_FOUND)
@ -40,7 +40,7 @@ if(CGAL_Qt5_FOUND AND Qt5_FOUND)
add_to_cached_list(CGAL_EXECUTABLE_TARGETS Alpha_shape_3)
target_link_libraries(Alpha_shape_3 PRIVATE CGAL::CGAL CGAL::CGAL_Qt5
Qt5::OpenGL Qt5::Gui)
Qt5::Widgets Qt5::OpenGL)
include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake)
cgal_add_compilation_test(Alpha_shape_3)

View File

@ -77,7 +77,7 @@ use binary search.
`Alpha_shape_3::number_of_solid_components()` performs a graph traversal and takes time
linear in the number of cells of the underlying triangulation.
`Alpha_shape_3::find_optimal_alpha()` uses binary search and takes time
\f$ O(n \log n)\f$, where \f$ n\f$ is the number of points.
\cgalBigO{n \log n}, where \f$ n\f$ is the number of points.
*/
template< typename Dt, typename ExactAlphaComparisonTag >

View File

@ -19,7 +19,7 @@ provided in the documentation of `Alpha_shape_3` for more details. The default v
must be \link Tag_true `Tag_true`\endlink if the underlying triangulation of the alpha shape to be used is a regular triangulation
and \link Tag_false `Tag_false`\endlink otherwise. The default is \link Tag_false `Tag_false`\endlink.
\cgalModels `AlphaShapeCell_3`
\cgalModels{AlphaShapeCell_3}
\sa `Delaunay_triangulation_cell_base_3`
\sa `Regular_triangulation_cell_base_3`

View File

@ -19,7 +19,7 @@ provided in the documentation of `Alpha_shape_3` for more details. The default v
must be \link Tag_true `Tag_true`\endlink if the underlying triangulation of the alpha shape to be used is a regular triangulation
and \link Tag_false `Tag_false`\endlink otherwise. The default is \link Tag_false `Tag_false`\endlink.
\cgalModels `AlphaShapeVertex_3`
\cgalModels{AlphaShapeVertex_3}
\sa `Triangulation_vertex_base_3`
\sa `Regular_triangulation_vertex_base_3`

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