do not use complex numbers in C++ interface

This commit is contained in:
Martin Reinecke 2012-11-06 14:44:11 +01:00
parent ada46c7aa5
commit 297c070c3d

View file

@ -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__<float>
template<typename T> class sharp_cxxjob: public sharp_base
{
private:
static void *conv (xcomplex<T> *ptr)
{ return reinterpret_cast<void *>(ptr); }
static void *conv (const xcomplex<T> *ptr)
{ return const_cast<void *>(reinterpret_cast<const void *>(ptr)); }
static void *conv (T *ptr)
{ return reinterpret_cast<void *>(ptr); }
static void *conv (const T *ptr)
{ return const_cast<void *>(reinterpret_cast<const void *>(ptr)); }
public:
void alm2map (const xcomplex<T> *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__<T>::val,0,0,0);
}
void alm2map_spin (const xcomplex<T> *alm1, const xcomplex<T> *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<typename T> class sharp_cxxjob: public sharp_base
sharp_execute (SHARP_ALM2MAP, spin, add, aptr, mptr, ginfo, ainfo, 1,
cxxjobhelper__<T>::val,0,0,0);
}
void alm2map_der1 (const xcomplex<T> *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__<T>::val,0,0,0);
}
void map2alm (const T *map, xcomplex<T> *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__<T>::val,0,0,0);
}
void map2alm_spin (const T *map1, const T *map2, xcomplex<T> *alm1,
xcomplex<T> *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);