From 297c070c3d475c3a00f91e694e514a5e5af3a1af Mon Sep 17 00:00:00 2001 From: Martin Reinecke Date: Tue, 6 Nov 2012 14:44:11 +0100 Subject: [PATCH] do not use complex numbers in C++ interface --- libsharp/sharp_cxx.h | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/libsharp/sharp_cxx.h b/libsharp/sharp_cxx.h index b5ed35f..c067f7e 100644 --- a/libsharp/sharp_cxx.h +++ b/libsharp/sharp_cxx.h @@ -35,7 +35,6 @@ #include "sharp_lowlevel.h" #include "sharp_geomhelpers.h" #include "sharp_almhelpers.h" -#include "xcomplex.h" class sharp_base { @@ -88,24 +87,20 @@ template<> struct cxxjobhelper__ template class sharp_cxxjob: public sharp_base { private: - static void *conv (xcomplex *ptr) - { return reinterpret_cast(ptr); } - static void *conv (const xcomplex *ptr) - { return const_cast(reinterpret_cast(ptr)); } static void *conv (T *ptr) { return reinterpret_cast(ptr); } static void *conv (const T *ptr) { return const_cast(reinterpret_cast(ptr)); } public: - void alm2map (const xcomplex *alm, T *map, bool add) + void alm2map (const T *alm, T *map, bool add) { void *aptr=conv(alm), *mptr=conv(map); sharp_execute (SHARP_ALM2MAP, 0, add, &aptr, &mptr, ginfo, ainfo, 1, cxxjobhelper__::val,0,0,0); } - void alm2map_spin (const xcomplex *alm1, const xcomplex *alm2, - T *map1, T *map2, int spin, bool add) + void alm2map_spin (const T *alm1, const T *alm2, T *map1, T *map2, + int spin, bool add) { void *aptr[2], *mptr[2]; aptr[0]=conv(alm1); aptr[1]=conv(alm2); @@ -113,21 +108,21 @@ template class sharp_cxxjob: public sharp_base sharp_execute (SHARP_ALM2MAP, spin, add, aptr, mptr, ginfo, ainfo, 1, cxxjobhelper__::val,0,0,0); } - void alm2map_der1 (const xcomplex *alm, T *map1, T *map2, bool add) + void alm2map_der1 (const T *alm, T *map1, T *map2, bool add) { void *aptr=conv(alm), *mptr[2]; mptr[0]=conv(map1); mptr[1]=conv(map2); sharp_execute (SHARP_ALM2MAP_DERIV1, 1, add,&aptr, mptr, ginfo, ainfo, 1, cxxjobhelper__::val,0,0,0); } - void map2alm (const T *map, xcomplex *alm, bool add) + void map2alm (const T *map, T *alm, bool add) { void *aptr=conv(alm), *mptr=conv(map); sharp_execute (SHARP_MAP2ALM, 0, add, &aptr, &mptr, ginfo, ainfo, 1, cxxjobhelper__::val,0,0,0); } - void map2alm_spin (const T *map1, const T *map2, xcomplex *alm1, - xcomplex *alm2, int spin, bool add) + void map2alm_spin (const T *map1, const T *map2, T *alm1, T *alm2, + int spin, bool add) { void *aptr[2], *mptr[2]; aptr[0]=conv(alm1); aptr[1]=conv(alm2);