From 1d9ac0823fa98ab66d09d97611f5540fddb1c34e Mon Sep 17 00:00:00 2001 From: Aleksejs Popovs Date: Tue, 27 Jun 2017 20:01:57 -0400 Subject: [PATCH 1/2] Change order of include directories Before this change, building libfqfft on a system that already has libfqfft installed could result in cmake using the installed headers instead of ones from the version being built. --- CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c31d782..3d2b47b 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -72,6 +72,8 @@ else() ) endif() +include_directories(.) + # GMP find_path(GMP_INCLUDE_DIR NAMES gmp.h) find_library(GMP_LIBRARIES NAMES gmp libgmp) @@ -101,6 +103,5 @@ add_custom_target( COMMAND polynomial_multiplication ) -include_directories(.) add_subdirectory(libfqfft) add_subdirectory(tutorials) From 6178257cfb4d419d92b1bc4866adce26c304dfde Mon Sep 17 00:00:00 2001 From: Aleksejs Popovs Date: Tue, 27 Jun 2017 20:05:04 -0400 Subject: [PATCH 2/2] Move get_evaluation_domain into separate file This resolves the cyclic dependencies between specific evaluation domains and evaluation_domain.hpp --- .../evaluation_domain/evaluation_domain.hpp | 10 ------ .../get_evaluation_domain.hpp | 32 +++++++++++++++++++ ...n_domain.tcc => get_evaluation_domain.tcc} | 7 ++-- libfqfft/profiling/profile/profile.cpp | 6 +++- libfqfft/tests/evaluation_domain_test.cpp | 7 +++- 5 files changed, 47 insertions(+), 15 deletions(-) create mode 100644 libfqfft/evaluation_domain/get_evaluation_domain.hpp rename libfqfft/evaluation_domain/{evaluation_domain.tcc => get_evaluation_domain.tcc} (93%) diff --git a/libfqfft/evaluation_domain/evaluation_domain.hpp b/libfqfft/evaluation_domain/evaluation_domain.hpp index e9ad13e..57c4f67 100755 --- a/libfqfft/evaluation_domain/evaluation_domain.hpp +++ b/libfqfft/evaluation_domain/evaluation_domain.hpp @@ -26,7 +26,6 @@ #ifndef EVALUATION_DOMAIN_HPP_ #define EVALUATION_DOMAIN_HPP_ -#include #include namespace libfqfft { @@ -99,15 +98,6 @@ class evaluation_domain { virtual void divide_by_Z_on_coset(std::vector &P) = 0; }; -/** - * Return an evaluation domain object in which the domain S has size |S| >= min_size. - * The function chooses from different supported domains, depending on min_size. - */ -template -std::shared_ptr > get_evaluation_domain(const size_t min_size); - } // libfqfft -#include - #endif // EVALUATION_DOMAIN_HPP_ diff --git a/libfqfft/evaluation_domain/get_evaluation_domain.hpp b/libfqfft/evaluation_domain/get_evaluation_domain.hpp new file mode 100644 index 0000000..d278ba2 --- /dev/null +++ b/libfqfft/evaluation_domain/get_evaluation_domain.hpp @@ -0,0 +1,32 @@ +/** @file + ***************************************************************************** + + A convenience method for choosing an evaluation domain + + Returns an evaluation domain object in which the domain S has size + |S| >= min_size. + The function chooses from different supported domains, depending on min_size. + + ***************************************************************************** + * @author This file is part of libfqfft, developed by SCIPR Lab + * and contributors (see AUTHORS). + * @copyright MIT license (see LICENSE file) + *****************************************************************************/ + +#ifndef GET_EVALUATION_DOMAIN_HPP_ +#define GET_EVALUATION_DOMAIN_HPP_ + +#include + +#include + +namespace libfqfft { + +template +std::shared_ptr > get_evaluation_domain(const size_t min_size); + +} // libfqfft + +#include + +#endif // GET_EVALUATION_DOMAIN_HPP_ diff --git a/libfqfft/evaluation_domain/evaluation_domain.tcc b/libfqfft/evaluation_domain/get_evaluation_domain.tcc similarity index 93% rename from libfqfft/evaluation_domain/evaluation_domain.tcc rename to libfqfft/evaluation_domain/get_evaluation_domain.tcc index cf6b26e..299537c 100755 --- a/libfqfft/evaluation_domain/evaluation_domain.tcc +++ b/libfqfft/evaluation_domain/get_evaluation_domain.tcc @@ -16,14 +16,15 @@ * @copyright MIT license (see LICENSE file) *****************************************************************************/ -#ifndef EVALUATION_DOMAIN_TCC_ -#define EVALUATION_DOMAIN_TCC_ +#ifndef GET_EVALUATION_DOMAIN_TCC_ +#define GET_EVALUATION_DOMAIN_TCC_ #include #include #include #include #include +#include #include namespace libfqfft { @@ -52,4 +53,4 @@ std::shared_ptr > get_evaluation_domain(const size_t m } // libfqfft -#endif // EVALUATION_DOMAIN_TCC_ \ No newline at end of file +#endif // GET_EVALUATION_DOMAIN_TCC_ diff --git a/libfqfft/profiling/profile/profile.cpp b/libfqfft/profiling/profile/profile.cpp index a61743e..5e5dd67 100755 --- a/libfqfft/profiling/profile/profile.cpp +++ b/libfqfft/profiling/profile/profile.cpp @@ -29,7 +29,11 @@ #include #include -#include // this also includes all children of evaluation_domain +#include +#include +#include +#include +#include using namespace libfqfft; diff --git a/libfqfft/tests/evaluation_domain_test.cpp b/libfqfft/tests/evaluation_domain_test.cpp index d410821..31ac7fc 100755 --- a/libfqfft/tests/evaluation_domain_test.cpp +++ b/libfqfft/tests/evaluation_domain_test.cpp @@ -5,13 +5,18 @@ * @copyright MIT license (see LICENSE file) *****************************************************************************/ +#include #include #include #include #include -#include // this also includes all children of evaluation_domain +#include +#include +#include +#include +#include #include #include