Skip to content

Ensure everything compiles individually & sort includes #4

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 27, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions libfqfft/evaluation_domain/domains/basic_radix2_domain.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
#ifndef BASIC_RADIX2_DOMAIN_HPP_
#define BASIC_RADIX2_DOMAIN_HPP_

#include <vector>

#include <libfqfft/evaluation_domain/evaluation_domain.hpp>

namespace libfqfft {
Expand Down
4 changes: 4 additions & 0 deletions libfqfft/evaluation_domain/domains/basic_radix2_domain.tcc
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@
#ifndef BASIC_RADIX2_DOMAIN_TCC_
#define BASIC_RADIX2_DOMAIN_TCC_

#include <libff/algebra/fields/field_utils.hpp>
#include <libff/common/double.hpp>
#include <libff/common/utils.hpp>

#include <libfqfft/evaluation_domain/domains/basic_radix2_domain_aux.hpp>

namespace libfqfft {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
#ifndef BASIC_RADIX2_DOMAIN_AUX_HPP_
#define BASIC_RADIX2_DOMAIN_AUX_HPP_

#include <vector>

namespace libfqfft {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#define BASIC_RADIX2_DOMAIN_AUX_TCC_

#include <algorithm>
#include <vector>

#ifdef MULTICORE
#include <omp.h>
Expand All @@ -24,6 +25,10 @@

#include <libfqfft/tools/exceptions.hpp>

#ifdef DEBUG
#include <libff/common/profiling.hpp>
#endif

namespace libfqfft {

#ifdef MULTICORE
Expand Down
1 change: 1 addition & 0 deletions libfqfft/evaluation_domain/evaluation_domain.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#define EVALUATION_DOMAIN_HPP_

#include <memory>
#include <vector>

namespace libfqfft {

Expand Down
5 changes: 2 additions & 3 deletions libfqfft/evaluation_domain/evaluation_domain.tcc
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,11 @@
#ifndef EVALUATION_DOMAIN_TCC_
#define EVALUATION_DOMAIN_TCC_

#include <libfqfft/evaluation_domain/domains/arithmetic_sequence_domain.hpp>
#include <libfqfft/evaluation_domain/domains/basic_radix2_domain.hpp>
#include <libfqfft/evaluation_domain/domains/extended_radix2_domain.hpp>
#include <libfqfft/evaluation_domain/domains/step_radix2_domain.hpp>
#include <libfqfft/evaluation_domain/domains/arithmetic_sequence_domain.hpp>
#include <libfqfft/evaluation_domain/domains/geometric_sequence_domain.hpp>

#include <libfqfft/evaluation_domain/domains/step_radix2_domain.hpp>
#include <libfqfft/tools/exceptions.hpp>

namespace libfqfft {
Expand Down
2 changes: 2 additions & 0 deletions libfqfft/kronecker_substitution/kronecker_substitution.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
#ifndef KRONECKER_SUBSTITUTION_HPP_
#define KRONECKER_SUBSTITUTION_HPP_

#include <vector>

namespace libfqfft {

/**
Expand Down
15 changes: 8 additions & 7 deletions libfqfft/kronecker_substitution/kronecker_substitution.tcc
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@
#define KRONECKER_SUBSTITUTION_TCC_

#include <algorithm>
#include <math.h>
#include <cmath>

#define GMP_LIMB_BITS 64
#include <gmp.h>
#include <libff/common/utils.hpp>

namespace libfqfft {

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

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

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

/*
/*
* If the next iteration of LIMB_B is >= to the GMP_LIMB_BITS, then
* write it out to MP_LIMB_T* and reset LIMB. If VAL has remaining
* bits due to GMP_LIMB_BITS boundary, set it in LIMB and proceed.
Expand Down Expand Up @@ -130,7 +131,7 @@ void kronecker_substitution(std::vector<FieldT> &v3, const std::vector<FieldT> &
limb_b = 0;
for (size_t i = 0; i < n3; i++)
{
/*
/*
* If the coefficient's bit length is contained in LIMB, then
* write the masked value out to vector V3 and decrement LIMB
* by B bits.
Expand All @@ -142,7 +143,7 @@ void kronecker_substitution(std::vector<FieldT> &v3, const std::vector<FieldT> &
delta = b;
delta_b = limb_b - delta;
}
/*
/*
* If the remaining coefficient is across two LIMBs, then write
* to vector V3 the current limb's value and add upper bits from
* the second part. Lastly, decrement LIMB by the coefficient's
Expand Down
4 changes: 3 additions & 1 deletion libfqfft/polynomial_arithmetic/basic_operations.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*****************************************************************************

Declaration of interfaces for basic polynomial operation routines.

*****************************************************************************
* @author This file is part of libfqfft, developed by SCIPR Lab
* and contributors (see AUTHORS).
Expand All @@ -13,6 +13,8 @@
#ifndef BASIC_OPERATIONS_HPP_
#define BASIC_OPERATIONS_HPP_

#include <vector>

namespace libfqfft {

/**
Expand Down
4 changes: 3 additions & 1 deletion libfqfft/polynomial_arithmetic/basis_change.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
*****************************************************************************

Declaration of interfaces for basis change routines.

*****************************************************************************
* @author This file is part of libfqfft, developed by SCIPR Lab
* and contributors (see AUTHORS).
Expand All @@ -12,6 +12,8 @@
#ifndef BASIS_CHANGE_HPP_
#define BASIS_CHANGE_HPP_

#include <vector>

namespace libfqfft {

/**
Expand Down
3 changes: 2 additions & 1 deletion libfqfft/polynomial_arithmetic/basis_change.tcc
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@
#define BASIS_CHANGE_TCC_

#include <algorithm>

#include <libfqfft/evaluation_domain/domains/basic_radix2_domain_aux.hpp>
#include <libfqfft/polynomial_arithmetic/basic_operations.hpp>
#include <libfqfft/polynomial_arithmetic/xgcd.hpp>
#include <libfqfft/evaluation_domain/domains/basic_radix2_domain_aux.hpp>

namespace libfqfft {

Expand Down
6 changes: 5 additions & 1 deletion libfqfft/polynomial_arithmetic/naive_evaluate.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
*****************************************************************************

Declaration of interfaces for naive evaluation routines.

*****************************************************************************
* @author This file is part of libfqfft, developed by SCIPR Lab
* and contributors (see AUTHORS).
Expand All @@ -12,6 +12,10 @@
#ifndef NAIVE_EVALUATE_HPP_
#define NAIVE_EVALUATE_HPP_

#include <vector>

#include <libfqfft/tools/exceptions.hpp>

namespace libfqfft {

/**
Expand Down
4 changes: 3 additions & 1 deletion libfqfft/polynomial_arithmetic/xgcd.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
*****************************************************************************

Declaration of interfaces for extended GCD routines.

*****************************************************************************
* @author This file is part of libfqfft, developed by SCIPR Lab
* and contributors (see AUTHORS).
Expand All @@ -12,6 +12,8 @@
#ifndef XGCD_HPP_
#define XGCD_HPP_

#include <vector>

namespace libfqfft {

/**
Expand Down
3 changes: 2 additions & 1 deletion libfqfft/polynomial_arithmetic/xgcd.tcc
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@
#define XGCD_TCC_

#include <algorithm>
#include <libfqfft/polynomial_arithmetic/basic_operations.hpp>

#include <libfqfft/evaluation_domain/domains/basic_radix2_domain_aux.hpp>
#include <libfqfft/polynomial_arithmetic/basic_operations.hpp>

namespace libfqfft {

Expand Down
25 changes: 12 additions & 13 deletions libfqfft/profiling/profile/profile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,28 +9,27 @@
* @copyright MIT license (see LICENSE file)
*****************************************************************************/

#ifndef PROFILE_OP_COUNTS
#error PROFILE_OP_COUNTS must be defined to build this profiler.
#endif

#include <cstdint>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <iostream>
#include <fstream>
#include <omp.h>
#include <iostream>
#include <sstream>
#include <stdio.h>
#include <string.h>
#include <stdint.h>
#include <stdlib.h>
#include <vector>
#include <sys/resource.h>
#include <unistd.h>
#include <vector>

#include <libff/algebra/curves/edwards/edwards_pp.hpp>
#include <libff/common/double.hpp>
#include <omp.h>

#include <libfqfft/evaluation_domain/evaluation_domain.hpp>
#include <libfqfft/evaluation_domain/domains/basic_radix2_domain.hpp>
#include <libfqfft/evaluation_domain/domains/extended_radix2_domain.hpp>
#include <libfqfft/evaluation_domain/domains/step_radix2_domain.hpp>
#include <libfqfft/evaluation_domain/domains/geometric_sequence_domain.hpp>
#include <libfqfft/evaluation_domain/domains/arithmetic_sequence_domain.hpp>
#include <libfqfft/evaluation_domain/evaluation_domain.hpp> // this also includes all children of evaluation_domain

using namespace libfqfft;

Expand Down
11 changes: 6 additions & 5 deletions libfqfft/profiling/profiling_menu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,18 @@

#include <cmath>
#include <ctime>
#include <dirent.h>
#include <iostream>
#include <fstream>
#include <iostream>
#include <sstream>
#include <stdio.h>
#include <string.h>
#include <vector>

#include <dirent.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/resource.h>
#include <unistd.h>
#include <vector>

/* Level 2: Profile */
void profile()
Expand Down
19 changes: 7 additions & 12 deletions libfqfft/tests/evaluation_domain_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,13 @@
* @copyright MIT license (see LICENSE file)
*****************************************************************************/

#include <gtest/gtest.h>
#include <stdint.h>
#include <vector>

#include <gtest/gtest.h>
#include <libff/algebra/curves/mnt/mnt4/mnt4_pp.hpp>
#include <stdint.h>

#include <libfqfft/evaluation_domain/evaluation_domain.hpp>
#include <libfqfft/evaluation_domain/domains/basic_radix2_domain.hpp>
#include <libfqfft/evaluation_domain/domains/extended_radix2_domain.hpp>
#include <libfqfft/evaluation_domain/domains/step_radix2_domain.hpp>
#include <libfqfft/evaluation_domain/domains/geometric_sequence_domain.hpp>
#include <libfqfft/evaluation_domain/domains/arithmetic_sequence_domain.hpp>
#include <libfqfft/evaluation_domain/evaluation_domain.hpp> // this also includes all children of evaluation_domain
#include <libfqfft/polynomial_arithmetic/naive_evaluate.hpp>
#include <libfqfft/tools/exceptions.hpp>

Expand Down Expand Up @@ -78,7 +73,7 @@ namespace libfqfft {
}
}
}

TYPED_TEST(EvaluationDomainTest, InverseFFTofFFT) {

const size_t m = 4;
Expand Down Expand Up @@ -111,7 +106,7 @@ namespace libfqfft {
catch(const InvalidSizeException &e)
{
printf("%s - skipping\n", e.what());
}
}
}
}

Expand Down Expand Up @@ -161,7 +156,7 @@ namespace libfqfft {
std::shared_ptr<evaluation_domain<TypeParam> > domain;
for (int key = 0; key < 5; key++)
{

try
{
if (key == 0) domain.reset(new basic_radix2_domain<TypeParam>(m));
Expand Down Expand Up @@ -198,7 +193,7 @@ namespace libfqfft {
}

TYPED_TEST(EvaluationDomainTest, ComputeZ) {

const size_t m = 8;
TypeParam t = TypeParam(10);

Expand Down
3 changes: 2 additions & 1 deletion libfqfft/tests/kronecker_substitution_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@
* @copyright MIT license (see LICENSE file)
*****************************************************************************/

#include <vector>

#include <gtest/gtest.h>
#include <stdint.h>
#include <vector>

#include <libfqfft/polynomial_arithmetic/basic_operations.hpp>

Expand Down
3 changes: 2 additions & 1 deletion libfqfft/tests/polynomial_arithmetic_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@
* @copyright MIT license (see LICENSE file)
*****************************************************************************/

#include <vector>

#include <gtest/gtest.h>
#include <stdint.h>
#include <vector>

#include <libfqfft/polynomial_arithmetic/basic_operations.hpp>
#include <libfqfft/polynomial_arithmetic/xgcd.hpp>
Expand Down