Skip to content

Commit

Permalink
Fixed compile warnings related to deprecated std::bind1st, and surrou…
Browse files Browse the repository at this point in the history
…nding whitespace
  • Loading branch information
dtebbs committed Oct 4, 2021
1 parent 2139889 commit 25b9296
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 8 deletions.
12 changes: 8 additions & 4 deletions libfqfft/polynomial_arithmetic/basic_operations.tcc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Implementation of interfaces for basic polynomial operation routines.
See basic_operations.hpp .
*****************************************************************************
* @author This file is part of libfqfft, developed by SCIPR Lab
* and contributors (see AUTHORS).
Expand Down Expand Up @@ -75,7 +75,7 @@ void _polynomial_addition(std::vector<FieldT> &c, const std::vector<FieldT> &a,
std::copy(b.begin() + a_size, b.end(), c.begin() + a_size);
}
}

_condense(c);
}

Expand All @@ -95,7 +95,7 @@ void _polynomial_subtraction(std::vector<FieldT> &c, const std::vector<FieldT> &
{
size_t a_size = a.size();
size_t b_size = b.size();

if (a_size > b_size)
{
c.resize(a_size);
Expand Down Expand Up @@ -148,7 +148,11 @@ void _polynomial_multiplication_on_fft(std::vector<FieldT> &c, const std::vector
#endif

const FieldT sconst = FieldT(n).inverse();
std::transform(c.begin(), c.end(), c.begin(), std::bind1st(std::multiplies<FieldT>(), sconst));
std::transform(
c.begin(),
c.end(),
c.begin(),
std::bind(std::multiplies<FieldT>(), sconst, std::placeholders::_1));
_condense(c);
}

Expand Down
20 changes: 16 additions & 4 deletions libfqfft/polynomial_arithmetic/xgcd.tcc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Implementation of interfaces for extended GCD routines.
See xgcd.hpp .
*****************************************************************************
* @author This file is part of libfqfft, developed by SCIPR Lab
* and contributors (see AUTHORS).
Expand Down Expand Up @@ -58,9 +58,21 @@ void _polynomial_xgcd(const std::vector<FieldT> &a, const std::vector<FieldT> &b
_polynomial_division(V1, R, V3, b);

FieldT lead_coeff = G.back().inverse();
std::transform(G.begin(), G.end(), G.begin(), std::bind1st(std::multiplies<FieldT>(), lead_coeff));
std::transform(U.begin(), U.end(), U.begin(), std::bind1st(std::multiplies<FieldT>(), lead_coeff));
std::transform(V1.begin(), V1.end(), V1.begin(), std::bind1st(std::multiplies<FieldT>(), lead_coeff));
std::transform(
G.begin(),
G.end(),
G.begin(),
std::bind(std::multiplies<FieldT>(), lead_coeff, std::placeholders::_1));
std::transform(
U.begin(),
U.end(),
U.begin(),
std::bind(std::multiplies<FieldT>(), lead_coeff, std::placeholders::_1));
std::transform(
V1.begin(),
V1.end(),
V1.begin(),
std::bind(std::multiplies<FieldT>(), lead_coeff, std::placeholders::_1));

g = G;
u = U;
Expand Down

0 comments on commit 25b9296

Please sign in to comment.