Skip to content

Commit

Permalink
WIP BACKUP COMMIT TO BE REMOVED
Browse files Browse the repository at this point in the history
  • Loading branch information
sloriot committed Jun 16, 2023
1 parent f240a47 commit 318315a
Show file tree
Hide file tree
Showing 52 changed files with 493 additions and 782 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -631,7 +631,7 @@ class Curve_analysis_2 : public ::CGAL::Handle_with_policy< Rep_ > {
event_coordinates();
CGAL_assertion(this->ptr()->has_vertical_component);
}
return this->ptr()->has_vertical_component.get();
return this->ptr()->has_vertical_component.value();
}

public:
Expand Down Expand Up @@ -1437,7 +1437,7 @@ class Curve_analysis_2 : public ::CGAL::Handle_with_policy< Rep_ > {
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:
Expand Down Expand Up @@ -1558,7 +1558,7 @@ class Curve_analysis_2 : public ::CGAL::Handle_with_policy< Rep_ > {
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());
}
Expand Down Expand Up @@ -1593,7 +1593,7 @@ class Curve_analysis_2 : public ::CGAL::Handle_with_policy< Rep_ > {
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:
Expand Down Expand Up @@ -2111,7 +2111,7 @@ class Curve_analysis_2 : public ::CGAL::Handle_with_policy< Rep_ > {
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];
Expand All @@ -2121,7 +2121,7 @@ class Curve_analysis_2 : public ::CGAL::Handle_with_policy< Rep_ > {
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];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -547,15 +547,15 @@ class Curve_pair_analysis_2 :
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 {
if(! this->ptr()->resultant_roots) {
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 {
Expand All @@ -569,7 +569,7 @@ class Curve_pair_analysis_2 :
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 {
Expand All @@ -586,26 +586,26 @@ class Curve_pair_analysis_2 :
(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 {
if(! this->ptr()->event_x_coordinates) {
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 {
if(! this->ptr()->event_indices) {
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:
Expand Down Expand Up @@ -633,15 +633,15 @@ class Curve_pair_analysis_2 :
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 {
if(! this->ptr()->intermediate_slices) {
compute_intermediate_values_and_slices();
}
CGAL_assertion(bool(this->ptr()->intermediate_slices));
return this->ptr()->intermediate_slices.get();
return this->ptr()->intermediate_slices.value();
}


Expand All @@ -652,7 +652,7 @@ class Curve_pair_analysis_2 :
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 {
Expand All @@ -666,7 +666,7 @@ class Curve_pair_analysis_2 :
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 {
Expand All @@ -681,7 +681,7 @@ class Curve_pair_analysis_2 :
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 {
Expand Down Expand Up @@ -1045,7 +1045,7 @@ class Curve_pair_analysis_2 :

}

return intermediate_slices()[i].valuen();
return intermediate_slices()[i].value();
}

//! Returns bound representative value at the <tt>i</tt>th interval
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
}

Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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());

Expand All @@ -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]);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,7 @@ class Status_line_CA_1
//! 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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,7 @@ the output sequence.
`std::pair<Arrangement_2::Point_2, Arr_point_location_result<Arrangement_2>::%Type>`.
</UL>
\cgalHeading{A Note on Backwards Compatibility}
This function used to return `CGAL::Object` up to
\cgal version 4.2. Starting with \cgal version 4.3 the return type
is determined by the metafunction `CGAL::Arr_point_location_result`.
To preserve backwards compatibility
`CGAL::Object` can be constructed from the new return type
implicitly, but switching to the new style is recommended. To enable
the old style without any overhead, the macro
`::CGAL_ARR_POINT_LOCATION_VERSION` can be defined to 1 before any
\cgal header is included.
\sa `CGAL::Arr_point_location_result<Arrangement>`
\sa `CGAL_ARR_POINT_LOCATION_VERSION`
*/
template<typename Traits, typename Dcel,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ insertions of curves and not deletions of them.
\sa `ArrangementPointLocation_2`
\sa `ArrangementVerticalRayShoot_2`
\sa `CGAL::Arr_point_location_result<Arrangement>`
\sa `CGAL_ARR_POINT_LOCATION_VERSION`
*/
template< typename Arrangement, typename Generator >
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ time-consuming process when applied to dense arrangements.
\sa `ArrangementPointLocation_2`
\sa `ArrangementVerticalRayShoot_2`
\sa `CGAL::Arr_point_location_result<Arrangement>`
\sa `CGAL_ARR_POINT_LOCATION_VERSION`
*/
template< typename Arrangement >
Expand Down
Original file line number Diff line number Diff line change
@@ -1,25 +1,4 @@
/*!
\ingroup PkgArrangementOnSurface2PointLocation
The macro `CGAL_ARR_POINT_LOCATION_VERSION` can be used to configure
the point-location query API. In particular, it determines which version
of the result type of the point-location and vertical ray-shooting queries
should be used by models of the concepts `ArrangementPointLocation_2`
and `ArrangementVerticalRayShoot_2`, and by the free function
`locate`. The `CGAL_ARR_POINT_LOCATION_VERSION` should be defined before any \cgal header
is included.
- `CGAL_ARR_POINT_LOCATION_VERSION` == 1, the result type is set to be `CGAL::Object`.
- `CGAL_ARR_POINT_LOCATION_VERSION` == 2, the result type is set to be
`std::variant<Vertex_const_handle,Halfedge_const_handle,Face_const_handle>`, where `Vertex_const_handle`, `Halfedge_const_handle`, and
`Face_const_handle` are the corresponding nested types in a `CGAL::Arrangement_2` instance.
\sa `ArrangementPointLocation_2`
\sa `ArrangementVerticalRayShoot_2`
\sa `CGAL::Arr_point_location_result<Arrangement>`
*/
#define CGAL_ARR_POINT_LOCATION_VERSION
namespace CGAL {
Expand All @@ -37,16 +16,13 @@ or vertical ray-shoot query.
\sa `CGAL::Arr_walk_along_line_point_location<Arrangement>`
\sa `CGAL::Arr_landmarks_point_location<Arrangement,Generator>`
\sa `CGAL::Arr_trapezoid_ric_point_location<Arrangement>`
\sa `CGAL_ARR_POINT_LOCATION_VERSION`
*/
template <class Arrangement>
struct Arr_point_location_result
{
/*! The type of the arrangement feature that is the result of a
* point-location query or a vertical ray-shoot query, namely,
* `std::variant<Arrangement::Vertex_const_handle, Arrangement::Halfedge_const_handle, Arrangement::Face_const_handle>`
* if `::CGAL_ARR_POINT_LOCATION_VERSION` == 2, which is the default, otherwise
* `CGAL::Object`.
*/
typedef unspecified_type Type;
}; /* end Arr_point_location_result */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ This strategy supports arbitrary subdivisions, including unbounded ones.
\sa `ArrangementPointLocation_2`
\sa `ArrangementVerticalRayShoot_2`
\sa `CGAL::Arr_point_location_result<Arrangement>`
\sa `CGAL_ARR_POINT_LOCATION_VERSION`
*/
template< typename Arrangement >
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ namespace CGAL {
* \sa `ArrangementPointLocation_2`
* \sa `ArrangementVerticalRayShoot_2`
* \sa `CGAL::Arr_point_location_result<Arrangement>`
* \sa `CGAL_ARR_POINT_LOCATION_VERSION`
*/

template <typename Arrangement_>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ of issued queries is not large.
\sa `ArrangementPointLocation_2`
\sa `ArrangementVerticalRayShoot_2`
\sa `CGAL::Arr_point_location_result<Arrangement>`
\sa `CGAL_ARR_POINT_LOCATION_VERSION`
*/
template< typename Arrangement >
Expand Down
Loading

0 comments on commit 318315a

Please sign in to comment.