Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some simplifications #1296

Merged
merged 5 commits into from
Sep 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions include/boost/geometry/algorithms/detail/is_simple/linear.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,11 @@ template <typename Turn>
inline bool check_segment_indices(Turn const& turn,
signed_size_type last_index)
{
return
(turn.operations[0].seg_id.segment_index == 0
return (turn.operations[0].seg_id.segment_index == 0
&& turn.operations[1].seg_id.segment_index == last_index)
||
(turn.operations[0].seg_id.segment_index == 0
&& turn.operations[1].seg_id.segment_index == last_index);
(turn.operations[1].seg_id.segment_index == 0
&& turn.operations[0].seg_id.segment_index == last_index);
}


Expand Down
15 changes: 0 additions & 15 deletions include/boost/geometry/algorithms/detail/overlay/overlay.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,6 @@

#include <boost/geometry/util/condition.hpp>

#ifdef BOOST_GEOMETRY_DEBUG_ASSEMBLE
# include <boost/geometry/io/dsv/write.hpp>
#endif


namespace boost { namespace geometry
{
Expand Down Expand Up @@ -272,9 +268,6 @@ struct overlay

turn_container_type turns;

#ifdef BOOST_GEOMETRY_DEBUG_ASSEMBLE
std::cout << "get turns" << std::endl;
#endif
detail::get_turns::no_interrupt_policy policy;
geometry::get_turns
<
Expand Down Expand Up @@ -302,11 +295,6 @@ std::cout << "get turns" << std::endl;
}
#endif


#ifdef BOOST_GEOMETRY_DEBUG_ASSEMBLE
std::cout << "enrich" << std::endl;
#endif

cluster_type clusters;
std::map<ring_identifier, ring_turn_info> turn_info_per_ring;

Expand All @@ -317,9 +305,6 @@ std::cout << "enrich" << std::endl;

visitor.visit_clusters(clusters, turns);

#ifdef BOOST_GEOMETRY_DEBUG_ASSEMBLE
std::cout << "traverse" << std::endl;
#endif
// Traverse through intersection/turn points and create rings of them.
// These rings are always in clockwise order.
// In CCW polygons they are marked as "to be reversed" below.
Expand Down
33 changes: 15 additions & 18 deletions include/boost/geometry/formulas/karney_inverse.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,6 @@ class karney_inverse
sin_sigma1, cos_sigma1,
sin_sigma2, cos_sigma2,
eps, diff_omega12,
iteration < max_iterations,
dv, f, n, ep2, tiny, coeffs_C1);

// Reversed test to allow escape with NaNs.
Expand All @@ -392,7 +391,7 @@ class karney_inverse
cos_alpha1a = cos_alpha1;
}

if (iteration < max_iterations && dv > c0)
if (dv > c0)
{
CT diff_alpha1 = -v / dv;

Expand Down Expand Up @@ -843,7 +842,7 @@ class karney_inverse
CT& sin_sigma1, CT& cos_sigma1,
CT& sin_sigma2, CT& cos_sigma2,
CT& eps, CT& diff_omega12,
bool diffp, CT& diff_lam12,
CT& diff_lam12,
CT const& f, CT const& n, CT const& ep2, CT const& tiny,
CoeffsC1 const& coeffs_C1)
{
Expand Down Expand Up @@ -929,24 +928,22 @@ class karney_inverse
diff_omega12 = -f * A3 * sin_alpha0 * (sigma12 + B312);
lam12 = eta + diff_omega12;

if (diffp)
if (cos_alpha2 == c0)
{
if (cos_alpha2 == c0)
{
diff_lam12 = - c2 * one_minus_f * dn1 / sin_beta1;
}
else
{
CT dummy;
meridian_length(eps, ep2, sigma12, sin_sigma1, cos_sigma1, dn1,
sin_sigma2, cos_sigma2, dn2,
cos_beta1, cos_beta2, dummy,
diff_lam12, dummy, dummy,
dummy, coeffs_C1);
diff_lam12 = - c2 * one_minus_f * dn1 / sin_beta1;
}
else
{
CT dummy;
meridian_length(eps, ep2, sigma12, sin_sigma1, cos_sigma1, dn1,
sin_sigma2, cos_sigma2, dn2,
cos_beta1, cos_beta2, dummy,
diff_lam12, dummy, dummy,
dummy, coeffs_C1);

diff_lam12 *= one_minus_f / (cos_alpha2 * cos_beta2);
}
diff_lam12 *= one_minus_f / (cos_alpha2 * cos_beta2);
}

return lam12;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
#include <iostream>
#include <string>

//#define BOOST_GEOMETRY_DEBUG_ASSEMBLE
//#define BOOST_GEOMETRY_CHECK_WITH_SQLSERVER

//#define BOOST_GEOMETRY_DEBUG_SEGMENT_IDENTIFIER
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,8 +227,7 @@ std::string test_difference(std::string const& caseid, G1 const& g1, G2 const& g

difference_output(caseid, g1, g2, result);

#if ! (defined(BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE) \
|| defined(BOOST_GEOMETRY_DEBUG_ASSEMBLE))
#if ! defined(BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE)
{
// Test inserter functionality
// Test if inserter returns output-iterator (using Boost.Range copy)
Expand Down
Loading