Skip to content

Commit

Permalink
Algebraic_kernel_d: replace new/delete
Browse files Browse the repository at this point in the history
  • Loading branch information
afabri committed Mar 21, 2024
1 parent e4c9cfd commit be1e075
Showing 1 changed file with 12 additions and 15 deletions.
27 changes: 12 additions & 15 deletions Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Descartes.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,9 @@ class Descartes {

Polynomial poly_;
int number_of_real_roots_;
IT* numerator;
IT* denominator_exponent;
bool* is_exact;
std::vector<IT> numerator;
std::vector<IT> denominator_exponent;
std::vector<bool> is_exact;
IT LEFT,SCALE,DENOM;
bool is_strong_;
int k;
Expand All @@ -91,9 +91,9 @@ class Descartes {
k(kk),
interval_given(false) {

numerator = new IT[CGAL::degree(P)];
denominator_exponent = new IT[CGAL::degree(P)];
is_exact = new bool[CGAL::degree(P)];
numerator.resize(CGAL::degree(P));
denominator_exponent.resize(CGAL::degree(P));
is_exact.resize(CGAL::degree(P));
number_of_real_roots_ = 0;
if(CGAL::degree(P) == 0)
{
Expand All @@ -116,9 +116,9 @@ class Descartes {
k(kk),
interval_given(true) {

numerator = new IT[CGAL::degree(P)];
denominator_exponent = new IT[CGAL::degree(P)];
is_exact = new bool[CGAL::degree(P)];
numerator.resize(CGAL::degree(P));
denominator_exponent.resize(CGAL::degree(P));
is_exact.resize(CGAL::degree(P));
number_of_real_roots_ = 0;
if(CGAL::degree(P) == 0)
{
Expand Down Expand Up @@ -153,9 +153,9 @@ class Descartes {
k(D.k),
interval_given(D.interval_given) {

numerator = new IT[CGAL::degree(poly_)];
denominator_exponent = new IT[CGAL::degree(poly_)];
is_exact = new bool[CGAL::degree(poly_)];
numerator.resize(CGAL::degree(poly_));
denominator_exponent.resize(CGAL::degree(poly_));
is_exact.resize(CGAL::degree(poly_));
for(int i=0; i<number_of_real_roots(); i++)
{
numerator[i] = D.numerator[i];
Expand All @@ -166,9 +166,6 @@ class Descartes {

// destructor
~Descartes() {
delete[] numerator;
delete[] denominator_exponent;
delete[] is_exact;
}

public: // functions
Expand Down

0 comments on commit be1e075

Please sign in to comment.