Skip to content

Commit

Permalink
removed some work-arounds for pre-C++11
Browse files Browse the repository at this point in the history
a tiny bit of code clean-up
  • Loading branch information
KrisThielemans committed Sep 17, 2023
1 parent 6066134 commit 13350f7
Showing 1 changed file with 1 addition and 78 deletions.
79 changes: 1 addition & 78 deletions src/numerics_buildblock/fourier.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,6 @@ struct fourier_auxiliary
};

// specialisation for the one-dimensional case
#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION

template <typename elemT>
struct fourier_auxiliary<std::complex<elemT> >
Expand All @@ -138,49 +137,22 @@ struct fourier_auxiliary<std::complex<elemT> >
}
};


#else //no partial template specialisation

// we just list float and double explicitly
struct fourier_auxiliary<std::complex<float> >
{
static void
do_fourier(VectorWithOffset<std::complex<float> >& c, const int sign)
{
fourier_1d(c, sign);
}
};

struct fourier_auxiliary<std::complex<double> >
{
static void
do_fourier(VectorWithOffset<std::complex<double> >& c, const int sign)
{
fourier_1d(c, sign);
}
};
#endif

} // end of namespace detail

// now the fourier function is easy to define in terms of the class above
template <typename T>
void
fourier(T& c, const int sign)
{
#if !defined(_MSC_VER) || _MSC_VER>1200
detail::fourier_auxiliary<typename T::value_type>::do_fourier(c,sign);
#else
detail::fourier_auxiliary<T::value_type>::do_fourier(c,sign);
#endif
}


/******************************************************************
DFT of real data
*****************************************************************/


// specialisation for the one-dimensional case

template <typename T>
Array<1,std::complex<T> >
Expand Down Expand Up @@ -346,9 +318,6 @@ struct fourier_for_real_data_auxiliary
}
};

// specialisation for the one-dimensional case
#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION

template <typename elemT>
struct fourier_for_real_data_auxiliary<1,elemT>
{
Expand All @@ -366,52 +335,6 @@ struct fourier_for_real_data_auxiliary<1,elemT>
}
};


#else //no partial template specialisation

// we just list float explicitly

struct fourier_for_real_data_auxiliary<1,float>
{
static Array<1,std::complex<float> >
do_fourier_for_real_data(const Array<1,float>& c, const int sign)
{
return
fourier_1d_for_real_data(c, sign);
}
static Array<1,float>
do_inverse_fourier_for_real_data_corrupting_input(Array<1,std::complex<float> >& c, const int sign)
{
return
inverse_fourier_1d_for_real_data_corrupting_input(c, sign);
}
};

#if 0
/* Disabled double for now.
If you want to use double, you will probably have
to make sure that Array<1,std::complex<double> > is instantiated.
At time of writing, you would do this at the end of Array.h
*/
struct fourier_for_real_data_auxiliary<1,double>
{
static Array<1,std::complex<double> >
do_fourier_for_real_data(const Array<1,double>& c, const int sign)
{
return
fourier_1d_for_real_data(c, sign);
}
static Array<1,double>
do_inverse_fourier_for_real_data_corrupting_input(Array<1,std::complex<double> >& c, const int sign)
{
return
inverse_fourier_1d_for_real_data_corrupting_input(c, sign);
}
};
#endif // end of double

#endif // end of BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION

} // end of namespace detail


Expand Down

0 comments on commit 13350f7

Please sign in to comment.