Skip to content

Commit 016691b

Browse files
committed
Merge branch 'develop' into feature/traits_make
2 parents 8ec873c + 632d1fc commit 016691b

File tree

484 files changed

+3339
-28729
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

484 files changed

+3339
-28729
lines changed

.github/workflows/documentation.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
# GitHub Actions Workflow for Boost.Geometry to build documentation
33
#
44
# Copyright (c) 2020 Mateusz Loskot <mateusz@loskot.net>
5+
# Copyright (c) 2020 Adam Wulkiewicz, Lodz, Poland
56
#
67
# Use, modification and distribution is subject to the Boost Software License,
78
# Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
@@ -31,12 +32,12 @@ jobs:
3132
id: setenv
3233
run: |
3334
if [[ "$GITHUB_REF" == *master ]]; then
34-
echo "::set-env name=BOOST_BRANCH::master"
35+
echo "BOOST_BRANCH=master" >> $GITHUB_ENV
3536
else
36-
echo "::set-env name=BOOST_BRANCH::develop"
37+
echo "BOOST_BRANCH=develop" >> $GITHUB_ENV
3738
fi
38-
echo "::set-env name=BOOST_SELF::$(basename $GITHUB_WORKSPACE)"
39-
echo "::set-env name=BOOST_ROOT::$GITHUB_WORKSPACE/boost-root"
39+
echo "BOOST_SELF=$(basename $GITHUB_WORKSPACE)" >> $GITHUB_ENV
40+
echo "BOOST_ROOT=$GITHUB_WORKSPACE/boost-root" >> $GITHUB_ENV
4041
echo "::set-output name=boost_self::$(basename $GITHUB_WORKSPACE)"
4142
echo "::set-output name=boost_root::$GITHUB_WORKSPACE/boost-root"
4243

.github/workflows/minimal-clang.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
# GitHub Actions Workflow for Boost.Geometry to build minimal tests with Clang
33
#
44
# Copyright (c) 2020 Mateusz Loskot <mateusz@loskot.net>
5+
# Copyright (c) 2020 Adam Wulkiewicz, Lodz, Poland
56
#
67
# Use, modification and distribution is subject to the Boost Software License,
78
# Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
@@ -61,12 +62,12 @@ jobs:
6162
id: setenv
6263
run: |
6364
if [[ "$GITHUB_REF" == *master ]]; then
64-
echo "::set-env name=BOOST_BRANCH::master"
65+
echo "BOOST_BRANCH=master" >> $GITHUB_ENV
6566
else
66-
echo "::set-env name=BOOST_BRANCH::develop"
67+
echo "BOOST_BRANCH=develop" >> $GITHUB_ENV
6768
fi
68-
echo "::set-env name=BOOST_SELF::$(basename $GITHUB_WORKSPACE)"
69-
echo "::set-env name=BOOST_ROOT::$GITHUB_WORKSPACE/boost-root"
69+
echo "BOOST_SELF=$(basename $GITHUB_WORKSPACE)" >> $GITHUB_ENV
70+
echo "BOOST_ROOT=$GITHUB_WORKSPACE/boost-root" >> $GITHUB_ENV
7071
echo "::set-output name=boost_self::$(basename $GITHUB_WORKSPACE)"
7172
echo "::set-output name=boost_root::$GITHUB_WORKSPACE/boost-root"
7273
@@ -91,6 +92,7 @@ jobs:
9192
9293
- name: Install
9394
run: |
95+
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 15CF4D18AF4F7421
9496
sudo add-apt-repository "deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-10 main"
9597
sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
9698
sudo apt -q -y update

.github/workflows/minimal-gcc.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
# GitHub Actions Workflow for Boost.Geometry to build minimal tests with GCC
33
#
44
# Copyright (c) 2020 Mateusz Loskot <mateusz@loskot.net>
5+
# Copyright (c) 2020 Adam Wulkiewicz, Lodz, Poland
56
#
67
# Use, modification and distribution is subject to the Boost Software License,
78
# Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
@@ -49,12 +50,12 @@ jobs:
4950
id: setenv
5051
run: |
5152
if [[ "$GITHUB_REF" == *master ]]; then
52-
echo "::set-env name=BOOST_BRANCH::master"
53+
echo "BOOST_BRANCH=master" >> $GITHUB_ENV
5354
else
54-
echo "::set-env name=BOOST_BRANCH::develop"
55+
echo "BOOST_BRANCH=develop" >> $GITHUB_ENV
5556
fi
56-
echo "::set-env name=BOOST_SELF::$(basename $GITHUB_WORKSPACE)"
57-
echo "::set-env name=BOOST_ROOT::$GITHUB_WORKSPACE/boost-root"
57+
echo "BOOST_SELF=$(basename $GITHUB_WORKSPACE)" >> $GITHUB_ENV
58+
echo "BOOST_ROOT=$GITHUB_WORKSPACE/boost-root" >> $GITHUB_ENV
5859
echo "::set-output name=boost_self::$(basename $GITHUB_WORKSPACE)"
5960
echo "::set-output name=boost_root::$GITHUB_WORKSPACE/boost-root"
6061

.github/workflows/minimal-msvc.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
# GitHub Actions Workflow for Boost.Geometry to build minimal tests with MSVC
33
#
44
# Copyright (c) 2020 Mateusz Loskot <mateusz@loskot.net>
5+
# Copyright (c) 2020 Adam Wulkiewicz, Lodz, Poland
56
#
67
# Use, modification and distribution is subject to the Boost Software License,
78
# Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
@@ -34,13 +35,13 @@ jobs:
3435
id: setenv
3536
shell: pwsh
3637
run: |
37-
if ("$GITHUB_REF" -contains "master") {
38-
echo "::set-env name=BOOST_BRANCH::master"
38+
if ("$env:GITHUB_REF" -contains "master") {
39+
echo "BOOST_BRANCH=master" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
3940
} else {
40-
echo "::set-env name=BOOST_BRANCH::develop"
41+
echo "BOOST_BRANCH=develop" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
4142
}
42-
echo "::set-env name=BOOST_SELF::$((Get-Item $env:GITHUB_WORKSPACE).BaseName)"
43-
echo "::set-env name=BOOST_ROOT::$env:GITHUB_WORKSPACE\boost-root"
43+
echo "BOOST_SELF=$((Get-Item $env:GITHUB_WORKSPACE).BaseName)" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
44+
echo "BOOST_ROOT=$env:GITHUB_WORKSPACE\boost-root" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
4445
echo "::set-output name=boost_self::$((Get-Item $env:GITHUB_WORKSPACE).BaseName)"
4546
echo "::set-output name=boost_root::$env:GITHUB_WORKSPACE\boost-root"
4647

Jamfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
project boost-geometry
1212
:
1313
requirements
14-
<include>../../boost/geometry/extensions/contrib/ttmath
1514
<toolset>msvc:<asynch-exceptions>on
1615
;
1716

doc/doxy/doxygen_input/pages/doxygen_d_robustness.hpp

Lines changed: 6 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -57,20 +57,7 @@ a <a href="http://en.wikipedia.org/wiki/Long_double">long double</a>, not standa
5757
5858
By default, algorithms select the coordinate type of the input geometries. If there are two input geometries, and they have different coordinate types, the coordinate type with the most precision is selected. This is done by the meta-function \b select_most_precise.
5959
60-
Boost.Geometry supports also high precision arithmetic types, by adaption. The numeric_adaptor, used for adaption, is not part of Boost.Geometry itself but developed by us and sent (as preview) to the Boost List (as it turned out, that functionality might also be provided by Boost.Math bindings, but the mechanism is the same). Types from the following libraries are supported:
61-
62-
- GMP (http://gmplib.org)
63-
- CLN (http://www.ginac.de/CLN)
64-
65-
Note that the libraries themselves are not included in Boost.Geometry, they are completely independant of each other.
66-
67-
These numeric types can be used as following:
68-
\code
69-
boost::geometry::point_xy<boost::numeric_adaptor::gmp_value_type> p4;
70-
boost::geometry::point_xy<boost::numeric_adaptor::cln_value_type> p5;
71-
\endcode
72-
73-
All algorithms using these points will use the \b GMP resp. \b CLN library for calculations.
60+
Boost.Geometry supports also high precision arithmetic types, by adaption. For example from Boost.Multiprecision.
7461
7562
\section robustness_par4 Calculation types
7663
@@ -81,21 +68,21 @@ If high precision arithmetic types are used as shown above, coordinates are stor
8168
8269
\code
8370
{
84-
typedef boost::geometry::point_xy<double> point_type;
85-
boost::geometry::linear_ring<point_type> ring;
71+
using point_type = bg::model::point<default_test_type, 2, bg::cs::cartesian> ;
72+
boost::geometry::model::ring<point_type> ring;
8673
ring.push_back(boost::geometry::make<point_type>(0.0, 0.0));
8774
ring.push_back(boost::geometry::make<point_type>(0.0, 0.0012));
8875
ring.push_back(boost::geometry::make<point_type>(1234567.89012345, 0.0));
8976
ring.push_back(ring.front());
9077
91-
typedef boost::numeric_adaptor::gmp_value_type gmp;
78+
using mp = boost::multiprecision::cpp_bin_float_100;
9279
93-
gmp area = boost::geometry::area(ring, boost::geometry::strategy::area::by_triangles<point_type, gmp>());
80+
auto area = boost::geometry::area(ring, boost::geometry::strategies::area::cartesian<mp>());
9481
std::cout << area << std::endl;
9582
}
9683
\endcode
9784
98-
Above shows how this is used to use \b GMP or \b CLN for double coordinates. Exactly the same mechanism works (of course) also to do calculation in double, where coordinates are stored in float.
85+
Above shows how this is used to use Boost.Multiprecision with double coordinates. Exactly the same mechanism works (of course) also to do calculation in double, where coordinates are stored in float.
9986
10087
\section robustness_par5 Strategies
10188

doc/src/examples/algorithms/assign_2d_point.cpp

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,14 @@
88
// http://www.boost.org/LICENSE_1_0.txt)
99

1010
//[assign_2d_point
11-
//` Shows the usage of assign to set point coordinates, and, besides that, shows how you can initialize ttmath points with high precision
11+
//` Shows the usage of assign to set point coordinates
1212

1313
#include <iostream>
1414
#include <iomanip>
1515

1616
#include <boost/geometry.hpp>
1717
#include <boost/geometry/geometries/point_xy.hpp>
1818

19-
#if defined(HAVE_TTMATH)
20-
# include <boost/geometry/extensions/contrib/ttmath_stub.hpp>
21-
#endif
22-
23-
2419
int main()
2520
{
2621
using boost::geometry::assign_values;
@@ -29,21 +24,9 @@ int main()
2924
boost::geometry::model::d2::point_xy<double> p1;
3025
assign_values(p1, 1.2345, 2.3456);
3126

32-
#if defined(HAVE_TTMATH)
33-
boost::geometry::model::d2::point_xy<ttmath::Big<1,4> > p2;
34-
assign_values(p2, "1.2345", "2.3456"); /*< It is possible to assign coordinates with other types than the coordinate type.
35-
For ttmath, you can e.g. conveniently use strings. The advantage is that it then has higher precision, because
36-
if doubles are used for assignments the double-precision is used.
37-
>*/
38-
#endif
39-
4027
std::cout
4128
<< std::setprecision(20)
42-
<< boost::geometry::dsv(p1) << std::endl
43-
#if defined(HAVE_TTMATH)
44-
<< boost::geometry::dsv(p2) << std::endl
45-
#endif
46-
;
29+
<< boost::geometry::dsv(p1) << std::endl;
4730

4831
return 0;
4932
}

extensions/Jamfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
project boost-geometry-extensions
1212
:
1313
requirements
14-
<include>../../../boost/geometry/extensions/contrib/ttmath
1514
<toolset>msvc:<asynch-exceptions>on
1615
;
1716

extensions/test/Jamfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ project boost-geometry-extensions-test
1515
:
1616
requirements
1717
<include>../../test
18-
<include>../../../boost/geometry/extensions/contrib/ttmath
1918
<toolset>msvc:<asynch-exceptions>on
2019
<toolset>msvc:<cxxflags>/bigobj
2120
<host-os>windows,<toolset>intel:<cxxflags>/bigobj

extensions/test/algorithms/is_convex.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,5 @@ int test_main(int, char* [])
118118
//test_all<bg::model::d2::point_xy<float> >();
119119
test_all<bg::model::d2::point_xy<double> >();
120120

121-
#if defined(HAVE_TTMATH)
122-
test_all<bg::model::d2::point_xy<ttmath_big> >();
123-
#endif
124-
125121
return 0;
126122
}

extensions/test/gis/latlong/cross_track.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -120,10 +120,5 @@ int test_main(int, char* [])
120120
{
121121
test_all<bg::model::point<double, 2, bg::cs::geographic<bg::degree> > >();
122122

123-
#if defined(HAVE_TTMATH)
124-
typedef ttmath::Big<1,4> tt;
125-
test_all<bg::model::point<tt, 2, bg::cs::geographic<bg::degree> > >();
126-
#endif
127-
128123
return 0;
129124
}

include/boost/geometry/algorithms/append.hpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,8 @@
44
// Copyright (c) 2008-2014 Bruno Lalande, Paris, France.
55
// Copyright (c) 2009-2014 Mateusz Loskot, London, UK.
66

7-
// This file was modified by Oracle on 2014.
8-
// Modifications copyright (c) 2014, Oracle and/or its affiliates.
9-
7+
// This file was modified by Oracle on 2014-2020.
8+
// Modifications copyright (c) 2014-2020, Oracle and/or its affiliates.
109
// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
1110
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
1211

@@ -21,7 +20,9 @@
2120
#define BOOST_GEOMETRY_ALGORITHMS_APPEND_HPP
2221

2322

24-
#include <boost/range.hpp>
23+
#include <boost/range/begin.hpp>
24+
#include <boost/range/end.hpp>
25+
#include <boost/range/value_type.hpp>
2526

2627
#include <boost/variant/apply_visitor.hpp>
2728
#include <boost/variant/static_visitor.hpp>

include/boost/geometry/algorithms/area.hpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,10 @@
2121

2222
#include <boost/concept_check.hpp>
2323
#include <boost/core/ignore_unused.hpp>
24-
#include <boost/range/functions.hpp>
25-
#include <boost/range/metafunctions.hpp>
24+
#include <boost/range/begin.hpp>
25+
#include <boost/range/end.hpp>
26+
#include <boost/range/size.hpp>
27+
#include <boost/range/value_type.hpp>
2628

2729
#include <boost/variant/apply_visitor.hpp>
2830
#include <boost/variant/static_visitor.hpp>

include/boost/geometry/algorithms/area_result.hpp

Lines changed: 40 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626

2727
#include <boost/geometry/util/select_most_precise.hpp>
2828
#include <boost/geometry/util/sequence.hpp>
29+
#include <boost/geometry/util/type_traits.hpp>
2930

3031
#include <boost/variant/variant_fwd.hpp>
3132

@@ -46,21 +47,23 @@ template
4647
bool IsUmbrella = strategies::detail::is_umbrella_strategy<Strategy>::value
4748
>
4849
struct area_result
49-
: decltype(std::declval<Strategy>().area(std::declval<Geometry>()))
50-
::template result_type<Geometry>
51-
{};
50+
{
51+
typedef decltype(std::declval<Strategy>().area(std::declval<Geometry>())) strategy_type;
52+
typedef typename strategy_type::template result_type<Geometry>::type type;
53+
};
54+
55+
template <typename Geometry, typename Strategy>
56+
struct area_result<Geometry, Strategy, false>
57+
{
58+
typedef typename Strategy::template result_type<Geometry>::type type;
59+
};
60+
5261

5362
template
5463
<
5564
typename Geometry,
56-
typename Strategy
65+
bool IsGeometry = util::is_geometry<Geometry>::value
5766
>
58-
struct area_result<Geometry, Strategy, false>
59-
: Strategy::template result_type<Geometry>
60-
{};
61-
62-
63-
template <typename Geometry>
6467
struct default_area_result
6568
: area_result
6669
<
@@ -72,15 +75,37 @@ struct default_area_result
7275
>
7376
{};
7477

78+
// Workaround for VS2015
79+
#if (_MSC_VER < 1910)
80+
template
81+
<
82+
typename Geometry,
83+
bool IsGeometry = util::is_geometry<Geometry>::value
84+
>
85+
struct coordinate_type
86+
: geometry::coordinate_type<Geometry>
87+
{};
88+
template <typename Geometry>
89+
struct coordinate_type<Geometry, false>
90+
{
91+
typedef int type;
92+
};
93+
template <typename Geometry>
94+
struct default_area_result<Geometry, false>
95+
{
96+
typedef int type;
97+
};
98+
#endif
99+
75100
template <typename Curr, typename Next>
76101
struct more_precise_coordinate_type
77102
: std::is_same
78103
<
79-
typename geometry::coordinate_type<Curr>::type,
104+
typename coordinate_type<Curr>::type,
80105
typename geometry::select_most_precise
81106
<
82-
typename geometry::coordinate_type<Curr>::type,
83-
typename geometry::coordinate_type<Next>::type
107+
typename coordinate_type<Curr>::type,
108+
typename coordinate_type<Next>::type
84109
>::type
85110
>
86111
{};
@@ -138,14 +163,13 @@ struct area_result<Geometry, default_strategy>
138163

139164
template <typename ...Ts>
140165
struct area_result<boost::variant<Ts...>, default_strategy>
141-
: geometry::area_result
166+
: detail::area::default_area_result
142167
<
143168
typename util::select_pack_element
144169
<
145170
detail::area::more_precise_default_area_result,
146171
Ts...
147-
>::type,
148-
default_strategy
172+
>::type
149173
>
150174
{};
151175

0 commit comments

Comments
 (0)