Skip to content

Commit

Permalink
more clang fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmed-irfan committed Dec 17, 2024
1 parent 8a6f684 commit 1f2bf29
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 2 additions & 0 deletions src/polyxx/polynomial.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,7 @@ namespace poly {
for (std::size_t i = 0; i < size; ++i) {
res.emplace_back(tmp[i]);
}
tmp.clear();
return res;
}

Expand All @@ -400,6 +401,7 @@ namespace poly {
for (std::size_t i = 0; i < size; ++i) {
res.emplace_back(tmp[i]);
}
tmp.clear();
return res;
}

Expand Down
9 changes: 6 additions & 3 deletions src/polyxx/upolynomial.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,16 +100,19 @@ namespace poly {
}

std::vector<Integer> coefficients(const UPolynomial& p) {
lp_integer_t coeffs[degree(p) + 1];
std::vector<lp_integer_t> coeffs;
lp_integer_t *tmp = nullptr;
for (std::size_t i = 0; i < degree(p) + 1; ++i) {
lp_integer_construct_from_int(lp_Z, &coeffs[i], 0);
lp_integer_construct_from_int(lp_Z, tmp, 0);
coeffs.push_back(*tmp);
}
lp_upolynomial_unpack(p.get_internal(), coeffs);
lp_upolynomial_unpack(p.get_internal(), coeffs.data());
std::vector<Integer> res;
for (std::size_t i = 0; i < degree(p) + 1; ++i) {
res.emplace_back(&coeffs[i]);
lp_integer_destruct(&coeffs[i]);
}
coeffs.clear();
return res;
}

Expand Down

0 comments on commit 1f2bf29

Please sign in to comment.