Skip to content

Commit

Permalink
clang formatted
Browse files Browse the repository at this point in the history
  • Loading branch information
nindanaoto committed Aug 23, 2024
1 parent d825221 commit 5207698
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
21 changes: 12 additions & 9 deletions include/mulfft.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,10 +152,10 @@ inline void TwistIFFTUInt(PolynomialInFD<P> &res, const Polynomial<P> &a)
if constexpr (std::is_same_v<typename P::T, uint32_t>)
fftplvl1.execute_reverse_uint(res.data(), a.data());
// if constexpr (std::is_same_v<typename P::T, uint64_t>)
// fftplvl1.execute_reverse_torus64(res.data(), a.data());
// fftplvl1.execute_reverse_torus64(res.data(), a.data());
}
// else if constexpr (std::is_same_v<typename P::T, uint64_t>)
// fftplvl2.execute_reverse_torus64(res.data(), a.data());
// fftplvl2.execute_reverse_torus64(res.data(), a.data());
else
static_assert(false_v<typename P::T>, "Undefined TwistIFFT!");
}
Expand Down Expand Up @@ -316,8 +316,7 @@ inline void PolyMul(Polynomial<P> &res, const Polynomial<P> &a,
}

template <class P>
inline void PolyMulRescaleUnsigned(Polynomial<P> &res,
const Polynomial<P> &a,
inline void PolyMulRescaleUnsigned(Polynomial<P> &res, const Polynomial<P> &a,
const Polynomial<P> &b)
{
// if constexpr (std::is_same_v<typename P::T, uint32_t>) {
Expand Down Expand Up @@ -350,16 +349,20 @@ inline void PolyMulNaive(Polynomial<P> &res, const Polynomial<P> &a,
}

template <class P>
inline void PolyMulNaieveRescaleUnsigned(Polynomial<P> &res, const Polynomial<P> &a,
const Polynomial<P> &b)
inline void PolyMulNaieveRescaleUnsigned(Polynomial<P> &res,
const Polynomial<P> &a,
const Polynomial<P> &b)
{
for (int i = 0; i < P::n; i++) {
__int128_t ri = 0;
for (int j = 0; j <= i; j++)
ri += static_cast<__int128_t>(a[j]) * static_cast<__int128_t>(b[i - j]);
ri += static_cast<__int128_t>(a[j]) *
static_cast<__int128_t>(b[i - j]);
for (int j = i + 1; j < P::n; j++)
ri -= static_cast<__int128_t>(a[j]) * static_cast<__int128_t>(b[P::n + i - j]);
// res[i] = static_cast<typename P::T>((ri) >> (std::numeric_limits<typename P::T>::digits - 3));
ri -= static_cast<__int128_t>(a[j]) *
static_cast<__int128_t>(b[P::n + i - j]);
// res[i] = static_cast<typename P::T>((ri) >>
// (std::numeric_limits<typename P::T>::digits - 3));
res[i] = static_cast<typename P::T>((ri) >> 29);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ void FFT_Processor_Spqliox_AArch64::execute_reverse_int(double *res,
}

void FFT_Processor_Spqliox_AArch64::execute_reverse_uint(double *res,
const uint32_t *a)
const uint32_t *a)
{
for (size_t i = 0; i < N; i++) real_inout[i] = (double)a[i];

Expand Down Expand Up @@ -264,7 +264,6 @@ void FFT_Processor_Spqliox_AArch64::execute_direct_torus64_rescale(
res[i] = uint64_t(int64_t(real_inout[i] / Δ));
}


void FFT_Processor_Spqliox_AArch64::execute_direct_torus64(uint64_t *res,
const double *a)
{
Expand Down

0 comments on commit 5207698

Please sign in to comment.