Skip to content

Commit 6178257

Browse files
Move get_evaluation_domain into separate file
This resolves the cyclic dependencies between specific evaluation domains and evaluation_domain.hpp
1 parent 1d9ac08 commit 6178257

File tree

5 files changed

+47
-15
lines changed

5 files changed

+47
-15
lines changed

libfqfft/evaluation_domain/evaluation_domain.hpp

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
#ifndef EVALUATION_DOMAIN_HPP_
2727
#define EVALUATION_DOMAIN_HPP_
2828

29-
#include <memory>
3029
#include <vector>
3130

3231
namespace libfqfft {
@@ -99,15 +98,6 @@ class evaluation_domain {
9998
virtual void divide_by_Z_on_coset(std::vector<FieldT> &P) = 0;
10099
};
101100

102-
/**
103-
* Return an evaluation domain object in which the domain S has size |S| >= min_size.
104-
* The function chooses from different supported domains, depending on min_size.
105-
*/
106-
template<typename FieldT>
107-
std::shared_ptr<evaluation_domain<FieldT> > get_evaluation_domain(const size_t min_size);
108-
109101
} // libfqfft
110102

111-
#include <libfqfft/evaluation_domain/evaluation_domain.tcc>
112-
113103
#endif // EVALUATION_DOMAIN_HPP_
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
/** @file
2+
*****************************************************************************
3+
4+
A convenience method for choosing an evaluation domain
5+
6+
Returns an evaluation domain object in which the domain S has size
7+
|S| >= min_size.
8+
The function chooses from different supported domains, depending on min_size.
9+
10+
*****************************************************************************
11+
* @author This file is part of libfqfft, developed by SCIPR Lab
12+
* and contributors (see AUTHORS).
13+
* @copyright MIT license (see LICENSE file)
14+
*****************************************************************************/
15+
16+
#ifndef GET_EVALUATION_DOMAIN_HPP_
17+
#define GET_EVALUATION_DOMAIN_HPP_
18+
19+
#include <memory>
20+
21+
#include <libfqfft/evaluation_domain/evaluation_domain.hpp>
22+
23+
namespace libfqfft {
24+
25+
template<typename FieldT>
26+
std::shared_ptr<evaluation_domain<FieldT> > get_evaluation_domain(const size_t min_size);
27+
28+
} // libfqfft
29+
30+
#include <libfqfft/evaluation_domain/get_evaluation_domain.tcc>
31+
32+
#endif // GET_EVALUATION_DOMAIN_HPP_

libfqfft/evaluation_domain/evaluation_domain.tcc renamed to libfqfft/evaluation_domain/get_evaluation_domain.tcc

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,15 @@
1616
* @copyright MIT license (see LICENSE file)
1717
*****************************************************************************/
1818

19-
#ifndef EVALUATION_DOMAIN_TCC_
20-
#define EVALUATION_DOMAIN_TCC_
19+
#ifndef GET_EVALUATION_DOMAIN_TCC_
20+
#define GET_EVALUATION_DOMAIN_TCC_
2121

2222
#include <libfqfft/evaluation_domain/domains/arithmetic_sequence_domain.hpp>
2323
#include <libfqfft/evaluation_domain/domains/basic_radix2_domain.hpp>
2424
#include <libfqfft/evaluation_domain/domains/extended_radix2_domain.hpp>
2525
#include <libfqfft/evaluation_domain/domains/geometric_sequence_domain.hpp>
2626
#include <libfqfft/evaluation_domain/domains/step_radix2_domain.hpp>
27+
#include <libfqfft/evaluation_domain/evaluation_domain.hpp>
2728
#include <libfqfft/tools/exceptions.hpp>
2829

2930
namespace libfqfft {
@@ -52,4 +53,4 @@ std::shared_ptr<evaluation_domain<FieldT> > get_evaluation_domain(const size_t m
5253

5354
} // libfqfft
5455

55-
#endif // EVALUATION_DOMAIN_TCC_
56+
#endif // GET_EVALUATION_DOMAIN_TCC_

libfqfft/profiling/profile/profile.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,11 @@
2929
#include <libff/common/double.hpp>
3030
#include <omp.h>
3131

32-
#include <libfqfft/evaluation_domain/evaluation_domain.hpp> // this also includes all children of evaluation_domain
32+
#include <libfqfft/evaluation_domain/domains/arithmetic_sequence_domain.hpp>
33+
#include <libfqfft/evaluation_domain/domains/basic_radix2_domain.hpp>
34+
#include <libfqfft/evaluation_domain/domains/extended_radix2_domain.hpp>
35+
#include <libfqfft/evaluation_domain/domains/geometric_sequence_domain.hpp>
36+
#include <libfqfft/evaluation_domain/domains/step_radix2_domain.hpp>
3337

3438
using namespace libfqfft;
3539

libfqfft/tests/evaluation_domain_test.cpp

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

8+
#include <memory>
89
#include <vector>
910

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

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

0 commit comments

Comments
 (0)