Moved plan creation into its subroutine
This commit is contained in:
parent
0a412e0ec3
commit
e2280a899f
@ -168,6 +168,7 @@ namespace CosmoTool
|
||||
{
|
||||
protected:
|
||||
FourierTransform() {}
|
||||
FourierTransform(const FourierTransform<T>& a) { abort(); }
|
||||
public:
|
||||
virtual ~FourierTransform() { }
|
||||
|
||||
|
@ -55,11 +55,24 @@ namespace CosmoTool
|
||||
std::vector<double> m_L;
|
||||
public:
|
||||
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());
|
||||
std::vector<double> dk(L.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_hc = dims;
|
||||
m_dims_hc[0] = dims[0]/2+1;
|
||||
|
Loading…
Reference in New Issue
Block a user