Moved plan creation into its subroutine

This commit is contained in:
Guilhem Lavaux 2013-05-02 15:04:25 -04:00
parent 0a412e0ec3
commit e2280a899f
2 changed files with 15 additions and 1 deletions

View File

@ -168,6 +168,7 @@ namespace CosmoTool
{ {
protected: protected:
FourierTransform() {} FourierTransform() {}
FourierTransform(const FourierTransform<T>& a) { abort(); }
public: public:
virtual ~FourierTransform() { } virtual ~FourierTransform() { }

View File

@ -55,11 +55,24 @@ namespace CosmoTool
std::vector<double> m_L; std::vector<double> m_L;
public: public:
EuclidianFourierTransform(const DimArray& dims, const std::vector<double>& L) EuclidianFourierTransform(const DimArray& dims, const std::vector<double>& L)
{
create_plan(dims, L);
}
void create_plan(const DimArray& dims, const std::vector<double>& L)
{ {
assert(L.size() == dims.size()); assert(L.size() == dims.size());
std::vector<double> dk(L.size()); std::vector<double> dk(L.size());
std::vector<int> swapped_dims(dims.size()); std::vector<int> swapped_dims(dims.size());
if (realMap != 0)
{
delete realMap;
delete fourierMap;
calls::destroy_plan(m_synthesis);
calls::destroy_plan(m_analysis);
}
m_dims = dims; m_dims = dims;
m_dims_hc = dims; m_dims_hc = dims;
m_dims_hc[0] = dims[0]/2+1; m_dims_hc[0] = dims[0]/2+1;