Commit 2f1e1948 authored by Jean-Eric Campagne's avatar Jean-Eric Campagne
Browse files

(JEC) 24/3/16 transfert code from test_suite to laguerre2bessel. Cleanup code....

(JEC) 24/3/16 transfert code from test_suite to laguerre2bessel. Cleanup code. remove using namespace in global space
parent fb5907a8
...@@ -140,6 +140,7 @@ CXXHDR = $(SRC)lagsht_exceptions.h \ ...@@ -140,6 +140,7 @@ CXXHDR = $(SRC)lagsht_exceptions.h \
$(SRC)walltimer.h \ $(SRC)walltimer.h \
$(SRC)lagsht_bessel.h \ $(SRC)lagsht_bessel.h \
$(SRC)laguerre2bessel.h \ $(SRC)laguerre2bessel.h \
$(SRC)lagsht_func.h \
$(SRC)quadinteg.h $(SRC)quadinteg.h
CPPFLAGS += $(BLASYES) $(SHARPINC) $(BLASINC) $(BOOSTINC) $(FFTWINC) CPPFLAGS += $(BLASYES) $(SHARPINC) $(BLASINC) $(BOOSTINC) $(FFTWINC)
......
...@@ -15,9 +15,9 @@ ...@@ -15,9 +15,9 @@
namespace LagSHT { namespace LagSHT {
void LaguerreSphericalTransform::Synthesis(const vector< complex<r_8> >& flmn, void LaguerreSphericalTransform::Synthesis(const std::vector< std::complex<r_8> >& flmn,
vector<r_8>& fijk, std::vector<r_8>& fijk,
vector< complex<r_8> >& flmk) { std::vector< std::complex<r_8> >& flmk) {
int Ntot3DPix = Npix_*N_; int Ntot3DPix = Npix_*N_;
int NtotCoeff = Nalm_*N_; int NtotCoeff = Nalm_*N_;
if(flmn.size() != (size_t)NtotCoeff) throw LagSHTError("SphLagTransform::Synthesis size error"); if(flmn.size() != (size_t)NtotCoeff) throw LagSHTError("SphLagTransform::Synthesis size error");
...@@ -25,7 +25,6 @@ void LaguerreSphericalTransform::Synthesis(const vector< complex<r_8> >& flmn, ...@@ -25,7 +25,6 @@ void LaguerreSphericalTransform::Synthesis(const vector< complex<r_8> >& flmn,
fijk.resize(Ntot3DPix); fijk.resize(Ntot3DPix);
//Perform the Inverse Laguerre Transform first //Perform the Inverse Laguerre Transform first
// vector< complex<r_8> > flmk(NtotCoeff);
flmk.resize(NtotCoeff); flmk.resize(NtotCoeff);
...@@ -52,7 +51,7 @@ void LaguerreSphericalTransform::Synthesis(const vector< complex<r_8> >& flmn, ...@@ -52,7 +51,7 @@ void LaguerreSphericalTransform::Synthesis(const vector< complex<r_8> >& flmn,
off7k = n*Npix_; off7k = n*Npix_;
#if DEBUG >= 2 #if DEBUG >= 2
cout << "Synthesis... at shell num: " << n << endl; std::cout << "Synthesis... at shell num: " << n << std::endl;
#endif #endif
sphere_->alm2map(reinterpret_cast<const r_8*>(&(flmk.data()[off7n])),&fijk.data()[off7k],false); //the false is to forbidd accumulation sphere_->alm2map(reinterpret_cast<const r_8*>(&(flmk.data()[off7n])),&fijk.data()[off7k],false); //the false is to forbidd accumulation
...@@ -61,15 +60,15 @@ void LaguerreSphericalTransform::Synthesis(const vector< complex<r_8> >& flmn, ...@@ -61,15 +60,15 @@ void LaguerreSphericalTransform::Synthesis(const vector< complex<r_8> >& flmn,
tstack_pop("SHT Synthesis"); tstack_pop("SHT Synthesis");
#if DEBUG >= 1 #if DEBUG >= 1
cout << "SphLagTransform::Synthesis.... Done" << endl; std::cout << "SphLagTransform::Synthesis.... Done" << std::endl;
#endif #endif
}//Synthesis }//Synthesis
void LaguerreSphericalTransform::Analysis(const vector<r_8>& fijk, void LaguerreSphericalTransform::Analysis(const std::vector<r_8>& fijk,
vector< complex<r_8> >& flmn, std::vector< std::complex<r_8> >& flmn,
vector< complex<r_8> >& almk std::vector< std::complex<r_8> >& almk
) { ) {
int Ntot3DPix = Npix_*N_; int Ntot3DPix = Npix_*N_;
int NtotCoeff = Nalm_*N_; int NtotCoeff = Nalm_*N_;
...@@ -79,7 +78,7 @@ void LaguerreSphericalTransform::Analysis(const vector<r_8>& fijk, ...@@ -79,7 +78,7 @@ void LaguerreSphericalTransform::Analysis(const vector<r_8>& fijk,
//done in Laguerre routine flmn.resize(NtotCoeff); //done in Laguerre routine flmn.resize(NtotCoeff);
#if DEBUG >= 1 #if DEBUG >= 1
cout << "SphLagTransform::Analysis.... Go..." << endl; std::cout << "SphLagTransform::Analysis.... Go..." << std::endl;
#endif #endif
//Perform the Spherical Hamonic analysis first //Perform the Spherical Hamonic analysis first
...@@ -93,7 +92,7 @@ void LaguerreSphericalTransform::Analysis(const vector<r_8>& fijk, ...@@ -93,7 +92,7 @@ void LaguerreSphericalTransform::Analysis(const vector<r_8>& fijk,
off7k = n*Npix_; off7k = n*Npix_;
#if DEBUG >= 1 #if DEBUG >= 1
cout << "Start Harmonic Spheric... at n = "<< n << endl; std::cout << "Start Harmonic Spheric... at n = "<< n << std::endl;
#endif #endif
sphere_->map2alm(&(fijk.data()[off7k]),reinterpret_cast<r_8*>(&(almk.data()[off7n])),false); //the false is to forbidd accumulation sphere_->map2alm(&(fijk.data()[off7k]),reinterpret_cast<r_8*>(&(almk.data()[off7n])),false); //the false is to forbidd accumulation
...@@ -101,8 +100,8 @@ void LaguerreSphericalTransform::Analysis(const vector<r_8>& fijk, ...@@ -101,8 +100,8 @@ void LaguerreSphericalTransform::Analysis(const vector<r_8>& fijk,
}//loop on shell }//loop on shell
#if DEBUG >= 1 #if DEBUG >= 1
cout << "End Harmonic Spheric..." << endl; std::cout << "End Harmonic Spheric..." << std::endl;
cout << "Start Laguerre..." << endl; std::cout << "Start Laguerre..." << std::endl;
#endif #endif
tstack_pop("SHT Analysis"); tstack_pop("SHT Analysis");
...@@ -112,7 +111,7 @@ void LaguerreSphericalTransform::Analysis(const vector<r_8>& fijk, ...@@ -112,7 +111,7 @@ void LaguerreSphericalTransform::Analysis(const vector<r_8>& fijk,
lagTrans_->MultiAnalysis(almk, flmn, Nalm_); lagTrans_->MultiAnalysis(almk, flmn, Nalm_);
#if DEBUG >= 1 #if DEBUG >= 1
cout << "End Laguerre..." << endl; std::cout << "End Laguerre..." << std::endl;
#endif #endif
tstack_pop("Laguerre MultiAnalysis"); tstack_pop("Laguerre MultiAnalysis");
...@@ -120,20 +119,22 @@ void LaguerreSphericalTransform::Analysis(const vector<r_8>& fijk, ...@@ -120,20 +119,22 @@ void LaguerreSphericalTransform::Analysis(const vector<r_8>& fijk,
#if DEBUG >= 2 #if DEBUG >= 2
for (int i=0;i<NtotCoeff; i++) { for (int i=0;i<NtotCoeff; i++) {
cout << "flmn("<<i<<"): " <<flmn[i] << endl; std::cout << "flmn("<<i<<"): " <<flmn[i] << std::endl;
} }
#endif #endif
#if DEBUG >= 1 #if DEBUG >= 1
cout << "SphLagTransform::Analysis.... Done" << endl; std::cout << "SphLagTransform::Analysis.... Done" << std::endl;
#endif #endif
}//Analysis }//Analysis
void LaguerreSphericalTransform::Synthesis(const vector< complex<r_8> >& Elmn, const vector<complex<r_8> >& Blmn, void LaguerreSphericalTransform::Synthesis(const std::vector< std::complex<r_8> >& Elmn,
const std::vector< std::complex<r_8> >& Blmn,
int spin, int spin,
vector<r_8>& fijk_re, vector<r_8>& fijk_im, std::vector<r_8>& fijk_re, std::vector<r_8>& fijk_im,
vector< complex<r_8> >& Elmk, vector<complex<r_8> >& Blmk std::vector< std::complex<r_8> >& Elmk,
std::vector< std::complex<r_8> >& Blmk
) { ) {
int Ntot3DPix = Npix_*N_; int Ntot3DPix = Npix_*N_;
int NtotCoeff = Nalm_*N_; int NtotCoeff = Nalm_*N_;
...@@ -148,8 +149,8 @@ void LaguerreSphericalTransform::Synthesis(const vector< complex<r_8> >& Elmn, c ...@@ -148,8 +149,8 @@ void LaguerreSphericalTransform::Synthesis(const vector< complex<r_8> >& Elmn, c
Blmk.resize(NtotCoeff); Blmk.resize(NtotCoeff);
#if DEBUG >= 1 #if DEBUG >= 1
cout << "SphLagTransform::Synthesis type <r_8> I/O .... Go..." << endl; std::cout << "SphLagTransform::Synthesis type <r_8> I/O .... Go..." << std::endl;
cout << "Start Inverse Laguerre...." << endl; std::cout << "Start Inverse Laguerre...." << std::endl;
#endif #endif
tstack_push("Laguerre MultiSynthesis"); tstack_push("Laguerre MultiSynthesis");
...@@ -157,17 +158,9 @@ void LaguerreSphericalTransform::Synthesis(const vector< complex<r_8> >& Elmn, c ...@@ -157,17 +158,9 @@ void LaguerreSphericalTransform::Synthesis(const vector< complex<r_8> >& Elmn, c
lagTrans_->MultiSynthesis(Blmn, Blmk, Nalm_); lagTrans_->MultiSynthesis(Blmn, Blmk, Nalm_);
tstack_pop("Laguerre MultiSynthesis"); tstack_pop("Laguerre MultiSynthesis");
// cout << "Elmk, Blmk" <<endl;
// for(int i=0; i<100; i++){
// cout << "Elmk["<<i<<"]: " << Elmk[i] << "; "
// << "Blmk["<<i<<"]: " << Blmk[i] << endl;
// }
#if DEBUG >= 1 #if DEBUG >= 1
cout << "End Inverse Laguerre...." << endl; std::cout << "End Inverse Laguerre...." << std::endl;
cout << "Start Inverse H.Spherical Transform " << endl; std::cout << "Start Inverse H.Spherical Transform " << std::endl;
#endif #endif
tstack_push("SHT Synthesis"); tstack_push("SHT Synthesis");
...@@ -178,7 +171,7 @@ void LaguerreSphericalTransform::Synthesis(const vector< complex<r_8> >& Elmn, c ...@@ -178,7 +171,7 @@ void LaguerreSphericalTransform::Synthesis(const vector< complex<r_8> >& Elmn, c
off7k = n*Npix_; off7k = n*Npix_;
#if DEBUG >= 2 #if DEBUG >= 2
cout << "Synthesis... at shell num: " << n << endl; std::cout << "Synthesis... at shell num: " << n << std::endl;
#endif #endif
sphere_->alm2map_spin(reinterpret_cast<const r_8*>(&(Elmk.data()[off7n])), sphere_->alm2map_spin(reinterpret_cast<const r_8*>(&(Elmk.data()[off7n])),
reinterpret_cast<const r_8*>(&(Blmk.data()[off7n])), reinterpret_cast<const r_8*>(&(Blmk.data()[off7n])),
...@@ -192,15 +185,18 @@ void LaguerreSphericalTransform::Synthesis(const vector< complex<r_8> >& Elmn, c ...@@ -192,15 +185,18 @@ void LaguerreSphericalTransform::Synthesis(const vector< complex<r_8> >& Elmn, c
tstack_pop("SHT Synthesis"); tstack_pop("SHT Synthesis");
#if DEBUG >= 1 #if DEBUG >= 1
cout << "SphLagTransform::Synthesis.... Done" << endl; std::cout << "SphLagTransform::Synthesis.... Done" << std::endl;
#endif #endif
}//Synthesis }//Synthesis
void LaguerreSphericalTransform::Analysis(const vector<r_8>& fijk_re, const vector<r_8>& fijk_im, void LaguerreSphericalTransform::Analysis(const std::vector<r_8>& fijk_re,
const std::vector<r_8>& fijk_im,
int spin, int spin,
vector< complex<r_8> >& Elmn, vector<complex<r_8> >& Blmn, std::vector< std::complex<r_8> >& Elmn,
vector< complex<r_8> >& Elmk, vector<complex<r_8> >& Blmk std::vector< std::complex<r_8> >& Blmn,
std::vector< std::complex<r_8> >& Elmk,
std::vector< std::complex<r_8> >& Blmk
) { ) {
int Ntot3DPix = Npix_*N_; int Ntot3DPix = Npix_*N_;
int NtotCoeff = Nalm_*N_; int NtotCoeff = Nalm_*N_;
...@@ -215,7 +211,7 @@ void LaguerreSphericalTransform::Analysis(const vector<r_8>& fijk_re, const vect ...@@ -215,7 +211,7 @@ void LaguerreSphericalTransform::Analysis(const vector<r_8>& fijk_re, const vect
#if DEBUG >= 1 #if DEBUG >= 1
cout << "SphLagTransform::Analysis.... Go..." << endl; std::cout << "SphLagTransform::Analysis.... Go..." << std::endl;
#endif #endif
//Perform the Spherical Hamonic analysis first //Perform the Spherical Hamonic analysis first
...@@ -229,7 +225,7 @@ void LaguerreSphericalTransform::Analysis(const vector<r_8>& fijk_re, const vect ...@@ -229,7 +225,7 @@ void LaguerreSphericalTransform::Analysis(const vector<r_8>& fijk_re, const vect
off7k = n*Npix_; off7k = n*Npix_;
#if DEBUG >= 1 #if DEBUG >= 1
cout << "Start Harmonic Spheric... at n = "<< n << endl; std::cout << "Start Harmonic Spheric... at n = "<< n << std::endl;
#endif #endif
sphere_->map2alm_spin(&(fijk_re.data()[off7k]), sphere_->map2alm_spin(&(fijk_re.data()[off7k]),
...@@ -243,8 +239,8 @@ void LaguerreSphericalTransform::Analysis(const vector<r_8>& fijk_re, const vect ...@@ -243,8 +239,8 @@ void LaguerreSphericalTransform::Analysis(const vector<r_8>& fijk_re, const vect
}//loop on shell }//loop on shell
#if DEBUG >= 1 #if DEBUG >= 1
cout << "End Harmonic Spheric..." << endl; std::cout << "End Harmonic Spheric..." << std::endl;
cout << "Start Laguerre..." << endl; std::cout << "Start Laguerre..." << std::endl;
#endif #endif
tstack_pop("SHT Analysis"); tstack_pop("SHT Analysis");
...@@ -255,18 +251,18 @@ void LaguerreSphericalTransform::Analysis(const vector<r_8>& fijk_re, const vect ...@@ -255,18 +251,18 @@ void LaguerreSphericalTransform::Analysis(const vector<r_8>& fijk_re, const vect
lagTrans_->MultiAnalysis(Blmk, Blmn, Nalm_); lagTrans_->MultiAnalysis(Blmk, Blmn, Nalm_);
#if DEBUG >= 1 #if DEBUG >= 1
cout << "End Laguerre..." << endl; std::cout << "End Laguerre..." << std::endl;
#endif #endif
tstack_pop("Laguerre MultiAnalysis"); tstack_pop("Laguerre MultiAnalysis");
#if DEBUG >= 2 #if DEBUG >= 2
for (int i=0;i<NtotCoeff; i++) { for (int i=0;i<NtotCoeff; i++) {
cout << "flmn("<<i<<"): " << Elmn[i] << ", " << Blmn[i] << endl; std::cout << "flmn("<<i<<"): " << Elmn[i] << ", " << Blmn[i] << std::endl;
} }
#endif #endif
#if DEBUG >= 1 #if DEBUG >= 1
cout << "SphLagTransform::Analysis.... Done" << endl; std::cout << "SphLagTransform::Analysis.... Done" << std::endl;
#endif #endif
}//Analysis }//Analysis
......
...@@ -54,7 +54,7 @@ class LaguerreSphericalTransform { ...@@ -54,7 +54,7 @@ class LaguerreSphericalTransform {
// LaguerreSphericalTransform(string spheregeom, int Lmax, int Mmax, int Nmax, // LaguerreSphericalTransform(string spheregeom, int Lmax, int Mmax, int Nmax,
// r_8 R, int Nrings = -1, int Nphi = -1, int alpha=2, bool R2tau=true): // r_8 R, int Nrings = -1, int Nphi = -1, int alpha=2, bool R2tau=true):
LaguerreSphericalTransform(string spheregeom, int Lmax, int Mmax, int Nmax, LaguerreSphericalTransform(std::string spheregeom, int Lmax, int Mmax, int Nmax,
r_8 R, int Nrings = -1, int Nphi = -1, r_8 alpha=2, bool R2tau=true): r_8 R, int Nrings = -1, int Nphi = -1, r_8 alpha=2, bool R2tau=true):
Lmax_(Lmax), Mmax_(Mmax), R_(R) { Lmax_(Lmax), Mmax_(Mmax), R_(R) {
...@@ -66,7 +66,7 @@ class LaguerreSphericalTransform { ...@@ -66,7 +66,7 @@ class LaguerreSphericalTransform {
} else if (spheregeom == "Healpix") { } else if (spheregeom == "Healpix") {
sphere_ = new HealpixGeometry(Lmax, Mmax, Nrings); //here Nsides = Nrings sphere_ = new HealpixGeometry(Lmax, Mmax, Nrings); //here Nsides = Nrings
} else { } else {
cout << "FAILURE: LaguerreSphericalTransform::Ctor wrong geometry type" << endl; std::cout << "FAILURE: LaguerreSphericalTransform::Ctor wrong geometry type" << std::endl;
sphere_ = 0; sphere_ = 0;
throw LagSHTError("LaguerreSphericalTransform::Ctor wrong geometry type"); throw LagSHTError("LaguerreSphericalTransform::Ctor wrong geometry type");
} }
...@@ -119,12 +119,12 @@ class LaguerreSphericalTransform { ...@@ -119,12 +119,12 @@ class LaguerreSphericalTransform {
//! Get the f(l,m,n) coefficient in the vector collection //! Get the f(l,m,n) coefficient in the vector collection
//make a Flmn Class //make a Flmn Class
inline complex<r_8> GetFlmn(const vector< complex<r_8> >& flmn, int l , int m, int n) const { inline std::complex<r_8> GetFlmn(const std::vector< std::complex<r_8> >& flmn, int l , int m, int n) const {
int id= n*Nalm_ + l +m*Lmax_ -m*(m+1)/2; int id= n*Nalm_ + l +m*Lmax_ -m*(m+1)/2;
return flmn[id]; return flmn[id];
} }
//! Set the f(l,m,n) coefficient in the vector collection //! Set the f(l,m,n) coefficient in the vector collection
inline void SetFlmn(vector< complex<r_8> >& flmn, int l , int m, int n, complex<r_8> value) const { inline void SetFlmn(std::vector< std::complex<r_8> >& flmn, int l , int m, int n, std::complex<r_8> value) const {
int id= n*Nalm_ + l +m*Lmax_ -m*(m+1)/2; int id= n*Nalm_ + l +m*Lmax_ -m*(m+1)/2;
flmn[id] = value; flmn[id] = value;
} }
...@@ -137,18 +137,18 @@ class LaguerreSphericalTransform { ...@@ -137,18 +137,18 @@ class LaguerreSphericalTransform {
\output fijk: 3D real function values \output fijk: 3D real function values
\output almk: 2D alm complex spherical coefficients for each subshell k \output almk: 2D alm complex spherical coefficients for each subshell k
*/ */
void Synthesis(const vector< complex<r_8> >& flmn, void Synthesis(const std::vector< std::complex<r_8> >& flmn,
vector<r_8>& fijk, std::vector<r_8>& fijk,
vector< complex<r_8> >& almk); std::vector< std::complex<r_8> >& almk);
//!Synthesis (spin = 0) //!Synthesis (spin = 0)
/*! \brief Coeffs -> Pixels with Input/Output using T floating representation /*! \brief Coeffs -> Pixels with Input/Output using T floating representation
\input flmn: 3D complex spherical-laguerre coefficients \input flmn: 3D complex spherical-laguerre coefficients
\output fijk: 3D real function values \output fijk: 3D real function values
*/ */
void Synthesis(const vector< complex<r_8> >& flmn, vector<r_8>& fijk) { void Synthesis(const std::vector< std::complex<r_8> >& flmn, std::vector<r_8>& fijk) {
int NtotCoeff = Nalm_*N_; int NtotCoeff = Nalm_*N_;
vector< complex<r_8> > almk(NtotCoeff); std::vector< std::complex<r_8> > almk(NtotCoeff);
Synthesis(flmn,fijk,almk); Synthesis(flmn,fijk,almk);
} }
...@@ -158,9 +158,9 @@ class LaguerreSphericalTransform { ...@@ -158,9 +158,9 @@ class LaguerreSphericalTransform {
\input fijk: 3D real function values \input fijk: 3D real function values
\output flmn: 3D complex spherical-laguerre coefficients \output flmn: 3D complex spherical-laguerre coefficients
*/ */
void Analysis(const vector<r_8>& fijk, void Analysis(const std::vector<r_8>& fijk,
vector< complex<r_8> >& flmn, std::vector< std::complex<r_8> >& flmn,
vector< complex<r_8> >& almk std::vector< std::complex<r_8> >& almk
); );
//! Analysis (spin = 0) //! Analysis (spin = 0)
...@@ -168,9 +168,9 @@ class LaguerreSphericalTransform { ...@@ -168,9 +168,9 @@ class LaguerreSphericalTransform {
\input fijk: 3D real function values \input fijk: 3D real function values
\output flmn: 3D complex spherical-laguerre coefficients \output flmn: 3D complex spherical-laguerre coefficients
*/ */
void Analysis(const vector<r_8>& fijk, vector< complex<r_8> >& flmn){ void Analysis(const std::vector<r_8>& fijk, std::vector< std::complex<r_8> >& flmn){
int NtotCoeff = Nalm_*N_; int NtotCoeff = Nalm_*N_;
vector< complex<r_8> > almk(NtotCoeff); std::vector< std::complex<r_8> > almk(NtotCoeff);
Analysis(fijk,flmn,almk); Analysis(fijk,flmn,almk);
} }
...@@ -185,20 +185,22 @@ class LaguerreSphericalTransform { ...@@ -185,20 +185,22 @@ class LaguerreSphericalTransform {
\output Elmk: 2D alm complex spherical coefficients for each subshell k of the gradient E \output Elmk: 2D alm complex spherical coefficients for each subshell k of the gradient E
\output Blmk: 2D alm complex spherical coefficients for each subshell k of the curl B \output Blmk: 2D alm complex spherical coefficients for each subshell k of the curl B
*/ */
void Synthesis(const vector< complex<r_8> >& Elmn, const vector<complex<r_8> >& Blmn, void Synthesis(const std::vector< std::complex<r_8> >& Elmn,
const std::vector< std::complex<r_8> >& Blmn,
int spin, int spin,
vector<r_8>& fijk_re, vector<r_8>& fijk_im, std::vector<r_8>& fijk_re, std::vector<r_8>& fijk_im,
vector< complex<r_8> >& Elmk, vector<complex<r_8> >& Blmk std::vector< std::complex<r_8> >& Elmk, std::vector< std::complex<r_8> >& Blmk
); );
void Synthesis(const vector< complex<r_8> >& Elmn, const vector<complex<r_8> >& Blmn, void Synthesis(const std::vector< std::complex<r_8> >& Elmn,
const std::vector< std::complex<r_8> >& Blmn,
int spin, int spin,
vector<r_8>& fijk_re, vector<r_8>& fijk_im std::vector<r_8>& fijk_re, std::vector<r_8>& fijk_im
){ ){
int NtotCoeff = Nalm_*N_; int NtotCoeff = Nalm_*N_;
vector< complex<r_8> > Elmk(NtotCoeff); std::vector< std::complex<r_8> > Elmk(NtotCoeff);
vector< complex<r_8> > Blmk(NtotCoeff); std::vector< std::complex<r_8> > Blmk(NtotCoeff);
Synthesis(Elmn,Blmn,spin,fijk_re,fijk_im,Elmk,Blmk); Synthesis(Elmn,Blmn,spin,fijk_re,fijk_im,Elmk,Blmk);
} }
...@@ -211,19 +213,19 @@ class LaguerreSphericalTransform { ...@@ -211,19 +213,19 @@ class LaguerreSphericalTransform {
\output Elmk: 2D alm complex spherical coefficients for each subshell k of the gradient E \output Elmk: 2D alm complex spherical coefficients for each subshell k of the gradient E
\output Blmk: 2D alm complex spherical coefficients for each subshell k of the curl B \output Blmk: 2D alm complex spherical coefficients for each subshell k of the curl B
*/ */
void Analysis(const vector<r_8>& fijk_re, const vector<r_8>& fijk_im, void Analysis(const std::vector<r_8>& fijk_re, const std::vector<r_8>& fijk_im,
int spin, int spin,
vector< complex<r_8> >& Elmn, vector<complex<r_8> >& Blmn, std::vector< std::complex<r_8> >& Elmn, std::vector< std::complex<r_8> >& Blmn,
vector< complex<r_8> >& Elmk, vector<complex<r_8> >& Blmk std::vector< std::complex<r_8> >& Elmk, std::vector< std::complex<r_8> >& Blmk
); );
void Analysis(const vector<r_8>& fijk_re, const vector<r_8>& fijk_im, void Analysis(const std::vector<r_8>& fijk_re, const std::vector<r_8>& fijk_im,
int spin, int spin,
vector< complex<r_8> >& Elmn, vector<complex<r_8> >& Blmn std::vector< std::complex<r_8> >& Elmn, std::vector< std::complex<r_8> >& Blmn
){ ){
int NtotCoeff = Nalm_*N_; int NtotCoeff = Nalm_*N_;
vector< complex<r_8> > Elmk(NtotCoeff); std::vector< std::complex<r_8> > Elmk(NtotCoeff);
vector< complex<r_8> > Blmk(NtotCoeff); std::vector< std::complex<r_8> > Blmk(NtotCoeff);
Analysis(fijk_re, fijk_im, spin, Elmn, Blmn, Elmk, Blmk); Analysis(fijk_re, fijk_im, spin, Elmn, Blmn, Elmk, Blmk);
} }
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
namespace LagSHT { namespace LagSHT {
void Bessel::BesselRoots() { void Bessel::BesselRoots() {
// using namespace std; using namespace std;
string msg; string msg;
......
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
#include "boost/math/special_functions/bessel.hpp" #include "boost/math/special_functions/bessel.hpp"
#include "lagsht_numbers.h" #include "lagsht_numbers.h"
using namespace std;
namespace LagSHT { namespace LagSHT {
...@@ -79,9 +79,10 @@ class Bessel { ...@@ -79,9 +79,10 @@ class Bessel {
/* if(l>lmax_ || n > nmax_) cout <<" ERROR Besel::Op(l,n) called with ("<<l<<","<<n<<") while " */ /* if(l>lmax_ || n > nmax_) cout <<" ERROR Besel::Op(l,n) called with ("<<l<<","<<n<<") while " */
/* << " lmax = " << lmax_ << " nmax = " << nmax_ <<endl; */ /* << " lmax = " << lmax_ << " nmax = " << nmax_ <<endl; */
return qln_[l*nmax_+n];} //qln(l,n) return qln_[l*nmax_+n];} //qln(l,n)
void GetVecRoots(std::vector<r_8>& roots, int l) const { void GetVecRoots(std::vector<r_8>& roots, int l) const {
roots.resize(nmax_); roots.resize(nmax_);
copy(qln_.begin()+l*nmax_,qln_.begin()+(l+1)*nmax_,roots.begin()); std::copy(qln_.begin()+l*nmax_,qln_.begin()+(l+1)*nmax_,roots.begin());
} }
//Find Bessel root (qln) values such that j_l(qln) = 0 for l=O,...,Lmax and n=1,..,Nmax //Find Bessel root (qln) values such that j_l(qln) = 0 for l=O,...,Lmax and n=1,..,Nmax
...@@ -93,7 +94,7 @@ class Bessel { ...@@ -93,7 +94,7 @@ class Bessel {
int lmax_; //!< l=0,...,lmax-1 order of Spherical Bessel indice int lmax_; //!< l=0,...,lmax-1 order of Spherical Bessel indice
int nmax_; //!< n=0,...,nmax-1 index of the roots of Spherical Bessel func int nmax_; //!< n=0,...,nmax-1 index of the roots of Spherical Bessel func
vector<r_8> qln_; //!< roots: Care qln(l,n) l=0,...,lmax-1; n=0,...,nmax-1 but stands for n=1,..,nmax std::vector<r_8> qln_; //!< roots: Care qln(l,n) l=0,...,lmax-1; n=0,...,nmax-1 but stands for n=1,..,nmax
private: private:
......
...@@ -27,6 +27,8 @@ void BaseGeometry::SetCommonMapFeatures() { ...@@ -27,6 +27,8 @@ void BaseGeometry::SetCommonMapFeatures() {
}//SetThetaPhiMap }//SetThetaPhiMap
void BaseGeometry::SetPixelPositions() { void BaseGeometry::SetPixelPositions() {
using namespace std;
const sharp_geom_info *ginfo; const sharp_geom_info *ginfo;
ginfo = sharpjob_.get_geom_info(); ginfo = sharpjob_.get_geom_info();
for (int i=0; i<ginfo->npairs; ++i) { for (int i=0; i<ginfo->npairs; ++i) {
...@@ -87,6 +89,7 @@ void ECPGeometry::PixThetaPhi(int k, r_8& theta, r_8& phi) const { ...@@ -87,6 +89,7 @@ void ECPGeometry::PixThetaPhi(int k, r_8& theta, r_8& phi) const {
}//PixThetaPhi }//PixThetaPhi