Skip to content

Commit 20fc9bf

Browse files
committed
Style consistency
1 parent 5d1b6a6 commit 20fc9bf

File tree

6 files changed

+39
-33
lines changed

6 files changed

+39
-33
lines changed

libfqfft/evaluation_domain/domains/arithmetic_sequence_domain.tcc

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,13 @@ namespace libfqfft {
2626
template<typename FieldT>
2727
bool arithmetic_sequence_domain<FieldT>::valid_for_size(const size_t m)
2828
{
29-
if (m <=1)
30-
return false;
29+
if (m <=1) {
30+
return false;
31+
}
3132

32-
if (FieldT::arithmetic_generator() == FieldT::zero())
33-
return false;
33+
if (FieldT::arithmetic_generator() == FieldT::zero()) {
34+
return false;
35+
}
3436

3537
return true;
3638
}
@@ -54,7 +56,7 @@ void arithmetic_sequence_domain<FieldT>::FFT(std::vector<FieldT> &a)
5456

5557
/* Monomial to Newton */
5658
monomial_to_newton_basis(a, this->subproduct_tree, this->m);
57-
59+
5860
/* Newton to Evaluation */
5961
std::vector<FieldT> S(this->m); /* i! * arithmetic_generator */
6062
S[0] = FieldT::one();
@@ -82,7 +84,7 @@ template<typename FieldT>
8284
void arithmetic_sequence_domain<FieldT>::iFFT(std::vector<FieldT> &a)
8385
{
8486
if (a.size() != this->m) throw DomainSizeException("arithmetic: expected a.size() == this->m");
85-
87+
8688
if (!this->precomputation_sentinel) do_precomputation();
8789

8890
/* Interpolation to Newton */
@@ -164,7 +166,7 @@ std::vector<FieldT> arithmetic_sequence_domain<FieldT>::evaluate_all_lagrange_po
164166

165167
std::vector<FieldT> w(this->m);
166168
w[0] = g_vanish.inverse() * (this->arithmetic_generator^(this->m-1));
167-
169+
168170
l[0] = l_vanish * l[0].inverse() * w[0];
169171
for (size_t i = 1; i < this->m; i++)
170172
{

libfqfft/evaluation_domain/domains/basic_radix2_domain.tcc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ bool basic_radix2_domain<FieldT>::valid_for_size(const size_t m)
3737
return false;
3838
}
3939

40-
if( get_root_of_unity_will_throw<FieldT>(m) )
40+
if (get_root_of_unity_will_throw<FieldT>(m))
4141
return false;
4242

4343
return true;

libfqfft/evaluation_domain/domains/extended_radix2_domain.tcc

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,21 +20,23 @@ namespace libfqfft {
2020
template<typename FieldT>
2121
bool extended_radix2_domain<FieldT>::valid_for_size(const size_t m)
2222
{
23-
if ( m <= 1 )
23+
if (m <= 1) {
2424
return false;
25+
}
2526

2627
// Will `get_root_of_unity` throw?
2728
if (!std::is_same<FieldT, libff::Double>::value)
2829
{
2930
const size_t logm = libff::log2(m);
3031

31-
if (logm != (FieldT::s + 1))
32+
if (logm != (FieldT::s + 1)) {
3233
return false;
34+
}
3335
}
3436

3537
size_t small_m = m / 2;
3638

37-
if( get_root_of_unity_will_throw<FieldT>(small_m) )
39+
if (get_root_of_unity_will_throw<FieldT>(small_m))
3840
return false;
3941

4042
return true;

libfqfft/evaluation_domain/domains/geometric_sequence_domain.tcc

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,15 @@ namespace libfqfft {
2626
template<typename FieldT>
2727
bool geometric_sequence_domain<FieldT>::valid_for_size(const size_t m)
2828
{
29-
if ( m <= 1 )
30-
return false;
29+
if ( m <= 1 ) {
30+
return false;
31+
}
3132

32-
if (FieldT::geometric_generator() == FieldT::zero())
33-
return false;
33+
if (FieldT::geometric_generator() == FieldT::zero()) {
34+
return false;
35+
}
3436

35-
return true;
37+
return true;
3638
}
3739

3840
template<typename FieldT>
@@ -41,13 +43,13 @@ geometric_sequence_domain<FieldT>::geometric_sequence_domain(const size_t m) : e
4143
if (m <= 1) throw InvalidSizeException("geometric(): expected m > 1");
4244
if (FieldT::geometric_generator() == FieldT::zero())
4345
throw InvalidSizeException("geometric(): expected FieldT::geometric_generator() != FieldT::zero()");
44-
46+
4547
precomputation_sentinel = 0;
4648
}
4749

4850
template<typename FieldT>
4951
void geometric_sequence_domain<FieldT>::FFT(std::vector<FieldT> &a)
50-
{
52+
{
5153
if (a.size() != this->m) throw DomainSizeException("geometric: expected a.size() == this->m");
5254

5355
if (!this->precomputation_sentinel) do_precomputation();
@@ -83,7 +85,7 @@ template<typename FieldT>
8385
void geometric_sequence_domain<FieldT>::iFFT(std::vector<FieldT> &a)
8486
{
8587
if (a.size() != this->m) throw DomainSizeException("geometric: expected a.size() == this->m");
86-
88+
8789
if (!this->precomputation_sentinel) do_precomputation();
8890

8991
/* Interpolation to Newton */

libfqfft/evaluation_domain/domains/step_radix2_domain.tcc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ namespace libfqfft {
2020
template<typename FieldT>
2121
bool step_radix2_domain<FieldT>::valid_for_size(const size_t m)
2222
{
23-
if ( m <= 1 )
23+
if (m <= 1)
2424
return false;
2525

2626
const size_t big_m = 1ul<<(libff::log2(m)-1);
@@ -30,11 +30,11 @@ bool step_radix2_domain<FieldT>::valid_for_size(const size_t m)
3030
return false;
3131

3232
// omega
33-
if( get_root_of_unity_will_throw<FieldT>(1ul<<libff::log2(m)) )
33+
if (get_root_of_unity_will_throw<FieldT>(1ul<<libff::log2(m)))
3434
return false;
3535

3636
// small_omega
37-
if( get_root_of_unity_will_throw<FieldT>(1ul<<libff::log2(small_m)) )
37+
if (get_root_of_unity_will_throw<FieldT>(1ul<<libff::log2(small_m)))
3838
return false;
3939

4040
return true;
@@ -53,7 +53,7 @@ step_radix2_domain<FieldT>::step_radix2_domain(const size_t m) : evaluation_doma
5353

5454
try { omega = libff::get_root_of_unity<FieldT>(1ul<<libff::log2(m)); }
5555
catch (const std::invalid_argument& e) { throw DomainSizeException(e.what()); }
56-
56+
5757
big_omega = omega.squared();
5858
small_omega = libff::get_root_of_unity<FieldT>(small_m);
5959
}

libfqfft/evaluation_domain/get_evaluation_domain.tcc

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -38,28 +38,28 @@ std::shared_ptr<evaluation_domain<FieldT> > get_evaluation_domain(const size_t m
3838
const size_t small = min_size - big;
3939
const size_t rounded_small = (1ul<<libff::log2(small));
4040

41-
if ( basic_radix2_domain<FieldT>::valid_for_size(min_size) ) {
42-
result.reset(new basic_radix2_domain<FieldT>(min_size));
41+
if (basic_radix2_domain<FieldT>::valid_for_size(min_size)) {
42+
result.reset(new basic_radix2_domain<FieldT>(min_size));
4343
}
44-
else if ( extended_radix2_domain<FieldT>::valid_for_size(min_size) ) {
44+
else if (extended_radix2_domain<FieldT>::valid_for_size(min_size)) {
4545
result.reset(new extended_radix2_domain<FieldT>(min_size));
4646
}
47-
else if ( step_radix2_domain<FieldT>::valid_for_size(min_size) ) {
47+
else if (step_radix2_domain<FieldT>::valid_for_size(min_size)) {
4848
result.reset(new step_radix2_domain<FieldT>(min_size));
4949
}
50-
else if ( basic_radix2_domain<FieldT>::valid_for_size(big + rounded_small) ) {
50+
else if (basic_radix2_domain<FieldT>::valid_for_size(big + rounded_small)) {
5151
result.reset(new basic_radix2_domain<FieldT>(big + rounded_small));
5252
}
53-
else if ( extended_radix2_domain<FieldT>::valid_for_size(big + rounded_small) ) {
54-
result.reset(new extended_radix2_domain<FieldT>(big + rounded_small));
53+
else if (extended_radix2_domain<FieldT>::valid_for_size(big + rounded_small)) {
54+
result.reset(new extended_radix2_domain<FieldT>(big + rounded_small));
5555
}
56-
else if ( step_radix2_domain<FieldT>::valid_for_size(big + rounded_small) ) {
56+
else if (step_radix2_domain<FieldT>::valid_for_size(big + rounded_small)) {
5757
result.reset(new step_radix2_domain<FieldT>(big + rounded_small));
5858
}
59-
else if ( geometric_sequence_domain<FieldT>::valid_for_size(min_size) ) {
59+
else if (geometric_sequence_domain<FieldT>::valid_for_size(min_size)) {
6060
result.reset(new geometric_sequence_domain<FieldT>(min_size));
6161
}
62-
else if ( arithmetic_sequence_domain<FieldT>::valid_for_size(min_size) ) {
62+
else if (arithmetic_sequence_domain<FieldT>::valid_for_size(min_size)) {
6363
result.reset(new arithmetic_sequence_domain<FieldT>(min_size));
6464
}
6565
else {

0 commit comments

Comments
 (0)