Skip to content

Commit 01c5201

Browse files
authored
Merge pull request #4 from popoffka/sort-includes
Ensure everything compiles individually & sort includes
2 parents 43c472e + b844c27 commit 01c5201

19 files changed

+73
-48
lines changed

libfqfft/evaluation_domain/domains/basic_radix2_domain.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
#ifndef BASIC_RADIX2_DOMAIN_HPP_
1515
#define BASIC_RADIX2_DOMAIN_HPP_
1616

17+
#include <vector>
18+
1719
#include <libfqfft/evaluation_domain/evaluation_domain.hpp>
1820

1921
namespace libfqfft {

libfqfft/evaluation_domain/domains/basic_radix2_domain.tcc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@
1414
#ifndef BASIC_RADIX2_DOMAIN_TCC_
1515
#define BASIC_RADIX2_DOMAIN_TCC_
1616

17+
#include <libff/algebra/fields/field_utils.hpp>
18+
#include <libff/common/double.hpp>
19+
#include <libff/common/utils.hpp>
20+
1721
#include <libfqfft/evaluation_domain/domains/basic_radix2_domain_aux.hpp>
1822

1923
namespace libfqfft {

libfqfft/evaluation_domain/domains/basic_radix2_domain_aux.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
#ifndef BASIC_RADIX2_DOMAIN_AUX_HPP_
1616
#define BASIC_RADIX2_DOMAIN_AUX_HPP_
1717

18+
#include <vector>
19+
1820
namespace libfqfft {
1921

2022
/**

libfqfft/evaluation_domain/domains/basic_radix2_domain_aux.tcc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#define BASIC_RADIX2_DOMAIN_AUX_TCC_
1616

1717
#include <algorithm>
18+
#include <vector>
1819

1920
#ifdef MULTICORE
2021
#include <omp.h>
@@ -24,6 +25,10 @@
2425

2526
#include <libfqfft/tools/exceptions.hpp>
2627

28+
#ifdef DEBUG
29+
#include <libff/common/profiling.hpp>
30+
#endif
31+
2732
namespace libfqfft {
2833

2934
#ifdef MULTICORE

libfqfft/evaluation_domain/evaluation_domain.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
#define EVALUATION_DOMAIN_HPP_
2828

2929
#include <memory>
30+
#include <vector>
3031

3132
namespace libfqfft {
3233

libfqfft/evaluation_domain/evaluation_domain.tcc

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,11 @@
1919
#ifndef EVALUATION_DOMAIN_TCC_
2020
#define EVALUATION_DOMAIN_TCC_
2121

22+
#include <libfqfft/evaluation_domain/domains/arithmetic_sequence_domain.hpp>
2223
#include <libfqfft/evaluation_domain/domains/basic_radix2_domain.hpp>
2324
#include <libfqfft/evaluation_domain/domains/extended_radix2_domain.hpp>
24-
#include <libfqfft/evaluation_domain/domains/step_radix2_domain.hpp>
25-
#include <libfqfft/evaluation_domain/domains/arithmetic_sequence_domain.hpp>
2625
#include <libfqfft/evaluation_domain/domains/geometric_sequence_domain.hpp>
27-
26+
#include <libfqfft/evaluation_domain/domains/step_radix2_domain.hpp>
2827
#include <libfqfft/tools/exceptions.hpp>
2928

3029
namespace libfqfft {

libfqfft/kronecker_substitution/kronecker_substitution.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
#ifndef KRONECKER_SUBSTITUTION_HPP_
1313
#define KRONECKER_SUBSTITUTION_HPP_
1414

15+
#include <vector>
16+
1517
namespace libfqfft {
1618

1719
/**

libfqfft/kronecker_substitution/kronecker_substitution.tcc

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,10 @@
1515
#define KRONECKER_SUBSTITUTION_TCC_
1616

1717
#include <algorithm>
18-
#include <math.h>
18+
#include <cmath>
1919

20-
#define GMP_LIMB_BITS 64
20+
#include <gmp.h>
21+
#include <libff/common/utils.hpp>
2122

2223
namespace libfqfft {
2324

@@ -44,7 +45,7 @@ void kronecker_substitution(std::vector<FieldT> &v3, const std::vector<FieldT> &
4445
/* Output polynomial */
4546
v3.resize(n3, FieldT::zero());
4647

47-
/*
48+
/*
4849
* Allocate all MP_LIMB_T space once and store the reference pointer M1
4950
* to free memory afterwards. P1, P2, and P3 will remain fixed pointers
5051
* to the start of their respective polynomials as reference.
@@ -72,7 +73,7 @@ void kronecker_substitution(std::vector<FieldT> &v3, const std::vector<FieldT> &
7273
val = v1[i].as_ulong();
7374
limb += (val << limb_b);
7475

75-
/*
76+
/*
7677
* If the next iteration of LIMB_B is >= to the GMP_LIMB_BITS, then
7778
* write it out to MP_LIMB_T* and reset LIMB. If VAL has remaining
7879
* bits due to GMP_LIMB_BITS boundary, set it in LIMB and proceed.
@@ -99,7 +100,7 @@ void kronecker_substitution(std::vector<FieldT> &v3, const std::vector<FieldT> &
99100
val = v2[i].as_ulong();
100101
limb += (val << limb_b);
101102

102-
/*
103+
/*
103104
* If the next iteration of LIMB_B is >= to the GMP_LIMB_BITS, then
104105
* write it out to MP_LIMB_T* and reset LIMB. If VAL has remaining
105106
* bits due to GMP_LIMB_BITS boundary, set it in LIMB and proceed.
@@ -130,7 +131,7 @@ void kronecker_substitution(std::vector<FieldT> &v3, const std::vector<FieldT> &
130131
limb_b = 0;
131132
for (size_t i = 0; i < n3; i++)
132133
{
133-
/*
134+
/*
134135
* If the coefficient's bit length is contained in LIMB, then
135136
* write the masked value out to vector V3 and decrement LIMB
136137
* by B bits.
@@ -142,7 +143,7 @@ void kronecker_substitution(std::vector<FieldT> &v3, const std::vector<FieldT> &
142143
delta = b;
143144
delta_b = limb_b - delta;
144145
}
145-
/*
146+
/*
146147
* If the remaining coefficient is across two LIMBs, then write
147148
* to vector V3 the current limb's value and add upper bits from
148149
* the second part. Lastly, decrement LIMB by the coefficient's

libfqfft/polynomial_arithmetic/basic_operations.hpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*****************************************************************************
44
55
Declaration of interfaces for basic polynomial operation routines.
6-
6+
77
*****************************************************************************
88
* @author This file is part of libfqfft, developed by SCIPR Lab
99
* and contributors (see AUTHORS).
@@ -13,6 +13,8 @@
1313
#ifndef BASIC_OPERATIONS_HPP_
1414
#define BASIC_OPERATIONS_HPP_
1515

16+
#include <vector>
17+
1618
namespace libfqfft {
1719

1820
/**

libfqfft/polynomial_arithmetic/basis_change.hpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
*****************************************************************************
33
44
Declaration of interfaces for basis change routines.
5-
5+
66
*****************************************************************************
77
* @author This file is part of libfqfft, developed by SCIPR Lab
88
* and contributors (see AUTHORS).
@@ -12,6 +12,8 @@
1212
#ifndef BASIS_CHANGE_HPP_
1313
#define BASIS_CHANGE_HPP_
1414

15+
#include <vector>
16+
1517
namespace libfqfft {
1618

1719
/**

libfqfft/polynomial_arithmetic/basis_change.tcc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,10 @@
1515
#define BASIS_CHANGE_TCC_
1616

1717
#include <algorithm>
18+
19+
#include <libfqfft/evaluation_domain/domains/basic_radix2_domain_aux.hpp>
1820
#include <libfqfft/polynomial_arithmetic/basic_operations.hpp>
1921
#include <libfqfft/polynomial_arithmetic/xgcd.hpp>
20-
#include <libfqfft/evaluation_domain/domains/basic_radix2_domain_aux.hpp>
2122

2223
namespace libfqfft {
2324

libfqfft/polynomial_arithmetic/naive_evaluate.hpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
*****************************************************************************
33
44
Declaration of interfaces for naive evaluation routines.
5-
5+
66
*****************************************************************************
77
* @author This file is part of libfqfft, developed by SCIPR Lab
88
* and contributors (see AUTHORS).
@@ -12,6 +12,10 @@
1212
#ifndef NAIVE_EVALUATE_HPP_
1313
#define NAIVE_EVALUATE_HPP_
1414

15+
#include <vector>
16+
17+
#include <libfqfft/tools/exceptions.hpp>
18+
1519
namespace libfqfft {
1620

1721
/**

libfqfft/polynomial_arithmetic/xgcd.hpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
*****************************************************************************
33
44
Declaration of interfaces for extended GCD routines.
5-
5+
66
*****************************************************************************
77
* @author This file is part of libfqfft, developed by SCIPR Lab
88
* and contributors (see AUTHORS).
@@ -12,6 +12,8 @@
1212
#ifndef XGCD_HPP_
1313
#define XGCD_HPP_
1414

15+
#include <vector>
16+
1517
namespace libfqfft {
1618

1719
/**

libfqfft/polynomial_arithmetic/xgcd.tcc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,9 @@
1515
#define XGCD_TCC_
1616

1717
#include <algorithm>
18-
#include <libfqfft/polynomial_arithmetic/basic_operations.hpp>
18+
1919
#include <libfqfft/evaluation_domain/domains/basic_radix2_domain_aux.hpp>
20+
#include <libfqfft/polynomial_arithmetic/basic_operations.hpp>
2021

2122
namespace libfqfft {
2223

libfqfft/profiling/profile/profile.cpp

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,28 +9,27 @@
99
* @copyright MIT license (see LICENSE file)
1010
*****************************************************************************/
1111

12+
#ifndef PROFILE_OP_COUNTS
13+
#error PROFILE_OP_COUNTS must be defined to build this profiler.
14+
#endif
15+
16+
#include <cstdint>
17+
#include <cstdio>
18+
#include <cstdlib>
19+
#include <cstring>
1220
#include <ctime>
13-
#include <iostream>
1421
#include <fstream>
15-
#include <omp.h>
22+
#include <iostream>
1623
#include <sstream>
17-
#include <stdio.h>
18-
#include <string.h>
19-
#include <stdint.h>
20-
#include <stdlib.h>
24+
#include <vector>
2125
#include <sys/resource.h>
2226
#include <unistd.h>
23-
#include <vector>
2427

2528
#include <libff/algebra/curves/edwards/edwards_pp.hpp>
2629
#include <libff/common/double.hpp>
30+
#include <omp.h>
2731

28-
#include <libfqfft/evaluation_domain/evaluation_domain.hpp>
29-
#include <libfqfft/evaluation_domain/domains/basic_radix2_domain.hpp>
30-
#include <libfqfft/evaluation_domain/domains/extended_radix2_domain.hpp>
31-
#include <libfqfft/evaluation_domain/domains/step_radix2_domain.hpp>
32-
#include <libfqfft/evaluation_domain/domains/geometric_sequence_domain.hpp>
33-
#include <libfqfft/evaluation_domain/domains/arithmetic_sequence_domain.hpp>
32+
#include <libfqfft/evaluation_domain/evaluation_domain.hpp> // this also includes all children of evaluation_domain
3433

3534
using namespace libfqfft;
3635

libfqfft/profiling/profiling_menu.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,18 @@
1111

1212
#include <cmath>
1313
#include <ctime>
14-
#include <dirent.h>
15-
#include <iostream>
1614
#include <fstream>
15+
#include <iostream>
1716
#include <sstream>
18-
#include <stdio.h>
19-
#include <string.h>
17+
#include <vector>
18+
19+
#include <dirent.h>
2020
#include <stdint.h>
21+
#include <stdio.h>
2122
#include <stdlib.h>
23+
#include <string.h>
2224
#include <sys/resource.h>
2325
#include <unistd.h>
24-
#include <vector>
2526

2627
/* Level 2: Profile */
2728
void profile()

libfqfft/tests/evaluation_domain_test.cpp

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,13 @@
55
* @copyright MIT license (see LICENSE file)
66
*****************************************************************************/
77

8-
#include <gtest/gtest.h>
9-
#include <stdint.h>
108
#include <vector>
119

10+
#include <gtest/gtest.h>
1211
#include <libff/algebra/curves/mnt/mnt4/mnt4_pp.hpp>
12+
#include <stdint.h>
1313

14-
#include <libfqfft/evaluation_domain/evaluation_domain.hpp>
15-
#include <libfqfft/evaluation_domain/domains/basic_radix2_domain.hpp>
16-
#include <libfqfft/evaluation_domain/domains/extended_radix2_domain.hpp>
17-
#include <libfqfft/evaluation_domain/domains/step_radix2_domain.hpp>
18-
#include <libfqfft/evaluation_domain/domains/geometric_sequence_domain.hpp>
19-
#include <libfqfft/evaluation_domain/domains/arithmetic_sequence_domain.hpp>
14+
#include <libfqfft/evaluation_domain/evaluation_domain.hpp> // this also includes all children of evaluation_domain
2015
#include <libfqfft/polynomial_arithmetic/naive_evaluate.hpp>
2116
#include <libfqfft/tools/exceptions.hpp>
2217

@@ -78,7 +73,7 @@ namespace libfqfft {
7873
}
7974
}
8075
}
81-
76+
8277
TYPED_TEST(EvaluationDomainTest, InverseFFTofFFT) {
8378

8479
const size_t m = 4;
@@ -111,7 +106,7 @@ namespace libfqfft {
111106
catch(const InvalidSizeException &e)
112107
{
113108
printf("%s - skipping\n", e.what());
114-
}
109+
}
115110
}
116111
}
117112

@@ -161,7 +156,7 @@ namespace libfqfft {
161156
std::shared_ptr<evaluation_domain<TypeParam> > domain;
162157
for (int key = 0; key < 5; key++)
163158
{
164-
159+
165160
try
166161
{
167162
if (key == 0) domain.reset(new basic_radix2_domain<TypeParam>(m));
@@ -198,7 +193,7 @@ namespace libfqfft {
198193
}
199194

200195
TYPED_TEST(EvaluationDomainTest, ComputeZ) {
201-
196+
202197
const size_t m = 8;
203198
TypeParam t = TypeParam(10);
204199

libfqfft/tests/kronecker_substitution_test.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@
55
* @copyright MIT license (see LICENSE file)
66
*****************************************************************************/
77

8+
#include <vector>
9+
810
#include <gtest/gtest.h>
911
#include <stdint.h>
10-
#include <vector>
1112

1213
#include <libfqfft/polynomial_arithmetic/basic_operations.hpp>
1314

libfqfft/tests/polynomial_arithmetic_test.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@
55
* @copyright MIT license (see LICENSE file)
66
*****************************************************************************/
77

8+
#include <vector>
9+
810
#include <gtest/gtest.h>
911
#include <stdint.h>
10-
#include <vector>
1112

1213
#include <libfqfft/polynomial_arithmetic/basic_operations.hpp>
1314
#include <libfqfft/polynomial_arithmetic/xgcd.hpp>

0 commit comments

Comments
 (0)