Skip to content

Commit

Permalink
fix compilation issues
Browse files Browse the repository at this point in the history
mainly due to expression template
  • Loading branch information
sloriot committed Feb 28, 2024
1 parent c9c089c commit 432449b
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 16 deletions.
11 changes: 6 additions & 5 deletions Arrangement_on_surface_2/include/CGAL/Arr_conic_traits_2.h
Original file line number Diff line number Diff line change
Expand Up @@ -3904,18 +3904,19 @@ class Arr_conic_traits_2 {
auto u = cv.u();
auto v = cv.v();
auto w = cv.w();
Algebraic* ys_end = m_nt_traits->solve_quadratic_equation(t*t - four*r*s,
two*t*u - four*r*v,
u*u - four*r*w,
ys);
Algebraic* ys_end = m_nt_traits->template
solve_quadratic_equation<Integer>(t*t - four*r*s,
two*t*u - four*r*v,
u*u - four*r*w,
ys);
auto n = static_cast<int>(ys_end - ys);

// Compute the x coordinates and construct the horizontal tangency points.
for (int i = 0; i < n; ++i) {
// Having computed y, x is the single solution to the quadratic equation
// above, and since its discriminant is 0, x is simply given by:
Algebraic x = -(m_nt_traits->convert(t)*ys[i] + m_nt_traits->convert(u)) /
m_nt_traits->convert(two*r);
m_nt_traits->convert(Integer(two*r));
ps[i] = Point_2(x, ys[i]);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ struct Curve_renderer_traits<CGAL::Interval_nt<true>, CORE::BigRat > :

//! Specialization for \c CORE::BigFloat
template <>
struct Curve_renderer_traits<CORE::BigFloat, class CORE::BigRat>
struct Curve_renderer_traits<CORE::BigFloat, CORE::BigRat>
: public Curve_renderer_traits_base<CORE::BigFloat, CORE::BigInt,
CORE::BigRat> {

Expand Down
18 changes: 9 additions & 9 deletions Envelope_3/include/CGAL/Env_sphere_traits_3.h
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ class Env_sphere_traits_3 : public ConicTraits_2 {
if (n_ys == 0) return o; // no intersection

// the x coordinate of the solution points
Algebraic xs = m / (2*a_diff);
Algebraic xs = m / (Rational(2)*a_diff);

if (n_ys == 1) {
// intersection is a point
Expand Down Expand Up @@ -340,7 +340,7 @@ class Env_sphere_traits_3 : public ConicTraits_2 {
}
if (n_xs == 1) {
// intersection is a point
Point_2 inter_point(xs[0], (-2*a_diff*xs[0] + m)/(2*b_diff) );
Point_2 inter_point(xs[0], (-Rational(2)*a_diff*xs[0] + m)/(Rational(2)*b_diff) );
*o++ = inter_point;
return o;
}
Expand All @@ -350,8 +350,8 @@ class Env_sphere_traits_3 : public ConicTraits_2 {
// so we construct a COLLINEAR conic (with equation as in (1))
// with 2 endpoints
Algebraic ys[2];
ys[0] = (-2*a_diff*xs[0] + m)/(2*b_diff);
ys[1] = (-2*a_diff*xs[1] + m)/(2*b_diff);
ys[0] = (-Rational(2)*a_diff*xs[0] + m)/(Rational(2)*b_diff);
ys[1] = (-Rational(2)*a_diff*xs[1] + m)/(Rational(2)*b_diff);

Alg_point_2 end1(xs[0], ys[0]);
Alg_point_2 end2(xs[1], ys[1]);
Expand Down Expand Up @@ -977,10 +977,10 @@ class Env_sphere_traits_3 : public ConicTraits_2 {
const Rational& u = cv.u();
const Rational& v = cv.v();
// const Rational& w = cv.w(); // unused
Algebraic m = -1 * (2*r*x0 + t*y0 + u);
Algebraic n = 2*s*y0 + t*x0 + v;
Algebraic m = -1 * (Rational(2)*r*x0 + t*y0 + u);
Algebraic n = Rational(2)*s*y0 + t*x0 + v;
// line coefficients: A3, B3, C3
Algebraic A3 = -1*m, B3 = n, C3 = m*x0 - n*y0;
Algebraic A3 = -m, B3 = n, C3 = m*x0 - n*y0;

// the tangences of the spheres (in point (x0,y0,z0)):
Algebraic z0 = compute_envelope_z_in_point(cv_point, s1);
Expand Down Expand Up @@ -1077,8 +1077,8 @@ class Env_sphere_traits_3 : public ConicTraits_2 {
Algebraic x_diff = x1 - a, y_diff = y1 - b;
// the coefficients are:
Algebraic A = 1;
Algebraic B = -2*c;
Algebraic C = x_diff*x_diff + y_diff*y_diff + c*c - sqr_r;
Algebraic B = -Rational(2)*c;
Algebraic C = x_diff*x_diff + y_diff*y_diff + Algebraic(c*c - sqr_r);

Algebraic zs[2];
Algebraic* zs_end;
Expand Down
1 change: 0 additions & 1 deletion Number_types/test/Number_types/ioformat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ int main()

// CORE
#ifdef CGAL_USE_CORE
static_assert(CGAL::Output_rep<CORE::BigRat>::is_specialized == true);
//bug in io for CORE.
test_it<CORE::BigInt>("CORE::BigInt");
test_it<CORE::BigRat>("CORE::BigRat");
Expand Down

0 comments on commit 432449b

Please sign in to comment.