From 0c0b04548b253a91d21b4fecc3a219ae4231a7b6 Mon Sep 17 00:00:00 2001 From: Guilhem Lavaux Date: Thu, 25 Oct 2012 13:51:54 -0400 Subject: [PATCH 01/43] Return data directly if flags is zero --- src/loadRamses.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/loadRamses.cpp b/src/loadRamses.cpp index 4dcbad2..5cd2e1e 100644 --- a/src/loadRamses.cpp +++ b/src/loadRamses.cpp @@ -318,6 +318,9 @@ CosmoTool::SimuData *CosmoTool::loadRamsesSimu(const char *basename, int outputI data->Omega_M = info.omega_m; data->Omega_Lambda = info.omega_lambda; + if (flags == 0) + return data; + if (cpuid < 0) cpuid = 1; else cpuid++; From 19c5e446aa480a213d547e717b86185466f9c417 Mon Sep 17 00:00:00 2001 From: Guilhem Lavaux Date: Tue, 30 Oct 2012 13:58:46 -0400 Subject: [PATCH 02/43] Allow to disable simplices if they are strange --- src/dinterpolate.hpp | 3 +++ src/dinterpolate.tcc | 49 +++++++++++++++++++++++++++++++++++++++----- 2 files changed, 47 insertions(+), 5 deletions(-) diff --git a/src/dinterpolate.hpp b/src/dinterpolate.hpp index 9ce6281..acbe3f7 100644 --- a/src/dinterpolate.hpp +++ b/src/dinterpolate.hpp @@ -29,6 +29,7 @@ namespace CosmoTool { uint32_t numSimplex; uint32_t *simplex_list; gsl_eigen_symmv_workspace *eigen_work; + bool *disable_simplex; /** * This construct the interpolator. The construction is time consuming so @@ -53,6 +54,7 @@ namespace CosmoTool { this->simplex_list = simplex_list; this->numPoints = numPoints; this->numSimplex = numSimplex; + this->disable_simplex = new bool[numSimplex]; buildPreweight(); buildQuickAccess(); @@ -67,6 +69,7 @@ namespace CosmoTool { delete quickAccess; delete[] point_to_simplex_list_base; delete[] all_preweight; + delete[] disable_simplex; gsl_eigen_symmv_free(eigen_work); } diff --git a/src/dinterpolate.tcc b/src/dinterpolate.tcc index e18a7e6..e0cf763 100644 --- a/src/dinterpolate.tcc +++ b/src/dinterpolate.tcc @@ -1,3 +1,6 @@ +#include +#include +#include #include #include #include @@ -21,7 +24,8 @@ namespace CosmoTool { for (uint32_t i = 0; i < (N+1)*numSimplex; i++) { assert(simplex_list[i] < numPoints); - numSimplex_by_point[simplex_list[i]]++; + if (!disable_simplex[i/(N+1)]) + numSimplex_by_point[simplex_list[i]]++; } // Compute the total number and the index for accessing lists. @@ -37,7 +41,11 @@ namespace CosmoTool { { for (int j = 0; j <= N; j++) { - uint32_t p = simplex_list[(N+1)*i+j]; + uint32_t s = (N+1)*i+j; + if (disable_simplex[i]) + continue; + + uint32_t p = simplex_list[s]; assert(index_by_point[p] < point_to_simplex_size); point_to_simplex_list_base[index_by_point[p]] = i; ++index_by_point[p]; @@ -48,7 +56,9 @@ namespace CosmoTool { for (uint32_t i = 0; i < numPoints; i++) { // check assertion - assert((i==0 && index_by_point[0]==numSimplex_by_point[0]) || ((index_by_point[i]-index_by_point[i-1]) == (numSimplex_by_point[i]+1))); + assert((i==0 && index_by_point[0]==numSimplex_by_point[0]) + || + ((index_by_point[i]-index_by_point[i-1]) == (numSimplex_by_point[i]+1))); assert(index_by_point[i] < point_to_simplex_size); point_to_simplex_list_base[index_by_point[i]] = -1; } @@ -80,6 +90,7 @@ namespace CosmoTool { double preweight[N*N]; double preweight_inverse[N*N]; gsl_permutation *p = gsl_permutation_alloc(N); + uint32_t numDisabled = 0; all_preweight = new PType[N*N*numSimplex]; @@ -105,13 +116,38 @@ namespace CosmoTool { gsl_linalg_LU_decomp(&M.matrix, p, &signum); double a = fabs(gsl_linalg_LU_det(&M.matrix, signum)); if (a < 1e-10) - throw InvalidArgumentException("Invalid tesselation. One simplex is coplanar."); - gsl_linalg_LU_invert(&M.matrix, p, &iM.matrix); + { +#ifdef DEBUG + for (int j = 0; j < N; j++) + { + PType xref = positions[pref][j]; + for (int k = 0; k < N; k++) + { + preweight[j*N + k] = positions[simplex_list[k+base+1]][j] - xref; + } + } + std::ofstream f("matrix.txt"); + for (int j = 0; j < N*N; j++) + f << std::setprecision(12) << preweight[j] << std::endl; + throw InvalidArgumentException("Invalid tesselation. One simplex is coplanar."); +#else + gsl_matrix_set_zero(&iM.matrix); + disable_simplex[i] = true; + numDisabled++; +#endif + } + else { + gsl_linalg_LU_invert(&M.matrix, p, &iM.matrix); + disable_simplex[i] = false; + } + for (int j = 0; j < N*N; j++) all_preweight[N*N*i + j] = preweight_inverse[j]; } + std::cout << "Number of disabled simplices: " << numDisabled << std::endl; + gsl_permutation_free(p); } @@ -166,6 +202,9 @@ namespace CosmoTool { template bool DelaunayInterpolate::checkPointInSimplex(const CoordType& pos, uint32_t simplex) { + if (disable_simplex[simplex]) + return false; + uint32_t *desc_simplex = &simplex_list[simplex*(N+1)]; CoordType *p[N+1], v[N], hyper; From cc7996175cc1a5989b3a4f16fb6efe2e2108d19f Mon Sep 17 00:00:00 2001 From: Guilhem Lavaux Date: Sat, 10 Nov 2012 17:35:27 -0500 Subject: [PATCH 03/43] Implemented power spectrum support in Euclidian/Healpix --- sample/test_fft_calls.cpp | 21 +++++++++ sample/test_healpix_calls.cpp | 2 +- src/fourier/base_types.hpp | 23 ++++++++-- src/fourier/euclidian.hpp | 66 ++++++++++++++++++++++++---- src/fourier/healpix.hpp | 82 +++++++++++++++++++++++++++++++++-- 5 files changed, 178 insertions(+), 16 deletions(-) diff --git a/sample/test_fft_calls.cpp b/sample/test_fft_calls.cpp index 06c1c9a..e774a53 100644 --- a/sample/test_fft_calls.cpp +++ b/sample/test_fft_calls.cpp @@ -1,13 +1,23 @@ +#include "yorick.hpp" +#include #include +#include #include "fourier/euclidian.hpp" using namespace CosmoTool; using namespace std; +double spectrum_generator(double k) +{ + return 1/(0.1+pow(k, 3.0)); +} + int main() { EuclidianFourierTransform_2d dft(128,128,1.0,1.0); + EuclidianSpectrum_1D spectrum(spectrum_generator); double volume = 128*128; + gsl_rng *rng = gsl_rng_alloc(gsl_rng_default); dft.realSpace().eigen().setRandom(); dft.analysis(); @@ -15,6 +25,17 @@ int main() cout << "Fourier dot-product = " << dft.fourierSpace().dot_product(dft.fourierSpace()).real()*volume << endl; dft.synthesis(); cout << "Resynthesis dot-product = " << dft.realSpace().dot_product(dft.realSpace()) << endl; + + dft.realSpace().scale(2.0); + dft.fourierSpace().scale(0.2); + + SpectrumFunction::FourierMapPtr m = spectrum.newRandomFourier(rng, dft.fourierSpace()); + dft.fourierSpace() = *m.get(); + dft.synthesis(); + + uint32_t dims[2] = { 128, 128 }; + CosmoTool::saveArray("generated_map.nc", dft.realSpace().data(), dims, 2); + return 0; } diff --git a/sample/test_healpix_calls.cpp b/sample/test_healpix_calls.cpp index ae1844e..d1f1bf3 100644 --- a/sample/test_healpix_calls.cpp +++ b/sample/test_healpix_calls.cpp @@ -6,7 +6,7 @@ using namespace std; int main() { - HealpixFourierTransform dft(128,3*128,3*128, 40); + HealpixFourierTransform dft(128,2*128,2*128, 40); long Npix = dft.realSpace().size(); dft.realSpace().eigen().setRandom(); diff --git a/src/fourier/base_types.hpp b/src/fourier/base_types.hpp index 9f54320..3a10798 100644 --- a/src/fourier/base_types.hpp +++ b/src/fourier/base_types.hpp @@ -24,14 +24,17 @@ namespace CosmoTool typedef Eigen::Map MapType; typedef Eigen::Map ConstMapType; typedef FourierMap > FourierMapType; + typedef boost::shared_ptr FourierMapPtr; - virtual boost::shared_ptr + virtual FourierMapPtr newRandomFourier(gsl_rng *rng, const FourierMapType& like_map) const = 0; - virtual void mul(FourierMap >& m) const = 0; + virtual void mul(FourierMapType& m) const = 0; + virtual void mul_sqrt(FourierMapType& m) const = 0; + virtual void mul_inv(FourierMapType& m) const = 0; + virtual void mul_inv_sqrt(FourierMapType& m) const = 0; }; - template class FourierMap { @@ -60,6 +63,12 @@ namespace CosmoTool return ConstMapType(data(), size()); } + FourierMap& operator=(const FourierMap& m) + { + eigen() = m.eigen(); + return *this; + } + void sqrt() { MapType m = eigen(); @@ -130,6 +139,14 @@ namespace CosmoTool virtual void synthesis_conjugate() = 0; }; + template + class MapUtilityFunction + { + typedef SpectrumFunction Spectrum; + typedef Spectrum *Spectrum_ptr; + typedef FourierMap > FMap; + typedef Spectrum_ptr (*SpectrumFromMap)(const FMap& m); + }; }; diff --git a/src/fourier/euclidian.hpp b/src/fourier/euclidian.hpp index fac27f6..605013c 100644 --- a/src/fourier/euclidian.hpp +++ b/src/fourier/euclidian.hpp @@ -30,6 +30,9 @@ namespace CosmoTool ptr_map newRandomFourier(gsl_rng *rng, const FourierMapType& like_map) const; void mul(FourierMap >& m) const; + void mul_sqrt(FourierMap >& m) const; + void mul_inv(FourierMap >& m) const; + void mul_inv_sqrt(FourierMap >& m) const; }; template @@ -140,7 +143,7 @@ namespace CosmoTool double k2 = 0; for (int q = 0; q < ik.size(); q++) { - int dk = ik; + int dk = ik[q]; if (dk > dims[q]/2) dk = dk - dims[q]; @@ -349,18 +352,21 @@ namespace CosmoTool EuclidianSpectrum_1D::newRandomFourier(gsl_rng *rng, const FourierMapType& like_map) const { typedef EuclidianFourierMapComplex MapT; + typedef typename EuclidianSpectrum_1D::ptr_map ptr_map; typedef typename MapT::DimArray DimArray; - MapT& m_c = dynamic_cast(like_map); - MapT *rand_map = m_c.mimick(); - std::complex *d = rand_map->data(); + const MapT& m_c = dynamic_cast(like_map); + ptr_map ret_map = ptr_map(m_c.mimick()); + MapT& rand_map = dynamic_cast(*ret_map.get()); + + std::complex *d = rand_map.data(); long idx; - const DimArray& dims = rand_map->getDims(); + const DimArray& dims = rand_map.getDims(); long plane_size; for (long p = 1; p < m_c.size(); p++) { - double A_k = std::sqrt(0.5*f(rand_map->get_K(p))); + double A_k = std::sqrt(0.5*f(rand_map.get_K(p))); d[p] = std::complex(gsl_ran_gaussian(rng, A_k), gsl_ran_gaussian(rng, A_k)); } @@ -372,7 +378,7 @@ namespace CosmoTool if (dims.size() == 1) { d[idx] = std::complex(d[idx].real() + d[idx].imag(), 0); - return boost::shared_ptr::FourierMapType>(rand_map); + return ret_map; } plane_size = 1; @@ -391,6 +397,7 @@ namespace CosmoTool } long q = dims[0]; d[q] = std::complex(d[q].real() + d[q].imag()); + return ret_map; } template @@ -400,8 +407,51 @@ namespace CosmoTool std::complex *d = m.data(); for (long p = 0; p < m_c.size(); p++) - d[p] *= f(m.get_K(p)); + d[p] *= f(m_c.get_K(p)); } + + template + void EuclidianSpectrum_1D::mul_sqrt(FourierMap >& m) const + { + EuclidianFourierMapComplex& m_c = dynamic_cast&>(m); + std::complex *d = m.data(); + + for (long p = 0; p < m_c.size(); p++) + d[p] *= std::sqrt(f(m_c.get_K(p))); + } + + template + void EuclidianSpectrum_1D::mul_inv(FourierMap >& m) const + { + EuclidianFourierMapComplex& m_c = dynamic_cast&>(m); + std::complex *d = m.data(); + + for (long p = 0; p < m_c.size(); p++) + { + T A = f(m_c.get_K(p)); + if (A==0) + d[p] = 0; + else + d[p] /= A; + } + } + + template + void EuclidianSpectrum_1D::mul_inv_sqrt(FourierMap >& m) const + { + EuclidianFourierMapComplex& m_c = dynamic_cast&>(m); + std::complex *d = m.data(); + + for (long p = 0; p < m_c.size(); p++) + { + T A = std::sqrt(f(m_c.get_K(p))); + if (A == 0) + d[p] = 0; + else + d[p] /= A; + } + } + }; #endif diff --git a/src/fourier/healpix.hpp b/src/fourier/healpix.hpp index 8aac379..06da0fc 100644 --- a/src/fourier/healpix.hpp +++ b/src/fourier/healpix.hpp @@ -32,8 +32,13 @@ namespace CosmoTool const T *data() const { return &cls[0]; } long size() const { return cls.size(); } - ptr_map newRandomFourier(gsl_rng *rng, const FourierMapType& like_map) const = 0; - }; + ptr_map newRandomFourier(gsl_rng *rng, const FourierMapType& like_map) const; + + void mul(FourierMapType& m) const; + void mul_sqrt(FourierMapType& m) const; + void mul_inv(FourierMapType& m) const; + void mul_inv_sqrt(FourierMapType& m) const; + }; template class HealpixFourierMap: public FourierMap @@ -248,13 +253,13 @@ namespace CosmoTool long lmaxGen = std::min(cls.size()-1, alms.Lmax()); std::complex *new_data = new_alms->data(); - for (long l = 0; l < lmaxGen; l++) + for (long l = 0; l <= lmaxGen; l++) { double Al = std::sqrt(cls[l]); new_data[alms.index(l,0)] = gsl_ran_gaussian(rng, Al); Al *= M_SQRT1_2; - for (long m = 1; m < alms.Mmax(); m++) + for (long m = 1; m <= std::min(l,alms.Mmax()); m++) { std::complex& c = new_data[alms.index(l,m)]; c.real() = gsl_ran_gaussian(rng, Al); @@ -263,6 +268,75 @@ namespace CosmoTool } return r; } + + template + void HealpixSpectrum::mul(FourierMapType& like_map) const + { + HealpixFourierALM& alms = dynamic_cast&>(like_map); + std::complex *data = alms.data(); + + for (long l = 0; l <= alms.Lmax(); l++) + { + double Al = cls[l]; + + for (long m = 0; m <= std::min(l,alms.Mmax()); m++) + { + data[alms.index(l,m)] *= Al; + } + } + } + + template + void HealpixSpectrum::mul_sqrt(FourierMapType& like_map) const + { + HealpixFourierALM& alms = dynamic_cast&>(like_map); + std::complex *data = alms.data(); + + for (long l = 0; l <= alms.Lmax(); l++) + { + double Al = std::sqrt(cls[l]); + + for (long m = 0; m <= std::min(l,alms.Mmax()); m++) + { + data[alms.index(l,m)] *= Al; + } + } + } + + template + void HealpixSpectrum::mul_inv(FourierMapType& like_map) const + { + HealpixFourierALM& alms = dynamic_cast&>(like_map); + std::complex *data = alms.data(); + + for (long l = 0; l <= alms.Lmax(); l++) + { + double Al = (cls[l] <= 0) ? 0 : (1/cls[l]); + + for (long m = 0; m <= std::min(l,alms.Mmax()); m++) + { + data[alms.index(l,m)] *= Al; + } + } + } + + template + void HealpixSpectrum::mul_inv_sqrt(FourierMapType& like_map) const + { + HealpixFourierALM& alms = dynamic_cast&>(like_map); + std::complex *data = alms.data(); + + for (long l = 0; l <= alms.Lmax(); l++) + { + double Al = (cls[l] <= 0) ? 0 : std::sqrt(1/cls[l]); + + for (long m = 0; m <= std::min(l,alms.Mmax()); m++) + { + data[alms.index(l,m)] *= Al; + } + } + } + }; #endif From 3c0e7ae8f8de89a9ed3d47942db2024d62934d7f Mon Sep 17 00:00:00 2001 From: Guilhem Lavaux Date: Sat, 10 Nov 2012 19:11:34 -0500 Subject: [PATCH 04/43] Fixed K computation. Handle fully the Nyquist plane depending on the parity of dimensions. --- sample/test_fft_calls.cpp | 10 +++-- src/fourier/euclidian.hpp | 81 +++++++++++++++++++++++++++++++-------- 2 files changed, 70 insertions(+), 21 deletions(-) diff --git a/sample/test_fft_calls.cpp b/sample/test_fft_calls.cpp index e774a53..a4a82a1 100644 --- a/sample/test_fft_calls.cpp +++ b/sample/test_fft_calls.cpp @@ -9,14 +9,16 @@ using namespace std; double spectrum_generator(double k) { - return 1/(0.1+pow(k, 3.0)); + if (k==0) + return 0; + return 1/(0.01+pow(k, 3.0)); } int main() { - EuclidianFourierTransform_2d dft(128,128,1.0,1.0); + EuclidianFourierTransform_2d dft(1024,1024,1.0,1.0); EuclidianSpectrum_1D spectrum(spectrum_generator); - double volume = 128*128; + double volume = 1024*1024; gsl_rng *rng = gsl_rng_alloc(gsl_rng_default); dft.realSpace().eigen().setRandom(); @@ -33,7 +35,7 @@ int main() dft.fourierSpace() = *m.get(); dft.synthesis(); - uint32_t dims[2] = { 128, 128 }; + uint32_t dims[2] = { 1024, 1024 }; CosmoTool::saveArray("generated_map.nc", dft.realSpace().data(), dims, 2); return 0; diff --git a/src/fourier/euclidian.hpp b/src/fourier/euclidian.hpp index 605013c..2a9c2b1 100644 --- a/src/fourier/euclidian.hpp +++ b/src/fourier/euclidian.hpp @@ -109,19 +109,26 @@ namespace CosmoTool protected: typedef boost::shared_ptr > ptr_t; std::vector delta_k; + int m_dim0; + bool even0, alleven; long plane_size; public: typedef typename EuclidianFourierMapBase >::DimArray DimArray; EuclidianFourierMapComplex(ptr_t indata, + int dim0, const DimArray& indims, const std::vector& dk) - : EuclidianFourierMapBase >(indata, indims), delta_k(dk) + : EuclidianFourierMapBase >(indata, indims), delta_k(dk), m_dim0(dim0), even0((dim0 % 2)==0) { assert(dk.size() == indims.size()); plane_size = 1; + alleven = true; for (int q = 1; q < indims.size(); q++) - plane_size *= indims[q]; + { + plane_size *= indims[q]; + alleven = alleven && ((indims[q]%2)==0); + } } virtual FourierMap > *mimick() const @@ -131,6 +138,7 @@ namespace CosmoTool ptr_t((std::complex *) fftw_malloc(sizeof(std::complex)*this->size()), std::ptr_fun(fftw_free)), + m_dim0, this->getDims(), this->delta_k); } @@ -141,7 +149,9 @@ namespace CosmoTool const DimArray& dims = this->getDims(); assert(ik.size() == dims.size()); double k2 = 0; - for (int q = 0; q < ik.size(); q++) + k2 += CosmoTool::square(ik[0]*delta_k[0]); + + for (int q = 1; q < ik.size(); q++) { int dk = ik[q]; @@ -165,6 +175,9 @@ namespace CosmoTool return get_K(d); } + bool allDimensionsEven() const { return alleven; } + bool firstDimensionEven() const { return even0; } + virtual std::complex dot_product(const FourierMap >& other) const throw(std::bad_cast) { @@ -175,7 +188,7 @@ namespace CosmoTool const std::complex *d1 = this->data(); const std::complex *d2 = m2.data(); const DimArray& dims = this->getDims(); - int N0 = dims[0]; + int N0 = dims[0] + (even0 ? 0 : 1); std::complex result = 0; for (long q0 = 1; q0 < N0-1; q0++) @@ -187,11 +200,14 @@ namespace CosmoTool result += 2*(conj(d1[idx]) * d2[idx]).real(); } } - for (long p = 0; p < plane_size; p++) + if (!even0) { - long q0 = N0*p, q1 = (p+1)*N0-1; - result += conj(d1[q0]) * d2[q0]; - result += conj(d1[q1]) * d2[q1]; + for (long p = 0; p < plane_size; p++) + { + long q0 = N0*p, q1 = (p+1)*N0-1; + result += conj(d1[q0]) * d2[q0]; + result += conj(d1[q1]) * d2[q1]; + } } return result; } @@ -239,7 +255,7 @@ namespace CosmoTool fourierMap = new EuclidianFourierMapComplex( boost::shared_ptr >((std::complex*)calls::alloc_complex(N), std::ptr_fun(calls::free)), - m_dims_hc, dk); + dims[0], m_dims_hc, dk); m_analysis = calls::plan_dft_r2c(dims.size(), &dims[0], realMap->data(), (typename calls::complex_type *)fourierMap->data(), FFTW_MEASURE); @@ -306,6 +322,26 @@ namespace CosmoTool } }; + template + class EuclidianFourierTransform_1d: public EuclidianFourierTransform + { + private: + template + static std::vector make_1d_vector(T2 a) + { + T2 arr[2] = { a}; + return std::vector(&arr[0],&arr[1]); + } + public: + EuclidianFourierTransform_1d(int Nx, double Lx) + : EuclidianFourierTransform(make_1d_vector(Nx), make_1d_vector(Lx)) + { + } + + virtual ~EuclidianFourierTransform_1d() {} + + }; + template class EuclidianFourierTransform_2d: public EuclidianFourierTransform { @@ -363,6 +399,7 @@ namespace CosmoTool long idx; const DimArray& dims = rand_map.getDims(); long plane_size; + bool alleven = rand_map.allDimensionsEven(); for (long p = 1; p < m_c.size(); p++) { @@ -371,16 +408,18 @@ namespace CosmoTool gsl_ran_gaussian(rng, A_k)); } // Generate the mean value - d[0] = std::complex(std::sqrt(f(0)), 0); + d[0] = std::complex(gsl_ran_gaussian(rng, std::sqrt(f(0))), 0); + + if (!rand_map.firstDimensionEven()) + return ret_map; + // Correct the Nyquist plane idx = dims[0]-1; // Stick to the last element of the first dimension + d[idx] = std::complex(d[idx].real() + d[idx].imag(), 0); // 1D is special case if (dims.size() == 1) - { - d[idx] = std::complex(d[idx].real() + d[idx].imag(), 0); - return ret_map; - } - + return ret_map; + plane_size = 1; for (int q = 1; q < dims.size(); q++) { @@ -395,8 +434,16 @@ namespace CosmoTool assert(q2 < plane_size*dims[0]); d[q] = conj(d[q2]); } - long q = dims[0]; - d[q] = std::complex(d[q].real() + d[q].imag()); + + if (alleven) + { + long q = 0; + for (int i = dims.size()-1; i >= 1; i--) + q = dims[i]*q + dims[i]/2; + q += dims[0]-1; + d[q] = std::complex(d[q].real()+d[q].imag(),0); + } + return ret_map; } From b161ab0990d4239d11652cc20e574b5a0793249a Mon Sep 17 00:00:00 2001 From: Guilhem Lavaux Date: Sun, 11 Nov 2012 09:10:30 -0500 Subject: [PATCH 05/43] Fixed dot-product in case the first dimension is odd --- src/fourier/euclidian.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fourier/euclidian.hpp b/src/fourier/euclidian.hpp index 2a9c2b1..1fbd480 100644 --- a/src/fourier/euclidian.hpp +++ b/src/fourier/euclidian.hpp @@ -200,7 +200,7 @@ namespace CosmoTool result += 2*(conj(d1[idx]) * d2[idx]).real(); } } - if (!even0) + if (even0) { for (long p = 0; p < plane_size; p++) { From ff7b8dc45e926da9980db259249da493cbaba54f Mon Sep 17 00:00:00 2001 From: Guilhem Lavaux Date: Sun, 11 Nov 2012 13:30:29 -0500 Subject: [PATCH 06/43] Improved the test to check different size of maps --- sample/test_fft_calls.cpp | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/sample/test_fft_calls.cpp b/sample/test_fft_calls.cpp index a4a82a1..e7e28c1 100644 --- a/sample/test_fft_calls.cpp +++ b/sample/test_fft_calls.cpp @@ -1,3 +1,4 @@ +#include #include "yorick.hpp" #include #include @@ -5,6 +6,8 @@ #include "fourier/euclidian.hpp" using namespace CosmoTool; +using boost::format; +using boost::str; using namespace std; double spectrum_generator(double k) @@ -14,15 +17,16 @@ double spectrum_generator(double k) return 1/(0.01+pow(k, 3.0)); } -int main() +void test_2d(int Nx, int Ny) { - EuclidianFourierTransform_2d dft(1024,1024,1.0,1.0); + EuclidianFourierTransform_2d dft(Nx,Ny,1.0,1.0); EuclidianSpectrum_1D spectrum(spectrum_generator); - double volume = 1024*1024; + double volume = Nx*Ny; gsl_rng *rng = gsl_rng_alloc(gsl_rng_default); dft.realSpace().eigen().setRandom(); dft.analysis(); + cout << format("Testing (%d,%d)") % Nx % Ny << endl; cout << "Map dot-product = " << dft.realSpace().dot_product(dft.realSpace()) << endl; cout << "Fourier dot-product = " << dft.fourierSpace().dot_product(dft.fourierSpace()).real()*volume << endl; dft.synthesis(); @@ -35,9 +39,13 @@ int main() dft.fourierSpace() = *m.get(); dft.synthesis(); - uint32_t dims[2] = { 1024, 1024 }; - CosmoTool::saveArray("generated_map.nc", dft.realSpace().data(), dims, 2); - - return 0; - + uint32_t dims[2] = { Ny, Nx }; + CosmoTool::saveArray(str(format("generated_map_%d_%d.nc") %Nx % Ny) , dft.realSpace().data(), dims, 2); +} + +int main(int argc, char **argv) +{ + test_2d(128,128); + test_2d(131,128); + return 0; } From 09551ae85bc92d919fb9718c2fbca1d33e257386 Mon Sep 17 00:00:00 2001 From: Guilhem Lavaux Date: Sun, 11 Nov 2012 13:30:41 -0500 Subject: [PATCH 07/43] Fixed index computation in dot-product --- src/fourier/euclidian.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fourier/euclidian.hpp b/src/fourier/euclidian.hpp index 1fbd480..56d6964 100644 --- a/src/fourier/euclidian.hpp +++ b/src/fourier/euclidian.hpp @@ -195,7 +195,7 @@ namespace CosmoTool { for (long p = 0; p < plane_size; p++) { - long idx = q0+N0*p; + long idx = q0+dims[0]*p; assert(idx < this->size()); result += 2*(conj(d1[idx]) * d2[idx]).real(); } From 38eb21def88df503a89d3aa37b9aad9a881cb1d6 Mon Sep 17 00:00:00 2001 From: Guilhem Lavaux Date: Sun, 11 Nov 2012 14:24:09 -0500 Subject: [PATCH 08/43] Use size_t instead of int for alloc_* --- src/fourier/fft/fftw_calls.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/fourier/fft/fftw_calls.hpp b/src/fourier/fft/fftw_calls.hpp index 0106055..41e4d7c 100644 --- a/src/fourier/fft/fftw_calls.hpp +++ b/src/fourier/fft/fftw_calls.hpp @@ -28,8 +28,8 @@ public: \ typedef prefix ## _complex complex_type; \ typedef prefix ## _plan plan_type; \ \ - static complex_type *alloc_complex(int N) { return prefix ## _alloc_complex(N); } \ - static real_type *alloc_real(int N) { return prefix ## _alloc_real(N); } \ + static complex_type *alloc_complex(size_t N) { return prefix ## _alloc_complex(N); } \ + static real_type *alloc_real(size_t N) { return prefix ## _alloc_real(N); } \ static void free(void *p) { fftw_free(p); } \ \ static void execute(plan_type p) { prefix ## _execute(p); } \ From 596dd5d6817f39898aaade5af6327db5eab60335 Mon Sep 17 00:00:00 2001 From: Guilhem Lavaux Date: Sun, 11 Nov 2012 14:24:35 -0500 Subject: [PATCH 09/43] Fixed use of constness in FourierMap::scale --- src/fourier/base_types.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fourier/base_types.hpp b/src/fourier/base_types.hpp index 3a10798..29a4c87 100644 --- a/src/fourier/base_types.hpp +++ b/src/fourier/base_types.hpp @@ -85,7 +85,7 @@ namespace CosmoTool { assert(size() == map2->size()); MapType m(data(), size()); - MapType m2(map2->data(), map2->size()); + ConstMapType m2(map2->data(), map2->size()); m *= m2; } From d8734b2a59901137fae3be527c9bd51554d92f4a Mon Sep 17 00:00:00 2001 From: Guilhem Lavaux Date: Sun, 11 Nov 2012 14:25:05 -0500 Subject: [PATCH 10/43] Fixed allocation and specification of dimensions to FFTW (must be swapped compared to CosmoTool convention) --- src/fourier/euclidian.hpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/fourier/euclidian.hpp b/src/fourier/euclidian.hpp index 56d6964..600ebbb 100644 --- a/src/fourier/euclidian.hpp +++ b/src/fourier/euclidian.hpp @@ -225,7 +225,7 @@ namespace CosmoTool EuclidianFourierMapComplex *fourierMap; typename calls::plan_type m_analysis, m_synthesis; double volume; - long N; + long N, Nc; DimArray m_dims, m_dims_hc; std::vector m_L; public: @@ -233,6 +233,7 @@ namespace CosmoTool { assert(L.size() == dims.size()); std::vector dk(L.size()); + std::vector swapped_dims(dims.size()); m_dims = dims; m_dims_hc = dims; @@ -240,12 +241,15 @@ namespace CosmoTool m_L = L; N = 1; + Nc = 1; volume = 1; for (int i = 0; i < dims.size(); i++) { N *= dims[i]; + Nc *= m_dims_hc[i]; volume *= L[i]; dk[i] = 2*M_PI/L[i]; + swapped_dims[dims.size()-1-i] = dims[i]; } realMap = new EuclidianFourierMapReal( @@ -253,15 +257,15 @@ namespace CosmoTool std::ptr_fun(calls::free)), m_dims); fourierMap = new EuclidianFourierMapComplex( - boost::shared_ptr >((std::complex*)calls::alloc_complex(N), + boost::shared_ptr >((std::complex*)calls::alloc_complex(Nc), std::ptr_fun(calls::free)), dims[0], m_dims_hc, dk); - m_analysis = calls::plan_dft_r2c(dims.size(), &dims[0], + m_analysis = calls::plan_dft_r2c(dims.size(), &swapped_dims[0], realMap->data(), (typename calls::complex_type *)fourierMap->data(), - FFTW_MEASURE); - m_synthesis = calls::plan_dft_c2r(dims.size(), &dims[0], + FFTW_DESTROY_INPUT|FFTW_MEASURE); + m_synthesis = calls::plan_dft_c2r(dims.size(), &swapped_dims[0], (typename calls::complex_type *)fourierMap->data(), realMap->data(), - FFTW_MEASURE); + FFTW_DESTROY_INPUT|FFTW_MEASURE); } virtual ~EuclidianFourierTransform() From db2ad96752ef08236dafce3ea886fb6592d96a97 Mon Sep 17 00:00:00 2001 From: Guilhem Lavaux Date: Sun, 11 Nov 2012 14:26:05 -0500 Subject: [PATCH 11/43] Templatized the test for future, to also test floats --- sample/test_fft_calls.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/sample/test_fft_calls.cpp b/sample/test_fft_calls.cpp index e7e28c1..2541223 100644 --- a/sample/test_fft_calls.cpp +++ b/sample/test_fft_calls.cpp @@ -17,14 +17,16 @@ double spectrum_generator(double k) return 1/(0.01+pow(k, 3.0)); } +template void test_2d(int Nx, int Ny) { - EuclidianFourierTransform_2d dft(Nx,Ny,1.0,1.0); - EuclidianSpectrum_1D spectrum(spectrum_generator); + EuclidianFourierTransform_2d dft(Nx,Ny,1.0,1.0); + EuclidianSpectrum_1D spectrum(spectrum_generator); double volume = Nx*Ny; gsl_rng *rng = gsl_rng_alloc(gsl_rng_default); dft.realSpace().eigen().setRandom(); + dft.fourierSpace().scale(std::complex(0,0)); dft.analysis(); cout << format("Testing (%d,%d)") % Nx % Ny << endl; cout << "Map dot-product = " << dft.realSpace().dot_product(dft.realSpace()) << endl; @@ -35,17 +37,19 @@ void test_2d(int Nx, int Ny) dft.realSpace().scale(2.0); dft.fourierSpace().scale(0.2); - SpectrumFunction::FourierMapPtr m = spectrum.newRandomFourier(rng, dft.fourierSpace()); + typename SpectrumFunction::FourierMapPtr m = spectrum.newRandomFourier(rng, dft.fourierSpace()); dft.fourierSpace() = *m.get(); dft.synthesis(); uint32_t dims[2] = { Ny, Nx }; CosmoTool::saveArray(str(format("generated_map_%d_%d.nc") %Nx % Ny) , dft.realSpace().data(), dims, 2); + + gsl_rng_free(rng); } int main(int argc, char **argv) { - test_2d(128,128); - test_2d(131,128); + test_2d(128,128); + test_2d(131,128); return 0; } From c49c8cb2321a61903f5c471c37046b5830f6a8fc Mon Sep 17 00:00:00 2001 From: Guilhem Lavaux Date: Sun, 11 Nov 2012 14:26:26 -0500 Subject: [PATCH 12/43] Test float implementation --- sample/test_fft_calls.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sample/test_fft_calls.cpp b/sample/test_fft_calls.cpp index 2541223..0009607 100644 --- a/sample/test_fft_calls.cpp +++ b/sample/test_fft_calls.cpp @@ -51,5 +51,7 @@ int main(int argc, char **argv) { test_2d(128,128); test_2d(131,128); + test_2d(128,128); + test_2d(131,128); return 0; } From ed1fede33d195386a055d2140640ac37707340f1 Mon Sep 17 00:00:00 2001 From: Guilhem Lavaux Date: Sun, 11 Nov 2012 14:30:45 -0500 Subject: [PATCH 13/43] Link to fftw3f library. Added test with swapped dimensions --- CMakeLists.txt | 1 + sample/CMakeLists.txt | 4 ++-- sample/test_fft_calls.cpp | 4 +++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 77bd8b8..f9df817 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -55,6 +55,7 @@ include(FindHDF5) include(FindPkgConfig) pkg_check_modules(FFTW3 fftw3>=3.3) +pkg_check_modules(FFTW3F fftw3f>=3.3) pkg_check_modules(EIGEN3 eigen3) include(FindPackageHandleStandardArgs) diff --git a/sample/CMakeLists.txt b/sample/CMakeLists.txt index 816d7bb..9d65cc3 100644 --- a/sample/CMakeLists.txt +++ b/sample/CMakeLists.txt @@ -44,9 +44,9 @@ target_link_libraries(testAlgo ${tolink}) add_executable(testBSP testBSP.cpp) target_link_libraries(testBSP ${tolink}) -if (FFTW3_FOUND AND EIGEN3_FOUND) +if (FFTW3_FOUND AND FFTW3F_FOUND AND EIGEN3_FOUND) add_executable(test_fft_calls test_fft_calls.cpp) - target_link_libraries(test_fft_calls ${tolink} ${FFTW3_LIBRARIES}) + target_link_libraries(test_fft_calls ${tolink} ${FFTW3_LIBRARIES} ${FFTW3F_LIBRARIES}) endif (FFTW3_FOUND AND EIGEN3_FOUND) if (SHARP_LIBRARY AND SHARP_INCLUDE_PATH AND EIGEN3_FOUND) diff --git a/sample/test_fft_calls.cpp b/sample/test_fft_calls.cpp index 0009607..4ba1f91 100644 --- a/sample/test_fft_calls.cpp +++ b/sample/test_fft_calls.cpp @@ -51,7 +51,9 @@ int main(int argc, char **argv) { test_2d(128,128); test_2d(131,128); + test_2d(130,128); test_2d(128,128); - test_2d(131,128); + test_2d(128,131); + test_2d(128,130); return 0; } From 7ad49118728dc5e98124a86f6cfeffa001ccde81 Mon Sep 17 00:00:00 2001 From: Guilhem Lavaux Date: Sun, 11 Nov 2012 15:46:03 -0500 Subject: [PATCH 14/43] Changed interface of newRandomFourier to avoid generating copies. --- sample/CMakeLists.txt | 2 +- sample/test_fft_calls.cpp | 3 +-- src/fourier/base_types.hpp | 4 ++-- src/fourier/euclidian.hpp | 33 ++++++++++++++------------------- src/fourier/healpix.hpp | 12 ++++-------- 5 files changed, 22 insertions(+), 32 deletions(-) diff --git a/sample/CMakeLists.txt b/sample/CMakeLists.txt index 9d65cc3..17e01c4 100644 --- a/sample/CMakeLists.txt +++ b/sample/CMakeLists.txt @@ -47,7 +47,7 @@ target_link_libraries(testBSP ${tolink}) if (FFTW3_FOUND AND FFTW3F_FOUND AND EIGEN3_FOUND) add_executable(test_fft_calls test_fft_calls.cpp) target_link_libraries(test_fft_calls ${tolink} ${FFTW3_LIBRARIES} ${FFTW3F_LIBRARIES}) -endif (FFTW3_FOUND AND EIGEN3_FOUND) +endif (FFTW3_FOUND AND FFTW3F_FOUND AND EIGEN3_FOUND) if (SHARP_LIBRARY AND SHARP_INCLUDE_PATH AND EIGEN3_FOUND) include_directories(${SHARP_INCLUDE_PATH}) diff --git a/sample/test_fft_calls.cpp b/sample/test_fft_calls.cpp index 4ba1f91..f62e678 100644 --- a/sample/test_fft_calls.cpp +++ b/sample/test_fft_calls.cpp @@ -37,8 +37,7 @@ void test_2d(int Nx, int Ny) dft.realSpace().scale(2.0); dft.fourierSpace().scale(0.2); - typename SpectrumFunction::FourierMapPtr m = spectrum.newRandomFourier(rng, dft.fourierSpace()); - dft.fourierSpace() = *m.get(); + spectrum.newRandomFourier(rng, dft.fourierSpace()); dft.synthesis(); uint32_t dims[2] = { Ny, Nx }; diff --git a/src/fourier/base_types.hpp b/src/fourier/base_types.hpp index 29a4c87..73d3698 100644 --- a/src/fourier/base_types.hpp +++ b/src/fourier/base_types.hpp @@ -26,8 +26,8 @@ namespace CosmoTool typedef FourierMap > FourierMapType; typedef boost::shared_ptr FourierMapPtr; - virtual FourierMapPtr - newRandomFourier(gsl_rng *rng, const FourierMapType& like_map) const = 0; + virtual void + newRandomFourier(gsl_rng *rng, FourierMapType& out_map) const = 0; virtual void mul(FourierMapType& m) const = 0; virtual void mul_sqrt(FourierMapType& m) const = 0; diff --git a/src/fourier/euclidian.hpp b/src/fourier/euclidian.hpp index 600ebbb..fb92e40 100644 --- a/src/fourier/euclidian.hpp +++ b/src/fourier/euclidian.hpp @@ -27,12 +27,12 @@ namespace CosmoTool { } - ptr_map newRandomFourier(gsl_rng *rng, const FourierMapType& like_map) const; + void newRandomFourier(gsl_rng *rng, FourierMapType& out_map) const; - void mul(FourierMap >& m) const; - void mul_sqrt(FourierMap >& m) const; - void mul_inv(FourierMap >& m) const; - void mul_inv_sqrt(FourierMap >& m) const; + void mul(FourierMapType& m) const; + void mul_sqrt(FourierMapType& m) const; + void mul_inv(FourierMapType& m) const; + void mul_inv_sqrt(FourierMapType& m) const; }; template @@ -388,16 +388,13 @@ namespace CosmoTool template - typename EuclidianSpectrum_1D::ptr_map - EuclidianSpectrum_1D::newRandomFourier(gsl_rng *rng, const FourierMapType& like_map) const + void EuclidianSpectrum_1D::newRandomFourier(gsl_rng *rng, FourierMapType& out_map) const { typedef EuclidianFourierMapComplex MapT; typedef typename EuclidianSpectrum_1D::ptr_map ptr_map; typedef typename MapT::DimArray DimArray; - const MapT& m_c = dynamic_cast(like_map); - ptr_map ret_map = ptr_map(m_c.mimick()); - MapT& rand_map = dynamic_cast(*ret_map.get()); + MapT& rand_map = dynamic_cast(out_map); std::complex *d = rand_map.data(); long idx; @@ -405,7 +402,7 @@ namespace CosmoTool long plane_size; bool alleven = rand_map.allDimensionsEven(); - for (long p = 1; p < m_c.size(); p++) + for (long p = 1; p < rand_map.size(); p++) { double A_k = std::sqrt(0.5*f(rand_map.get_K(p))); d[p] = std::complex(gsl_ran_gaussian(rng, A_k), @@ -415,14 +412,14 @@ namespace CosmoTool d[0] = std::complex(gsl_ran_gaussian(rng, std::sqrt(f(0))), 0); if (!rand_map.firstDimensionEven()) - return ret_map; + return; // Correct the Nyquist plane idx = dims[0]-1; // Stick to the last element of the first dimension d[idx] = std::complex(d[idx].real() + d[idx].imag(), 0); // 1D is special case if (dims.size() == 1) - return ret_map; + return; plane_size = 1; for (int q = 1; q < dims.size(); q++) @@ -447,12 +444,10 @@ namespace CosmoTool q += dims[0]-1; d[q] = std::complex(d[q].real()+d[q].imag(),0); } - - return ret_map; } template - void EuclidianSpectrum_1D::mul(FourierMap >& m) const + void EuclidianSpectrum_1D::mul(FourierMapType& m) const { EuclidianFourierMapComplex& m_c = dynamic_cast&>(m); std::complex *d = m.data(); @@ -462,7 +457,7 @@ namespace CosmoTool } template - void EuclidianSpectrum_1D::mul_sqrt(FourierMap >& m) const + void EuclidianSpectrum_1D::mul_sqrt(FourierMapType& m) const { EuclidianFourierMapComplex& m_c = dynamic_cast&>(m); std::complex *d = m.data(); @@ -472,7 +467,7 @@ namespace CosmoTool } template - void EuclidianSpectrum_1D::mul_inv(FourierMap >& m) const + void EuclidianSpectrum_1D::mul_inv(FourierMapType& m) const { EuclidianFourierMapComplex& m_c = dynamic_cast&>(m); std::complex *d = m.data(); @@ -488,7 +483,7 @@ namespace CosmoTool } template - void EuclidianSpectrum_1D::mul_inv_sqrt(FourierMap >& m) const + void EuclidianSpectrum_1D::mul_inv_sqrt(FourierMapType& m) const { EuclidianFourierMapComplex& m_c = dynamic_cast&>(m); std::complex *d = m.data(); diff --git a/src/fourier/healpix.hpp b/src/fourier/healpix.hpp index 06da0fc..bd868e7 100644 --- a/src/fourier/healpix.hpp +++ b/src/fourier/healpix.hpp @@ -32,7 +32,7 @@ namespace CosmoTool const T *data() const { return &cls[0]; } long size() const { return cls.size(); } - ptr_map newRandomFourier(gsl_rng *rng, const FourierMapType& like_map) const; + void newRandomFourier(gsl_rng *rng, FourierMapType& like_map) const; void mul(FourierMapType& m) const; void mul_sqrt(FourierMapType& m) const; @@ -244,14 +244,11 @@ namespace CosmoTool }; template - typename HealpixSpectrum::ptr_map - HealpixSpectrum::newRandomFourier(gsl_rng *rng, const FourierMapType& like_map) const + void HealpixSpectrum::newRandomFourier(gsl_rng *rng, FourierMapType& out_map) const { - const HealpixFourierALM& alms = dynamic_cast&>(like_map); - HealpixFourierALM *new_alms; - ptr_map r(new_alms = new HealpixFourierALM(alms.Lmax(), alms.Mmax())); + HealpixFourierALM& alms = dynamic_cast&>(out_map); long lmaxGen = std::min(cls.size()-1, alms.Lmax()); - std::complex *new_data = new_alms->data(); + std::complex *new_data = alms.data(); for (long l = 0; l <= lmaxGen; l++) { @@ -266,7 +263,6 @@ namespace CosmoTool c.imag() = gsl_ran_gaussian(rng, Al); } } - return r; } template From 60c6d789e3c3b776ce913f50d5d57989b0de5e3c Mon Sep 17 00:00:00 2001 From: Guilhem Lavaux Date: Mon, 12 Nov 2012 10:02:22 -0500 Subject: [PATCH 15/43] Added the copy and sqrt operator to SpectrumFunction --- src/fourier/base_types.hpp | 5 +++++ src/fourier/euclidian.hpp | 27 +++++++++++++++++++++++++++ src/fourier/healpix.hpp | 13 ++++++++++++- 3 files changed, 44 insertions(+), 1 deletion(-) diff --git a/src/fourier/base_types.hpp b/src/fourier/base_types.hpp index 73d3698..b1ee549 100644 --- a/src/fourier/base_types.hpp +++ b/src/fourier/base_types.hpp @@ -25,10 +25,15 @@ namespace CosmoTool typedef Eigen::Map ConstMapType; typedef FourierMap > FourierMapType; typedef boost::shared_ptr FourierMapPtr; + typedef boost::shared_ptr > SpectrumFunctionPtr; virtual void newRandomFourier(gsl_rng *rng, FourierMapType& out_map) const = 0; + virtual SpectrumFunctionPtr copy() const = 0; + + virtual void sqrt() = 0; + virtual void mul(FourierMapType& m) const = 0; virtual void mul_sqrt(FourierMapType& m) const = 0; virtual void mul_inv(FourierMapType& m) const = 0; diff --git a/src/fourier/euclidian.hpp b/src/fourier/euclidian.hpp index fb92e40..1a8c53f 100644 --- a/src/fourier/euclidian.hpp +++ b/src/fourier/euclidian.hpp @@ -1,6 +1,7 @@ #ifndef __COSMOTOOL_FOURIER_EUCLIDIAN_HPP #define __COSMOTOOL_FOURIER_EUCLIDIAN_HPP +#include #include #include #include @@ -11,6 +12,18 @@ namespace CosmoTool { + template + class EuclidianOperator + { + public: + typedef boost::function1 Function; + + Function base, op; + T operator()(T k) { + return op(base(k)); + } + }; + template class EuclidianSpectrum_1D: public SpectrumFunction { @@ -18,8 +31,11 @@ namespace CosmoTool typedef boost::function1 Function; protected: Function f; + + static T msqrt(T a) { return std::sqrt(a); } public: typedef typename SpectrumFunction::FourierMapType FourierMapType; + typedef typename SpectrumFunction::SpectrumFunctionPtr SpectrumFunctionPtr; typedef boost::shared_ptr ptr_map; EuclidianSpectrum_1D(Function P) @@ -29,6 +45,17 @@ namespace CosmoTool void newRandomFourier(gsl_rng *rng, FourierMapType& out_map) const; + SpectrumFunctionPtr copy() const { + return SpectrumFunctionPtr(new EuclidianSpectrum_1D(f)); + } + + void sqrt() { + EuclidianOperator o; + o.base = f; + o.op = &EuclidianSpectrum_1D::msqrt; + f = (Function(o)); + } + void mul(FourierMapType& m) const; void mul_sqrt(FourierMapType& m) const; void mul_inv(FourierMapType& m) const; diff --git a/src/fourier/healpix.hpp b/src/fourier/healpix.hpp index bd868e7..460935d 100644 --- a/src/fourier/healpix.hpp +++ b/src/fourier/healpix.hpp @@ -12,6 +12,8 @@ #include #include #include +#include +#include namespace CosmoTool { @@ -23,7 +25,7 @@ namespace CosmoTool public: typedef typename SpectrumFunction::FourierMapType FourierMapType; typedef boost::shared_ptr ptr_map; - + typedef typename SpectrumFunction::SpectrumFunctionPtr SpectrumFunctionPtr; HealpixSpectrum(long Lmax) : cls(Lmax+1) {} @@ -33,6 +35,15 @@ namespace CosmoTool long size() const { return cls.size(); } void newRandomFourier(gsl_rng *rng, FourierMapType& like_map) const; + SpectrumFunctionPtr copy() const { + HealpixSpectrum *s = new HealpixSpectrum(cls.size()-1); + s->cls = cls; + return SpectrumFunctionPtr(s); + } + + void sqrt() { + std::transform(cls.begin(), cls.end(), cls.begin(), std::ptr_fun(std::sqrt)); + } void mul(FourierMapType& m) const; void mul_sqrt(FourierMapType& m) const; From f67b04e57e88175f4558a8ce904946ac24d7a3fa Mon Sep 17 00:00:00 2001 From: Guilhem Lavaux Date: Mon, 12 Nov 2012 20:27:32 -0500 Subject: [PATCH 16/43] Splitted euclidian.hpp into several files. Added implementation of binned powerspectrum --- src/fourier/base_types.hpp | 14 +- src/fourier/details/euclidian_maps.hpp | 188 +++++++ src/fourier/details/euclidian_spectrum_1d.hpp | 172 ++++++ .../details/euclidian_spectrum_1d_bin.hpp | 65 +++ src/fourier/details/euclidian_transform.hpp | 181 ++++++ src/fourier/euclidian.hpp | 521 +----------------- 6 files changed, 622 insertions(+), 519 deletions(-) create mode 100644 src/fourier/details/euclidian_maps.hpp create mode 100644 src/fourier/details/euclidian_spectrum_1d.hpp create mode 100644 src/fourier/details/euclidian_spectrum_1d_bin.hpp create mode 100644 src/fourier/details/euclidian_transform.hpp diff --git a/src/fourier/base_types.hpp b/src/fourier/base_types.hpp index b1ee549..ae62f54 100644 --- a/src/fourier/base_types.hpp +++ b/src/fourier/base_types.hpp @@ -27,11 +27,17 @@ namespace CosmoTool typedef boost::shared_ptr FourierMapPtr; typedef boost::shared_ptr > SpectrumFunctionPtr; + virtual ~SpectrumFunction() {} + virtual void newRandomFourier(gsl_rng *rng, FourierMapType& out_map) const = 0; virtual SpectrumFunctionPtr copy() const = 0; + virtual const T *data() const { return 0; } + virtual const T *dof() const { return 0; } + virtual long size() const { return -1; } + virtual void sqrt() = 0; virtual void mul(FourierMapType& m) const = 0; @@ -147,10 +153,14 @@ namespace CosmoTool template class MapUtilityFunction { + public: typedef SpectrumFunction Spectrum; - typedef Spectrum *Spectrum_ptr; + typedef boost::shared_ptr Spectrum_ptr; typedef FourierMap > FMap; - typedef Spectrum_ptr (*SpectrumFromMap)(const FMap& m); + + virtual Spectrum_ptr estimateSpectrumFromMap(const FMap& m) const = 0; + virtual Spectrum_ptr newSpectrumFromRaw(T *data, long size, + Spectrum_ptr like_spec) const = 0; }; }; diff --git a/src/fourier/details/euclidian_maps.hpp b/src/fourier/details/euclidian_maps.hpp new file mode 100644 index 0000000..c890471 --- /dev/null +++ b/src/fourier/details/euclidian_maps.hpp @@ -0,0 +1,188 @@ +#ifndef __DETAILS_EUCLIDIAN_MAPS +#define __DETAILS_EUCLIDIAN_MAPS + + +namespace CosmoTool +{ + + template + class EuclidianFourierMapBase: public FourierMap + { + public: + typedef std::vector DimArray; + private: + boost::shared_ptr m_data; + DimArray m_dims; + long m_size; + public: + + EuclidianFourierMapBase(boost::shared_ptr indata, const DimArray& indims) + { + m_data = indata; + m_dims = indims; + m_size = 1; + for (int i = 0; i < m_dims.size(); i++) + m_size *= m_dims[i]; + } + + virtual ~EuclidianFourierMapBase() + { + } + + const DimArray& getDims() const { return m_dims; } + + virtual const T *data() const { return m_data.get(); } + virtual T *data() { return m_data.get(); } + virtual long size() const { return m_size; } + + virtual FourierMap *copy() const + { + FourierMap *m = this->mimick(); + m->eigen() = this->eigen(); + return m; + } + + }; + + template + class EuclidianFourierMapReal: public EuclidianFourierMapBase + { + public: + typedef typename EuclidianFourierMapBase::DimArray DimArray; + + EuclidianFourierMapReal(boost::shared_ptr indata, const DimArray& indims) + : EuclidianFourierMapBase(indata, indims) + {} + + virtual FourierMap *mimick() const + { + return new EuclidianFourierMapReal( + boost::shared_ptr((T *)fftw_malloc(sizeof(T)*this->size()), + std::ptr_fun(fftw_free)), + this->getDims()); + } + + virtual T dot_product(const FourierMap& other) const + throw(std::bad_cast) + { + const EuclidianFourierMapReal& m2 = dynamic_cast&>(other); + if (this->size() != m2.size()) + throw std::bad_cast(); + + return (this->eigen()*m2.eigen()).sum(); + } + }; + + template + class EuclidianFourierMapComplex: public EuclidianFourierMapBase > + { + protected: + typedef boost::shared_ptr > ptr_t; + std::vector delta_k; + int m_dim0; + bool even0, alleven; + long plane_size; + public: + typedef typename EuclidianFourierMapBase >::DimArray DimArray; + + EuclidianFourierMapComplex(ptr_t indata, + int dim0, + const DimArray& indims, + const std::vector& dk) + : EuclidianFourierMapBase >(indata, indims), delta_k(dk), m_dim0(dim0), even0((dim0 % 2)==0) + { + assert(dk.size() == indims.size()); + plane_size = 1; + alleven = true; + for (int q = 1; q < indims.size(); q++) + { + plane_size *= indims[q]; + alleven = alleven && ((indims[q]%2)==0); + } + } + + virtual FourierMap > *mimick() const + { + return + new EuclidianFourierMapComplex( + ptr_t((std::complex *) + fftw_malloc(sizeof(std::complex)*this->size()), + std::ptr_fun(fftw_free)), + m_dim0, + this->getDims(), + this->delta_k); + } + + template + double get_K(const Array& ik) + { + const DimArray& dims = this->getDims(); + assert(ik.size() == dims.size()); + double k2 = 0; + k2 += CosmoTool::square(ik[0]*delta_k[0]); + + for (int q = 1; q < ik.size(); q++) + { + int dk = ik[q]; + + if (dk > dims[q]/2) + dk = dk - dims[q]; + + k2 += CosmoTool::square(delta_k[q]*dk); + } + return std::sqrt(k2); + } + + double get_K(long p) + { + const DimArray& dims = this->getDims(); + DimArray d(delta_k.size()); + for (int q = 0; q < d.size(); q++) + { + d[q] = p%dims[q]; + p = (p-d[q])/dims[q]; + } + return get_K(d); + } + + bool allDimensionsEven() const { return alleven; } + bool firstDimensionEven() const { return even0; } + + virtual std::complex dot_product(const FourierMap >& other) const + throw(std::bad_cast) + { + const EuclidianFourierMapComplex& m2 = dynamic_cast&>(other); + if (this->size() != m2.size()) + throw std::bad_cast(); + + const std::complex *d1 = this->data(); + const std::complex *d2 = m2.data(); + const DimArray& dims = this->getDims(); + int N0 = dims[0] + (even0 ? 0 : 1); + std::complex result = 0; + + for (long q0 = 1; q0 < N0-1; q0++) + { + for (long p = 0; p < plane_size; p++) + { + long idx = q0+dims[0]*p; + assert(idx < this->size()); + result += 2*(conj(d1[idx]) * d2[idx]).real(); + } + } + if (even0) + { + for (long p = 0; p < plane_size; p++) + { + long q0 = N0*p, q1 = (p+1)*N0-1; + result += conj(d1[q0]) * d2[q0]; + result += conj(d1[q1]) * d2[q1]; + } + } + return result; + } + + }; +}; + +#endif diff --git a/src/fourier/details/euclidian_spectrum_1d.hpp b/src/fourier/details/euclidian_spectrum_1d.hpp new file mode 100644 index 0000000..b12864b --- /dev/null +++ b/src/fourier/details/euclidian_spectrum_1d.hpp @@ -0,0 +1,172 @@ +#ifndef __DETAILS_EUCLIDIAN_SPECTRUM_1D +#define __DETAILS_EUCLIDIAN_SPECTRUM_1D + + +namespace CosmoTool +{ + template + class EuclidianOperator + { + public: + typedef boost::function1 Function; + + Function base, op; + T operator()(T k) { + return op(base(k)); + } + }; + + template + class EuclidianSpectrum_1D: public SpectrumFunction + { + public: + typedef boost::function1 Function; + protected: + Function f; + + static T msqrt(T a) { return std::sqrt(a); } + public: + typedef typename SpectrumFunction::FourierMapType FourierMapType; + typedef typename SpectrumFunction::SpectrumFunctionPtr SpectrumFunctionPtr; + typedef boost::shared_ptr ptr_map; + + EuclidianSpectrum_1D(Function P) + : f(P) + { + } + + void newRandomFourier(gsl_rng *rng, FourierMapType& out_map) const; + + SpectrumFunctionPtr copy() const { + return SpectrumFunctionPtr(new EuclidianSpectrum_1D(f)); + } + + void sqrt() { + EuclidianOperator o; + o.base = f; + o.op = &EuclidianSpectrum_1D::msqrt; + f = (Function(o)); + } + + void mul(FourierMapType& m) const; + void mul_sqrt(FourierMapType& m) const; + void mul_inv(FourierMapType& m) const; + void mul_inv_sqrt(FourierMapType& m) const; + }; + + + template + void EuclidianSpectrum_1D::newRandomFourier(gsl_rng *rng, FourierMapType& out_map) const + { + typedef EuclidianFourierMapComplex MapT; + typedef typename EuclidianSpectrum_1D::ptr_map ptr_map; + typedef typename MapT::DimArray DimArray; + + MapT& rand_map = dynamic_cast(out_map); + + std::complex *d = rand_map.data(); + long idx; + const DimArray& dims = rand_map.getDims(); + long plane_size; + bool alleven = rand_map.allDimensionsEven(); + + for (long p = 1; p < rand_map.size(); p++) + { + double A_k = std::sqrt(0.5*f(rand_map.get_K(p))); + d[p] = std::complex(gsl_ran_gaussian(rng, A_k), + gsl_ran_gaussian(rng, A_k)); + } + // Generate the mean value + d[0] = std::complex(gsl_ran_gaussian(rng, std::sqrt(f(0))), 0); + + if (!rand_map.firstDimensionEven()) + return; + + // Correct the Nyquist plane + idx = dims[0]-1; // Stick to the last element of the first dimension + d[idx] = std::complex(d[idx].real() + d[idx].imag(), 0); + // 1D is special case + if (dims.size() == 1) + return; + + plane_size = 1; + for (int q = 1; q < dims.size(); q++) + { + plane_size *= dims[q]; + } + + for (long p = 1; p < plane_size/2; p++) + { + long q = (p+1)*dims[0]-1; + long q2 = (plane_size-p+1)*dims[0]-1; + assert(q < plane_size*dims[0]); + assert(q2 < plane_size*dims[0]); + d[q] = conj(d[q2]); + } + + if (alleven) + { + long q = 0; + for (int i = dims.size()-1; i >= 1; i--) + q = dims[i]*q + dims[i]/2; + q += dims[0]-1; + d[q] = std::complex(d[q].real()+d[q].imag(),0); + } + } + + template + void EuclidianSpectrum_1D::mul(FourierMapType& m) const + { + EuclidianFourierMapComplex& m_c = dynamic_cast&>(m); + std::complex *d = m.data(); + + for (long p = 0; p < m_c.size(); p++) + d[p] *= f(m_c.get_K(p)); + } + + template + void EuclidianSpectrum_1D::mul_sqrt(FourierMapType& m) const + { + EuclidianFourierMapComplex& m_c = dynamic_cast&>(m); + std::complex *d = m.data(); + + for (long p = 0; p < m_c.size(); p++) + d[p] *= std::sqrt(f(m_c.get_K(p))); + } + + template + void EuclidianSpectrum_1D::mul_inv(FourierMapType& m) const + { + EuclidianFourierMapComplex& m_c = dynamic_cast&>(m); + std::complex *d = m.data(); + + for (long p = 0; p < m_c.size(); p++) + { + T A = f(m_c.get_K(p)); + if (A==0) + d[p] = 0; + else + d[p] /= A; + } + } + + template + void EuclidianSpectrum_1D::mul_inv_sqrt(FourierMapType& m) const + { + EuclidianFourierMapComplex& m_c = dynamic_cast&>(m); + std::complex *d = m.data(); + + for (long p = 0; p < m_c.size(); p++) + { + T A = std::sqrt(f(m_c.get_K(p))); + if (A == 0) + d[p] = 0; + else + d[p] /= A; + } + } + +}; + + +#endif diff --git a/src/fourier/details/euclidian_spectrum_1d_bin.hpp b/src/fourier/details/euclidian_spectrum_1d_bin.hpp new file mode 100644 index 0000000..ff1c98d --- /dev/null +++ b/src/fourier/details/euclidian_spectrum_1d_bin.hpp @@ -0,0 +1,65 @@ +#ifndef __DETAILS_EUCLIDIAN_SPECTRUM_1D_BIN +#define __DETAILS_EUCLIDIAN_SPECTRUM_1D_BIN + +#include +#include + +namespace CosmoTool +{ + template + class EuclidianSpectrum_1D_Binned: public EuclidianSpectrum_1D + { + protected: + T *m_data; + long m_size; + T m_kmin, m_kmax, m_logdeltak; + std::vector m_dof; + public: + typedef typename SpectrumFunction::FourierMapType FourierMapType; + typedef typename SpectrumFunction::SpectrumFunctionPtr SpectrumFunctionPtr; + typedef boost::shared_ptr ptr_map; + + T interpolate_spectrum(T k) + { + T q = std::log(k/m_kmin)/m_logdeltak; + long ik = std::floor(q); + + if (ik >= m_size-1) + return m_data[m_size-1]; + else if (ik < 0) + return k/m_kmin*m_data[0]; + + return std::exp((q-ik)*m_data[ik+1] + (1-(q-ik))*m_data[ik]); + } + + EuclidianSpectrum_1D_Binned(int numBin, T kmin, T kmax) + : EuclidianSpectrum_1D(boost::bind(&EuclidianSpectrum_1D_Binned::interpolate_spectrum, this, _1)) + { + m_data = new T[numBin]; + m_kmin = kmin; + m_kmax = kmax; + m_size = numBin; + m_logdeltak = std::log(m_kmax/m_kmin); + } + + SpectrumFunctionPtr copy() const + { + EuclidianSpectrum_1D_Binned *s = new EuclidianSpectrum_1D_Binned(m_size, m_kmin, m_kmax); + std::copy(m_data, m_data+m_size, s->m_data); + return SpectrumFunctionPtr(s); + } + + void set_dof(std::vector& dof_array) + { + assert(m_size == dof_array.size()); + m_dof = dof_array; + } + + const T *data() const { return m_data; } + long size() const { return m_size; } + const T *dof() const { return &m_dof[0]; } + }; + +}; + +#endif diff --git a/src/fourier/details/euclidian_transform.hpp b/src/fourier/details/euclidian_transform.hpp new file mode 100644 index 0000000..b533227 --- /dev/null +++ b/src/fourier/details/euclidian_transform.hpp @@ -0,0 +1,181 @@ +#ifndef __DETAILS_EUCLIDIAN_TRANSFORM +#define __DETAILS_EUCLIDIAN_TRANSFORM + +namespace CosmoTool +{ + + template + class EuclidianFourierTransform: public FourierTransform + { + public: + typedef typename EuclidianFourierMapBase::DimArray DimArray; + private: + typedef FFTW_Calls calls; + EuclidianFourierMapReal *realMap; + EuclidianFourierMapComplex *fourierMap; + typename calls::plan_type m_analysis, m_synthesis; + double volume; + long N, Nc; + DimArray m_dims, m_dims_hc; + std::vector m_L; + public: + EuclidianFourierTransform(const DimArray& dims, const std::vector& L) + { + assert(L.size() == dims.size()); + std::vector dk(L.size()); + std::vector swapped_dims(dims.size()); + + m_dims = dims; + m_dims_hc = dims; + m_dims_hc[0] = dims[0]/2+1; + m_L = L; + + N = 1; + Nc = 1; + volume = 1; + for (int i = 0; i < dims.size(); i++) + { + N *= dims[i]; + Nc *= m_dims_hc[i]; + volume *= L[i]; + dk[i] = 2*M_PI/L[i]; + swapped_dims[dims.size()-1-i] = dims[i]; + } + + realMap = new EuclidianFourierMapReal( + boost::shared_ptr(calls::alloc_real(N), + std::ptr_fun(calls::free)), + m_dims); + fourierMap = new EuclidianFourierMapComplex( + boost::shared_ptr >((std::complex*)calls::alloc_complex(Nc), + std::ptr_fun(calls::free)), + dims[0], m_dims_hc, dk); + m_analysis = calls::plan_dft_r2c(dims.size(), &swapped_dims[0], + realMap->data(), (typename calls::complex_type *)fourierMap->data(), + FFTW_DESTROY_INPUT|FFTW_MEASURE); + m_synthesis = calls::plan_dft_c2r(dims.size(), &swapped_dims[0], + (typename calls::complex_type *)fourierMap->data(), realMap->data(), + FFTW_DESTROY_INPUT|FFTW_MEASURE); + } + + virtual ~EuclidianFourierTransform() + { + delete realMap; + delete fourierMap; + calls::destroy_plan(m_synthesis); + calls::destroy_plan(m_analysis); + } + + void synthesis() + { + calls::execute(m_synthesis); + realMap->scale(1/volume); + } + + void analysis() + { + calls::execute(m_analysis); + fourierMap->scale(volume/N); + } + + void synthesis_conjugate() + { + calls::execute(m_analysis); + fourierMap->scale(1/volume); + } + + void analysis_conjugate() + { + calls::execute(m_synthesis); + realMap->scale(volume/N); + } + + const FourierMap >& fourierSpace() const + { + return *fourierMap; + } + + FourierMap >& fourierSpace() + { + return *fourierMap; + } + + const FourierMap& realSpace() const + { + return *realMap; + } + + FourierMap& realSpace() + { + return *realMap; + } + + FourierTransform *mimick() const + { + return new EuclidianFourierTransform(m_dims, m_L); + } + }; + + template + class EuclidianFourierTransform_1d: public EuclidianFourierTransform + { + private: + template + static std::vector make_1d_vector(T2 a) + { + T2 arr[2] = { a}; + return std::vector(&arr[0],&arr[1]); + } + public: + EuclidianFourierTransform_1d(int Nx, double Lx) + : EuclidianFourierTransform(make_1d_vector(Nx), make_1d_vector(Lx)) + { + } + + virtual ~EuclidianFourierTransform_1d() {} + + }; + + template + class EuclidianFourierTransform_2d: public EuclidianFourierTransform + { + private: + template + static std::vector make_2d_vector(T2 a, T2 b) + { + T2 arr[2] = { a, b}; + return std::vector(&arr[0], &arr[2]); + } + public: + EuclidianFourierTransform_2d(int Nx, int Ny, double Lx, double Ly) + : EuclidianFourierTransform(make_2d_vector(Nx, Ny), make_2d_vector(Lx, Ly)) + { + } + + virtual ~EuclidianFourierTransform_2d() {} + + }; + + template + class EuclidianFourierTransform_3d: public EuclidianFourierTransform + { + private: + template + static std::vector make_3d_vector(T2 a, T2 b, T2 c) + { + T2 arr[2] = { a, b, c}; + return std::vector(&arr[0], &arr[3]); + } + + public: + EuclidianFourierTransform_3d(int Nx, int Ny, int Nz, double Lx, double Ly, double Lz) + : EuclidianFourierTransform(make_3d_vector(Nx, Ny, Nz), make_3d_vector(Lx, Ly, Lz)) + { + } + + virtual ~EuclidianFourierTransform_3d() {} + }; + +}; + +#endif diff --git a/src/fourier/euclidian.hpp b/src/fourier/euclidian.hpp index 1a8c53f..45ec3dc 100644 --- a/src/fourier/euclidian.hpp +++ b/src/fourier/euclidian.hpp @@ -9,522 +9,9 @@ #include "base_types.hpp" #include "fft/fftw_calls.hpp" #include "../algo.hpp" - -namespace CosmoTool -{ - template - class EuclidianOperator - { - public: - typedef boost::function1 Function; - - Function base, op; - T operator()(T k) { - return op(base(k)); - } - }; - - template - class EuclidianSpectrum_1D: public SpectrumFunction - { - public: - typedef boost::function1 Function; - protected: - Function f; - - static T msqrt(T a) { return std::sqrt(a); } - public: - typedef typename SpectrumFunction::FourierMapType FourierMapType; - typedef typename SpectrumFunction::SpectrumFunctionPtr SpectrumFunctionPtr; - typedef boost::shared_ptr ptr_map; - - EuclidianSpectrum_1D(Function P) - : f(P) - { - } - - void newRandomFourier(gsl_rng *rng, FourierMapType& out_map) const; - - SpectrumFunctionPtr copy() const { - return SpectrumFunctionPtr(new EuclidianSpectrum_1D(f)); - } - - void sqrt() { - EuclidianOperator o; - o.base = f; - o.op = &EuclidianSpectrum_1D::msqrt; - f = (Function(o)); - } - - void mul(FourierMapType& m) const; - void mul_sqrt(FourierMapType& m) const; - void mul_inv(FourierMapType& m) const; - void mul_inv_sqrt(FourierMapType& m) const; - }; - - template - class EuclidianFourierMapBase: public FourierMap - { - public: - typedef std::vector DimArray; - private: - boost::shared_ptr m_data; - DimArray m_dims; - long m_size; - public: - - EuclidianFourierMapBase(boost::shared_ptr indata, const DimArray& indims) - { - m_data = indata; - m_dims = indims; - m_size = 1; - for (int i = 0; i < m_dims.size(); i++) - m_size *= m_dims[i]; - } - - virtual ~EuclidianFourierMapBase() - { - } - - const DimArray& getDims() const { return m_dims; } - - virtual const T *data() const { return m_data.get(); } - virtual T *data() { return m_data.get(); } - virtual long size() const { return m_size; } - - virtual FourierMap *copy() const - { - FourierMap *m = this->mimick(); - m->eigen() = this->eigen(); - return m; - } - - }; - - template - class EuclidianFourierMapReal: public EuclidianFourierMapBase - { - public: - typedef typename EuclidianFourierMapBase::DimArray DimArray; - - EuclidianFourierMapReal(boost::shared_ptr indata, const DimArray& indims) - : EuclidianFourierMapBase(indata, indims) - {} - - virtual FourierMap *mimick() const - { - return new EuclidianFourierMapReal( - boost::shared_ptr((T *)fftw_malloc(sizeof(T)*this->size()), - std::ptr_fun(fftw_free)), - this->getDims()); - } - - virtual T dot_product(const FourierMap& other) const - throw(std::bad_cast) - { - const EuclidianFourierMapReal& m2 = dynamic_cast&>(other); - if (this->size() != m2.size()) - throw std::bad_cast(); - - return (this->eigen()*m2.eigen()).sum(); - } - }; - - template - class EuclidianFourierMapComplex: public EuclidianFourierMapBase > - { - protected: - typedef boost::shared_ptr > ptr_t; - std::vector delta_k; - int m_dim0; - bool even0, alleven; - long plane_size; - public: - typedef typename EuclidianFourierMapBase >::DimArray DimArray; - - EuclidianFourierMapComplex(ptr_t indata, - int dim0, - const DimArray& indims, - const std::vector& dk) - : EuclidianFourierMapBase >(indata, indims), delta_k(dk), m_dim0(dim0), even0((dim0 % 2)==0) - { - assert(dk.size() == indims.size()); - plane_size = 1; - alleven = true; - for (int q = 1; q < indims.size(); q++) - { - plane_size *= indims[q]; - alleven = alleven && ((indims[q]%2)==0); - } - } - - virtual FourierMap > *mimick() const - { - return - new EuclidianFourierMapComplex( - ptr_t((std::complex *) - fftw_malloc(sizeof(std::complex)*this->size()), - std::ptr_fun(fftw_free)), - m_dim0, - this->getDims(), - this->delta_k); - } - - template - double get_K(const Array& ik) - { - const DimArray& dims = this->getDims(); - assert(ik.size() == dims.size()); - double k2 = 0; - k2 += CosmoTool::square(ik[0]*delta_k[0]); - - for (int q = 1; q < ik.size(); q++) - { - int dk = ik[q]; - - if (dk > dims[q]/2) - dk = dk - dims[q]; - - k2 += CosmoTool::square(delta_k[q]*dk); - } - return std::sqrt(k2); - } - - double get_K(long p) - { - const DimArray& dims = this->getDims(); - DimArray d(delta_k.size()); - for (int q = 0; q < d.size(); q++) - { - d[q] = p%dims[q]; - p = (p-d[q])/dims[q]; - } - return get_K(d); - } - - bool allDimensionsEven() const { return alleven; } - bool firstDimensionEven() const { return even0; } - - virtual std::complex dot_product(const FourierMap >& other) const - throw(std::bad_cast) - { - const EuclidianFourierMapComplex& m2 = dynamic_cast&>(other); - if (this->size() != m2.size()) - throw std::bad_cast(); - - const std::complex *d1 = this->data(); - const std::complex *d2 = m2.data(); - const DimArray& dims = this->getDims(); - int N0 = dims[0] + (even0 ? 0 : 1); - std::complex result = 0; - - for (long q0 = 1; q0 < N0-1; q0++) - { - for (long p = 0; p < plane_size; p++) - { - long idx = q0+dims[0]*p; - assert(idx < this->size()); - result += 2*(conj(d1[idx]) * d2[idx]).real(); - } - } - if (even0) - { - for (long p = 0; p < plane_size; p++) - { - long q0 = N0*p, q1 = (p+1)*N0-1; - result += conj(d1[q0]) * d2[q0]; - result += conj(d1[q1]) * d2[q1]; - } - } - return result; - } - - }; - - template - class EuclidianFourierTransform: public FourierTransform - { - public: - typedef typename EuclidianFourierMapBase::DimArray DimArray; - private: - typedef FFTW_Calls calls; - EuclidianFourierMapReal *realMap; - EuclidianFourierMapComplex *fourierMap; - typename calls::plan_type m_analysis, m_synthesis; - double volume; - long N, Nc; - DimArray m_dims, m_dims_hc; - std::vector m_L; - public: - EuclidianFourierTransform(const DimArray& dims, const std::vector& L) - { - assert(L.size() == dims.size()); - std::vector dk(L.size()); - std::vector swapped_dims(dims.size()); - - m_dims = dims; - m_dims_hc = dims; - m_dims_hc[0] = dims[0]/2+1; - m_L = L; - - N = 1; - Nc = 1; - volume = 1; - for (int i = 0; i < dims.size(); i++) - { - N *= dims[i]; - Nc *= m_dims_hc[i]; - volume *= L[i]; - dk[i] = 2*M_PI/L[i]; - swapped_dims[dims.size()-1-i] = dims[i]; - } - - realMap = new EuclidianFourierMapReal( - boost::shared_ptr(calls::alloc_real(N), - std::ptr_fun(calls::free)), - m_dims); - fourierMap = new EuclidianFourierMapComplex( - boost::shared_ptr >((std::complex*)calls::alloc_complex(Nc), - std::ptr_fun(calls::free)), - dims[0], m_dims_hc, dk); - m_analysis = calls::plan_dft_r2c(dims.size(), &swapped_dims[0], - realMap->data(), (typename calls::complex_type *)fourierMap->data(), - FFTW_DESTROY_INPUT|FFTW_MEASURE); - m_synthesis = calls::plan_dft_c2r(dims.size(), &swapped_dims[0], - (typename calls::complex_type *)fourierMap->data(), realMap->data(), - FFTW_DESTROY_INPUT|FFTW_MEASURE); - } - - virtual ~EuclidianFourierTransform() - { - delete realMap; - delete fourierMap; - calls::destroy_plan(m_synthesis); - calls::destroy_plan(m_analysis); - } - - void synthesis() - { - calls::execute(m_synthesis); - realMap->scale(1/volume); - } - - void analysis() - { - calls::execute(m_analysis); - fourierMap->scale(volume/N); - } - - void synthesis_conjugate() - { - calls::execute(m_analysis); - fourierMap->scale(1/volume); - } - - void analysis_conjugate() - { - calls::execute(m_synthesis); - realMap->scale(volume/N); - } - - const FourierMap >& fourierSpace() const - { - return *fourierMap; - } - - FourierMap >& fourierSpace() - { - return *fourierMap; - } - - const FourierMap& realSpace() const - { - return *realMap; - } - - FourierMap& realSpace() - { - return *realMap; - } - - FourierTransform *mimick() const - { - return new EuclidianFourierTransform(m_dims, m_L); - } - }; - - template - class EuclidianFourierTransform_1d: public EuclidianFourierTransform - { - private: - template - static std::vector make_1d_vector(T2 a) - { - T2 arr[2] = { a}; - return std::vector(&arr[0],&arr[1]); - } - public: - EuclidianFourierTransform_1d(int Nx, double Lx) - : EuclidianFourierTransform(make_1d_vector(Nx), make_1d_vector(Lx)) - { - } - - virtual ~EuclidianFourierTransform_1d() {} - - }; - - template - class EuclidianFourierTransform_2d: public EuclidianFourierTransform - { - private: - template - static std::vector make_2d_vector(T2 a, T2 b) - { - T2 arr[2] = { a, b}; - return std::vector(&arr[0], &arr[2]); - } - public: - EuclidianFourierTransform_2d(int Nx, int Ny, double Lx, double Ly) - : EuclidianFourierTransform(make_2d_vector(Nx, Ny), make_2d_vector(Lx, Ly)) - { - } - - virtual ~EuclidianFourierTransform_2d() {} - - }; - - template - class EuclidianFourierTransform_3d: public EuclidianFourierTransform - { - private: - template - static std::vector make_3d_vector(T2 a, T2 b, T2 c) - { - T2 arr[2] = { a, b, c}; - return std::vector(&arr[0], &arr[3]); - } - - public: - EuclidianFourierTransform_3d(int Nx, int Ny, int Nz, double Lx, double Ly, double Lz) - : EuclidianFourierTransform(make_3d_vector(Nx, Ny, Nz), make_3d_vector(Lx, Ly, Lz)) - { - } - - virtual ~EuclidianFourierTransform_3d() {} - }; - - - template - void EuclidianSpectrum_1D::newRandomFourier(gsl_rng *rng, FourierMapType& out_map) const - { - typedef EuclidianFourierMapComplex MapT; - typedef typename EuclidianSpectrum_1D::ptr_map ptr_map; - typedef typename MapT::DimArray DimArray; - - MapT& rand_map = dynamic_cast(out_map); - - std::complex *d = rand_map.data(); - long idx; - const DimArray& dims = rand_map.getDims(); - long plane_size; - bool alleven = rand_map.allDimensionsEven(); - - for (long p = 1; p < rand_map.size(); p++) - { - double A_k = std::sqrt(0.5*f(rand_map.get_K(p))); - d[p] = std::complex(gsl_ran_gaussian(rng, A_k), - gsl_ran_gaussian(rng, A_k)); - } - // Generate the mean value - d[0] = std::complex(gsl_ran_gaussian(rng, std::sqrt(f(0))), 0); - - if (!rand_map.firstDimensionEven()) - return; - - // Correct the Nyquist plane - idx = dims[0]-1; // Stick to the last element of the first dimension - d[idx] = std::complex(d[idx].real() + d[idx].imag(), 0); - // 1D is special case - if (dims.size() == 1) - return; - - plane_size = 1; - for (int q = 1; q < dims.size(); q++) - { - plane_size *= dims[q]; - } - - for (long p = 1; p < plane_size/2; p++) - { - long q = (p+1)*dims[0]-1; - long q2 = (plane_size-p+1)*dims[0]-1; - assert(q < plane_size*dims[0]); - assert(q2 < plane_size*dims[0]); - d[q] = conj(d[q2]); - } - - if (alleven) - { - long q = 0; - for (int i = dims.size()-1; i >= 1; i--) - q = dims[i]*q + dims[i]/2; - q += dims[0]-1; - d[q] = std::complex(d[q].real()+d[q].imag(),0); - } - } - - template - void EuclidianSpectrum_1D::mul(FourierMapType& m) const - { - EuclidianFourierMapComplex& m_c = dynamic_cast&>(m); - std::complex *d = m.data(); - - for (long p = 0; p < m_c.size(); p++) - d[p] *= f(m_c.get_K(p)); - } - - template - void EuclidianSpectrum_1D::mul_sqrt(FourierMapType& m) const - { - EuclidianFourierMapComplex& m_c = dynamic_cast&>(m); - std::complex *d = m.data(); - - for (long p = 0; p < m_c.size(); p++) - d[p] *= std::sqrt(f(m_c.get_K(p))); - } - - template - void EuclidianSpectrum_1D::mul_inv(FourierMapType& m) const - { - EuclidianFourierMapComplex& m_c = dynamic_cast&>(m); - std::complex *d = m.data(); - - for (long p = 0; p < m_c.size(); p++) - { - T A = f(m_c.get_K(p)); - if (A==0) - d[p] = 0; - else - d[p] /= A; - } - } - - template - void EuclidianSpectrum_1D::mul_inv_sqrt(FourierMapType& m) const - { - EuclidianFourierMapComplex& m_c = dynamic_cast&>(m); - std::complex *d = m.data(); - - for (long p = 0; p < m_c.size(); p++) - { - T A = std::sqrt(f(m_c.get_K(p))); - if (A == 0) - d[p] = 0; - else - d[p] /= A; - } - } - -}; +#include "details/euclidian_maps.hpp" +#include "details/euclidian_spectrum_1d.hpp" +#include "details/euclidian_spectrum_1d_bin.hpp" +#include "details/euclidian_transform.hpp" #endif From b7156fcc76f0fb54d27e0c6e823877635742b4b8 Mon Sep 17 00:00:00 2001 From: Guilhem Lavaux Date: Sun, 18 Nov 2012 15:47:37 -0500 Subject: [PATCH 17/43] Splitted healpix.hpp into several files for easier maintainability --- src/fourier/details/healpix_alms.hpp | 76 +++++ src/fourier/details/healpix_map.hpp | 54 ++++ src/fourier/details/healpix_spectrum.hpp | 133 +++++++++ src/fourier/details/healpix_transform.hpp | 97 +++++++ src/fourier/healpix.hpp | 333 +--------------------- 5 files changed, 364 insertions(+), 329 deletions(-) create mode 100644 src/fourier/details/healpix_alms.hpp create mode 100644 src/fourier/details/healpix_map.hpp create mode 100644 src/fourier/details/healpix_spectrum.hpp create mode 100644 src/fourier/details/healpix_transform.hpp diff --git a/src/fourier/details/healpix_alms.hpp b/src/fourier/details/healpix_alms.hpp new file mode 100644 index 0000000..849781f --- /dev/null +++ b/src/fourier/details/healpix_alms.hpp @@ -0,0 +1,76 @@ +#ifndef __COSMOTOOL_FOURIER_HEALPIX_DETAILS_ALM_HPP +#define __COSMOTOOL_FOURIER_HEALPIX_DETAILS_ALM_HPP + +namespace CosmoTool +{ + template + class HealpixFourierALM: public FourierMap > + { + private: + std::complex *alms; + long m_size; + long Lmax_, Mmax_, TVal_; + Eigen::aligned_allocator > alloc; + public: + typedef unsigned long LType; + + LType Lmax() const { return Lmax_; } + LType Mmax() const { return Mmax_; } + + LType Num_Alms() const + { + return ((Mmax_+1)*(Mmax_+2))/2 + (Mmax_+1)*(Lmax_-Mmax_); + } + + LType index_l0(LType m) const + { + return ((m*(TVal_-m))/2); + } + + LType index(LType l, LType m) const + { + return index_l0(m) + l; + } + + HealpixFourierALM(LType lmax, LType mmax) + : Lmax_(lmax), Mmax_(mmax), TVal_(2*lmax+1) + { + m_size = Num_Alms(); + alms = alloc.allocate(m_size); + } + + virtual ~HealpixFourierALM() + { + alloc.deallocate(alms, m_size); + } + + virtual const std::complex* data() const { return alms; } + virtual std::complex * data() { return alms;} + virtual long size() const { return m_size; } + + virtual FourierMap > *mimick() const + { + return new HealpixFourierALM(Lmax_, Mmax_); + } + + virtual std::complex dot_product(const FourierMap >& other) const + throw(std::bad_cast) + { + const HealpixFourierALM& mfm = dynamic_cast&>(other); + typedef typename FourierMap >::MapType MapType; + std::complex S; + + if (m_size != mfm.m_size) + throw std::bad_cast(); + + MapType m1(alms, m_size); + MapType m2(mfm.alms, mfm.m_size); + + S = (m1.block(0,0,1,Lmax_+1).conjugate() * m2.block(0,0,1,Lmax_+1)).sum(); + S += std::complex(2,0)*(m1.block(0,1+Lmax_,1,m_size-1-Lmax_).conjugate() * m2.block(0,1+Lmax_,1,m_size-1-Lmax_)).sum(); + return S; + } + }; +}; + +#endif diff --git a/src/fourier/details/healpix_map.hpp b/src/fourier/details/healpix_map.hpp new file mode 100644 index 0000000..6b96974 --- /dev/null +++ b/src/fourier/details/healpix_map.hpp @@ -0,0 +1,54 @@ +#ifndef __COSMOTOOL_FOURIER_HEALPIX_DETAILS_MAP_HPP +#define __COSMOTOOL_FOURIER_HEALPIX_DETAILS_MAP_HPP + +namespace CosmoTool +{ + + template + class HealpixFourierMap: public FourierMap + { + private: + T *m_data; + long Npix, m_Nside; + Eigen::aligned_allocator alloc; + public: + HealpixFourierMap(long nSide) + : Npix(12*nSide*nSide), m_Nside(nSide) + { + m_data = alloc.allocate(Npix); + } + + virtual ~HealpixFourierMap() + { + alloc.deallocate(m_data, Npix); + } + + long Nside() const { return m_Nside; } + virtual const T* data() const { return m_data; } + virtual T *data() { return m_data; } + virtual long size() const { return Npix; } + + virtual T dot_product(const FourierMap& other) const + throw(std::bad_cast) + { + typedef typename FourierMap::MapType MapType; + + const HealpixFourierMap& mfm = dynamic_cast&>(other); + if (Npix != mfm.size()) + throw std::bad_cast(); + + MapType m1(m_data, Npix); + MapType m2(mfm.m_data, mfm.Npix); + + return (m1*m2).sum(); + } + + virtual FourierMap *mimick() const + { + return new HealpixFourierMap(m_Nside); + } + }; + +}; + +#endif diff --git a/src/fourier/details/healpix_spectrum.hpp b/src/fourier/details/healpix_spectrum.hpp new file mode 100644 index 0000000..2031acf --- /dev/null +++ b/src/fourier/details/healpix_spectrum.hpp @@ -0,0 +1,133 @@ +#ifndef __COSMOTOOL_FOURIER_HEALPIX_DETAILS_SPECTRUM_HPP +#define __COSMOTOOL_FOURIER_HEALPIX_DETAILS_SPECTRUM_HPP + +namespace CosmoTool +{ + template + class HealpixSpectrum: public SpectrumFunction + { + protected: + std::vector cls; + public: + typedef typename SpectrumFunction::FourierMapType FourierMapType; + typedef boost::shared_ptr ptr_map; + typedef typename SpectrumFunction::SpectrumFunctionPtr SpectrumFunctionPtr; + + HealpixSpectrum(long Lmax) + : cls(Lmax+1) {} + + T *data() { return &cls[0]; } + const T *data() const { return &cls[0]; } + long size() const { return cls.size(); } + + void newRandomFourier(gsl_rng *rng, FourierMapType& like_map) const; + + SpectrumFunctionPtr copy() const { + HealpixSpectrum *s = new HealpixSpectrum(cls.size()-1); + s->cls = cls; + return SpectrumFunctionPtr(s); + } + + void sqrt() { + std::transform(cls.begin(), cls.end(), cls.begin(), std::ptr_fun(std::sqrt)); + } + + void mul(FourierMapType& m) const; + void mul_sqrt(FourierMapType& m) const; + void mul_inv(FourierMapType& m) const; + void mul_inv_sqrt(FourierMapType& m) const; + }; + + template + void HealpixSpectrum::newRandomFourier(gsl_rng *rng, FourierMapType& out_map) const + { + HealpixFourierALM& alms = dynamic_cast&>(out_map); + long lmaxGen = std::min(cls.size()-1, alms.Lmax()); + std::complex *new_data = alms.data(); + + for (long l = 0; l <= lmaxGen; l++) + { + double Al = std::sqrt(cls[l]); + + new_data[alms.index(l,0)] = gsl_ran_gaussian(rng, Al); + Al *= M_SQRT1_2; + for (long m = 1; m <= std::min(l,alms.Mmax()); m++) + { + std::complex& c = new_data[alms.index(l,m)]; + c.real() = gsl_ran_gaussian(rng, Al); + c.imag() = gsl_ran_gaussian(rng, Al); + } + } + } + + template + void HealpixSpectrum::mul(FourierMapType& like_map) const + { + HealpixFourierALM& alms = dynamic_cast&>(like_map); + std::complex *data = alms.data(); + + for (long l = 0; l <= alms.Lmax(); l++) + { + double Al = cls[l]; + + for (long m = 0; m <= std::min(l,alms.Mmax()); m++) + { + data[alms.index(l,m)] *= Al; + } + } + } + + template + void HealpixSpectrum::mul_sqrt(FourierMapType& like_map) const + { + HealpixFourierALM& alms = dynamic_cast&>(like_map); + std::complex *data = alms.data(); + + for (long l = 0; l <= alms.Lmax(); l++) + { + double Al = std::sqrt(cls[l]); + + for (long m = 0; m <= std::min(l,alms.Mmax()); m++) + { + data[alms.index(l,m)] *= Al; + } + } + } + + template + void HealpixSpectrum::mul_inv(FourierMapType& like_map) const + { + HealpixFourierALM& alms = dynamic_cast&>(like_map); + std::complex *data = alms.data(); + + for (long l = 0; l <= alms.Lmax(); l++) + { + double Al = (cls[l] <= 0) ? 0 : (1/cls[l]); + + for (long m = 0; m <= std::min(l,alms.Mmax()); m++) + { + data[alms.index(l,m)] *= Al; + } + } + } + + template + void HealpixSpectrum::mul_inv_sqrt(FourierMapType& like_map) const + { + HealpixFourierALM& alms = dynamic_cast&>(like_map); + std::complex *data = alms.data(); + + for (long l = 0; l <= alms.Lmax(); l++) + { + double Al = (cls[l] <= 0) ? 0 : std::sqrt(1/cls[l]); + + for (long m = 0; m <= std::min(l,alms.Mmax()); m++) + { + data[alms.index(l,m)] *= Al; + } + } + } + +}; + +#endif diff --git a/src/fourier/details/healpix_transform.hpp b/src/fourier/details/healpix_transform.hpp new file mode 100644 index 0000000..bc542e7 --- /dev/null +++ b/src/fourier/details/healpix_transform.hpp @@ -0,0 +1,97 @@ +#ifndef __COSMOTOOL_FOURIER_HEALPIX_DETAILS_TRANSFORM_HPP +#define __COSMOTOOL_FOURIER_HEALPIX_DETAILS_TRANSFORM_HPP + +namespace CosmoTool +{ + + template struct HealpixJobHelper__ {}; + + template<> struct HealpixJobHelper__ + { enum {val=1}; }; + + template<> struct HealpixJobHelper__ + { enum {val=0}; }; + + + template + class HealpixFourierTransform: public FourierTransform + { + private: + sharp_alm_info *ainfo; + sharp_geom_info *ginfo; + HealpixFourierMap realMap; + HealpixFourierALM fourierMap; + int m_iterate; + public: + HealpixFourierTransform(long nSide, long Lmax, long Mmax, int iterate = 0) + : realMap(nSide), fourierMap(Lmax, Mmax), ainfo(0), ginfo(0), m_iterate(iterate) + { + sharp_make_healpix_geom_info (nSide, 1, &ginfo); + sharp_make_triangular_alm_info (Lmax, Mmax, 1, &ainfo); + } + + virtual ~HealpixFourierTransform() + { + sharp_destroy_geom_info(ginfo); + sharp_destroy_alm_info(ainfo); + } + + virtual const FourierMap >& fourierSpace() const { return fourierMap; } + + virtual FourierMap >& fourierSpace() { return fourierMap; } + + virtual const FourierMap& realSpace() const { return realMap; } + + virtual FourierMap& realSpace() { return realMap; } + + virtual FourierTransform *mimick() const + { + return new HealpixFourierTransform(realMap.Nside(), fourierMap.Lmax(), fourierMap.Mmax()); + } + + virtual void analysis() + { + void *aptr=reinterpret_cast(fourierMap.data()), *mptr=reinterpret_cast(realMap.data()); + + sharp_execute (SHARP_MAP2ALM, 0, 0, &aptr, &mptr, ginfo, ainfo, 1, + HealpixJobHelper__::val,0,0,0); + for (int i = 0; i < m_iterate; i++) + { + HealpixFourierMap tmp_map(realMap.Nside()); + void *tmp_ptr=reinterpret_cast(tmp_map.data()); + typename HealpixFourierMap::MapType m0 = tmp_map.eigen(); + typename HealpixFourierMap::MapType m1 = realMap.eigen(); + + sharp_execute (SHARP_ALM2MAP, 0, 0, &aptr, &tmp_ptr, ginfo, ainfo, 1, + HealpixJobHelper__::val,0,0,0); + m0 = m1 - m0; + sharp_execute (SHARP_MAP2ALM, 0, 1, &aptr, &tmp_ptr, ginfo, ainfo, 1, + HealpixJobHelper__::val,0,0,0); + } + } + + virtual void synthesis() + { + void *aptr=reinterpret_cast(fourierMap.data()), *mptr=reinterpret_cast(realMap.data()); + + sharp_execute (SHARP_ALM2MAP, 0, 0, &aptr, &mptr, ginfo, ainfo, 1, + HealpixJobHelper__::val,0,0,0); + } + + virtual void analysis_conjugate() + { + synthesis(); + realMap.scale(4*M_PI/realMap.size()); + } + + virtual void synthesis_conjugate() + { + analysis(); + fourierMap.scale(realMap.size()/(4*M_PI)); + } + + }; + +}; + +#endif diff --git a/src/fourier/healpix.hpp b/src/fourier/healpix.hpp index 460935d..46f5356 100644 --- a/src/fourier/healpix.hpp +++ b/src/fourier/healpix.hpp @@ -15,335 +15,10 @@ #include #include -namespace CosmoTool -{ - template - class HealpixSpectrum: public SpectrumFunction - { - protected: - std::vector cls; - public: - typedef typename SpectrumFunction::FourierMapType FourierMapType; - typedef boost::shared_ptr ptr_map; - typedef typename SpectrumFunction::SpectrumFunctionPtr SpectrumFunctionPtr; +#include "details/healpix_map.hpp" +#include "details/healpix_alms.hpp" +#include "details/healpix_transform.hpp" +#include "details/healpix_spectrum.hpp" - HealpixSpectrum(long Lmax) - : cls(Lmax+1) {} - - T *data() { return &cls[0]; } - const T *data() const { return &cls[0]; } - long size() const { return cls.size(); } - - void newRandomFourier(gsl_rng *rng, FourierMapType& like_map) const; - SpectrumFunctionPtr copy() const { - HealpixSpectrum *s = new HealpixSpectrum(cls.size()-1); - s->cls = cls; - return SpectrumFunctionPtr(s); - } - - void sqrt() { - std::transform(cls.begin(), cls.end(), cls.begin(), std::ptr_fun(std::sqrt)); - } - - void mul(FourierMapType& m) const; - void mul_sqrt(FourierMapType& m) const; - void mul_inv(FourierMapType& m) const; - void mul_inv_sqrt(FourierMapType& m) const; - }; - - template - class HealpixFourierMap: public FourierMap - { - private: - T *m_data; - long Npix, m_Nside; - Eigen::aligned_allocator alloc; - public: - HealpixFourierMap(long nSide) - : Npix(12*nSide*nSide), m_Nside(nSide) - { - m_data = alloc.allocate(Npix); - } - - virtual ~HealpixFourierMap() - { - alloc.deallocate(m_data, Npix); - } - - long Nside() const { return m_Nside; } - virtual const T* data() const { return m_data; } - virtual T *data() { return m_data; } - virtual long size() const { return Npix; } - - virtual T dot_product(const FourierMap& other) const - throw(std::bad_cast) - { - typedef typename FourierMap::MapType MapType; - - const HealpixFourierMap& mfm = dynamic_cast&>(other); - if (Npix != mfm.size()) - throw std::bad_cast(); - - MapType m1(m_data, Npix); - MapType m2(mfm.m_data, mfm.Npix); - - return (m1*m2).sum(); - } - - virtual FourierMap *mimick() const - { - return new HealpixFourierMap(m_Nside); - } - }; - - - template - class HealpixFourierALM: public FourierMap > - { - private: - std::complex *alms; - long m_size; - long Lmax_, Mmax_, TVal_; - Eigen::aligned_allocator > alloc; - public: - typedef unsigned long LType; - - LType Lmax() const { return Lmax_; } - LType Mmax() const { return Mmax_; } - - LType Num_Alms() const - { - return ((Mmax_+1)*(Mmax_+2))/2 + (Mmax_+1)*(Lmax_-Mmax_); - } - - LType index_l0(LType m) const - { - return ((m*(TVal_-m))/2); - } - - LType index(LType l, LType m) const - { - return index_l0(m) + l; - } - - HealpixFourierALM(LType lmax, LType mmax) - : Lmax_(lmax), Mmax_(mmax), TVal_(2*lmax+1) - { - m_size = Num_Alms(); - alms = alloc.allocate(m_size); - } - - virtual ~HealpixFourierALM() - { - alloc.deallocate(alms, m_size); - } - - virtual const std::complex* data() const { return alms; } - virtual std::complex * data() { return alms;} - virtual long size() const { return m_size; } - - virtual FourierMap > *mimick() const - { - return new HealpixFourierALM(Lmax_, Mmax_); - } - - virtual std::complex dot_product(const FourierMap >& other) const - throw(std::bad_cast) - { - const HealpixFourierALM& mfm = dynamic_cast&>(other); - typedef typename FourierMap >::MapType MapType; - std::complex S; - - if (m_size != mfm.m_size) - throw std::bad_cast(); - - MapType m1(alms, m_size); - MapType m2(mfm.alms, mfm.m_size); - - S = (m1.block(0,0,1,Lmax_+1).conjugate() * m2.block(0,0,1,Lmax_+1)).sum(); - S += std::complex(2,0)*(m1.block(0,1+Lmax_,1,m_size-1-Lmax_).conjugate() * m2.block(0,1+Lmax_,1,m_size-1-Lmax_)).sum(); - return S; - } - }; - - template struct HealpixJobHelper__ {}; - - template<> struct HealpixJobHelper__ - { enum {val=1}; }; - - template<> struct HealpixJobHelper__ - { enum {val=0}; }; - - - template - class HealpixFourierTransform: public FourierTransform - { - private: - sharp_alm_info *ainfo; - sharp_geom_info *ginfo; - HealpixFourierMap realMap; - HealpixFourierALM fourierMap; - int m_iterate; - public: - HealpixFourierTransform(long nSide, long Lmax, long Mmax, int iterate = 0) - : realMap(nSide), fourierMap(Lmax, Mmax), ainfo(0), ginfo(0), m_iterate(iterate) - { - sharp_make_healpix_geom_info (nSide, 1, &ginfo); - sharp_make_triangular_alm_info (Lmax, Mmax, 1, &ainfo); - } - - virtual ~HealpixFourierTransform() - { - sharp_destroy_geom_info(ginfo); - sharp_destroy_alm_info(ainfo); - } - - virtual const FourierMap >& fourierSpace() const { return fourierMap; } - - virtual FourierMap >& fourierSpace() { return fourierMap; } - - virtual const FourierMap& realSpace() const { return realMap; } - - virtual FourierMap& realSpace() { return realMap; } - - virtual FourierTransform *mimick() const - { - return new HealpixFourierTransform(realMap.Nside(), fourierMap.Lmax(), fourierMap.Mmax()); - } - - virtual void analysis() - { - void *aptr=reinterpret_cast(fourierMap.data()), *mptr=reinterpret_cast(realMap.data()); - - sharp_execute (SHARP_MAP2ALM, 0, 0, &aptr, &mptr, ginfo, ainfo, 1, - HealpixJobHelper__::val,0,0,0); - for (int i = 0; i < m_iterate; i++) - { - HealpixFourierMap tmp_map(realMap.Nside()); - void *tmp_ptr=reinterpret_cast(tmp_map.data()); - typename HealpixFourierMap::MapType m0 = tmp_map.eigen(); - typename HealpixFourierMap::MapType m1 = realMap.eigen(); - - sharp_execute (SHARP_ALM2MAP, 0, 0, &aptr, &tmp_ptr, ginfo, ainfo, 1, - HealpixJobHelper__::val,0,0,0); - m0 = m1 - m0; - sharp_execute (SHARP_MAP2ALM, 0, 1, &aptr, &tmp_ptr, ginfo, ainfo, 1, - HealpixJobHelper__::val,0,0,0); - } - } - - virtual void synthesis() - { - void *aptr=reinterpret_cast(fourierMap.data()), *mptr=reinterpret_cast(realMap.data()); - - sharp_execute (SHARP_ALM2MAP, 0, 0, &aptr, &mptr, ginfo, ainfo, 1, - HealpixJobHelper__::val,0,0,0); - } - - virtual void analysis_conjugate() - { - synthesis(); - realMap.scale(4*M_PI/realMap.size()); - } - - virtual void synthesis_conjugate() - { - analysis(); - fourierMap.scale(realMap.size()/(4*M_PI)); - } - - }; - - template - void HealpixSpectrum::newRandomFourier(gsl_rng *rng, FourierMapType& out_map) const - { - HealpixFourierALM& alms = dynamic_cast&>(out_map); - long lmaxGen = std::min(cls.size()-1, alms.Lmax()); - std::complex *new_data = alms.data(); - - for (long l = 0; l <= lmaxGen; l++) - { - double Al = std::sqrt(cls[l]); - - new_data[alms.index(l,0)] = gsl_ran_gaussian(rng, Al); - Al *= M_SQRT1_2; - for (long m = 1; m <= std::min(l,alms.Mmax()); m++) - { - std::complex& c = new_data[alms.index(l,m)]; - c.real() = gsl_ran_gaussian(rng, Al); - c.imag() = gsl_ran_gaussian(rng, Al); - } - } - } - - template - void HealpixSpectrum::mul(FourierMapType& like_map) const - { - HealpixFourierALM& alms = dynamic_cast&>(like_map); - std::complex *data = alms.data(); - - for (long l = 0; l <= alms.Lmax(); l++) - { - double Al = cls[l]; - - for (long m = 0; m <= std::min(l,alms.Mmax()); m++) - { - data[alms.index(l,m)] *= Al; - } - } - } - - template - void HealpixSpectrum::mul_sqrt(FourierMapType& like_map) const - { - HealpixFourierALM& alms = dynamic_cast&>(like_map); - std::complex *data = alms.data(); - - for (long l = 0; l <= alms.Lmax(); l++) - { - double Al = std::sqrt(cls[l]); - - for (long m = 0; m <= std::min(l,alms.Mmax()); m++) - { - data[alms.index(l,m)] *= Al; - } - } - } - - template - void HealpixSpectrum::mul_inv(FourierMapType& like_map) const - { - HealpixFourierALM& alms = dynamic_cast&>(like_map); - std::complex *data = alms.data(); - - for (long l = 0; l <= alms.Lmax(); l++) - { - double Al = (cls[l] <= 0) ? 0 : (1/cls[l]); - - for (long m = 0; m <= std::min(l,alms.Mmax()); m++) - { - data[alms.index(l,m)] *= Al; - } - } - } - - template - void HealpixSpectrum::mul_inv_sqrt(FourierMapType& like_map) const - { - HealpixFourierALM& alms = dynamic_cast&>(like_map); - std::complex *data = alms.data(); - - for (long l = 0; l <= alms.Lmax(); l++) - { - double Al = (cls[l] <= 0) ? 0 : std::sqrt(1/cls[l]); - - for (long m = 0; m <= std::min(l,alms.Mmax()); m++) - { - data[alms.index(l,m)] *= Al; - } - } - } - -}; #endif From 4c482daf9b8a1ee5e69f7675a361aae0c7c93878 Mon Sep 17 00:00:00 2001 From: Guilhem Lavaux Date: Sun, 18 Nov 2012 16:18:18 -0500 Subject: [PATCH 18/43] Fixed dof interface. Implement utility class for healpix --- src/fourier/base_types.hpp | 2 +- src/fourier/details/healpix_spectrum.hpp | 11 ++++- src/fourier/details/healpix_utility.hpp | 61 ++++++++++++++++++++++++ src/fourier/healpix.hpp | 2 +- 4 files changed, 73 insertions(+), 3 deletions(-) create mode 100644 src/fourier/details/healpix_utility.hpp diff --git a/src/fourier/base_types.hpp b/src/fourier/base_types.hpp index ae62f54..5e93e48 100644 --- a/src/fourier/base_types.hpp +++ b/src/fourier/base_types.hpp @@ -35,7 +35,7 @@ namespace CosmoTool virtual SpectrumFunctionPtr copy() const = 0; virtual const T *data() const { return 0; } - virtual const T *dof() const { return 0; } + virtual const int *dof() const { return 0; } virtual long size() const { return -1; } virtual void sqrt() = 0; diff --git a/src/fourier/details/healpix_spectrum.hpp b/src/fourier/details/healpix_spectrum.hpp index 2031acf..e797c91 100644 --- a/src/fourier/details/healpix_spectrum.hpp +++ b/src/fourier/details/healpix_spectrum.hpp @@ -8,16 +8,25 @@ namespace CosmoTool { protected: std::vector cls; + int *m_dof; public: typedef typename SpectrumFunction::FourierMapType FourierMapType; typedef boost::shared_ptr ptr_map; typedef typename SpectrumFunction::SpectrumFunctionPtr SpectrumFunctionPtr; HealpixSpectrum(long Lmax) - : cls(Lmax+1) {} + : cls(Lmax+1), m_dof(new int[Lmax+1]) + { + for (int l = 0; l <= Lmax; l++) + m_dof[l] = l + 1; + } T *data() { return &cls[0]; } const T *data() const { return &cls[0]; } + const int *dof() const { return m_dof; } + + void set_dof(long l, int dof) { m_dof[l] = dof; } + long size() const { return cls.size(); } void newRandomFourier(gsl_rng *rng, FourierMapType& like_map) const; diff --git a/src/fourier/details/healpix_utility.hpp b/src/fourier/details/healpix_utility.hpp new file mode 100644 index 0000000..b527366 --- /dev/null +++ b/src/fourier/details/healpix_utility.hpp @@ -0,0 +1,61 @@ +#ifndef __COSMOTOOL_FOURIER_HEALPIX_DETAILS_SPECTRUM_HP +#define __COSMOTOOL_FOURIER_HEALPIX_DETAILS_SPECTRUM_HP + +namespace CosmoTool +{ + + template + class HealpixUtilityFunction: public MapUtilityFunction + { + public: + typedef typename MapUtilityFunction::Spectrum Spectrum; + typedef typename MapUtilityFunction::Spectrum_ptr Spectrum_ptr; + typedef typename MapUtilityFunction::FMap FMap; + + Spectrum_ptr estimateSpectrumFromMap(const FMap& m) const + { + const HealpixFourierALM& alms = dynamic_cast&>(m); + long Lmax = alms.Lmax(), Mmax = alms.Mmax(); + HealpixSpectrum *spectrum = new HealpixSpectrum(Lmax); + T *data_cls = spectrum->data(); + std::complex *data_alms = alms.data(); + + // make an estimate of the cls + std::fill(data_cls, data_cls+Lmax+1, 0); + for (long m = 0, q = 0; m <= Mmax; ++m ) + { + for (long l = 0; l <= Lmax; ++l) + { + // Triangular storage + data_cls[l] += std::norm(alms[l+q]); + } + q += Lmax+1; + } + + for (long l = 0; l <= Lmax; ++l) + { + int dof = 1 + std::min(l, Mmax); + spectrum->set_dof(l, dof); + data_cls[l] /= dof; + } + + return Spectrum_ptr(spectrum); + } + + Spectrum_ptr newSpectrumFromRaw(T *data, long size, + Spectrum_ptr like_spec) const + { + Spectrum *s = like_spec.get(); + HealpixSpectrum& in_spec = dynamic_cast&>(*s); + HealpixSpectrum *new_spectrum = new HealpixSpectrum(in_spec.Lmax()); + T *out_d = new_spectrum->data(); + + std::copy(data, data + min(size,new_spectrum->size()), out_d); + + return Spectrum_ptr(new_spectrum); + } + }; + +}; + +#endif diff --git a/src/fourier/healpix.hpp b/src/fourier/healpix.hpp index 46f5356..36f7979 100644 --- a/src/fourier/healpix.hpp +++ b/src/fourier/healpix.hpp @@ -19,6 +19,6 @@ #include "details/healpix_alms.hpp" #include "details/healpix_transform.hpp" #include "details/healpix_spectrum.hpp" - +#include "details/healpix_utility.hpp" #endif From bb20fcee059fc5f49c5c775c97ba25f1c1a34249 Mon Sep 17 00:00:00 2001 From: Guilhem Lavaux Date: Sun, 18 Nov 2012 16:36:18 -0500 Subject: [PATCH 19/43] Check healpix utility calls --- sample/test_healpix_calls.cpp | 5 ++++ src/fourier/details/healpix_spectrum.hpp | 30 +++++++++++++----------- src/fourier/details/healpix_utility.hpp | 19 ++++++++------- 3 files changed, 32 insertions(+), 22 deletions(-) diff --git a/sample/test_healpix_calls.cpp b/sample/test_healpix_calls.cpp index d1f1bf3..7cc4272 100644 --- a/sample/test_healpix_calls.cpp +++ b/sample/test_healpix_calls.cpp @@ -7,14 +7,19 @@ using namespace std; int main() { HealpixFourierTransform dft(128,2*128,2*128, 40); + HealpixUtilityFunction utils; long Npix = dft.realSpace().size(); dft.realSpace().eigen().setRandom(); dft.analysis(); cout << "Map dot-product = " << dft.realSpace().dot_product(dft.realSpace()) << endl; cout << "Fourier dot-product = " << dft.fourierSpace().dot_product(dft.fourierSpace()).real()*Npix/(4*M_PI) << endl; + cout << "Spectrum analysis" << endl; + HealpixUtilityFunction::Spectrum_ptr s = utils.estimateSpectrumFromMap(dft.fourierSpace()); + dft.synthesis(); cout << "Resynthesis dot-product = " << dft.realSpace().dot_product(dft.realSpace()) << endl; + return 0; } diff --git a/src/fourier/details/healpix_spectrum.hpp b/src/fourier/details/healpix_spectrum.hpp index e797c91..cfeebc9 100644 --- a/src/fourier/details/healpix_spectrum.hpp +++ b/src/fourier/details/healpix_spectrum.hpp @@ -13,8 +13,9 @@ namespace CosmoTool typedef typename SpectrumFunction::FourierMapType FourierMapType; typedef boost::shared_ptr ptr_map; typedef typename SpectrumFunction::SpectrumFunctionPtr SpectrumFunctionPtr; + typedef unsigned long LType; - HealpixSpectrum(long Lmax) + HealpixSpectrum(LType Lmax) : cls(Lmax+1), m_dof(new int[Lmax+1]) { for (int l = 0; l <= Lmax; l++) @@ -25,14 +26,15 @@ namespace CosmoTool const T *data() const { return &cls[0]; } const int *dof() const { return m_dof; } - void set_dof(long l, int dof) { m_dof[l] = dof; } + void set_dof(LType l, int dof) { m_dof[l] = dof; } + LType Lmax() const { return cls.size()-1; } long size() const { return cls.size(); } void newRandomFourier(gsl_rng *rng, FourierMapType& like_map) const; SpectrumFunctionPtr copy() const { - HealpixSpectrum *s = new HealpixSpectrum(cls.size()-1); + HealpixSpectrum *s = new HealpixSpectrum(Lmax()); s->cls = cls; return SpectrumFunctionPtr(s); } @@ -54,13 +56,13 @@ namespace CosmoTool long lmaxGen = std::min(cls.size()-1, alms.Lmax()); std::complex *new_data = alms.data(); - for (long l = 0; l <= lmaxGen; l++) + for (LType l = 0; l <= lmaxGen; l++) { double Al = std::sqrt(cls[l]); new_data[alms.index(l,0)] = gsl_ran_gaussian(rng, Al); Al *= M_SQRT1_2; - for (long m = 1; m <= std::min(l,alms.Mmax()); m++) + for (LType m = 1; m <= std::min(l,alms.Mmax()); m++) { std::complex& c = new_data[alms.index(l,m)]; c.real() = gsl_ran_gaussian(rng, Al); @@ -75,11 +77,11 @@ namespace CosmoTool HealpixFourierALM& alms = dynamic_cast&>(like_map); std::complex *data = alms.data(); - for (long l = 0; l <= alms.Lmax(); l++) + for (LType l = 0; l <= alms.Lmax(); l++) { double Al = cls[l]; - for (long m = 0; m <= std::min(l,alms.Mmax()); m++) + for (LType m = 0; m <= std::min(l,alms.Mmax()); m++) { data[alms.index(l,m)] *= Al; } @@ -89,14 +91,14 @@ namespace CosmoTool template void HealpixSpectrum::mul_sqrt(FourierMapType& like_map) const { - HealpixFourierALM& alms = dynamic_cast&>(like_map); + HealpixFourierALM& alms = dynamic_cast&>(like_map); std::complex *data = alms.data(); - for (long l = 0; l <= alms.Lmax(); l++) + for (LType l = 0; l <= alms.Lmax(); l++) { double Al = std::sqrt(cls[l]); - for (long m = 0; m <= std::min(l,alms.Mmax()); m++) + for (LType m = 0; m <= std::min(l,alms.Mmax()); m++) { data[alms.index(l,m)] *= Al; } @@ -109,11 +111,11 @@ namespace CosmoTool HealpixFourierALM& alms = dynamic_cast&>(like_map); std::complex *data = alms.data(); - for (long l = 0; l <= alms.Lmax(); l++) + for (LType l = 0; l <= alms.Lmax(); l++) { double Al = (cls[l] <= 0) ? 0 : (1/cls[l]); - for (long m = 0; m <= std::min(l,alms.Mmax()); m++) + for (LType m = 0; m <= std::min(l,alms.Mmax()); m++) { data[alms.index(l,m)] *= Al; } @@ -126,11 +128,11 @@ namespace CosmoTool HealpixFourierALM& alms = dynamic_cast&>(like_map); std::complex *data = alms.data(); - for (long l = 0; l <= alms.Lmax(); l++) + for (LType l = 0; l <= alms.Lmax(); l++) { double Al = (cls[l] <= 0) ? 0 : std::sqrt(1/cls[l]); - for (long m = 0; m <= std::min(l,alms.Mmax()); m++) + for (LType m = 0; m <= std::min(l,alms.Mmax()); m++) { data[alms.index(l,m)] *= Al; } diff --git a/src/fourier/details/healpix_utility.hpp b/src/fourier/details/healpix_utility.hpp index b527366..004208b 100644 --- a/src/fourier/details/healpix_utility.hpp +++ b/src/fourier/details/healpix_utility.hpp @@ -11,28 +11,31 @@ namespace CosmoTool typedef typename MapUtilityFunction::Spectrum Spectrum; typedef typename MapUtilityFunction::Spectrum_ptr Spectrum_ptr; typedef typename MapUtilityFunction::FMap FMap; - + typedef typename HealpixSpectrum::LType LType; + Spectrum_ptr estimateSpectrumFromMap(const FMap& m) const { const HealpixFourierALM& alms = dynamic_cast&>(m); - long Lmax = alms.Lmax(), Mmax = alms.Mmax(); + LType Lmax = alms.Lmax(), Mmax = alms.Mmax(); HealpixSpectrum *spectrum = new HealpixSpectrum(Lmax); T *data_cls = spectrum->data(); - std::complex *data_alms = alms.data(); + const std::complex *data_alms = alms.data(); // make an estimate of the cls std::fill(data_cls, data_cls+Lmax+1, 0); - for (long m = 0, q = 0; m <= Mmax; ++m ) + LType q = 0; + for (LType m = 0; m <= Mmax; ++m ) { - for (long l = 0; l <= Lmax; ++l) + for (LType l = m; l <= Lmax; ++l) { // Triangular storage - data_cls[l] += std::norm(alms[l+q]); + data_cls[l] += std::norm(data_alms[l+q]); } - q += Lmax+1; + q += Lmax+1-m; } + assert(q==alms.size()); - for (long l = 0; l <= Lmax; ++l) + for (LType l = 0; l <= Lmax; ++l) { int dof = 1 + std::min(l, Mmax); spectrum->set_dof(l, dof); From 50142e318966e9a31099026296a29180ea9bf46f Mon Sep 17 00:00:00 2001 From: Guilhem Lavaux Date: Tue, 20 Nov 2012 08:45:48 -0500 Subject: [PATCH 20/43] Changed programming interface of newSpectrumRaw --- src/fourier/base_types.hpp | 2 +- src/fourier/details/healpix_utility.hpp | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/fourier/base_types.hpp b/src/fourier/base_types.hpp index 5e93e48..936bc83 100644 --- a/src/fourier/base_types.hpp +++ b/src/fourier/base_types.hpp @@ -160,7 +160,7 @@ namespace CosmoTool virtual Spectrum_ptr estimateSpectrumFromMap(const FMap& m) const = 0; virtual Spectrum_ptr newSpectrumFromRaw(T *data, long size, - Spectrum_ptr like_spec) const = 0; + const Spectrum& like_spec) const = 0; }; }; diff --git a/src/fourier/details/healpix_utility.hpp b/src/fourier/details/healpix_utility.hpp index 004208b..d989dd8 100644 --- a/src/fourier/details/healpix_utility.hpp +++ b/src/fourier/details/healpix_utility.hpp @@ -46,10 +46,9 @@ namespace CosmoTool } Spectrum_ptr newSpectrumFromRaw(T *data, long size, - Spectrum_ptr like_spec) const + const Spectrum& like_spec) const { - Spectrum *s = like_spec.get(); - HealpixSpectrum& in_spec = dynamic_cast&>(*s); + const HealpixSpectrum& in_spec = dynamic_cast&>(like_spec); HealpixSpectrum *new_spectrum = new HealpixSpectrum(in_spec.Lmax()); T *out_d = new_spectrum->data(); From 4c9b2ef96b3bf332d4b859df7b9b5dc77f914cb0 Mon Sep 17 00:00:00 2001 From: Guilhem Lavaux Date: Tue, 20 Nov 2012 16:58:10 -0500 Subject: [PATCH 21/43] Removed support for loadGadgetPosition. Added attribute support to SimuData. --- src/loadGadget.cpp | 117 +++++++++++++++------------------------------ src/loadGadget.hpp | 5 +- src/loadSimu.hpp | 50 +++++++++++++++++++ 3 files changed, 90 insertions(+), 82 deletions(-) diff --git a/src/loadGadget.cpp b/src/loadGadget.cpp index 38aff37..ee30d80 100644 --- a/src/loadGadget.cpp +++ b/src/loadGadget.cpp @@ -10,61 +10,41 @@ using namespace CosmoTool; using namespace std; -PurePositionData *CosmoTool::loadGadgetPosition(const char *fname) -{ - PurePositionData *data; - int p, n; - UnformattedRead f(fname); - GadgetHeader h; - - data = new PurePositionData; - f.beginCheckpoint(); - for (int i = 0; i < 6; i++) - h.npart[i] = f.readInt32(); - for (int i = 0; i < 6; i++) - h.mass[i] = f.readReal64(); - h.time = f.readReal64(); - h.redshift = f.readReal64(); - h.flag_sfr = f.readInt32(); - h.flag_feedback = f.readInt32(); - for (int i = 0; i < 6; i++) - h.npartTotal[i] = f.readInt32(); - h.flag_cooling = f.readInt32(); - h.num_files = f.readInt32(); - data->BoxSize = h.BoxSize = f.readReal64(); - h.Omega0 = f.readReal64(); - h.OmegaLambda = f.readReal64(); - h.HubbleParam = f.readReal64(); - f.endCheckpoint(true); - - data->NumPart = 0; - for(int k=0; k<5; k++) - data->NumPart += h.npart[k]; - - data->pos = new FCoordinates[data->NumPart]; - - f.beginCheckpoint(); - for(int k = 0, p = 0; k < 5; k++) { - for(int n = 0; n < h.npart[k]; n++) { - data->pos[p][0] = f.readReal32(); - data->pos[p][1] = f.readReal32(); - data->pos[p][2] = f.readReal32(); - p++; - } - } - f.endCheckpoint(); - - // Skip velocities - f.skip((long)data->NumPart*3+2*4); - // Skip ids - return data; +void loadGadgetHeader(UnformattedRead *f, GadgetHeader& h, SimuData *data, int id) +{ + f->beginCheckpoint(); + for (int i = 0; i < 6; i++) + h.npart[i] = f->readInt32(); + for (int i = 0; i < 6; i++) + h.mass[i] = f->readReal64(); + data->time = h.time = f->readReal64(); + h.redshift = f->readReal64(); + h.flag_sfr = f->readInt32(); + h.flag_feedback = f->readInt32(); + for (int i = 0; i < 6; i++) + h.npartTotal[i] = f->readInt32(); + h.flag_cooling = f->readInt32(); + h.num_files = f->readInt32(); + data->BoxSize = h.BoxSize = f->readReal64(); + data->Omega_M = h.Omega0 = f->readReal64(); + data->Omega_Lambda = h.OmegaLambda = f->readReal64(); + data->Hubble = h.HubbleParam = f->readReal64(); + f->endCheckpoint(true); + + long NumPart = 0, NumPartTotal = 0; + for(int k=0; k<6; k++) + { + NumPart += h.npart[k]; + NumPartTotal += (id < 0) ? h.npart[k] : h.npartTotal[k]; + } + data->NumPart = NumPart; + data->TotalNumPart = NumPartTotal; } - - - -SimuData *CosmoTool::loadGadgetMulti(const char *fname, int id, int loadflags, int GadgetFormat) +SimuData *CosmoTool::loadGadgetMulti(const char *fname, int id, + int loadflags, int GadgetFormat, + SimuFilter filter) { SimuData *data; int p, n; @@ -98,35 +78,11 @@ SimuData *CosmoTool::loadGadgetMulti(const char *fname, int id, int loadflags, i } long NumPart = 0, NumPartTotal = 0; - + try { - f->beginCheckpoint(); - for (int i = 0; i < 6; i++) - h.npart[i] = f->readInt32(); - for (int i = 0; i < 6; i++) - h.mass[i] = f->readReal64(); - data->time = h.time = f->readReal64(); - h.redshift = f->readReal64(); - h.flag_sfr = f->readInt32(); - h.flag_feedback = f->readInt32(); - for (int i = 0; i < 6; i++) - h.npartTotal[i] = f->readInt32(); - h.flag_cooling = f->readInt32(); - h.num_files = f->readInt32(); - data->BoxSize = h.BoxSize = f->readReal64(); - data->Omega_M = h.Omega0 = f->readReal64(); - data->Omega_Lambda = h.OmegaLambda = f->readReal64(); - data->Hubble = h.HubbleParam = f->readReal64(); - f->endCheckpoint(true); - - for(int k=0; k<6; k++) - { - NumPart += h.npart[k]; - NumPartTotal += (id < 0) ? h.npart[k] : h.npartTotal[k]; - } - data->NumPart = NumPart; - data->TotalNumPart = NumPartTotal; + loadGadgetHeader(f, h, data, id); + if (GadgetFormat == 1) velmul = sqrt(h.time); else if (GadgetFormat == 2) @@ -135,6 +91,9 @@ SimuData *CosmoTool::loadGadgetMulti(const char *fname, int id, int loadflags, i cerr << "unknown gadget format" << endl; abort(); } + + NumPart = data->NumPart; + NumPartTotal = data->TotalNumPart; } catch (const InvalidUnformattedAccess& e) { diff --git a/src/loadGadget.hpp b/src/loadGadget.hpp index 69f0ea6..be49ad4 100644 --- a/src/loadGadget.hpp +++ b/src/loadGadget.hpp @@ -5,10 +5,9 @@ #include "loadSimu.hpp" namespace CosmoTool { - - PurePositionData *loadGadgetPosition(const char *fname); - SimuData *loadGadgetMulti(const char *fname, int id, int flags, int GadgetFormat = 1); + SimuData *loadGadgetMulti(const char *fname, int id, int flags, + int GadgetFormat = 1, SimuFilter filter = 0); // Only single snapshot supported void writeGadget(const char *fname, SimuData *data, int GadgetFormat = 1); diff --git a/src/loadSimu.hpp b/src/loadSimu.hpp index a7db941..8e4c507 100644 --- a/src/loadSimu.hpp +++ b/src/loadSimu.hpp @@ -1,6 +1,8 @@ #ifndef __COSMOTOOLBOX_HPP #define __COSMOTOOLBOX_HPP +#include +#include namespace CosmoTool { @@ -9,9 +11,24 @@ namespace CosmoTool static const int NEED_VELOCITY = 4; static const int NEED_TYPE = 8; + struct SimuParticle + { + float Pos[3]; + float Vel[3]; + int type; + int id; + + bool flag_vel, flag_type, flag_id; + }; + + typedef bool (*SimuFilter)(const SimuParticle& p); + class SimuData { public: + typedef void (*FreeFunction)(void *); + typedef std::map > AttributeMap; + float BoxSize; float time; float Hubble; @@ -25,6 +42,9 @@ namespace CosmoTool float *Pos[3]; float *Vel[3]; int *type; + + AttributeMap attributes; + public: SimuData() : Id(0),NumPart(0),type(0) { Pos[0]=Pos[1]=Pos[2]=0; Vel[0]=Vel[1]=Vel[2]=0; } ~SimuData() @@ -40,7 +60,37 @@ namespace CosmoTool delete[] type; if (Id) delete[] Id; + + for (AttributeMap::iterator i = attributes.begin(); + i != attributes.end(); + ++i) + { + if (i->second.second) + i->second.second(i->second.first); + } } + + template + T *as(const std::string& n) + { + AttributeMap::iterator i = attributes.find(n); + if (i == attributes.end()) + return 0; + + return reinterpret_cast(i->first); + } + + void new_attribute(const std::string& n, void *p, FreeFunction free_func) + { + AttributeMap::iterator i = attributes.find(n); + if (i != attributes.end()) + { + if (i->second.second) + i->second.second(i->second.first); + } + attributes[n] = std::make_pair(p, free_func); + } + }; }; From 126ec183179e728725aea7ba1b2183168cf9ae89 Mon Sep 17 00:00:00 2001 From: Guilhem Lavaux Date: Sat, 24 Nov 2012 17:45:19 -0500 Subject: [PATCH 22/43] Cast the proper pair and enfore NetCDF4 file format if possible (even for NetCDF3 C++ interface) --- src/loadSimu.hpp | 2 +- src/yorick_nc3.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/loadSimu.hpp b/src/loadSimu.hpp index 8e4c507..7a72259 100644 --- a/src/loadSimu.hpp +++ b/src/loadSimu.hpp @@ -77,7 +77,7 @@ namespace CosmoTool if (i == attributes.end()) return 0; - return reinterpret_cast(i->first); + return reinterpret_cast(i->second.first); } void new_attribute(const std::string& n, void *p, FreeFunction free_func) diff --git a/src/yorick_nc3.cpp b/src/yorick_nc3.cpp index d760009..92d55b6 100644 --- a/src/yorick_nc3.cpp +++ b/src/yorick_nc3.cpp @@ -151,7 +151,7 @@ namespace CosmoTool { ProgressiveOutput::saveArrayProgressive(const std::string& fname, uint32_t *dimList, uint32_t rank) { - NcFile *f = new NcFile(fname.c_str(), NcFile::Replace); + NcFile *f = new NcFile(fname.c_str(), NcFile::Replace, 0, 0, NcFile::Netcdf4); assert(f->is_valid()); @@ -202,7 +202,7 @@ namespace CosmoTool { void saveArray(const std::string& fname, T *array, uint32_t *dimList, uint32_t rank) { - NcFile f(fname.c_str(), NcFile::Replace); + NcFile f(fname.c_str(), NcFile::Replace, 0, 0, NcFile::Netcdf4); assert(f.is_valid()); From 5d6ad978e822b1c9f49475c953a9dbb70153391f Mon Sep 17 00:00:00 2001 From: Guilhem Lavaux Date: Tue, 27 Nov 2012 20:10:40 -0500 Subject: [PATCH 23/43] Fixed initialization of 3d FFT --- src/fourier/details/euclidian_transform.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fourier/details/euclidian_transform.hpp b/src/fourier/details/euclidian_transform.hpp index b533227..8faba32 100644 --- a/src/fourier/details/euclidian_transform.hpp +++ b/src/fourier/details/euclidian_transform.hpp @@ -163,7 +163,7 @@ namespace CosmoTool template static std::vector make_3d_vector(T2 a, T2 b, T2 c) { - T2 arr[2] = { a, b, c}; + T2 arr[3] = { a, b, c}; return std::vector(&arr[0], &arr[3]); } From bcf4ae2deb35502e2932363721fa9737135e2e48 Mon Sep 17 00:00:00 2001 From: Guilhem Lavaux Date: Wed, 28 Nov 2012 17:49:58 -0500 Subject: [PATCH 24/43] Added a specific function for computing \vec{k} --- src/fourier/details/euclidian_maps.hpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/fourier/details/euclidian_maps.hpp b/src/fourier/details/euclidian_maps.hpp index c890471..e0bd939 100644 --- a/src/fourier/details/euclidian_maps.hpp +++ b/src/fourier/details/euclidian_maps.hpp @@ -113,6 +113,24 @@ namespace CosmoTool this->delta_k); } + template + void get_Kvec(const Array& ik, Array& kvec) + { + const DimArray& dims = this->getDims(); + assert(ik.size() == dims.size()); + assert(kvec.size() == dims.size()); + + kvec[0] = ik[0] * delta_k[0]; + for (int q = 1; q < ik.size(); q++) + { + int dk = ik[q]; + if (dk > dims[q]/2) + dk = dk - dims[q]; + + kvec[q] = dk*delta_k[q]; + } + } + template double get_K(const Array& ik) { From 3ef64751215d570668f2f227d9876cfe360065d3 Mon Sep 17 00:00:00 2001 From: Guilhem Lavaux Date: Wed, 28 Nov 2012 17:54:21 -0500 Subject: [PATCH 25/43] Added pixel -> kvec function --- src/fourier/details/euclidian_maps.hpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/fourier/details/euclidian_maps.hpp b/src/fourier/details/euclidian_maps.hpp index e0bd939..b42320c 100644 --- a/src/fourier/details/euclidian_maps.hpp +++ b/src/fourier/details/euclidian_maps.hpp @@ -131,6 +131,20 @@ namespace CosmoTool } } + template + void get_Kvec(long p, Array2& kvec) + { + const DimArray& dims = this->getDims(); + DimArray d(delta_k.size()); + for (int q = 0; q < d.size(); q++) + { + d[q] = p%dims[q]; + p = (p-d[q])/dims[q]; + } + return get_Kvec(d, kvec); + } + + template double get_K(const Array& ik) { From 7db82b3bb17e5a00ca64c991e61bedf8b0c661de Mon Sep 17 00:00:00 2001 From: Guilhem Lavaux Date: Wed, 28 Nov 2012 18:57:23 -0500 Subject: [PATCH 26/43] Fixed parameter types and return values --- src/fourier/details/euclidian_maps.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/fourier/details/euclidian_maps.hpp b/src/fourier/details/euclidian_maps.hpp index b42320c..67b141b 100644 --- a/src/fourier/details/euclidian_maps.hpp +++ b/src/fourier/details/euclidian_maps.hpp @@ -114,7 +114,7 @@ namespace CosmoTool } template - void get_Kvec(const Array& ik, Array& kvec) + void get_Kvec(const Array& ik, Array2& kvec) { const DimArray& dims = this->getDims(); assert(ik.size() == dims.size()); @@ -141,7 +141,7 @@ namespace CosmoTool d[q] = p%dims[q]; p = (p-d[q])/dims[q]; } - return get_Kvec(d, kvec); + get_Kvec(d, kvec); } From 523cc8e44e060949103368e6f0bee6cc6a78a625 Mon Sep 17 00:00:00 2001 From: Guilhem Lavaux Date: Wed, 28 Nov 2012 22:33:42 -0500 Subject: [PATCH 27/43] Introduced another intermediate function for retrieving integer indexes --- src/fourier/details/euclidian_maps.hpp | 17 ++++++++++++----- src/fourier/details/euclidian_spectrum_1d.hpp | 2 ++ 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/src/fourier/details/euclidian_maps.hpp b/src/fourier/details/euclidian_maps.hpp index 67b141b..cfadc72 100644 --- a/src/fourier/details/euclidian_maps.hpp +++ b/src/fourier/details/euclidian_maps.hpp @@ -136,14 +136,21 @@ namespace CosmoTool { const DimArray& dims = this->getDims(); DimArray d(delta_k.size()); - for (int q = 0; q < d.size(); q++) - { - d[q] = p%dims[q]; - p = (p-d[q])/dims[q]; - } + get_IKvec(p, d); get_Kvec(d, kvec); } + void get_IKvec(long p, DimArray& ikvec) + { + const DimArray& dims = this->getDims(); + assert(dims.size()==ikvec.size()); + for (int q = 0; q < ikvec.size(); q++) + { + ikvec[q] = p%dims[q]; + p = (p-ikvec[q])/dims[q]; + } + } + template double get_K(const Array& ik) diff --git a/src/fourier/details/euclidian_spectrum_1d.hpp b/src/fourier/details/euclidian_spectrum_1d.hpp index b12864b..291470d 100644 --- a/src/fourier/details/euclidian_spectrum_1d.hpp +++ b/src/fourier/details/euclidian_spectrum_1d.hpp @@ -1,6 +1,8 @@ #ifndef __DETAILS_EUCLIDIAN_SPECTRUM_1D #define __DETAILS_EUCLIDIAN_SPECTRUM_1D +#include + namespace CosmoTool { From 01f36b9be7d3ab0185b5451fb5c36fc04bb85b95 Mon Sep 17 00:00:00 2001 From: Guilhem Lavaux Date: Fri, 30 Nov 2012 17:11:21 -0500 Subject: [PATCH 28/43] Added a get_delta_k function to get the element phase volume --- src/fourier/details/euclidian_maps.hpp | 5 +++++ src/powerSpectrum.cpp | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/fourier/details/euclidian_maps.hpp b/src/fourier/details/euclidian_maps.hpp index cfadc72..6a650fe 100644 --- a/src/fourier/details/euclidian_maps.hpp +++ b/src/fourier/details/euclidian_maps.hpp @@ -113,6 +113,11 @@ namespace CosmoTool this->delta_k); } + const std::vector& get_delta_k() const + { + return this->delta_k; + } + template void get_Kvec(const Array& ik, Array2& kvec) { diff --git a/src/powerSpectrum.cpp b/src/powerSpectrum.cpp index 9f3d7c8..6ad7c89 100644 --- a/src/powerSpectrum.cpp +++ b/src/powerSpectrum.cpp @@ -21,7 +21,7 @@ using namespace std; #define POWER_BDM 7 #define POWER_TEST 8 -#define POWER_SPECTRUM HU_WIGGLES +#define POWER_SPECTRUM POWER_EFSTATHIOU namespace Cosmology { From a3ef55c318e269547eacce97dfea43ca8ff22e65 Mon Sep 17 00:00:00 2001 From: Guilhem Lavaux Date: Fri, 30 Nov 2012 17:16:45 -0500 Subject: [PATCH 29/43] Multiply the power spectrum by the volume to have proper units --- src/fourier/details/euclidian_spectrum_1d.hpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/fourier/details/euclidian_spectrum_1d.hpp b/src/fourier/details/euclidian_spectrum_1d.hpp index 291470d..6e2c21e 100644 --- a/src/fourier/details/euclidian_spectrum_1d.hpp +++ b/src/fourier/details/euclidian_spectrum_1d.hpp @@ -69,17 +69,22 @@ namespace CosmoTool std::complex *d = rand_map.data(); long idx; const DimArray& dims = rand_map.getDims(); + const std::vector& delta_k = rand_map.get_delta_k(); long plane_size; bool alleven = rand_map.allDimensionsEven(); + double V = 1; + + for (int p = 0; p < delta_k.size(); p++) + V *= (2*M_PI/delta_k[p]); for (long p = 1; p < rand_map.size(); p++) { - double A_k = std::sqrt(0.5*f(rand_map.get_K(p))); + double A_k = std::sqrt(0.5*V*f(rand_map.get_K(p))); d[p] = std::complex(gsl_ran_gaussian(rng, A_k), gsl_ran_gaussian(rng, A_k)); } // Generate the mean value - d[0] = std::complex(gsl_ran_gaussian(rng, std::sqrt(f(0))), 0); + d[0] = std::complex(gsl_ran_gaussian(rng, std::sqrt(V*f(0))), 0); if (!rand_map.firstDimensionEven()) return; From 975156d1f3fa15c2c4139ae7281773499e6de94e Mon Sep 17 00:00:00 2001 From: Guilhem Lavaux Date: Wed, 12 Dec 2012 17:41:14 -0500 Subject: [PATCH 30/43] Added the correction from Jennings (2012) for the velocity field --- src/powerSpectrum.cpp | 14 ++++++++++++++ src/powerSpectrum.hpp | 2 ++ 2 files changed, 16 insertions(+) diff --git a/src/powerSpectrum.cpp b/src/powerSpectrum.cpp index 6ad7c89..02549d6 100644 --- a/src/powerSpectrum.cpp +++ b/src/powerSpectrum.cpp @@ -1,3 +1,4 @@ +#include #include #include #include @@ -651,4 +652,17 @@ double computeCorrel2(double powNorm, double topHatRad1, double topHatRad2) #endif } + double vvCorrection(double P_deltadelta, double k) + { + static const double alpha0 = -12480.5, alpha1 = 1.824, alpha2 = 2165.87, alpha3=1.796; + if (k > 0.3) + return 0; + double r =(alpha0*sqrt(P_deltadelta) + alpha1*P_deltadelta*P_deltadelta)/(alpha2 + alpha3*P_deltadelta); + assert(P_deltadelta > 0); + + if (r < 0) + return 0; + return r; + } + }; diff --git a/src/powerSpectrum.hpp b/src/powerSpectrum.hpp index ad0b0a9..de7ce53 100644 --- a/src/powerSpectrum.hpp +++ b/src/powerSpectrum.hpp @@ -30,6 +30,8 @@ namespace Cosmology { double computeVarianceZero(double powNorm); double computeCorrel(double powNorm, double topHatRad1); double computeCorrel2(double powNorm, double topHatRad1, double topHatRad2); + + double vvCorrection(double P_deltadelta, double k); }; #endif From 052bc78e5f5f902c0010da941b4242e40ddf88a7 Mon Sep 17 00:00:00 2001 From: Guilhem Lavaux Date: Thu, 13 Dec 2012 10:39:27 -0500 Subject: [PATCH 31/43] Added new class to isolate cosmology/powerspectra --- src/CMakeLists.txt | 1 + src/cosmopower.cpp | 250 +++++++++++++++++++++++++++++++++++++++++++++ src/cosmopower.hpp | 70 +++++++++++++ 3 files changed, 321 insertions(+) create mode 100644 src/cosmopower.cpp create mode 100644 src/cosmopower.hpp diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index c99918e..8901027 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -8,6 +8,7 @@ SET(CosmoTool_SRCS powerSpectrum.cpp miniargs.cpp growthFactor.cpp + cosmopower.cpp ) IF(FOUND_NETCDF3) diff --git a/src/cosmopower.cpp b/src/cosmopower.cpp new file mode 100644 index 0000000..7f64080 --- /dev/null +++ b/src/cosmopower.cpp @@ -0,0 +1,250 @@ +#include +#include +#include +#include +#include +#include +#include +#include "cosmopower.hpp" + +using namespace std; +using namespace CosmoTool; + +#define USE_GSL +#define TOLERANCE 1e-6 +#define NUM_ITERATION 8000 + + +CosmoPower::CosmoPower() +{ + eval = &CosmoPower::powerEfstathiou; + + n = 1.0; + K0 = 1; + V_LG_CMB = 627; + + CMB_VECTOR[0] = 56.759; + CMB_VECTOR[1] = -540.02; + CMB_VECTOR[2] = 313.50; + + h = 0.719; + SIGMA8 = 0.77; + OMEGA_B = 0.043969; + OMEGA_C = 0.21259; + + Theta_27 = 2.728/2.7; + + updateCosmology(); +} + +/* + * This is \hat{tophat} + */ +static double tophatFilter(double u) +{ + if (u != 0) + return 3 / (u*u*u) * (sin(u) - u * cos(u)); + else + return 1; +} + +static double powC(double q, double alpha_c) +{ + return 14.2 / alpha_c + 386 / (1 + 69.9 * pow(q, 1.08)); +} + +static double T_tilde_0(double q, double alpha_c, double beta_c) +{ + double a = log(M_E + 1.8 * beta_c * q); + return a / ( a + powC(q, alpha_c) * q * q); +} + +static double j_0(double x) +{ + if (x == 0) + return 1.0; + return sin(x)/x; +} + +static double powG(double y) +{ + double a = sqrt(1 + y); + + return y * (-6 * a + (2 + 3 * y) *log((a + 1)/(a - 1))); +} + +double CosmoPower::powerEfstathiou(double k) +{ + double a = 6.4/Gamma0; + double b = 3/Gamma0; + double c = 1.7/Gamma0; + double nu = 1.13; + + double f = (a*k) + pow(b*k,1.5) + pow(c*k,2); + + // EFSTATHIOU ET AL. (1992) + return normPower * pow(k,n) * pow(1+pow(f,nu),(-2/nu)); +} + +double CosmoPower::powerHuWiggles(double k) +{ + // EISENSTEIN ET HU (1998) + // FULL POWER SPECTRUM WITH BARYONS AND WIGGLES + + double k_silk = 1.6 * pow(OMEGA_B * h * h, 0.52) * pow(OmegaEff, 0.73) * (1 + pow(10.4 * OmegaEff, -0.95)); + double z_eq = 2.50e4 * OmegaEff * pow(Theta_27, -4); + double s = 44.5 * log(9.83 / OmegaEff) / (sqrt(1 + 10 * pow(OMEGA_B * h * h, 0.75))); + double f = 1 / (1 + pow(k * s / 5.4, 4)); + double k_eq = 7.46e-2 * OmegaEff * pow(Theta_27, -2); + double a1 = pow(46.9 * OmegaEff, 0.670) * (1 + pow(32.1 * OmegaEff, -0.532)); + double a2 = pow(12.0 * OmegaEff, 0.424) * (1 + pow(45.0 * OmegaEff, -0.582)); + double alpha_c = pow(a1, -OMEGA_B/ OMEGA_0) * pow(a2, -pow(OMEGA_B / OMEGA_0, 3)); + + double q = k / (13.41 * k_eq); + double b1_betac = 0.944 * 1/(1 + pow(458 * OmegaEff, -0.708)); + double b2_betac = pow(0.395 * OmegaEff, -0.0266); + double beta_c = 1/ ( 1 + b1_betac * (pow(OMEGA_C / OMEGA_0, b2_betac) - 1) ); + double T_c = f * T_tilde_0(q, 1, beta_c) + (1 - f) * T_tilde_0(q, alpha_c, beta_c); + + double b1_zd = 0.313 * pow(OmegaEff, -0.419) * (1 + 0.607 * pow(OmegaEff, 0.674)); + double b2_zd = 0.238 * pow(OmegaEff, 0.223); + double z_d = 1291 * pow(OmegaEff, 0.251) / (1 + 0.659 * pow(OmegaEff, 0.828)) * (1 + b1_zd * pow(OmegaEff, b2_zd)); + double R_d = 31.5 * OMEGA_B * h * h * pow(Theta_27, -4) * 1e3 / z_d; + + double alpha_b = 2.07 * k_eq * s * pow(1 + R_d, -0.75) * powG((1 + z_eq)/(1 + z_d)); + double beta_b = 0.5 + OMEGA_B / OMEGA_0 + (3 - 2 * OMEGA_B / OMEGA_0) * sqrt(pow(17.2 * OmegaEff, 2) + 1); + double beta_node = 8.41 * pow(OmegaEff, 0.435); + double s_tilde = s * pow(1 + pow(beta_node / (k * s), 3), -1./3); + + double T_b = (T_tilde_0(q, 1, 1) / (1 + pow(k * s / 5.2, 2)) + alpha_b / (1 + pow(beta_b / (k * s), 3)) * exp(-pow(k/k_silk, 1.4))) * j_0(k * s_tilde); + + double T_k = OMEGA_B/OMEGA_0 * T_b + OMEGA_C/OMEGA_0 * T_c; + + return normPower * pow(k,n) * T_k * T_k; +} + +double CosmoPower::powerHuBaryons(double k) +{ + double s = 44.5 * log(9.83 / OmegaEff) / (sqrt(1 + 10 * pow(OMEGA_B * h * h, 0.75))); + double alpha_Gamma = 1 - 0.328 * log(431 * OmegaEff) * OMEGA_B / OMEGA_0 + 0.38 * log(22.3 * OmegaEff) * pow(OMEGA_B / OMEGA_0, 2); + double GammaEff = OMEGA_0 * h * (alpha_Gamma + (1 - alpha_Gamma)/(1 + pow(0.43 * k * s, 4))); + double q = k/(h*GammaEff) * pow(Theta_27, 2); + double L_0 = log(2 * M_E + 1.8 * q); + double C_0 = 14.2 + 731 / (1 + 62.5 * q); + double T0 = L_0 / (L_0 + C_0 * q * q); + + return normPower * pow(k,n) * T0 * T0; +} + +double CosmoPower::powerOld(double k) +{ + static const double l = 1/(Omega * h*h); + static const double alpha = 1.7 * l, beta = 9.0 * pow(l, 1.5), gamma = l*l; + return normPower * pow(k,n) * pow(1 + alpha * k + beta * pow(k,1.5) + gamma *k*k,-2); +} + +double CosmoPower::powerSugiyama(double k) +{ + double q = k * Theta_27*Theta_27 / (OmegaEff * exp(-OMEGA_B - sqrt(h/0.5)*OMEGA_B/OMEGA_0)); + double L0 = log(2*M_E + 1.8 * q); + double C0 = 14.2 + 731 / (1 + 62.5 * q); + double T_k = L0 / (L0 + C0 * q*q); + + return normPower * pow(k,n) * T_k * T_k; +} + +double CosmoPower::powerBardeen(double k) +{ + double q = k / (OmegaEff); + + double poly = 1 + 3.89 * q + pow(16.1*q,2) + pow(5.46*q,3) + pow(6.71*q,4); + double T_k = log(1+2.34*q)/(2.34*q) * pow(poly,-0.25); + + return normPower * pow(k,n) * T_k * T_k; +} + +double CosmoPower::powerBDM(double k) +{ + k /= h*h; + double alpha1 = 190; + double Gmu = 4.6; + double alpha2 = 11.5; + double alpha3 = 11; + double alpha4 = 12.55; + double alpha5 = 0.0004; + return normPower*k*alpha1*alpha1*Gmu*Gmu/(1+(alpha2*k)+pow(alpha3*k,2)+pow(alpha4*k,3))*pow(1+pow(alpha5/k,2), -2); +} + +double CosmoPower::powerTest(double k) +{ + return 1/(1+k*k); +} + +/* + * This function computes the normalization of the power spectrum. It requests + * a sigma8 (density fluctuations within 8 Mpc/h) + */ +static double gslPowSpecNorm(double k, void *params) +{ + CosmoPower *c = (CosmoPower *)params; + + return c->integrandNormalize(k); +} + +double CosmoPower::integrandNormalize(double k) +{ + double f = tophatFilter(k*8.0/h); + return power(k)*k*k*f*f; +} + +void CosmoPower::normalize(double sigma8) +{ + int Nsteps = 30000; + double normVal = 0; + double abserr; + gsl_integration_workspace *w = gsl_integration_workspace_alloc(NUM_ITERATION); + gsl_function f; + + f.function = gslPowSpecNorm; + f.params = this; + + normPower = 1; + + gsl_integration_qagiu(&f, 0, 0, TOLERANCE, NUM_ITERATION, w, &normVal, &abserr); + + gsl_integration_workspace_free(w); + + normVal /= (2*M_PI*M_PI); + + normPower = sigma8*sigma8/normVal; +} + +void CosmoPower::updateCosmology() +{ + OMEGA_0 = OMEGA_B+OMEGA_C; + Omega = OMEGA_0; + beta = pow(OMEGA_0, 5./9); + OmegaEff = OMEGA_0 * h * h; + Gamma0 = OMEGA_0 * h * h; +} + +double CosmoPower::eval_theta_theta(double k) +{ + // Jennings (2012) fit + double P_deltadelta = power(k); + + static const double alpha0 = -12480.5, alpha1 = 1.824, alpha2 = 2165.87, alpha3=1.796; + if (k > 0.3) + return 0; + double r =(alpha0*sqrt(P_deltadelta) + alpha1*P_deltadelta*P_deltadelta)/(alpha2 + alpha3*P_deltadelta); + assert(P_deltadelta > 0); + + if (r < 0) + return 0; + return r; +} + +double CosmoPower::power(double k) +{ + return (this->*eval)(k); +} diff --git a/src/cosmopower.hpp b/src/cosmopower.hpp new file mode 100644 index 0000000..83b3d8a --- /dev/null +++ b/src/cosmopower.hpp @@ -0,0 +1,70 @@ +#ifndef _COSMOPOWER_HPP +#define _COSMOPOWER_HPP + +namespace CosmoTool { + + class CosmoPower + { + public: + // PRIMARY VARIABLES + double n; + double K0; + double V_LG_CMB; + + double CMB_VECTOR[3]; + + double h; + double SIGMA8; + double OMEGA_B; + double OMEGA_C; + double Theta_27; + + // DERIVED VARIABLES + double OMEGA_0; + double Omega; + double beta; + double OmegaEff; + double Gamma0; + double normPower; + + enum CosmoFunction + { + POWER_EFSTATHIOU, + HU_WIGGLES, + HU_BARYON, + OLD_POWERSPECTRUM, + POWER_BARDEEN, + POWER_SUGIYAMA, + POWER_BDM, + POWER_TEST + }; + + CosmoPower(); + + void setFunction(); + + void updateCosmology(); + void normalize(double sigma8); + + + double eval_theta_theta(double k); + double power(double k); + + double integrandNormalize(double k); + private: + double (CosmoPower::*eval)(double); + + double powerEfstathiou(double k); + double powerHuWiggles(double k); + double powerHuBaryons(double k); + double powerOld(double k); + double powerBardeen(double k); + double powerSugiyama(double k); + double powerBDM(double k); + double powerTest(double k); + + }; + +}; + +#endif From 72df7b6c6613b813edfb6db6f28f8fbdc50721e8 Mon Sep 17 00:00:00 2001 From: Guilhem Lavaux Date: Thu, 13 Dec 2012 17:27:46 -0500 Subject: [PATCH 32/43] Fully implemented cosmopower --- src/cosmopower.cpp | 38 ++++++++++++++++++++++++-- src/cosmopower.hpp | 4 +-- src/fourier/details/euclidian_maps.hpp | 10 +++---- 3 files changed, 43 insertions(+), 9 deletions(-) diff --git a/src/cosmopower.cpp b/src/cosmopower.cpp index 7f64080..e82c25e 100644 --- a/src/cosmopower.cpp +++ b/src/cosmopower.cpp @@ -197,7 +197,7 @@ double CosmoPower::integrandNormalize(double k) return power(k)*k*k*f*f; } -void CosmoPower::normalize(double sigma8) +void CosmoPower::normalize() { int Nsteps = 30000; double normVal = 0; @@ -216,7 +216,7 @@ void CosmoPower::normalize(double sigma8) normVal /= (2*M_PI*M_PI); - normPower = sigma8*sigma8/normVal; + normPower = SIGMA8*SIGMA8/normVal; } void CosmoPower::updateCosmology() @@ -248,3 +248,37 @@ double CosmoPower::power(double k) { return (this->*eval)(k); } + + +void CosmoPower::setFunction(CosmoFunction f) +{ + switch (f) + { + case POWER_EFSTATHIOU: + eval = &CosmoPower::powerEfstathiou; + break; + case HU_WIGGLES: + eval = &CosmoPower::powerHuWiggles; + break; + case HU_BARYON: + eval = &CosmoPower::powerHuBaryons; + break; + case OLD_POWERSPECTRUM: + eval = &CosmoPower::powerOld; + break; + case POWER_BARDEEN: + eval = &CosmoPower::powerBardeen; + break; + case POWER_SUGIYAMA: + eval = &CosmoPower::powerSugiyama; + break; + case POWER_BDM: + eval = &CosmoPower::powerBDM; + break; + case POWER_TEST: + eval = &CosmoPower::powerTest; + break; + default: + abort(); + } +} diff --git a/src/cosmopower.hpp b/src/cosmopower.hpp index 83b3d8a..b700fc0 100644 --- a/src/cosmopower.hpp +++ b/src/cosmopower.hpp @@ -41,10 +41,10 @@ namespace CosmoTool { CosmoPower(); - void setFunction(); + void setFunction(CosmoFunction f); void updateCosmology(); - void normalize(double sigma8); + void normalize(); double eval_theta_theta(double k); diff --git a/src/fourier/details/euclidian_maps.hpp b/src/fourier/details/euclidian_maps.hpp index 6a650fe..a7c51b5 100644 --- a/src/fourier/details/euclidian_maps.hpp +++ b/src/fourier/details/euclidian_maps.hpp @@ -119,7 +119,7 @@ namespace CosmoTool } template - void get_Kvec(const Array& ik, Array2& kvec) + void get_Kvec(const Array& ik, Array2& kvec) const { const DimArray& dims = this->getDims(); assert(ik.size() == dims.size()); @@ -137,7 +137,7 @@ namespace CosmoTool } template - void get_Kvec(long p, Array2& kvec) + void get_Kvec(long p, Array2& kvec) const { const DimArray& dims = this->getDims(); DimArray d(delta_k.size()); @@ -145,7 +145,7 @@ namespace CosmoTool get_Kvec(d, kvec); } - void get_IKvec(long p, DimArray& ikvec) + void get_IKvec(long p, DimArray& ikvec) const { const DimArray& dims = this->getDims(); assert(dims.size()==ikvec.size()); @@ -158,7 +158,7 @@ namespace CosmoTool template - double get_K(const Array& ik) + double get_K(const Array& ik) const { const DimArray& dims = this->getDims(); assert(ik.size() == dims.size()); @@ -177,7 +177,7 @@ namespace CosmoTool return std::sqrt(k2); } - double get_K(long p) + double get_K(long p) const { const DimArray& dims = this->getDims(); DimArray d(delta_k.size()); From f1a30f3537b749df2837975d6494f846369a9944 Mon Sep 17 00:00:00 2001 From: Guilhem Lavaux Date: Tue, 19 Feb 2013 11:15:46 -0500 Subject: [PATCH 33/43] Use long instead of int for particle identifiers --- sample/CMakeLists.txt | 4 +++ src/cosmopower.cpp | 30 ++++++++++++++++--- src/cosmopower.hpp | 4 +++ src/fourier/details/euclidian_spectrum_1d.hpp | 1 + src/h5_readFlash.cpp | 4 +-- src/h5_readFlash.hpp | 2 +- src/loadFlash.cpp | 2 +- src/loadGadget.cpp | 2 +- src/loadRamses.cpp | 2 +- src/loadSimu.hpp | 2 +- 10 files changed, 42 insertions(+), 11 deletions(-) diff --git a/sample/CMakeLists.txt b/sample/CMakeLists.txt index 17e01c4..765e1b3 100644 --- a/sample/CMakeLists.txt +++ b/sample/CMakeLists.txt @@ -55,3 +55,7 @@ if (SHARP_LIBRARY AND SHARP_INCLUDE_PATH AND EIGEN3_FOUND) target_link_libraries(test_healpix_calls ${tolink} ${SHARP_LIBRARIES}) set_target_properties(test_healpix_calls PROPERTIES COMPILE_FLAGS ${OpenMP_CXX_FLAGS} LINK_FLAGS ${OpenMP_CXX_FLAGS}) endif (SHARP_LIBRARY AND SHARP_INCLUDE_PATH AND EIGEN3_FOUND) + +add_executable(test_cosmopower test_cosmopower.cpp) +target_link_libraries(test_cosmopower ${tolink}) + diff --git a/src/cosmopower.cpp b/src/cosmopower.cpp index e82c25e..19aec97 100644 --- a/src/cosmopower.cpp +++ b/src/cosmopower.cpp @@ -191,15 +191,15 @@ static double gslPowSpecNorm(double k, void *params) return c->integrandNormalize(k); } -double CosmoPower::integrandNormalize(double k) +double CosmoPower::integrandNormalize(double x) { + double k = (1-x)/x; double f = tophatFilter(k*8.0/h); - return power(k)*k*k*f*f; + return power(k)*k*k*f*f/(x*x); } void CosmoPower::normalize() { - int Nsteps = 30000; double normVal = 0; double abserr; gsl_integration_workspace *w = gsl_integration_workspace_alloc(NUM_ITERATION); @@ -210,8 +210,15 @@ void CosmoPower::normalize() normPower = 1; - gsl_integration_qagiu(&f, 0, 0, TOLERANCE, NUM_ITERATION, w, &normVal, &abserr); + ofstream ff("PP_k.txt"); + for (int i = 0; i < 100; i++) + { + double k = pow(10.0, 4.0*i/100.-2); + ff << k << " " << power(k) << endl; + } + // gsl_integration_qagiu(&f, 0, 0, TOLERANCE, NUM_ITERATION, w, &normVal, &abserr); + gsl_integration_qag(&f, 0, 1, 0, TOLERANCE, NUM_ITERATION, GSL_INTEG_GAUSS61, w, &normVal, &abserr); gsl_integration_workspace_free(w); normVal /= (2*M_PI*M_PI); @@ -226,6 +233,16 @@ void CosmoPower::updateCosmology() beta = pow(OMEGA_0, 5./9); OmegaEff = OMEGA_0 * h * h; Gamma0 = OMEGA_0 * h * h; + omega_B = OMEGA_B * h * h; + omega_C = OMEGA_C * h * h; +} + +void CosmoPower::updatePhysicalCosmology() +{ + OMEGA_B = omega_B / (h*h); + OMEGA_C = omega_C / (h*h); + OMEGA_0 = Gamma0 / (h*h); + beta = pow(OMEGA_0, 5./9); } double CosmoPower::eval_theta_theta(double k) @@ -282,3 +299,8 @@ void CosmoPower::setFunction(CosmoFunction f) abort(); } } + +void CosmoPower::setNormalization(double A_K) +{ + normPower = A_K/power(0.002); +} diff --git a/src/cosmopower.hpp b/src/cosmopower.hpp index b700fc0..1edf5b6 100644 --- a/src/cosmopower.hpp +++ b/src/cosmopower.hpp @@ -17,6 +17,8 @@ namespace CosmoTool { double SIGMA8; double OMEGA_B; double OMEGA_C; + double omega_B; + double omega_C; double Theta_27; // DERIVED VARIABLES @@ -44,7 +46,9 @@ namespace CosmoTool { void setFunction(CosmoFunction f); void updateCosmology(); + void updatePhysicalCosmology(); void normalize(); + void setNormalization(double A_K); double eval_theta_theta(double k); diff --git a/src/fourier/details/euclidian_spectrum_1d.hpp b/src/fourier/details/euclidian_spectrum_1d.hpp index 6e2c21e..fbc4f7f 100644 --- a/src/fourier/details/euclidian_spectrum_1d.hpp +++ b/src/fourier/details/euclidian_spectrum_1d.hpp @@ -1,6 +1,7 @@ #ifndef __DETAILS_EUCLIDIAN_SPECTRUM_1D #define __DETAILS_EUCLIDIAN_SPECTRUM_1D +#include #include diff --git a/src/h5_readFlash.cpp b/src/h5_readFlash.cpp index 0c78f58..d8f6475 100644 --- a/src/h5_readFlash.cpp +++ b/src/h5_readFlash.cpp @@ -185,7 +185,7 @@ void h5_read_flash3_particles (H5File* file, float *vel1, float *vel2, float *vel3, - int *id) + long *id) { herr_t status; @@ -341,7 +341,7 @@ void h5_read_flash3_particles (H5File* file, if (id) { for(p=0; p < (pcount); p++) { - id[p+poffset] = (int) *(partBuffer+iptag-1+p*numProps); + id[p+poffset] = (long) *(partBuffer+iptag-1+p*numProps); } } if (pos1 && pos2 && pos3) { diff --git a/src/h5_readFlash.hpp b/src/h5_readFlash.hpp index 5187232..71392bc 100644 --- a/src/h5_readFlash.hpp +++ b/src/h5_readFlash.hpp @@ -29,7 +29,7 @@ void h5_read_flash3_particles (H5File* file, float *vel1, float *vel2, float *vel3, - int *id); + long *id); void h5_read_flash3_header_info(H5File* file, double* time, /* simulation time */ diff --git a/src/loadFlash.cpp b/src/loadFlash.cpp index ada498d..f00f098 100644 --- a/src/loadFlash.cpp +++ b/src/loadFlash.cpp @@ -71,7 +71,7 @@ SimuData *CosmoTool::loadFlashMulti(const char *fname, int id, int loadflags) } } if (loadflags & NEED_GADGET_ID) { - data->Id = new int[data->NumPart]; + data->Id = new long[data->NumPart]; if (data->Id == 0) { delete data; return 0; diff --git a/src/loadGadget.cpp b/src/loadGadget.cpp index ee30d80..ced42b6 100644 --- a/src/loadGadget.cpp +++ b/src/loadGadget.cpp @@ -195,7 +195,7 @@ SimuData *CosmoTool::loadGadgetMulti(const char *fname, int id, try { f->beginCheckpoint(); - data->Id = new int[data->NumPart]; + data->Id = new long[data->NumPart]; if (data->Id == 0) { delete f; diff --git a/src/loadRamses.cpp b/src/loadRamses.cpp index 5cd2e1e..e05f426 100644 --- a/src/loadRamses.cpp +++ b/src/loadRamses.cpp @@ -384,7 +384,7 @@ CosmoTool::SimuData *CosmoTool::loadRamsesSimu(const char *basename, int outputI } if (flags & NEED_GADGET_ID) { - data->Id = new int[nPar]; + data->Id = new long[nPar]; } for (int k = 0; k < 3; k++) diff --git a/src/loadSimu.hpp b/src/loadSimu.hpp index 7a72259..e93fd64 100644 --- a/src/loadSimu.hpp +++ b/src/loadSimu.hpp @@ -38,7 +38,7 @@ namespace CosmoTool long NumPart; long TotalNumPart; - int *Id; + long *Id; float *Pos[3]; float *Vel[3]; int *type; From e49c3e1ed2cf8cc83515483d8733dfdfba3c4987 Mon Sep 17 00:00:00 2001 From: Guilhem Lavaux Date: Tue, 19 Feb 2013 11:28:50 -0500 Subject: [PATCH 34/43] Added missing test --- sample/test_cosmopower.cpp | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 sample/test_cosmopower.cpp diff --git a/sample/test_cosmopower.cpp b/sample/test_cosmopower.cpp new file mode 100644 index 0000000..f87677b --- /dev/null +++ b/sample/test_cosmopower.cpp @@ -0,0 +1,29 @@ +#include +#include +#include "cosmopower.hpp" + +using namespace std; +using namespace CosmoTool; + +int main() +{ + CosmoPower cp; + CosmoPower::CosmoFunction f[] = { CosmoPower::POWER_EFSTATHIOU, CosmoPower::HU_WIGGLES, CosmoPower::HU_BARYON, CosmoPower::POWER_SUGIYAMA }; + int num_F = sizeof(f)/sizeof(f[0]); + + cp.setFunction(f[0]); + cp.normalize(); + for (int ik = 0; ik < 100; ik++) + { + double k = pow(10.0, 4*ik/100.-3); + + cout << k << " "; + for (int q = 0; q < num_F; q++) + { + cp.setFunction(f[q]); + cout << cp.power(k) << " "; + } + cout << endl; + } + return 0; +} From ef83d367c23aeadb7bf3b632b9c4bb7dc7869442 Mon Sep 17 00:00:00 2001 From: Guilhem Lavaux Date: Sat, 2 Mar 2013 18:36:08 -0500 Subject: [PATCH 35/43] Added script to add license information to the code --- build_tools/gather_sources.py | 91 +++++++++++++++++++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100644 build_tools/gather_sources.py diff --git a/build_tools/gather_sources.py b/build_tools/gather_sources.py new file mode 100644 index 0000000..3ff32f4 --- /dev/null +++ b/build_tools/gather_sources.py @@ -0,0 +1,91 @@ +import shutil +import tempfile +import re +from git import Repo,Tree,Blob + +def apply_license(license, relimit, filename): + header = re.sub(r'@FILENAME@', filename, license) + + f = file(filename) + lines = f.read() + f.close() + + lines = re.sub(relimit, '', lines) + lines = header + lines + + with tempfile.NamedTemporaryFile(delete=False) as tmp_sources: + tmp_sources.write(lines) + + shutil.move(tmp_sources.name, filename) + + +def apply_python_license(filename): + license="""#+ +# CosmoTool -- A cosmotool box for cosmology -- @FILENAME@ +# Copyright (C) 2007-2013 Guilhem Lavaux +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +#+ +""" + + print("Shell/Python file: %s" % filename) + relimit=r'^#\+\n(#.*\n)*#\+\n' + apply_license(license, relimit, filename) + + +def apply_cpp_license(filename): + license="""/*+ + CosmoTool -- A cosmotool box for cosmology -- @FILENAME@ + Copyright (C) 2007-2013 Guilhem Lavaux + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. ++*/ +""" + relimit = r'^(?s)/\*\+.*\+\*/' + print("C++ file: %s" % filename) + apply_license(license, relimit, filename) + + +def analyze_tree(prefix, t): + for ename,entry in t.items(): + if ename == 'external' or ename == 'zobov': + continue + if type(entry) == Tree: + analyze_tree(prefix + "/" + ename, entry) + elif type(entry) == Blob: + if re.match(".*\.(sh|py|pyx)$",ename) != None: + fname=prefix+"/"+ename + apply_python_license(fname) + if re.match('.*\.(cpp|hpp|h)$', ename) != None: + fname=prefix+"/"+ename + apply_cpp_license(fname) + + +if __name__=="__main__": + repo = Repo(".") + assert repo.bare == False + t = repo.tree() + analyze_tree(".", t) From 818ad683b1fc168a93b6696d39347181b3ecae4d Mon Sep 17 00:00:00 2001 From: Guilhem Lavaux Date: Sat, 2 Mar 2013 18:41:57 -0500 Subject: [PATCH 36/43] Moved to CECIL --- build_tools/gather_sources.py | 83 ++++++++++++++++++++++++----------- 1 file changed, 58 insertions(+), 25 deletions(-) diff --git a/build_tools/gather_sources.py b/build_tools/gather_sources.py index 3ff32f4..b502472 100644 --- a/build_tools/gather_sources.py +++ b/build_tools/gather_sources.py @@ -21,22 +21,38 @@ def apply_license(license, relimit, filename): def apply_python_license(filename): license="""#+ -# CosmoTool -- A cosmotool box for cosmology -- @FILENAME@ -# Copyright (C) 2007-2013 Guilhem Lavaux +# This is CosmoTool (@FILENAME@) -- Copyright (C) Guilhem Lavaux (2007-2013) # -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; version 2 of the License. -# +# guilhem.lavaux@gmail.com # -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. +# This software is a computer program whose purpose is to provide a toolbox for cosmological +# data analysis (e.g. filters, generalized Fourier transforms, power spectra, ...) + +# This software is governed by the CeCILL license under French law and +# abiding by the rules of distribution of free software. You can use, +# modify and/ or redistribute the software under the terms of the CeCILL +# license as circulated by CEA, CNRS and INRIA at the following URL +# "http://www.cecill.info". # -# You should have received a copy of the GNU General Public License along -# with this program; if not, write to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# As a counterpart to the access to the source code and rights to copy, +# modify and redistribute granted by the license, users are provided only +# with a limited warranty and the software's author, the holder of the +# economic rights, and the successive licensors have only limited +# liability. +# +# In this respect, the user's attention is drawn to the risks associated +# with loading, using, modifying and/or developing or reproducing the +# software by the user in light of its specific status of free software, +# that may mean that it is complicated to manipulate, and that also +# therefore means that it is reserved for developers and experienced +# professionals having in-depth computer knowledge. Users are therefore +# encouraged to load and test the software's suitability as regards their +# requirements in conditions enabling the security of their systems and/or +# data to be ensured and, more generally, to use and operate it in the +# same conditions as regards security. +# +# The fact that you are presently reading this means that you have had +# knowledge of the CeCILL license and that you accept its terms. #+ """ @@ -47,21 +63,38 @@ def apply_python_license(filename): def apply_cpp_license(filename): license="""/*+ - CosmoTool -- A cosmotool box for cosmology -- @FILENAME@ - Copyright (C) 2007-2013 Guilhem Lavaux +This is CosmoTool (@FILENAME@) -- Copyright (C) Guilhem Lavaux (2007-2013) - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; version 2 of the License. +guilhem.lavaux@gmail.com - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. +This software is a computer program whose purpose is to provide a toolbox for cosmological +data analysis (e.g. filters, generalized Fourier transforms, power spectra, ...) - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +This software is governed by the CeCILL license under French law and +abiding by the rules of distribution of free software. You can use, +modify and/ or redistribute the software under the terms of the CeCILL +license as circulated by CEA, CNRS and INRIA at the following URL +"http://www.cecill.info". + +As a counterpart to the access to the source code and rights to copy, +modify and redistribute granted by the license, users are provided only +with a limited warranty and the software's author, the holder of the +economic rights, and the successive licensors have only limited +liability. + +In this respect, the user's attention is drawn to the risks associated +with loading, using, modifying and/or developing or reproducing the +software by the user in light of its specific status of free software, +that may mean that it is complicated to manipulate, and that also +therefore means that it is reserved for developers and experienced +professionals having in-depth computer knowledge. Users are therefore +encouraged to load and test the software's suitability as regards their +requirements in conditions enabling the security of their systems and/or +data to be ensured and, more generally, to use and operate it in the +same conditions as regards security. + +The fact that you are presently reading this means that you have had +knowledge of the CeCILL license and that you accept its terms. +*/ """ relimit = r'^(?s)/\*\+.*\+\*/' From e919bd4a738ef39653176d49c80fe0f54ee6f996 Mon Sep 17 00:00:00 2001 From: Guilhem Lavaux Date: Sat, 2 Mar 2013 18:42:56 -0500 Subject: [PATCH 37/43] Added Copyright/LICENSE disclaimer --- build_tools/gather_sources.py | 34 +++++++++++++++++++ sample/testAlgo.cpp | 34 +++++++++++++++++++ sample/testBQueue.cpp | 34 +++++++++++++++++++ sample/testBSP.cpp | 34 +++++++++++++++++++ sample/testDelaunay.cpp | 34 +++++++++++++++++++ sample/testEskow.cpp | 34 +++++++++++++++++++ sample/testInterpolate.cpp | 34 +++++++++++++++++++ sample/testNewton.cpp | 34 +++++++++++++++++++ sample/testPool.cpp | 34 +++++++++++++++++++ sample/testReadFlash.cpp | 34 +++++++++++++++++++ sample/testSmooth.cpp | 34 +++++++++++++++++++ sample/test_fft_calls.cpp | 34 +++++++++++++++++++ sample/test_healpix_calls.cpp | 34 +++++++++++++++++++ sample/testkd.cpp | 34 +++++++++++++++++++ sample/testkd2.cpp | 34 +++++++++++++++++++ src/algo.hpp | 34 +++++++++++++++++++ src/bqueue.hpp | 34 +++++++++++++++++++ src/bsp_simple.hpp | 34 +++++++++++++++++++ src/cic.cpp | 34 +++++++++++++++++++ src/cic.hpp | 34 +++++++++++++++++++ src/config.hpp | 34 +++++++++++++++++++ src/cosmopower.cpp | 34 +++++++++++++++++++ src/cosmopower.hpp | 34 +++++++++++++++++++ src/dinterpolate.hpp | 34 +++++++++++++++++++ src/eskow.hpp | 34 +++++++++++++++++++ src/field.hpp | 34 +++++++++++++++++++ src/fixArray.hpp | 34 +++++++++++++++++++ src/fortran.cpp | 34 +++++++++++++++++++ src/fortran.hpp | 34 +++++++++++++++++++ src/fourier/base_types.hpp | 34 +++++++++++++++++++ src/fourier/details/euclidian_maps.hpp | 34 +++++++++++++++++++ src/fourier/details/euclidian_spectrum_1d.hpp | 34 +++++++++++++++++++ .../details/euclidian_spectrum_1d_bin.hpp | 34 +++++++++++++++++++ src/fourier/details/euclidian_transform.hpp | 34 +++++++++++++++++++ src/fourier/details/healpix_alms.hpp | 34 +++++++++++++++++++ src/fourier/details/healpix_map.hpp | 34 +++++++++++++++++++ src/fourier/details/healpix_spectrum.hpp | 34 +++++++++++++++++++ src/fourier/details/healpix_transform.hpp | 34 +++++++++++++++++++ src/fourier/details/healpix_utility.hpp | 34 +++++++++++++++++++ src/fourier/euclidian.hpp | 34 +++++++++++++++++++ src/fourier/fft/fftw_calls.hpp | 34 +++++++++++++++++++ src/fourier/healpix.hpp | 34 +++++++++++++++++++ src/growthFactor.cpp | 34 +++++++++++++++++++ src/growthFactor.hpp | 34 +++++++++++++++++++ src/h5_readFlash.cpp | 34 +++++++++++++++++++ src/h5_readFlash.hpp | 34 +++++++++++++++++++ src/hdf5_flash.h | 34 +++++++++++++++++++ src/interpolate.cpp | 34 +++++++++++++++++++ src/interpolate.hpp | 34 +++++++++++++++++++ src/interpolate3d.hpp | 34 +++++++++++++++++++ src/kdtree_leaf.hpp | 34 +++++++++++++++++++ src/kdtree_splitters.hpp | 34 +++++++++++++++++++ src/loadFlash.cpp | 34 +++++++++++++++++++ src/loadFlash.hpp | 34 +++++++++++++++++++ src/loadFlash_dummy.cpp | 34 +++++++++++++++++++ src/loadGadget.cpp | 34 +++++++++++++++++++ src/loadGadget.hpp | 34 +++++++++++++++++++ src/loadRamses.cpp | 34 +++++++++++++++++++ src/loadRamses.hpp | 34 +++++++++++++++++++ src/loadSimu.hpp | 34 +++++++++++++++++++ src/load_data.cpp | 34 +++++++++++++++++++ src/load_data.hpp | 34 +++++++++++++++++++ src/mach.hpp | 34 +++++++++++++++++++ src/miniargs.cpp | 34 +++++++++++++++++++ src/miniargs.hpp | 34 +++++++++++++++++++ src/mykdtree.hpp | 34 +++++++++++++++++++ src/newton.hpp | 34 +++++++++++++++++++ src/octTree.cpp | 34 +++++++++++++++++++ src/octTree.hpp | 34 +++++++++++++++++++ src/pool.hpp | 34 +++++++++++++++++++ src/powerSpectrum.cpp | 34 +++++++++++++++++++ src/powerSpectrum.hpp | 34 +++++++++++++++++++ src/sparseGrid.hpp | 34 +++++++++++++++++++ src/sphSmooth.hpp | 34 +++++++++++++++++++ src/yorick.hpp | 34 +++++++++++++++++++ src/yorick_nc3.cpp | 34 +++++++++++++++++++ src/yorick_nc4.cpp | 34 +++++++++++++++++++ 77 files changed, 2618 insertions(+) diff --git a/build_tools/gather_sources.py b/build_tools/gather_sources.py index b502472..f787975 100644 --- a/build_tools/gather_sources.py +++ b/build_tools/gather_sources.py @@ -1,3 +1,37 @@ +#+ +# This is CosmoTool (./build_tools/gather_sources.py) -- Copyright (C) Guilhem Lavaux (2007-2013) +# +# guilhem.lavaux@gmail.com +# +# This software is a computer program whose purpose is to provide a toolbox for cosmological +# data analysis (e.g. filters, generalized Fourier transforms, power spectra, ...) + +# This software is governed by the CeCILL license under French law and +# abiding by the rules of distribution of free software. You can use, +# modify and/ or redistribute the software under the terms of the CeCILL +# license as circulated by CEA, CNRS and INRIA at the following URL +# "http://www.cecill.info". +# +# As a counterpart to the access to the source code and rights to copy, +# modify and redistribute granted by the license, users are provided only +# with a limited warranty and the software's author, the holder of the +# economic rights, and the successive licensors have only limited +# liability. +# +# In this respect, the user's attention is drawn to the risks associated +# with loading, using, modifying and/or developing or reproducing the +# software by the user in light of its specific status of free software, +# that may mean that it is complicated to manipulate, and that also +# therefore means that it is reserved for developers and experienced +# professionals having in-depth computer knowledge. Users are therefore +# encouraged to load and test the software's suitability as regards their +# requirements in conditions enabling the security of their systems and/or +# data to be ensured and, more generally, to use and operate it in the +# same conditions as regards security. +# +# The fact that you are presently reading this means that you have had +# knowledge of the CeCILL license and that you accept its terms. +#+ import shutil import tempfile import re diff --git a/sample/testAlgo.cpp b/sample/testAlgo.cpp index 65614f5..07cd7fe 100644 --- a/sample/testAlgo.cpp +++ b/sample/testAlgo.cpp @@ -1,3 +1,37 @@ +/*+ +This is CosmoTool (./sample/testAlgo.cpp) -- Copyright (C) Guilhem Lavaux (2007-2013) + +guilhem.lavaux@gmail.com + +This software is a computer program whose purpose is to provide a toolbox for cosmological +data analysis (e.g. filters, generalized Fourier transforms, power spectra, ...) + +This software is governed by the CeCILL license under French law and +abiding by the rules of distribution of free software. You can use, +modify and/ or redistribute the software under the terms of the CeCILL +license as circulated by CEA, CNRS and INRIA at the following URL +"http://www.cecill.info". + +As a counterpart to the access to the source code and rights to copy, +modify and redistribute granted by the license, users are provided only +with a limited warranty and the software's author, the holder of the +economic rights, and the successive licensors have only limited +liability. + +In this respect, the user's attention is drawn to the risks associated +with loading, using, modifying and/or developing or reproducing the +software by the user in light of its specific status of free software, +that may mean that it is complicated to manipulate, and that also +therefore means that it is reserved for developers and experienced +professionals having in-depth computer knowledge. Users are therefore +encouraged to load and test the software's suitability as regards their +requirements in conditions enabling the security of their systems and/or +data to be ensured and, more generally, to use and operate it in the +same conditions as regards security. + +The fact that you are presently reading this means that you have had +knowledge of the CeCILL license and that you accept its terms. ++*/ #include #include #include "algo.hpp" diff --git a/sample/testBQueue.cpp b/sample/testBQueue.cpp index 822cd6b..261321e 100644 --- a/sample/testBQueue.cpp +++ b/sample/testBQueue.cpp @@ -1,3 +1,37 @@ +/*+ +This is CosmoTool (./sample/testBQueue.cpp) -- Copyright (C) Guilhem Lavaux (2007-2013) + +guilhem.lavaux@gmail.com + +This software is a computer program whose purpose is to provide a toolbox for cosmological +data analysis (e.g. filters, generalized Fourier transforms, power spectra, ...) + +This software is governed by the CeCILL license under French law and +abiding by the rules of distribution of free software. You can use, +modify and/ or redistribute the software under the terms of the CeCILL +license as circulated by CEA, CNRS and INRIA at the following URL +"http://www.cecill.info". + +As a counterpart to the access to the source code and rights to copy, +modify and redistribute granted by the license, users are provided only +with a limited warranty and the software's author, the holder of the +economic rights, and the successive licensors have only limited +liability. + +In this respect, the user's attention is drawn to the risks associated +with loading, using, modifying and/or developing or reproducing the +software by the user in light of its specific status of free software, +that may mean that it is complicated to manipulate, and that also +therefore means that it is reserved for developers and experienced +professionals having in-depth computer knowledge. Users are therefore +encouraged to load and test the software's suitability as regards their +requirements in conditions enabling the security of their systems and/or +data to be ensured and, more generally, to use and operate it in the +same conditions as regards security. + +The fact that you are presently reading this means that you have had +knowledge of the CeCILL license and that you accept its terms. ++*/ #include #include "bqueue.hpp" diff --git a/sample/testBSP.cpp b/sample/testBSP.cpp index f142fc2..92597a3 100644 --- a/sample/testBSP.cpp +++ b/sample/testBSP.cpp @@ -1,3 +1,37 @@ +/*+ +This is CosmoTool (./sample/testBSP.cpp) -- Copyright (C) Guilhem Lavaux (2007-2013) + +guilhem.lavaux@gmail.com + +This software is a computer program whose purpose is to provide a toolbox for cosmological +data analysis (e.g. filters, generalized Fourier transforms, power spectra, ...) + +This software is governed by the CeCILL license under French law and +abiding by the rules of distribution of free software. You can use, +modify and/ or redistribute the software under the terms of the CeCILL +license as circulated by CEA, CNRS and INRIA at the following URL +"http://www.cecill.info". + +As a counterpart to the access to the source code and rights to copy, +modify and redistribute granted by the license, users are provided only +with a limited warranty and the software's author, the holder of the +economic rights, and the successive licensors have only limited +liability. + +In this respect, the user's attention is drawn to the risks associated +with loading, using, modifying and/or developing or reproducing the +software by the user in light of its specific status of free software, +that may mean that it is complicated to manipulate, and that also +therefore means that it is reserved for developers and experienced +professionals having in-depth computer knowledge. Users are therefore +encouraged to load and test the software's suitability as regards their +requirements in conditions enabling the security of their systems and/or +data to be ensured and, more generally, to use and operate it in the +same conditions as regards security. + +The fact that you are presently reading this means that you have had +knowledge of the CeCILL license and that you accept its terms. ++*/ #if 0 #include "bsp_simple.hpp" diff --git a/sample/testDelaunay.cpp b/sample/testDelaunay.cpp index fe14553..59093db 100644 --- a/sample/testDelaunay.cpp +++ b/sample/testDelaunay.cpp @@ -1,3 +1,37 @@ +/*+ +This is CosmoTool (./sample/testDelaunay.cpp) -- Copyright (C) Guilhem Lavaux (2007-2013) + +guilhem.lavaux@gmail.com + +This software is a computer program whose purpose is to provide a toolbox for cosmological +data analysis (e.g. filters, generalized Fourier transforms, power spectra, ...) + +This software is governed by the CeCILL license under French law and +abiding by the rules of distribution of free software. You can use, +modify and/ or redistribute the software under the terms of the CeCILL +license as circulated by CEA, CNRS and INRIA at the following URL +"http://www.cecill.info". + +As a counterpart to the access to the source code and rights to copy, +modify and redistribute granted by the license, users are provided only +with a limited warranty and the software's author, the holder of the +economic rights, and the successive licensors have only limited +liability. + +In this respect, the user's attention is drawn to the risks associated +with loading, using, modifying and/or developing or reproducing the +software by the user in light of its specific status of free software, +that may mean that it is complicated to manipulate, and that also +therefore means that it is reserved for developers and experienced +professionals having in-depth computer knowledge. Users are therefore +encouraged to load and test the software's suitability as regards their +requirements in conditions enabling the security of their systems and/or +data to be ensured and, more generally, to use and operate it in the +same conditions as regards security. + +The fact that you are presently reading this means that you have had +knowledge of the CeCILL license and that you accept its terms. ++*/ #include #include #include "dinterpolate.hpp" diff --git a/sample/testEskow.cpp b/sample/testEskow.cpp index 60c1821..318bb48 100644 --- a/sample/testEskow.cpp +++ b/sample/testEskow.cpp @@ -1,3 +1,37 @@ +/*+ +This is CosmoTool (./sample/testEskow.cpp) -- Copyright (C) Guilhem Lavaux (2007-2013) + +guilhem.lavaux@gmail.com + +This software is a computer program whose purpose is to provide a toolbox for cosmological +data analysis (e.g. filters, generalized Fourier transforms, power spectra, ...) + +This software is governed by the CeCILL license under French law and +abiding by the rules of distribution of free software. You can use, +modify and/ or redistribute the software under the terms of the CeCILL +license as circulated by CEA, CNRS and INRIA at the following URL +"http://www.cecill.info". + +As a counterpart to the access to the source code and rights to copy, +modify and redistribute granted by the license, users are provided only +with a limited warranty and the software's author, the holder of the +economic rights, and the successive licensors have only limited +liability. + +In this respect, the user's attention is drawn to the risks associated +with loading, using, modifying and/or developing or reproducing the +software by the user in light of its specific status of free software, +that may mean that it is complicated to manipulate, and that also +therefore means that it is reserved for developers and experienced +professionals having in-depth computer knowledge. Users are therefore +encouraged to load and test the software's suitability as regards their +requirements in conditions enabling the security of their systems and/or +data to be ensured and, more generally, to use and operate it in the +same conditions as regards security. + +The fact that you are presently reading this means that you have had +knowledge of the CeCILL license and that you accept its terms. ++*/ #include #include #include diff --git a/sample/testInterpolate.cpp b/sample/testInterpolate.cpp index df146b2..aa5eec0 100644 --- a/sample/testInterpolate.cpp +++ b/sample/testInterpolate.cpp @@ -1,3 +1,37 @@ +/*+ +This is CosmoTool (./sample/testInterpolate.cpp) -- Copyright (C) Guilhem Lavaux (2007-2013) + +guilhem.lavaux@gmail.com + +This software is a computer program whose purpose is to provide a toolbox for cosmological +data analysis (e.g. filters, generalized Fourier transforms, power spectra, ...) + +This software is governed by the CeCILL license under French law and +abiding by the rules of distribution of free software. You can use, +modify and/ or redistribute the software under the terms of the CeCILL +license as circulated by CEA, CNRS and INRIA at the following URL +"http://www.cecill.info". + +As a counterpart to the access to the source code and rights to copy, +modify and redistribute granted by the license, users are provided only +with a limited warranty and the software's author, the holder of the +economic rights, and the successive licensors have only limited +liability. + +In this respect, the user's attention is drawn to the risks associated +with loading, using, modifying and/or developing or reproducing the +software by the user in light of its specific status of free software, +that may mean that it is complicated to manipulate, and that also +therefore means that it is reserved for developers and experienced +professionals having in-depth computer knowledge. Users are therefore +encouraged to load and test the software's suitability as regards their +requirements in conditions enabling the security of their systems and/or +data to be ensured and, more generally, to use and operate it in the +same conditions as regards security. + +The fact that you are presently reading this means that you have had +knowledge of the CeCILL license and that you accept its terms. ++*/ #include #include "interpolate3d.hpp" diff --git a/sample/testNewton.cpp b/sample/testNewton.cpp index 27415b8..febb5af 100644 --- a/sample/testNewton.cpp +++ b/sample/testNewton.cpp @@ -1,3 +1,37 @@ +/*+ +This is CosmoTool (./sample/testNewton.cpp) -- Copyright (C) Guilhem Lavaux (2007-2013) + +guilhem.lavaux@gmail.com + +This software is a computer program whose purpose is to provide a toolbox for cosmological +data analysis (e.g. filters, generalized Fourier transforms, power spectra, ...) + +This software is governed by the CeCILL license under French law and +abiding by the rules of distribution of free software. You can use, +modify and/ or redistribute the software under the terms of the CeCILL +license as circulated by CEA, CNRS and INRIA at the following URL +"http://www.cecill.info". + +As a counterpart to the access to the source code and rights to copy, +modify and redistribute granted by the license, users are provided only +with a limited warranty and the software's author, the holder of the +economic rights, and the successive licensors have only limited +liability. + +In this respect, the user's attention is drawn to the risks associated +with loading, using, modifying and/or developing or reproducing the +software by the user in light of its specific status of free software, +that may mean that it is complicated to manipulate, and that also +therefore means that it is reserved for developers and experienced +professionals having in-depth computer knowledge. Users are therefore +encouraged to load and test the software's suitability as regards their +requirements in conditions enabling the security of their systems and/or +data to be ensured and, more generally, to use and operate it in the +same conditions as regards security. + +The fact that you are presently reading this means that you have had +knowledge of the CeCILL license and that you accept its terms. ++*/ #include #include diff --git a/sample/testPool.cpp b/sample/testPool.cpp index ee01468..53a6fb8 100644 --- a/sample/testPool.cpp +++ b/sample/testPool.cpp @@ -1,3 +1,37 @@ +/*+ +This is CosmoTool (./sample/testPool.cpp) -- Copyright (C) Guilhem Lavaux (2007-2013) + +guilhem.lavaux@gmail.com + +This software is a computer program whose purpose is to provide a toolbox for cosmological +data analysis (e.g. filters, generalized Fourier transforms, power spectra, ...) + +This software is governed by the CeCILL license under French law and +abiding by the rules of distribution of free software. You can use, +modify and/ or redistribute the software under the terms of the CeCILL +license as circulated by CEA, CNRS and INRIA at the following URL +"http://www.cecill.info". + +As a counterpart to the access to the source code and rights to copy, +modify and redistribute granted by the license, users are provided only +with a limited warranty and the software's author, the holder of the +economic rights, and the successive licensors have only limited +liability. + +In this respect, the user's attention is drawn to the risks associated +with loading, using, modifying and/or developing or reproducing the +software by the user in light of its specific status of free software, +that may mean that it is complicated to manipulate, and that also +therefore means that it is reserved for developers and experienced +professionals having in-depth computer knowledge. Users are therefore +encouraged to load and test the software's suitability as regards their +requirements in conditions enabling the security of their systems and/or +data to be ensured and, more generally, to use and operate it in the +same conditions as regards security. + +The fact that you are presently reading this means that you have had +knowledge of the CeCILL license and that you accept its terms. ++*/ #include "pool.hpp" using namespace CosmoTool; diff --git a/sample/testReadFlash.cpp b/sample/testReadFlash.cpp index 61d038e..b1129ec 100644 --- a/sample/testReadFlash.cpp +++ b/sample/testReadFlash.cpp @@ -1,3 +1,37 @@ +/*+ +This is CosmoTool (./sample/testReadFlash.cpp) -- Copyright (C) Guilhem Lavaux (2007-2013) + +guilhem.lavaux@gmail.com + +This software is a computer program whose purpose is to provide a toolbox for cosmological +data analysis (e.g. filters, generalized Fourier transforms, power spectra, ...) + +This software is governed by the CeCILL license under French law and +abiding by the rules of distribution of free software. You can use, +modify and/ or redistribute the software under the terms of the CeCILL +license as circulated by CEA, CNRS and INRIA at the following URL +"http://www.cecill.info". + +As a counterpart to the access to the source code and rights to copy, +modify and redistribute granted by the license, users are provided only +with a limited warranty and the software's author, the holder of the +economic rights, and the successive licensors have only limited +liability. + +In this respect, the user's attention is drawn to the risks associated +with loading, using, modifying and/or developing or reproducing the +software by the user in light of its specific status of free software, +that may mean that it is complicated to manipulate, and that also +therefore means that it is reserved for developers and experienced +professionals having in-depth computer knowledge. Users are therefore +encouraged to load and test the software's suitability as regards their +requirements in conditions enabling the security of their systems and/or +data to be ensured and, more generally, to use and operate it in the +same conditions as regards security. + +The fact that you are presently reading this means that you have had +knowledge of the CeCILL license and that you accept its terms. ++*/ #include #include #include diff --git a/sample/testSmooth.cpp b/sample/testSmooth.cpp index d1c94a9..1bb1603 100644 --- a/sample/testSmooth.cpp +++ b/sample/testSmooth.cpp @@ -1,3 +1,37 @@ +/*+ +This is CosmoTool (./sample/testSmooth.cpp) -- Copyright (C) Guilhem Lavaux (2007-2013) + +guilhem.lavaux@gmail.com + +This software is a computer program whose purpose is to provide a toolbox for cosmological +data analysis (e.g. filters, generalized Fourier transforms, power spectra, ...) + +This software is governed by the CeCILL license under French law and +abiding by the rules of distribution of free software. You can use, +modify and/ or redistribute the software under the terms of the CeCILL +license as circulated by CEA, CNRS and INRIA at the following URL +"http://www.cecill.info". + +As a counterpart to the access to the source code and rights to copy, +modify and redistribute granted by the license, users are provided only +with a limited warranty and the software's author, the holder of the +economic rights, and the successive licensors have only limited +liability. + +In this respect, the user's attention is drawn to the risks associated +with loading, using, modifying and/or developing or reproducing the +software by the user in light of its specific status of free software, +that may mean that it is complicated to manipulate, and that also +therefore means that it is reserved for developers and experienced +professionals having in-depth computer knowledge. Users are therefore +encouraged to load and test the software's suitability as regards their +requirements in conditions enabling the security of their systems and/or +data to be ensured and, more generally, to use and operate it in the +same conditions as regards security. + +The fact that you are presently reading this means that you have had +knowledge of the CeCILL license and that you accept its terms. ++*/ #include #include "sphSmooth.hpp" #include "yorick.hpp" diff --git a/sample/test_fft_calls.cpp b/sample/test_fft_calls.cpp index f62e678..0739328 100644 --- a/sample/test_fft_calls.cpp +++ b/sample/test_fft_calls.cpp @@ -1,3 +1,37 @@ +/*+ +This is CosmoTool (./sample/test_fft_calls.cpp) -- Copyright (C) Guilhem Lavaux (2007-2013) + +guilhem.lavaux@gmail.com + +This software is a computer program whose purpose is to provide a toolbox for cosmological +data analysis (e.g. filters, generalized Fourier transforms, power spectra, ...) + +This software is governed by the CeCILL license under French law and +abiding by the rules of distribution of free software. You can use, +modify and/ or redistribute the software under the terms of the CeCILL +license as circulated by CEA, CNRS and INRIA at the following URL +"http://www.cecill.info". + +As a counterpart to the access to the source code and rights to copy, +modify and redistribute granted by the license, users are provided only +with a limited warranty and the software's author, the holder of the +economic rights, and the successive licensors have only limited +liability. + +In this respect, the user's attention is drawn to the risks associated +with loading, using, modifying and/or developing or reproducing the +software by the user in light of its specific status of free software, +that may mean that it is complicated to manipulate, and that also +therefore means that it is reserved for developers and experienced +professionals having in-depth computer knowledge. Users are therefore +encouraged to load and test the software's suitability as regards their +requirements in conditions enabling the security of their systems and/or +data to be ensured and, more generally, to use and operate it in the +same conditions as regards security. + +The fact that you are presently reading this means that you have had +knowledge of the CeCILL license and that you accept its terms. ++*/ #include #include "yorick.hpp" #include diff --git a/sample/test_healpix_calls.cpp b/sample/test_healpix_calls.cpp index 7cc4272..ffd13fd 100644 --- a/sample/test_healpix_calls.cpp +++ b/sample/test_healpix_calls.cpp @@ -1,3 +1,37 @@ +/*+ +This is CosmoTool (./sample/test_healpix_calls.cpp) -- Copyright (C) Guilhem Lavaux (2007-2013) + +guilhem.lavaux@gmail.com + +This software is a computer program whose purpose is to provide a toolbox for cosmological +data analysis (e.g. filters, generalized Fourier transforms, power spectra, ...) + +This software is governed by the CeCILL license under French law and +abiding by the rules of distribution of free software. You can use, +modify and/ or redistribute the software under the terms of the CeCILL +license as circulated by CEA, CNRS and INRIA at the following URL +"http://www.cecill.info". + +As a counterpart to the access to the source code and rights to copy, +modify and redistribute granted by the license, users are provided only +with a limited warranty and the software's author, the holder of the +economic rights, and the successive licensors have only limited +liability. + +In this respect, the user's attention is drawn to the risks associated +with loading, using, modifying and/or developing or reproducing the +software by the user in light of its specific status of free software, +that may mean that it is complicated to manipulate, and that also +therefore means that it is reserved for developers and experienced +professionals having in-depth computer knowledge. Users are therefore +encouraged to load and test the software's suitability as regards their +requirements in conditions enabling the security of their systems and/or +data to be ensured and, more generally, to use and operate it in the +same conditions as regards security. + +The fact that you are presently reading this means that you have had +knowledge of the CeCILL license and that you accept its terms. ++*/ #include #include "fourier/healpix.hpp" diff --git a/sample/testkd.cpp b/sample/testkd.cpp index eabcfb2..71c0000 100644 --- a/sample/testkd.cpp +++ b/sample/testkd.cpp @@ -1,3 +1,37 @@ +/*+ +This is CosmoTool (./sample/testkd.cpp) -- Copyright (C) Guilhem Lavaux (2007-2013) + +guilhem.lavaux@gmail.com + +This software is a computer program whose purpose is to provide a toolbox for cosmological +data analysis (e.g. filters, generalized Fourier transforms, power spectra, ...) + +This software is governed by the CeCILL license under French law and +abiding by the rules of distribution of free software. You can use, +modify and/ or redistribute the software under the terms of the CeCILL +license as circulated by CEA, CNRS and INRIA at the following URL +"http://www.cecill.info". + +As a counterpart to the access to the source code and rights to copy, +modify and redistribute granted by the license, users are provided only +with a limited warranty and the software's author, the holder of the +economic rights, and the successive licensors have only limited +liability. + +In this respect, the user's attention is drawn to the risks associated +with loading, using, modifying and/or developing or reproducing the +software by the user in light of its specific status of free software, +that may mean that it is complicated to manipulate, and that also +therefore means that it is reserved for developers and experienced +professionals having in-depth computer knowledge. Users are therefore +encouraged to load and test the software's suitability as regards their +requirements in conditions enabling the security of their systems and/or +data to be ensured and, more generally, to use and operate it in the +same conditions as regards security. + +The fact that you are presently reading this means that you have had +knowledge of the CeCILL license and that you accept its terms. ++*/ #define __KD_TREE_SAVE_ON_DISK #include #include diff --git a/sample/testkd2.cpp b/sample/testkd2.cpp index bc65899..457c5b9 100644 --- a/sample/testkd2.cpp +++ b/sample/testkd2.cpp @@ -1,3 +1,37 @@ +/*+ +This is CosmoTool (./sample/testkd2.cpp) -- Copyright (C) Guilhem Lavaux (2007-2013) + +guilhem.lavaux@gmail.com + +This software is a computer program whose purpose is to provide a toolbox for cosmological +data analysis (e.g. filters, generalized Fourier transforms, power spectra, ...) + +This software is governed by the CeCILL license under French law and +abiding by the rules of distribution of free software. You can use, +modify and/ or redistribute the software under the terms of the CeCILL +license as circulated by CEA, CNRS and INRIA at the following URL +"http://www.cecill.info". + +As a counterpart to the access to the source code and rights to copy, +modify and redistribute granted by the license, users are provided only +with a limited warranty and the software's author, the holder of the +economic rights, and the successive licensors have only limited +liability. + +In this respect, the user's attention is drawn to the risks associated +with loading, using, modifying and/or developing or reproducing the +software by the user in light of its specific status of free software, +that may mean that it is complicated to manipulate, and that also +therefore means that it is reserved for developers and experienced +professionals having in-depth computer knowledge. Users are therefore +encouraged to load and test the software's suitability as regards their +requirements in conditions enabling the security of their systems and/or +data to be ensured and, more generally, to use and operate it in the +same conditions as regards security. + +The fact that you are presently reading this means that you have had +knowledge of the CeCILL license and that you accept its terms. ++*/ #include #include #include diff --git a/src/algo.hpp b/src/algo.hpp index 485db75..927ef4c 100644 --- a/src/algo.hpp +++ b/src/algo.hpp @@ -1,3 +1,37 @@ +/*+ +This is CosmoTool (./src/algo.hpp) -- Copyright (C) Guilhem Lavaux (2007-2013) + +guilhem.lavaux@gmail.com + +This software is a computer program whose purpose is to provide a toolbox for cosmological +data analysis (e.g. filters, generalized Fourier transforms, power spectra, ...) + +This software is governed by the CeCILL license under French law and +abiding by the rules of distribution of free software. You can use, +modify and/ or redistribute the software under the terms of the CeCILL +license as circulated by CEA, CNRS and INRIA at the following URL +"http://www.cecill.info". + +As a counterpart to the access to the source code and rights to copy, +modify and redistribute granted by the license, users are provided only +with a limited warranty and the software's author, the holder of the +economic rights, and the successive licensors have only limited +liability. + +In this respect, the user's attention is drawn to the risks associated +with loading, using, modifying and/or developing or reproducing the +software by the user in light of its specific status of free software, +that may mean that it is complicated to manipulate, and that also +therefore means that it is reserved for developers and experienced +professionals having in-depth computer knowledge. Users are therefore +encouraged to load and test the software's suitability as regards their +requirements in conditions enabling the security of their systems and/or +data to be ensured and, more generally, to use and operate it in the +same conditions as regards security. + +The fact that you are presently reading this means that you have had +knowledge of the CeCILL license and that you accept its terms. ++*/ #ifndef __COSMOTOOL_ALGO_HPP #define __COSMOTOOL_ALGO_HPP diff --git a/src/bqueue.hpp b/src/bqueue.hpp index 792d309..97d346c 100644 --- a/src/bqueue.hpp +++ b/src/bqueue.hpp @@ -1,3 +1,37 @@ +/*+ +This is CosmoTool (./src/bqueue.hpp) -- Copyright (C) Guilhem Lavaux (2007-2013) + +guilhem.lavaux@gmail.com + +This software is a computer program whose purpose is to provide a toolbox for cosmological +data analysis (e.g. filters, generalized Fourier transforms, power spectra, ...) + +This software is governed by the CeCILL license under French law and +abiding by the rules of distribution of free software. You can use, +modify and/ or redistribute the software under the terms of the CeCILL +license as circulated by CEA, CNRS and INRIA at the following URL +"http://www.cecill.info". + +As a counterpart to the access to the source code and rights to copy, +modify and redistribute granted by the license, users are provided only +with a limited warranty and the software's author, the holder of the +economic rights, and the successive licensors have only limited +liability. + +In this respect, the user's attention is drawn to the risks associated +with loading, using, modifying and/or developing or reproducing the +software by the user in light of its specific status of free software, +that may mean that it is complicated to manipulate, and that also +therefore means that it is reserved for developers and experienced +professionals having in-depth computer knowledge. Users are therefore +encouraged to load and test the software's suitability as regards their +requirements in conditions enabling the security of their systems and/or +data to be ensured and, more generally, to use and operate it in the +same conditions as regards security. + +The fact that you are presently reading this means that you have had +knowledge of the CeCILL license and that you accept its terms. ++*/ #ifndef __COSMO_QUEUE_HPP #define __COSMO_QUEUE_HPP diff --git a/src/bsp_simple.hpp b/src/bsp_simple.hpp index b61bcf3..3e4cce3 100644 --- a/src/bsp_simple.hpp +++ b/src/bsp_simple.hpp @@ -1,3 +1,37 @@ +/*+ +This is CosmoTool (./src/bsp_simple.hpp) -- Copyright (C) Guilhem Lavaux (2007-2013) + +guilhem.lavaux@gmail.com + +This software is a computer program whose purpose is to provide a toolbox for cosmological +data analysis (e.g. filters, generalized Fourier transforms, power spectra, ...) + +This software is governed by the CeCILL license under French law and +abiding by the rules of distribution of free software. You can use, +modify and/ or redistribute the software under the terms of the CeCILL +license as circulated by CEA, CNRS and INRIA at the following URL +"http://www.cecill.info". + +As a counterpart to the access to the source code and rights to copy, +modify and redistribute granted by the license, users are provided only +with a limited warranty and the software's author, the holder of the +economic rights, and the successive licensors have only limited +liability. + +In this respect, the user's attention is drawn to the risks associated +with loading, using, modifying and/or developing or reproducing the +software by the user in light of its specific status of free software, +that may mean that it is complicated to manipulate, and that also +therefore means that it is reserved for developers and experienced +professionals having in-depth computer knowledge. Users are therefore +encouraged to load and test the software's suitability as regards their +requirements in conditions enabling the security of their systems and/or +data to be ensured and, more generally, to use and operate it in the +same conditions as regards security. + +The fact that you are presently reading this means that you have had +knowledge of the CeCILL license and that you accept its terms. ++*/ #ifndef __COSMOTOOL_SIMPLE_BSP_HPP #define __COSMOTOOL_SIMPLE_BSP_HPP diff --git a/src/cic.cpp b/src/cic.cpp index 71a106d..9d7b77f 100644 --- a/src/cic.cpp +++ b/src/cic.cpp @@ -1,3 +1,37 @@ +/*+ +This is CosmoTool (./src/cic.cpp) -- Copyright (C) Guilhem Lavaux (2007-2013) + +guilhem.lavaux@gmail.com + +This software is a computer program whose purpose is to provide a toolbox for cosmological +data analysis (e.g. filters, generalized Fourier transforms, power spectra, ...) + +This software is governed by the CeCILL license under French law and +abiding by the rules of distribution of free software. You can use, +modify and/ or redistribute the software under the terms of the CeCILL +license as circulated by CEA, CNRS and INRIA at the following URL +"http://www.cecill.info". + +As a counterpart to the access to the source code and rights to copy, +modify and redistribute granted by the license, users are provided only +with a limited warranty and the software's author, the holder of the +economic rights, and the successive licensors have only limited +liability. + +In this respect, the user's attention is drawn to the risks associated +with loading, using, modifying and/or developing or reproducing the +software by the user in light of its specific status of free software, +that may mean that it is complicated to manipulate, and that also +therefore means that it is reserved for developers and experienced +professionals having in-depth computer knowledge. Users are therefore +encouraged to load and test the software's suitability as regards their +requirements in conditions enabling the security of their systems and/or +data to be ensured and, more generally, to use and operate it in the +same conditions as regards security. + +The fact that you are presently reading this means that you have had +knowledge of the CeCILL license and that you accept its terms. ++*/ #include #include #include diff --git a/src/cic.hpp b/src/cic.hpp index d522d00..3442c38 100644 --- a/src/cic.hpp +++ b/src/cic.hpp @@ -1,3 +1,37 @@ +/*+ +This is CosmoTool (./src/cic.hpp) -- Copyright (C) Guilhem Lavaux (2007-2013) + +guilhem.lavaux@gmail.com + +This software is a computer program whose purpose is to provide a toolbox for cosmological +data analysis (e.g. filters, generalized Fourier transforms, power spectra, ...) + +This software is governed by the CeCILL license under French law and +abiding by the rules of distribution of free software. You can use, +modify and/ or redistribute the software under the terms of the CeCILL +license as circulated by CEA, CNRS and INRIA at the following URL +"http://www.cecill.info". + +As a counterpart to the access to the source code and rights to copy, +modify and redistribute granted by the license, users are provided only +with a limited warranty and the software's author, the holder of the +economic rights, and the successive licensors have only limited +liability. + +In this respect, the user's attention is drawn to the risks associated +with loading, using, modifying and/or developing or reproducing the +software by the user in light of its specific status of free software, +that may mean that it is complicated to manipulate, and that also +therefore means that it is reserved for developers and experienced +professionals having in-depth computer knowledge. Users are therefore +encouraged to load and test the software's suitability as regards their +requirements in conditions enabling the security of their systems and/or +data to be ensured and, more generally, to use and operate it in the +same conditions as regards security. + +The fact that you are presently reading this means that you have had +knowledge of the CeCILL license and that you accept its terms. ++*/ #ifndef __CICFILTER_HPP #define __CICFILTER_HPP diff --git a/src/config.hpp b/src/config.hpp index b046e2f..afb43f6 100644 --- a/src/config.hpp +++ b/src/config.hpp @@ -1,3 +1,37 @@ +/*+ +This is CosmoTool (./src/config.hpp) -- Copyright (C) Guilhem Lavaux (2007-2013) + +guilhem.lavaux@gmail.com + +This software is a computer program whose purpose is to provide a toolbox for cosmological +data analysis (e.g. filters, generalized Fourier transforms, power spectra, ...) + +This software is governed by the CeCILL license under French law and +abiding by the rules of distribution of free software. You can use, +modify and/ or redistribute the software under the terms of the CeCILL +license as circulated by CEA, CNRS and INRIA at the following URL +"http://www.cecill.info". + +As a counterpart to the access to the source code and rights to copy, +modify and redistribute granted by the license, users are provided only +with a limited warranty and the software's author, the holder of the +economic rights, and the successive licensors have only limited +liability. + +In this respect, the user's attention is drawn to the risks associated +with loading, using, modifying and/or developing or reproducing the +software by the user in light of its specific status of free software, +that may mean that it is complicated to manipulate, and that also +therefore means that it is reserved for developers and experienced +professionals having in-depth computer knowledge. Users are therefore +encouraged to load and test the software's suitability as regards their +requirements in conditions enabling the security of their systems and/or +data to be ensured and, more generally, to use and operate it in the +same conditions as regards security. + +The fact that you are presently reading this means that you have had +knowledge of the CeCILL license and that you accept its terms. ++*/ #ifndef __COSMOTOOL_CONFIG_HPP #define __COSMOTOOL_CONFIG_HPP diff --git a/src/cosmopower.cpp b/src/cosmopower.cpp index e82c25e..af12c9b 100644 --- a/src/cosmopower.cpp +++ b/src/cosmopower.cpp @@ -1,3 +1,37 @@ +/*+ +This is CosmoTool (./src/cosmopower.cpp) -- Copyright (C) Guilhem Lavaux (2007-2013) + +guilhem.lavaux@gmail.com + +This software is a computer program whose purpose is to provide a toolbox for cosmological +data analysis (e.g. filters, generalized Fourier transforms, power spectra, ...) + +This software is governed by the CeCILL license under French law and +abiding by the rules of distribution of free software. You can use, +modify and/ or redistribute the software under the terms of the CeCILL +license as circulated by CEA, CNRS and INRIA at the following URL +"http://www.cecill.info". + +As a counterpart to the access to the source code and rights to copy, +modify and redistribute granted by the license, users are provided only +with a limited warranty and the software's author, the holder of the +economic rights, and the successive licensors have only limited +liability. + +In this respect, the user's attention is drawn to the risks associated +with loading, using, modifying and/or developing or reproducing the +software by the user in light of its specific status of free software, +that may mean that it is complicated to manipulate, and that also +therefore means that it is reserved for developers and experienced +professionals having in-depth computer knowledge. Users are therefore +encouraged to load and test the software's suitability as regards their +requirements in conditions enabling the security of their systems and/or +data to be ensured and, more generally, to use and operate it in the +same conditions as regards security. + +The fact that you are presently reading this means that you have had +knowledge of the CeCILL license and that you accept its terms. ++*/ #include #include #include diff --git a/src/cosmopower.hpp b/src/cosmopower.hpp index b700fc0..e6cc06c 100644 --- a/src/cosmopower.hpp +++ b/src/cosmopower.hpp @@ -1,3 +1,37 @@ +/*+ +This is CosmoTool (./src/cosmopower.hpp) -- Copyright (C) Guilhem Lavaux (2007-2013) + +guilhem.lavaux@gmail.com + +This software is a computer program whose purpose is to provide a toolbox for cosmological +data analysis (e.g. filters, generalized Fourier transforms, power spectra, ...) + +This software is governed by the CeCILL license under French law and +abiding by the rules of distribution of free software. You can use, +modify and/ or redistribute the software under the terms of the CeCILL +license as circulated by CEA, CNRS and INRIA at the following URL +"http://www.cecill.info". + +As a counterpart to the access to the source code and rights to copy, +modify and redistribute granted by the license, users are provided only +with a limited warranty and the software's author, the holder of the +economic rights, and the successive licensors have only limited +liability. + +In this respect, the user's attention is drawn to the risks associated +with loading, using, modifying and/or developing or reproducing the +software by the user in light of its specific status of free software, +that may mean that it is complicated to manipulate, and that also +therefore means that it is reserved for developers and experienced +professionals having in-depth computer knowledge. Users are therefore +encouraged to load and test the software's suitability as regards their +requirements in conditions enabling the security of their systems and/or +data to be ensured and, more generally, to use and operate it in the +same conditions as regards security. + +The fact that you are presently reading this means that you have had +knowledge of the CeCILL license and that you accept its terms. ++*/ #ifndef _COSMOPOWER_HPP #define _COSMOPOWER_HPP diff --git a/src/dinterpolate.hpp b/src/dinterpolate.hpp index acbe3f7..29b3507 100644 --- a/src/dinterpolate.hpp +++ b/src/dinterpolate.hpp @@ -1,3 +1,37 @@ +/*+ +This is CosmoTool (./src/dinterpolate.hpp) -- Copyright (C) Guilhem Lavaux (2007-2013) + +guilhem.lavaux@gmail.com + +This software is a computer program whose purpose is to provide a toolbox for cosmological +data analysis (e.g. filters, generalized Fourier transforms, power spectra, ...) + +This software is governed by the CeCILL license under French law and +abiding by the rules of distribution of free software. You can use, +modify and/ or redistribute the software under the terms of the CeCILL +license as circulated by CEA, CNRS and INRIA at the following URL +"http://www.cecill.info". + +As a counterpart to the access to the source code and rights to copy, +modify and redistribute granted by the license, users are provided only +with a limited warranty and the software's author, the holder of the +economic rights, and the successive licensors have only limited +liability. + +In this respect, the user's attention is drawn to the risks associated +with loading, using, modifying and/or developing or reproducing the +software by the user in light of its specific status of free software, +that may mean that it is complicated to manipulate, and that also +therefore means that it is reserved for developers and experienced +professionals having in-depth computer knowledge. Users are therefore +encouraged to load and test the software's suitability as regards their +requirements in conditions enabling the security of their systems and/or +data to be ensured and, more generally, to use and operate it in the +same conditions as regards security. + +The fact that you are presently reading this means that you have had +knowledge of the CeCILL license and that you accept its terms. ++*/ #ifndef __COSMO_DINTERPOLATE_HPP #define __COSMO_DINTERPOLATE_HPP diff --git a/src/eskow.hpp b/src/eskow.hpp index ac9b292..d6516d6 100644 --- a/src/eskow.hpp +++ b/src/eskow.hpp @@ -1,3 +1,37 @@ +/*+ +This is CosmoTool (./src/eskow.hpp) -- Copyright (C) Guilhem Lavaux (2007-2013) + +guilhem.lavaux@gmail.com + +This software is a computer program whose purpose is to provide a toolbox for cosmological +data analysis (e.g. filters, generalized Fourier transforms, power spectra, ...) + +This software is governed by the CeCILL license under French law and +abiding by the rules of distribution of free software. You can use, +modify and/ or redistribute the software under the terms of the CeCILL +license as circulated by CEA, CNRS and INRIA at the following URL +"http://www.cecill.info". + +As a counterpart to the access to the source code and rights to copy, +modify and redistribute granted by the license, users are provided only +with a limited warranty and the software's author, the holder of the +economic rights, and the successive licensors have only limited +liability. + +In this respect, the user's attention is drawn to the risks associated +with loading, using, modifying and/or developing or reproducing the +software by the user in light of its specific status of free software, +that may mean that it is complicated to manipulate, and that also +therefore means that it is reserved for developers and experienced +professionals having in-depth computer knowledge. Users are therefore +encouraged to load and test the software's suitability as regards their +requirements in conditions enabling the security of their systems and/or +data to be ensured and, more generally, to use and operate it in the +same conditions as regards security. + +The fact that you are presently reading this means that you have had +knowledge of the CeCILL license and that you accept its terms. ++*/ #ifndef __ESKOW_CHOLESKY_HPP #define __ESKOW_CHOLESKY_HPP diff --git a/src/field.hpp b/src/field.hpp index 25ec447..e78e651 100644 --- a/src/field.hpp +++ b/src/field.hpp @@ -1,3 +1,37 @@ +/*+ +This is CosmoTool (./src/field.hpp) -- Copyright (C) Guilhem Lavaux (2007-2013) + +guilhem.lavaux@gmail.com + +This software is a computer program whose purpose is to provide a toolbox for cosmological +data analysis (e.g. filters, generalized Fourier transforms, power spectra, ...) + +This software is governed by the CeCILL license under French law and +abiding by the rules of distribution of free software. You can use, +modify and/ or redistribute the software under the terms of the CeCILL +license as circulated by CEA, CNRS and INRIA at the following URL +"http://www.cecill.info". + +As a counterpart to the access to the source code and rights to copy, +modify and redistribute granted by the license, users are provided only +with a limited warranty and the software's author, the holder of the +economic rights, and the successive licensors have only limited +liability. + +In this respect, the user's attention is drawn to the risks associated +with loading, using, modifying and/or developing or reproducing the +software by the user in light of its specific status of free software, +that may mean that it is complicated to manipulate, and that also +therefore means that it is reserved for developers and experienced +professionals having in-depth computer knowledge. Users are therefore +encouraged to load and test the software's suitability as regards their +requirements in conditions enabling the security of their systems and/or +data to be ensured and, more generally, to use and operate it in the +same conditions as regards security. + +The fact that you are presently reading this means that you have had +knowledge of the CeCILL license and that you accept its terms. ++*/ #ifndef __COSMOTOOL_FIELD #define __COSMOTOOL_FIELD diff --git a/src/fixArray.hpp b/src/fixArray.hpp index d1516e4..2f8744f 100644 --- a/src/fixArray.hpp +++ b/src/fixArray.hpp @@ -1,3 +1,37 @@ +/*+ +This is CosmoTool (./src/fixArray.hpp) -- Copyright (C) Guilhem Lavaux (2007-2013) + +guilhem.lavaux@gmail.com + +This software is a computer program whose purpose is to provide a toolbox for cosmological +data analysis (e.g. filters, generalized Fourier transforms, power spectra, ...) + +This software is governed by the CeCILL license under French law and +abiding by the rules of distribution of free software. You can use, +modify and/ or redistribute the software under the terms of the CeCILL +license as circulated by CEA, CNRS and INRIA at the following URL +"http://www.cecill.info". + +As a counterpart to the access to the source code and rights to copy, +modify and redistribute granted by the license, users are provided only +with a limited warranty and the software's author, the holder of the +economic rights, and the successive licensors have only limited +liability. + +In this respect, the user's attention is drawn to the risks associated +with loading, using, modifying and/or developing or reproducing the +software by the user in light of its specific status of free software, +that may mean that it is complicated to manipulate, and that also +therefore means that it is reserved for developers and experienced +professionals having in-depth computer knowledge. Users are therefore +encouraged to load and test the software's suitability as regards their +requirements in conditions enabling the security of their systems and/or +data to be ensured and, more generally, to use and operate it in the +same conditions as regards security. + +The fact that you are presently reading this means that you have had +knowledge of the CeCILL license and that you accept its terms. ++*/ #ifndef __FIX_ARRAY_HPP #define __FIX_ARRAY_HPP diff --git a/src/fortran.cpp b/src/fortran.cpp index 727a6d0..c8c38d6 100644 --- a/src/fortran.cpp +++ b/src/fortran.cpp @@ -1,3 +1,37 @@ +/*+ +This is CosmoTool (./src/fortran.cpp) -- Copyright (C) Guilhem Lavaux (2007-2013) + +guilhem.lavaux@gmail.com + +This software is a computer program whose purpose is to provide a toolbox for cosmological +data analysis (e.g. filters, generalized Fourier transforms, power spectra, ...) + +This software is governed by the CeCILL license under French law and +abiding by the rules of distribution of free software. You can use, +modify and/ or redistribute the software under the terms of the CeCILL +license as circulated by CEA, CNRS and INRIA at the following URL +"http://www.cecill.info". + +As a counterpart to the access to the source code and rights to copy, +modify and redistribute granted by the license, users are provided only +with a limited warranty and the software's author, the holder of the +economic rights, and the successive licensors have only limited +liability. + +In this respect, the user's attention is drawn to the risks associated +with loading, using, modifying and/or developing or reproducing the +software by the user in light of its specific status of free software, +that may mean that it is complicated to manipulate, and that also +therefore means that it is reserved for developers and experienced +professionals having in-depth computer knowledge. Users are therefore +encouraged to load and test the software's suitability as regards their +requirements in conditions enabling the security of their systems and/or +data to be ensured and, more generally, to use and operate it in the +same conditions as regards security. + +The fact that you are presently reading this means that you have had +knowledge of the CeCILL license and that you accept its terms. ++*/ #include "config.hpp" #include #include diff --git a/src/fortran.hpp b/src/fortran.hpp index 651d0fd..bb98cc3 100644 --- a/src/fortran.hpp +++ b/src/fortran.hpp @@ -1,3 +1,37 @@ +/*+ +This is CosmoTool (./src/fortran.hpp) -- Copyright (C) Guilhem Lavaux (2007-2013) + +guilhem.lavaux@gmail.com + +This software is a computer program whose purpose is to provide a toolbox for cosmological +data analysis (e.g. filters, generalized Fourier transforms, power spectra, ...) + +This software is governed by the CeCILL license under French law and +abiding by the rules of distribution of free software. You can use, +modify and/ or redistribute the software under the terms of the CeCILL +license as circulated by CEA, CNRS and INRIA at the following URL +"http://www.cecill.info". + +As a counterpart to the access to the source code and rights to copy, +modify and redistribute granted by the license, users are provided only +with a limited warranty and the software's author, the holder of the +economic rights, and the successive licensors have only limited +liability. + +In this respect, the user's attention is drawn to the risks associated +with loading, using, modifying and/or developing or reproducing the +software by the user in light of its specific status of free software, +that may mean that it is complicated to manipulate, and that also +therefore means that it is reserved for developers and experienced +professionals having in-depth computer knowledge. Users are therefore +encouraged to load and test the software's suitability as regards their +requirements in conditions enabling the security of their systems and/or +data to be ensured and, more generally, to use and operate it in the +same conditions as regards security. + +The fact that you are presently reading this means that you have had +knowledge of the CeCILL license and that you accept its terms. ++*/ #ifndef __COSMO_FORTRAN_HPP #define __COSMO_FORTRAN_HPP diff --git a/src/fourier/base_types.hpp b/src/fourier/base_types.hpp index 936bc83..5f805ec 100644 --- a/src/fourier/base_types.hpp +++ b/src/fourier/base_types.hpp @@ -1,3 +1,37 @@ +/*+ +This is CosmoTool (./src/fourier/base_types.hpp) -- Copyright (C) Guilhem Lavaux (2007-2013) + +guilhem.lavaux@gmail.com + +This software is a computer program whose purpose is to provide a toolbox for cosmological +data analysis (e.g. filters, generalized Fourier transforms, power spectra, ...) + +This software is governed by the CeCILL license under French law and +abiding by the rules of distribution of free software. You can use, +modify and/ or redistribute the software under the terms of the CeCILL +license as circulated by CEA, CNRS and INRIA at the following URL +"http://www.cecill.info". + +As a counterpart to the access to the source code and rights to copy, +modify and redistribute granted by the license, users are provided only +with a limited warranty and the software's author, the holder of the +economic rights, and the successive licensors have only limited +liability. + +In this respect, the user's attention is drawn to the risks associated +with loading, using, modifying and/or developing or reproducing the +software by the user in light of its specific status of free software, +that may mean that it is complicated to manipulate, and that also +therefore means that it is reserved for developers and experienced +professionals having in-depth computer knowledge. Users are therefore +encouraged to load and test the software's suitability as regards their +requirements in conditions enabling the security of their systems and/or +data to be ensured and, more generally, to use and operate it in the +same conditions as regards security. + +The fact that you are presently reading this means that you have had +knowledge of the CeCILL license and that you accept its terms. ++*/ #ifndef __BASE_FOURIER_TYPES_HPP #define __BASE_FOURIER_TYPES_HPP diff --git a/src/fourier/details/euclidian_maps.hpp b/src/fourier/details/euclidian_maps.hpp index a7c51b5..8e78c80 100644 --- a/src/fourier/details/euclidian_maps.hpp +++ b/src/fourier/details/euclidian_maps.hpp @@ -1,3 +1,37 @@ +/*+ +This is CosmoTool (./src/fourier/details/euclidian_maps.hpp) -- Copyright (C) Guilhem Lavaux (2007-2013) + +guilhem.lavaux@gmail.com + +This software is a computer program whose purpose is to provide a toolbox for cosmological +data analysis (e.g. filters, generalized Fourier transforms, power spectra, ...) + +This software is governed by the CeCILL license under French law and +abiding by the rules of distribution of free software. You can use, +modify and/ or redistribute the software under the terms of the CeCILL +license as circulated by CEA, CNRS and INRIA at the following URL +"http://www.cecill.info". + +As a counterpart to the access to the source code and rights to copy, +modify and redistribute granted by the license, users are provided only +with a limited warranty and the software's author, the holder of the +economic rights, and the successive licensors have only limited +liability. + +In this respect, the user's attention is drawn to the risks associated +with loading, using, modifying and/or developing or reproducing the +software by the user in light of its specific status of free software, +that may mean that it is complicated to manipulate, and that also +therefore means that it is reserved for developers and experienced +professionals having in-depth computer knowledge. Users are therefore +encouraged to load and test the software's suitability as regards their +requirements in conditions enabling the security of their systems and/or +data to be ensured and, more generally, to use and operate it in the +same conditions as regards security. + +The fact that you are presently reading this means that you have had +knowledge of the CeCILL license and that you accept its terms. ++*/ #ifndef __DETAILS_EUCLIDIAN_MAPS #define __DETAILS_EUCLIDIAN_MAPS diff --git a/src/fourier/details/euclidian_spectrum_1d.hpp b/src/fourier/details/euclidian_spectrum_1d.hpp index 6e2c21e..8bc19b9 100644 --- a/src/fourier/details/euclidian_spectrum_1d.hpp +++ b/src/fourier/details/euclidian_spectrum_1d.hpp @@ -1,3 +1,37 @@ +/*+ +This is CosmoTool (./src/fourier/details/euclidian_spectrum_1d.hpp) -- Copyright (C) Guilhem Lavaux (2007-2013) + +guilhem.lavaux@gmail.com + +This software is a computer program whose purpose is to provide a toolbox for cosmological +data analysis (e.g. filters, generalized Fourier transforms, power spectra, ...) + +This software is governed by the CeCILL license under French law and +abiding by the rules of distribution of free software. You can use, +modify and/ or redistribute the software under the terms of the CeCILL +license as circulated by CEA, CNRS and INRIA at the following URL +"http://www.cecill.info". + +As a counterpart to the access to the source code and rights to copy, +modify and redistribute granted by the license, users are provided only +with a limited warranty and the software's author, the holder of the +economic rights, and the successive licensors have only limited +liability. + +In this respect, the user's attention is drawn to the risks associated +with loading, using, modifying and/or developing or reproducing the +software by the user in light of its specific status of free software, +that may mean that it is complicated to manipulate, and that also +therefore means that it is reserved for developers and experienced +professionals having in-depth computer knowledge. Users are therefore +encouraged to load and test the software's suitability as regards their +requirements in conditions enabling the security of their systems and/or +data to be ensured and, more generally, to use and operate it in the +same conditions as regards security. + +The fact that you are presently reading this means that you have had +knowledge of the CeCILL license and that you accept its terms. ++*/ #ifndef __DETAILS_EUCLIDIAN_SPECTRUM_1D #define __DETAILS_EUCLIDIAN_SPECTRUM_1D diff --git a/src/fourier/details/euclidian_spectrum_1d_bin.hpp b/src/fourier/details/euclidian_spectrum_1d_bin.hpp index ff1c98d..1200f83 100644 --- a/src/fourier/details/euclidian_spectrum_1d_bin.hpp +++ b/src/fourier/details/euclidian_spectrum_1d_bin.hpp @@ -1,3 +1,37 @@ +/*+ +This is CosmoTool (./src/fourier/details/euclidian_spectrum_1d_bin.hpp) -- Copyright (C) Guilhem Lavaux (2007-2013) + +guilhem.lavaux@gmail.com + +This software is a computer program whose purpose is to provide a toolbox for cosmological +data analysis (e.g. filters, generalized Fourier transforms, power spectra, ...) + +This software is governed by the CeCILL license under French law and +abiding by the rules of distribution of free software. You can use, +modify and/ or redistribute the software under the terms of the CeCILL +license as circulated by CEA, CNRS and INRIA at the following URL +"http://www.cecill.info". + +As a counterpart to the access to the source code and rights to copy, +modify and redistribute granted by the license, users are provided only +with a limited warranty and the software's author, the holder of the +economic rights, and the successive licensors have only limited +liability. + +In this respect, the user's attention is drawn to the risks associated +with loading, using, modifying and/or developing or reproducing the +software by the user in light of its specific status of free software, +that may mean that it is complicated to manipulate, and that also +therefore means that it is reserved for developers and experienced +professionals having in-depth computer knowledge. Users are therefore +encouraged to load and test the software's suitability as regards their +requirements in conditions enabling the security of their systems and/or +data to be ensured and, more generally, to use and operate it in the +same conditions as regards security. + +The fact that you are presently reading this means that you have had +knowledge of the CeCILL license and that you accept its terms. ++*/ #ifndef __DETAILS_EUCLIDIAN_SPECTRUM_1D_BIN #define __DETAILS_EUCLIDIAN_SPECTRUM_1D_BIN diff --git a/src/fourier/details/euclidian_transform.hpp b/src/fourier/details/euclidian_transform.hpp index 8faba32..79bf75b 100644 --- a/src/fourier/details/euclidian_transform.hpp +++ b/src/fourier/details/euclidian_transform.hpp @@ -1,3 +1,37 @@ +/*+ +This is CosmoTool (./src/fourier/details/euclidian_transform.hpp) -- Copyright (C) Guilhem Lavaux (2007-2013) + +guilhem.lavaux@gmail.com + +This software is a computer program whose purpose is to provide a toolbox for cosmological +data analysis (e.g. filters, generalized Fourier transforms, power spectra, ...) + +This software is governed by the CeCILL license under French law and +abiding by the rules of distribution of free software. You can use, +modify and/ or redistribute the software under the terms of the CeCILL +license as circulated by CEA, CNRS and INRIA at the following URL +"http://www.cecill.info". + +As a counterpart to the access to the source code and rights to copy, +modify and redistribute granted by the license, users are provided only +with a limited warranty and the software's author, the holder of the +economic rights, and the successive licensors have only limited +liability. + +In this respect, the user's attention is drawn to the risks associated +with loading, using, modifying and/or developing or reproducing the +software by the user in light of its specific status of free software, +that may mean that it is complicated to manipulate, and that also +therefore means that it is reserved for developers and experienced +professionals having in-depth computer knowledge. Users are therefore +encouraged to load and test the software's suitability as regards their +requirements in conditions enabling the security of their systems and/or +data to be ensured and, more generally, to use and operate it in the +same conditions as regards security. + +The fact that you are presently reading this means that you have had +knowledge of the CeCILL license and that you accept its terms. ++*/ #ifndef __DETAILS_EUCLIDIAN_TRANSFORM #define __DETAILS_EUCLIDIAN_TRANSFORM diff --git a/src/fourier/details/healpix_alms.hpp b/src/fourier/details/healpix_alms.hpp index 849781f..5aa31ce 100644 --- a/src/fourier/details/healpix_alms.hpp +++ b/src/fourier/details/healpix_alms.hpp @@ -1,3 +1,37 @@ +/*+ +This is CosmoTool (./src/fourier/details/healpix_alms.hpp) -- Copyright (C) Guilhem Lavaux (2007-2013) + +guilhem.lavaux@gmail.com + +This software is a computer program whose purpose is to provide a toolbox for cosmological +data analysis (e.g. filters, generalized Fourier transforms, power spectra, ...) + +This software is governed by the CeCILL license under French law and +abiding by the rules of distribution of free software. You can use, +modify and/ or redistribute the software under the terms of the CeCILL +license as circulated by CEA, CNRS and INRIA at the following URL +"http://www.cecill.info". + +As a counterpart to the access to the source code and rights to copy, +modify and redistribute granted by the license, users are provided only +with a limited warranty and the software's author, the holder of the +economic rights, and the successive licensors have only limited +liability. + +In this respect, the user's attention is drawn to the risks associated +with loading, using, modifying and/or developing or reproducing the +software by the user in light of its specific status of free software, +that may mean that it is complicated to manipulate, and that also +therefore means that it is reserved for developers and experienced +professionals having in-depth computer knowledge. Users are therefore +encouraged to load and test the software's suitability as regards their +requirements in conditions enabling the security of their systems and/or +data to be ensured and, more generally, to use and operate it in the +same conditions as regards security. + +The fact that you are presently reading this means that you have had +knowledge of the CeCILL license and that you accept its terms. ++*/ #ifndef __COSMOTOOL_FOURIER_HEALPIX_DETAILS_ALM_HPP #define __COSMOTOOL_FOURIER_HEALPIX_DETAILS_ALM_HPP diff --git a/src/fourier/details/healpix_map.hpp b/src/fourier/details/healpix_map.hpp index 6b96974..7e2479a 100644 --- a/src/fourier/details/healpix_map.hpp +++ b/src/fourier/details/healpix_map.hpp @@ -1,3 +1,37 @@ +/*+ +This is CosmoTool (./src/fourier/details/healpix_map.hpp) -- Copyright (C) Guilhem Lavaux (2007-2013) + +guilhem.lavaux@gmail.com + +This software is a computer program whose purpose is to provide a toolbox for cosmological +data analysis (e.g. filters, generalized Fourier transforms, power spectra, ...) + +This software is governed by the CeCILL license under French law and +abiding by the rules of distribution of free software. You can use, +modify and/ or redistribute the software under the terms of the CeCILL +license as circulated by CEA, CNRS and INRIA at the following URL +"http://www.cecill.info". + +As a counterpart to the access to the source code and rights to copy, +modify and redistribute granted by the license, users are provided only +with a limited warranty and the software's author, the holder of the +economic rights, and the successive licensors have only limited +liability. + +In this respect, the user's attention is drawn to the risks associated +with loading, using, modifying and/or developing or reproducing the +software by the user in light of its specific status of free software, +that may mean that it is complicated to manipulate, and that also +therefore means that it is reserved for developers and experienced +professionals having in-depth computer knowledge. Users are therefore +encouraged to load and test the software's suitability as regards their +requirements in conditions enabling the security of their systems and/or +data to be ensured and, more generally, to use and operate it in the +same conditions as regards security. + +The fact that you are presently reading this means that you have had +knowledge of the CeCILL license and that you accept its terms. ++*/ #ifndef __COSMOTOOL_FOURIER_HEALPIX_DETAILS_MAP_HPP #define __COSMOTOOL_FOURIER_HEALPIX_DETAILS_MAP_HPP diff --git a/src/fourier/details/healpix_spectrum.hpp b/src/fourier/details/healpix_spectrum.hpp index cfeebc9..0ddd58b 100644 --- a/src/fourier/details/healpix_spectrum.hpp +++ b/src/fourier/details/healpix_spectrum.hpp @@ -1,3 +1,37 @@ +/*+ +This is CosmoTool (./src/fourier/details/healpix_spectrum.hpp) -- Copyright (C) Guilhem Lavaux (2007-2013) + +guilhem.lavaux@gmail.com + +This software is a computer program whose purpose is to provide a toolbox for cosmological +data analysis (e.g. filters, generalized Fourier transforms, power spectra, ...) + +This software is governed by the CeCILL license under French law and +abiding by the rules of distribution of free software. You can use, +modify and/ or redistribute the software under the terms of the CeCILL +license as circulated by CEA, CNRS and INRIA at the following URL +"http://www.cecill.info". + +As a counterpart to the access to the source code and rights to copy, +modify and redistribute granted by the license, users are provided only +with a limited warranty and the software's author, the holder of the +economic rights, and the successive licensors have only limited +liability. + +In this respect, the user's attention is drawn to the risks associated +with loading, using, modifying and/or developing or reproducing the +software by the user in light of its specific status of free software, +that may mean that it is complicated to manipulate, and that also +therefore means that it is reserved for developers and experienced +professionals having in-depth computer knowledge. Users are therefore +encouraged to load and test the software's suitability as regards their +requirements in conditions enabling the security of their systems and/or +data to be ensured and, more generally, to use and operate it in the +same conditions as regards security. + +The fact that you are presently reading this means that you have had +knowledge of the CeCILL license and that you accept its terms. ++*/ #ifndef __COSMOTOOL_FOURIER_HEALPIX_DETAILS_SPECTRUM_HPP #define __COSMOTOOL_FOURIER_HEALPIX_DETAILS_SPECTRUM_HPP diff --git a/src/fourier/details/healpix_transform.hpp b/src/fourier/details/healpix_transform.hpp index bc542e7..564caff 100644 --- a/src/fourier/details/healpix_transform.hpp +++ b/src/fourier/details/healpix_transform.hpp @@ -1,3 +1,37 @@ +/*+ +This is CosmoTool (./src/fourier/details/healpix_transform.hpp) -- Copyright (C) Guilhem Lavaux (2007-2013) + +guilhem.lavaux@gmail.com + +This software is a computer program whose purpose is to provide a toolbox for cosmological +data analysis (e.g. filters, generalized Fourier transforms, power spectra, ...) + +This software is governed by the CeCILL license under French law and +abiding by the rules of distribution of free software. You can use, +modify and/ or redistribute the software under the terms of the CeCILL +license as circulated by CEA, CNRS and INRIA at the following URL +"http://www.cecill.info". + +As a counterpart to the access to the source code and rights to copy, +modify and redistribute granted by the license, users are provided only +with a limited warranty and the software's author, the holder of the +economic rights, and the successive licensors have only limited +liability. + +In this respect, the user's attention is drawn to the risks associated +with loading, using, modifying and/or developing or reproducing the +software by the user in light of its specific status of free software, +that may mean that it is complicated to manipulate, and that also +therefore means that it is reserved for developers and experienced +professionals having in-depth computer knowledge. Users are therefore +encouraged to load and test the software's suitability as regards their +requirements in conditions enabling the security of their systems and/or +data to be ensured and, more generally, to use and operate it in the +same conditions as regards security. + +The fact that you are presently reading this means that you have had +knowledge of the CeCILL license and that you accept its terms. ++*/ #ifndef __COSMOTOOL_FOURIER_HEALPIX_DETAILS_TRANSFORM_HPP #define __COSMOTOOL_FOURIER_HEALPIX_DETAILS_TRANSFORM_HPP diff --git a/src/fourier/details/healpix_utility.hpp b/src/fourier/details/healpix_utility.hpp index d989dd8..5e9775a 100644 --- a/src/fourier/details/healpix_utility.hpp +++ b/src/fourier/details/healpix_utility.hpp @@ -1,3 +1,37 @@ +/*+ +This is CosmoTool (./src/fourier/details/healpix_utility.hpp) -- Copyright (C) Guilhem Lavaux (2007-2013) + +guilhem.lavaux@gmail.com + +This software is a computer program whose purpose is to provide a toolbox for cosmological +data analysis (e.g. filters, generalized Fourier transforms, power spectra, ...) + +This software is governed by the CeCILL license under French law and +abiding by the rules of distribution of free software. You can use, +modify and/ or redistribute the software under the terms of the CeCILL +license as circulated by CEA, CNRS and INRIA at the following URL +"http://www.cecill.info". + +As a counterpart to the access to the source code and rights to copy, +modify and redistribute granted by the license, users are provided only +with a limited warranty and the software's author, the holder of the +economic rights, and the successive licensors have only limited +liability. + +In this respect, the user's attention is drawn to the risks associated +with loading, using, modifying and/or developing or reproducing the +software by the user in light of its specific status of free software, +that may mean that it is complicated to manipulate, and that also +therefore means that it is reserved for developers and experienced +professionals having in-depth computer knowledge. Users are therefore +encouraged to load and test the software's suitability as regards their +requirements in conditions enabling the security of their systems and/or +data to be ensured and, more generally, to use and operate it in the +same conditions as regards security. + +The fact that you are presently reading this means that you have had +knowledge of the CeCILL license and that you accept its terms. ++*/ #ifndef __COSMOTOOL_FOURIER_HEALPIX_DETAILS_SPECTRUM_HP #define __COSMOTOOL_FOURIER_HEALPIX_DETAILS_SPECTRUM_HP diff --git a/src/fourier/euclidian.hpp b/src/fourier/euclidian.hpp index 45ec3dc..ccaeced 100644 --- a/src/fourier/euclidian.hpp +++ b/src/fourier/euclidian.hpp @@ -1,3 +1,37 @@ +/*+ +This is CosmoTool (./src/fourier/euclidian.hpp) -- Copyright (C) Guilhem Lavaux (2007-2013) + +guilhem.lavaux@gmail.com + +This software is a computer program whose purpose is to provide a toolbox for cosmological +data analysis (e.g. filters, generalized Fourier transforms, power spectra, ...) + +This software is governed by the CeCILL license under French law and +abiding by the rules of distribution of free software. You can use, +modify and/ or redistribute the software under the terms of the CeCILL +license as circulated by CEA, CNRS and INRIA at the following URL +"http://www.cecill.info". + +As a counterpart to the access to the source code and rights to copy, +modify and redistribute granted by the license, users are provided only +with a limited warranty and the software's author, the holder of the +economic rights, and the successive licensors have only limited +liability. + +In this respect, the user's attention is drawn to the risks associated +with loading, using, modifying and/or developing or reproducing the +software by the user in light of its specific status of free software, +that may mean that it is complicated to manipulate, and that also +therefore means that it is reserved for developers and experienced +professionals having in-depth computer knowledge. Users are therefore +encouraged to load and test the software's suitability as regards their +requirements in conditions enabling the security of their systems and/or +data to be ensured and, more generally, to use and operate it in the +same conditions as regards security. + +The fact that you are presently reading this means that you have had +knowledge of the CeCILL license and that you accept its terms. ++*/ #ifndef __COSMOTOOL_FOURIER_EUCLIDIAN_HPP #define __COSMOTOOL_FOURIER_EUCLIDIAN_HPP diff --git a/src/fourier/fft/fftw_calls.hpp b/src/fourier/fft/fftw_calls.hpp index 41e4d7c..6cb39ea 100644 --- a/src/fourier/fft/fftw_calls.hpp +++ b/src/fourier/fft/fftw_calls.hpp @@ -1,3 +1,37 @@ +/*+ +This is CosmoTool (./src/fourier/fft/fftw_calls.hpp) -- Copyright (C) Guilhem Lavaux (2007-2013) + +guilhem.lavaux@gmail.com + +This software is a computer program whose purpose is to provide a toolbox for cosmological +data analysis (e.g. filters, generalized Fourier transforms, power spectra, ...) + +This software is governed by the CeCILL license under French law and +abiding by the rules of distribution of free software. You can use, +modify and/ or redistribute the software under the terms of the CeCILL +license as circulated by CEA, CNRS and INRIA at the following URL +"http://www.cecill.info". + +As a counterpart to the access to the source code and rights to copy, +modify and redistribute granted by the license, users are provided only +with a limited warranty and the software's author, the holder of the +economic rights, and the successive licensors have only limited +liability. + +In this respect, the user's attention is drawn to the risks associated +with loading, using, modifying and/or developing or reproducing the +software by the user in light of its specific status of free software, +that may mean that it is complicated to manipulate, and that also +therefore means that it is reserved for developers and experienced +professionals having in-depth computer knowledge. Users are therefore +encouraged to load and test the software's suitability as regards their +requirements in conditions enabling the security of their systems and/or +data to be ensured and, more generally, to use and operate it in the +same conditions as regards security. + +The fact that you are presently reading this means that you have had +knowledge of the CeCILL license and that you accept its terms. ++*/ #ifndef __FFTW_UNIFIED_CALLS_HPP #define __FFTW_UNIFIED_CALLS_HPP diff --git a/src/fourier/healpix.hpp b/src/fourier/healpix.hpp index 36f7979..975ac00 100644 --- a/src/fourier/healpix.hpp +++ b/src/fourier/healpix.hpp @@ -1,3 +1,37 @@ +/*+ +This is CosmoTool (./src/fourier/healpix.hpp) -- Copyright (C) Guilhem Lavaux (2007-2013) + +guilhem.lavaux@gmail.com + +This software is a computer program whose purpose is to provide a toolbox for cosmological +data analysis (e.g. filters, generalized Fourier transforms, power spectra, ...) + +This software is governed by the CeCILL license under French law and +abiding by the rules of distribution of free software. You can use, +modify and/ or redistribute the software under the terms of the CeCILL +license as circulated by CEA, CNRS and INRIA at the following URL +"http://www.cecill.info". + +As a counterpart to the access to the source code and rights to copy, +modify and redistribute granted by the license, users are provided only +with a limited warranty and the software's author, the holder of the +economic rights, and the successive licensors have only limited +liability. + +In this respect, the user's attention is drawn to the risks associated +with loading, using, modifying and/or developing or reproducing the +software by the user in light of its specific status of free software, +that may mean that it is complicated to manipulate, and that also +therefore means that it is reserved for developers and experienced +professionals having in-depth computer knowledge. Users are therefore +encouraged to load and test the software's suitability as regards their +requirements in conditions enabling the security of their systems and/or +data to be ensured and, more generally, to use and operate it in the +same conditions as regards security. + +The fact that you are presently reading this means that you have had +knowledge of the CeCILL license and that you accept its terms. ++*/ #ifndef __COSMOTOOL_FOURIER_HEALPIX_HPP #define __COSMOTOOL_FOURIER_HEALPIX_HPP diff --git a/src/growthFactor.cpp b/src/growthFactor.cpp index 485d876..d954000 100644 --- a/src/growthFactor.cpp +++ b/src/growthFactor.cpp @@ -1,3 +1,37 @@ +/*+ +This is CosmoTool (./src/growthFactor.cpp) -- Copyright (C) Guilhem Lavaux (2007-2013) + +guilhem.lavaux@gmail.com + +This software is a computer program whose purpose is to provide a toolbox for cosmological +data analysis (e.g. filters, generalized Fourier transforms, power spectra, ...) + +This software is governed by the CeCILL license under French law and +abiding by the rules of distribution of free software. You can use, +modify and/ or redistribute the software under the terms of the CeCILL +license as circulated by CEA, CNRS and INRIA at the following URL +"http://www.cecill.info". + +As a counterpart to the access to the source code and rights to copy, +modify and redistribute granted by the license, users are provided only +with a limited warranty and the software's author, the holder of the +economic rights, and the successive licensors have only limited +liability. + +In this respect, the user's attention is drawn to the risks associated +with loading, using, modifying and/or developing or reproducing the +software by the user in light of its specific status of free software, +that may mean that it is complicated to manipulate, and that also +therefore means that it is reserved for developers and experienced +professionals having in-depth computer knowledge. Users are therefore +encouraged to load and test the software's suitability as regards their +requirements in conditions enabling the security of their systems and/or +data to be ensured and, more generally, to use and operate it in the +same conditions as regards security. + +The fact that you are presently reading this means that you have had +knowledge of the CeCILL license and that you accept its terms. ++*/ #include #include #include "interpolate.hpp" diff --git a/src/growthFactor.hpp b/src/growthFactor.hpp index 2643fd0..01f0bd6 100644 --- a/src/growthFactor.hpp +++ b/src/growthFactor.hpp @@ -1,3 +1,37 @@ +/*+ +This is CosmoTool (./src/growthFactor.hpp) -- Copyright (C) Guilhem Lavaux (2007-2013) + +guilhem.lavaux@gmail.com + +This software is a computer program whose purpose is to provide a toolbox for cosmological +data analysis (e.g. filters, generalized Fourier transforms, power spectra, ...) + +This software is governed by the CeCILL license under French law and +abiding by the rules of distribution of free software. You can use, +modify and/ or redistribute the software under the terms of the CeCILL +license as circulated by CEA, CNRS and INRIA at the following URL +"http://www.cecill.info". + +As a counterpart to the access to the source code and rights to copy, +modify and redistribute granted by the license, users are provided only +with a limited warranty and the software's author, the holder of the +economic rights, and the successive licensors have only limited +liability. + +In this respect, the user's attention is drawn to the risks associated +with loading, using, modifying and/or developing or reproducing the +software by the user in light of its specific status of free software, +that may mean that it is complicated to manipulate, and that also +therefore means that it is reserved for developers and experienced +professionals having in-depth computer knowledge. Users are therefore +encouraged to load and test the software's suitability as regards their +requirements in conditions enabling the security of their systems and/or +data to be ensured and, more generally, to use and operate it in the +same conditions as regards security. + +The fact that you are presently reading this means that you have had +knowledge of the CeCILL license and that you accept its terms. ++*/ #ifndef COSMO_GROWTH_FACTOR_HPP #define COSMO_GROWTH_FACTOR_HPP diff --git a/src/h5_readFlash.cpp b/src/h5_readFlash.cpp index 0c78f58..f2d6806 100644 --- a/src/h5_readFlash.cpp +++ b/src/h5_readFlash.cpp @@ -1,3 +1,37 @@ +/*+ +This is CosmoTool (./src/h5_readFlash.cpp) -- Copyright (C) Guilhem Lavaux (2007-2013) + +guilhem.lavaux@gmail.com + +This software is a computer program whose purpose is to provide a toolbox for cosmological +data analysis (e.g. filters, generalized Fourier transforms, power spectra, ...) + +This software is governed by the CeCILL license under French law and +abiding by the rules of distribution of free software. You can use, +modify and/ or redistribute the software under the terms of the CeCILL +license as circulated by CEA, CNRS and INRIA at the following URL +"http://www.cecill.info". + +As a counterpart to the access to the source code and rights to copy, +modify and redistribute granted by the license, users are provided only +with a limited warranty and the software's author, the holder of the +economic rights, and the successive licensors have only limited +liability. + +In this respect, the user's attention is drawn to the risks associated +with loading, using, modifying and/or developing or reproducing the +software by the user in light of its specific status of free software, +that may mean that it is complicated to manipulate, and that also +therefore means that it is reserved for developers and experienced +professionals having in-depth computer knowledge. Users are therefore +encouraged to load and test the software's suitability as regards their +requirements in conditions enabling the security of their systems and/or +data to be ensured and, more generally, to use and operate it in the +same conditions as regards security. + +The fact that you are presently reading this means that you have had +knowledge of the CeCILL license and that you accept its terms. ++*/ /* This file contains the functions that read the data from the HDF5 file * The functions accept the PARAMESH data through arguments. */ diff --git a/src/h5_readFlash.hpp b/src/h5_readFlash.hpp index 5187232..16599bb 100644 --- a/src/h5_readFlash.hpp +++ b/src/h5_readFlash.hpp @@ -1,3 +1,37 @@ +/*+ +This is CosmoTool (./src/h5_readFlash.hpp) -- Copyright (C) Guilhem Lavaux (2007-2013) + +guilhem.lavaux@gmail.com + +This software is a computer program whose purpose is to provide a toolbox for cosmological +data analysis (e.g. filters, generalized Fourier transforms, power spectra, ...) + +This software is governed by the CeCILL license under French law and +abiding by the rules of distribution of free software. You can use, +modify and/ or redistribute the software under the terms of the CeCILL +license as circulated by CEA, CNRS and INRIA at the following URL +"http://www.cecill.info". + +As a counterpart to the access to the source code and rights to copy, +modify and redistribute granted by the license, users are provided only +with a limited warranty and the software's author, the holder of the +economic rights, and the successive licensors have only limited +liability. + +In this respect, the user's attention is drawn to the risks associated +with loading, using, modifying and/or developing or reproducing the +software by the user in light of its specific status of free software, +that may mean that it is complicated to manipulate, and that also +therefore means that it is reserved for developers and experienced +professionals having in-depth computer knowledge. Users are therefore +encouraged to load and test the software's suitability as regards their +requirements in conditions enabling the security of their systems and/or +data to be ensured and, more generally, to use and operate it in the +same conditions as regards security. + +The fact that you are presently reading this means that you have had +knowledge of the CeCILL license and that you accept its terms. ++*/ /* This file contains the functions that read the data from the HDF5 file * The functions accept the PARAMESH data through arguments. */ diff --git a/src/hdf5_flash.h b/src/hdf5_flash.h index aab54e6..2d0f29a 100644 --- a/src/hdf5_flash.h +++ b/src/hdf5_flash.h @@ -1,3 +1,37 @@ +/*+ +This is CosmoTool (./src/hdf5_flash.h) -- Copyright (C) Guilhem Lavaux (2007-2013) + +guilhem.lavaux@gmail.com + +This software is a computer program whose purpose is to provide a toolbox for cosmological +data analysis (e.g. filters, generalized Fourier transforms, power spectra, ...) + +This software is governed by the CeCILL license under French law and +abiding by the rules of distribution of free software. You can use, +modify and/ or redistribute the software under the terms of the CeCILL +license as circulated by CEA, CNRS and INRIA at the following URL +"http://www.cecill.info". + +As a counterpart to the access to the source code and rights to copy, +modify and redistribute granted by the license, users are provided only +with a limited warranty and the software's author, the holder of the +economic rights, and the successive licensors have only limited +liability. + +In this respect, the user's attention is drawn to the risks associated +with loading, using, modifying and/or developing or reproducing the +software by the user in light of its specific status of free software, +that may mean that it is complicated to manipulate, and that also +therefore means that it is reserved for developers and experienced +professionals having in-depth computer knowledge. Users are therefore +encouraged to load and test the software's suitability as regards their +requirements in conditions enabling the security of their systems and/or +data to be ensured and, more generally, to use and operate it in the +same conditions as regards security. + +The fact that you are presently reading this means that you have had +knowledge of the CeCILL license and that you accept its terms. ++*/ /* general header file for the HDF 5 IO in FLASH */ diff --git a/src/interpolate.cpp b/src/interpolate.cpp index 9a9fc70..3c175da 100644 --- a/src/interpolate.cpp +++ b/src/interpolate.cpp @@ -1,3 +1,37 @@ +/*+ +This is CosmoTool (./src/interpolate.cpp) -- Copyright (C) Guilhem Lavaux (2007-2013) + +guilhem.lavaux@gmail.com + +This software is a computer program whose purpose is to provide a toolbox for cosmological +data analysis (e.g. filters, generalized Fourier transforms, power spectra, ...) + +This software is governed by the CeCILL license under French law and +abiding by the rules of distribution of free software. You can use, +modify and/ or redistribute the software under the terms of the CeCILL +license as circulated by CEA, CNRS and INRIA at the following URL +"http://www.cecill.info". + +As a counterpart to the access to the source code and rights to copy, +modify and redistribute granted by the license, users are provided only +with a limited warranty and the software's author, the holder of the +economic rights, and the successive licensors have only limited +liability. + +In this respect, the user's attention is drawn to the risks associated +with loading, using, modifying and/or developing or reproducing the +software by the user in light of its specific status of free software, +that may mean that it is complicated to manipulate, and that also +therefore means that it is reserved for developers and experienced +professionals having in-depth computer knowledge. Users are therefore +encouraged to load and test the software's suitability as regards their +requirements in conditions enabling the security of their systems and/or +data to be ensured and, more generally, to use and operate it in the +same conditions as regards security. + +The fact that you are presently reading this means that you have had +knowledge of the CeCILL license and that you accept its terms. ++*/ #include #include #include diff --git a/src/interpolate.hpp b/src/interpolate.hpp index a0ffacc..4aa0573 100644 --- a/src/interpolate.hpp +++ b/src/interpolate.hpp @@ -1,3 +1,37 @@ +/*+ +This is CosmoTool (./src/interpolate.hpp) -- Copyright (C) Guilhem Lavaux (2007-2013) + +guilhem.lavaux@gmail.com + +This software is a computer program whose purpose is to provide a toolbox for cosmological +data analysis (e.g. filters, generalized Fourier transforms, power spectra, ...) + +This software is governed by the CeCILL license under French law and +abiding by the rules of distribution of free software. You can use, +modify and/ or redistribute the software under the terms of the CeCILL +license as circulated by CEA, CNRS and INRIA at the following URL +"http://www.cecill.info". + +As a counterpart to the access to the source code and rights to copy, +modify and redistribute granted by the license, users are provided only +with a limited warranty and the software's author, the holder of the +economic rights, and the successive licensors have only limited +liability. + +In this respect, the user's attention is drawn to the risks associated +with loading, using, modifying and/or developing or reproducing the +software by the user in light of its specific status of free software, +that may mean that it is complicated to manipulate, and that also +therefore means that it is reserved for developers and experienced +professionals having in-depth computer knowledge. Users are therefore +encouraged to load and test the software's suitability as regards their +requirements in conditions enabling the security of their systems and/or +data to be ensured and, more generally, to use and operate it in the +same conditions as regards security. + +The fact that you are presently reading this means that you have had +knowledge of the CeCILL license and that you accept its terms. ++*/ #ifndef __CTOOL_INTERPOLATE_HPP #define __CTOOL_INTERPOLATE_HPP diff --git a/src/interpolate3d.hpp b/src/interpolate3d.hpp index 8c165ff..c50a905 100644 --- a/src/interpolate3d.hpp +++ b/src/interpolate3d.hpp @@ -1,3 +1,37 @@ +/*+ +This is CosmoTool (./src/interpolate3d.hpp) -- Copyright (C) Guilhem Lavaux (2007-2013) + +guilhem.lavaux@gmail.com + +This software is a computer program whose purpose is to provide a toolbox for cosmological +data analysis (e.g. filters, generalized Fourier transforms, power spectra, ...) + +This software is governed by the CeCILL license under French law and +abiding by the rules of distribution of free software. You can use, +modify and/ or redistribute the software under the terms of the CeCILL +license as circulated by CEA, CNRS and INRIA at the following URL +"http://www.cecill.info". + +As a counterpart to the access to the source code and rights to copy, +modify and redistribute granted by the license, users are provided only +with a limited warranty and the software's author, the holder of the +economic rights, and the successive licensors have only limited +liability. + +In this respect, the user's attention is drawn to the risks associated +with loading, using, modifying and/or developing or reproducing the +software by the user in light of its specific status of free software, +that may mean that it is complicated to manipulate, and that also +therefore means that it is reserved for developers and experienced +professionals having in-depth computer knowledge. Users are therefore +encouraged to load and test the software's suitability as regards their +requirements in conditions enabling the security of their systems and/or +data to be ensured and, more generally, to use and operate it in the +same conditions as regards security. + +The fact that you are presently reading this means that you have had +knowledge of the CeCILL license and that you accept its terms. ++*/ #ifndef __COSMO_INTERPOLATE3D_HPP #define __COSMO_INTERPOLATE3D_HPP diff --git a/src/kdtree_leaf.hpp b/src/kdtree_leaf.hpp index 145fa57..f89fa80 100644 --- a/src/kdtree_leaf.hpp +++ b/src/kdtree_leaf.hpp @@ -1,3 +1,37 @@ +/*+ +This is CosmoTool (./src/kdtree_leaf.hpp) -- Copyright (C) Guilhem Lavaux (2007-2013) + +guilhem.lavaux@gmail.com + +This software is a computer program whose purpose is to provide a toolbox for cosmological +data analysis (e.g. filters, generalized Fourier transforms, power spectra, ...) + +This software is governed by the CeCILL license under French law and +abiding by the rules of distribution of free software. You can use, +modify and/ or redistribute the software under the terms of the CeCILL +license as circulated by CEA, CNRS and INRIA at the following URL +"http://www.cecill.info". + +As a counterpart to the access to the source code and rights to copy, +modify and redistribute granted by the license, users are provided only +with a limited warranty and the software's author, the holder of the +economic rights, and the successive licensors have only limited +liability. + +In this respect, the user's attention is drawn to the risks associated +with loading, using, modifying and/or developing or reproducing the +software by the user in light of its specific status of free software, +that may mean that it is complicated to manipulate, and that also +therefore means that it is reserved for developers and experienced +professionals having in-depth computer knowledge. Users are therefore +encouraged to load and test the software's suitability as regards their +requirements in conditions enabling the security of their systems and/or +data to be ensured and, more generally, to use and operate it in the +same conditions as regards security. + +The fact that you are presently reading this means that you have had +knowledge of the CeCILL license and that you accept its terms. ++*/ #ifndef __LEAF_KDTREE_HPP #define __LEAF_KDTREE_HPP diff --git a/src/kdtree_splitters.hpp b/src/kdtree_splitters.hpp index 4092cde..0dbfff7 100644 --- a/src/kdtree_splitters.hpp +++ b/src/kdtree_splitters.hpp @@ -1,3 +1,37 @@ +/*+ +This is CosmoTool (./src/kdtree_splitters.hpp) -- Copyright (C) Guilhem Lavaux (2007-2013) + +guilhem.lavaux@gmail.com + +This software is a computer program whose purpose is to provide a toolbox for cosmological +data analysis (e.g. filters, generalized Fourier transforms, power spectra, ...) + +This software is governed by the CeCILL license under French law and +abiding by the rules of distribution of free software. You can use, +modify and/ or redistribute the software under the terms of the CeCILL +license as circulated by CEA, CNRS and INRIA at the following URL +"http://www.cecill.info". + +As a counterpart to the access to the source code and rights to copy, +modify and redistribute granted by the license, users are provided only +with a limited warranty and the software's author, the holder of the +economic rights, and the successive licensors have only limited +liability. + +In this respect, the user's attention is drawn to the risks associated +with loading, using, modifying and/or developing or reproducing the +software by the user in light of its specific status of free software, +that may mean that it is complicated to manipulate, and that also +therefore means that it is reserved for developers and experienced +professionals having in-depth computer knowledge. Users are therefore +encouraged to load and test the software's suitability as regards their +requirements in conditions enabling the security of their systems and/or +data to be ensured and, more generally, to use and operate it in the +same conditions as regards security. + +The fact that you are presently reading this means that you have had +knowledge of the CeCILL license and that you accept its terms. ++*/ #ifndef __KDTREE_SPLITTERS_HPP #define __KDTREE_SPLITTERS_HPP diff --git a/src/loadFlash.cpp b/src/loadFlash.cpp index ada498d..d642151 100644 --- a/src/loadFlash.cpp +++ b/src/loadFlash.cpp @@ -1,3 +1,37 @@ +/*+ +This is CosmoTool (./src/loadFlash.cpp) -- Copyright (C) Guilhem Lavaux (2007-2013) + +guilhem.lavaux@gmail.com + +This software is a computer program whose purpose is to provide a toolbox for cosmological +data analysis (e.g. filters, generalized Fourier transforms, power spectra, ...) + +This software is governed by the CeCILL license under French law and +abiding by the rules of distribution of free software. You can use, +modify and/ or redistribute the software under the terms of the CeCILL +license as circulated by CEA, CNRS and INRIA at the following URL +"http://www.cecill.info". + +As a counterpart to the access to the source code and rights to copy, +modify and redistribute granted by the license, users are provided only +with a limited warranty and the software's author, the holder of the +economic rights, and the successive licensors have only limited +liability. + +In this respect, the user's attention is drawn to the risks associated +with loading, using, modifying and/or developing or reproducing the +software by the user in light of its specific status of free software, +that may mean that it is complicated to manipulate, and that also +therefore means that it is reserved for developers and experienced +professionals having in-depth computer knowledge. Users are therefore +encouraged to load and test the software's suitability as regards their +requirements in conditions enabling the security of their systems and/or +data to be ensured and, more generally, to use and operate it in the +same conditions as regards security. + +The fact that you are presently reading this means that you have had +knowledge of the CeCILL license and that you accept its terms. ++*/ /* Reads in FLASH v3 files in HDF5 format */ #include diff --git a/src/loadFlash.hpp b/src/loadFlash.hpp index 3d7d8af..fbc017f 100644 --- a/src/loadFlash.hpp +++ b/src/loadFlash.hpp @@ -1,3 +1,37 @@ +/*+ +This is CosmoTool (./src/loadFlash.hpp) -- Copyright (C) Guilhem Lavaux (2007-2013) + +guilhem.lavaux@gmail.com + +This software is a computer program whose purpose is to provide a toolbox for cosmological +data analysis (e.g. filters, generalized Fourier transforms, power spectra, ...) + +This software is governed by the CeCILL license under French law and +abiding by the rules of distribution of free software. You can use, +modify and/ or redistribute the software under the terms of the CeCILL +license as circulated by CEA, CNRS and INRIA at the following URL +"http://www.cecill.info". + +As a counterpart to the access to the source code and rights to copy, +modify and redistribute granted by the license, users are provided only +with a limited warranty and the software's author, the holder of the +economic rights, and the successive licensors have only limited +liability. + +In this respect, the user's attention is drawn to the risks associated +with loading, using, modifying and/or developing or reproducing the +software by the user in light of its specific status of free software, +that may mean that it is complicated to manipulate, and that also +therefore means that it is reserved for developers and experienced +professionals having in-depth computer knowledge. Users are therefore +encouraged to load and test the software's suitability as regards their +requirements in conditions enabling the security of their systems and/or +data to be ensured and, more generally, to use and operate it in the +same conditions as regards security. + +The fact that you are presently reading this means that you have had +knowledge of the CeCILL license and that you accept its terms. ++*/ #ifndef __COSMO_LOAD_FLASH_HPP #define __COSMO_LOAD_FLASH_HPP diff --git a/src/loadFlash_dummy.cpp b/src/loadFlash_dummy.cpp index 2df6604..f8a2a62 100644 --- a/src/loadFlash_dummy.cpp +++ b/src/loadFlash_dummy.cpp @@ -1,3 +1,37 @@ +/*+ +This is CosmoTool (./src/loadFlash_dummy.cpp) -- Copyright (C) Guilhem Lavaux (2007-2013) + +guilhem.lavaux@gmail.com + +This software is a computer program whose purpose is to provide a toolbox for cosmological +data analysis (e.g. filters, generalized Fourier transforms, power spectra, ...) + +This software is governed by the CeCILL license under French law and +abiding by the rules of distribution of free software. You can use, +modify and/ or redistribute the software under the terms of the CeCILL +license as circulated by CEA, CNRS and INRIA at the following URL +"http://www.cecill.info". + +As a counterpart to the access to the source code and rights to copy, +modify and redistribute granted by the license, users are provided only +with a limited warranty and the software's author, the holder of the +economic rights, and the successive licensors have only limited +liability. + +In this respect, the user's attention is drawn to the risks associated +with loading, using, modifying and/or developing or reproducing the +software by the user in light of its specific status of free software, +that may mean that it is complicated to manipulate, and that also +therefore means that it is reserved for developers and experienced +professionals having in-depth computer knowledge. Users are therefore +encouraged to load and test the software's suitability as regards their +requirements in conditions enabling the security of their systems and/or +data to be ensured and, more generally, to use and operate it in the +same conditions as regards security. + +The fact that you are presently reading this means that you have had +knowledge of the CeCILL license and that you accept its terms. ++*/ #include "load_data.hpp" #include "loadFlash.hpp" diff --git a/src/loadGadget.cpp b/src/loadGadget.cpp index ee30d80..c0c3392 100644 --- a/src/loadGadget.cpp +++ b/src/loadGadget.cpp @@ -1,3 +1,37 @@ +/*+ +This is CosmoTool (./src/loadGadget.cpp) -- Copyright (C) Guilhem Lavaux (2007-2013) + +guilhem.lavaux@gmail.com + +This software is a computer program whose purpose is to provide a toolbox for cosmological +data analysis (e.g. filters, generalized Fourier transforms, power spectra, ...) + +This software is governed by the CeCILL license under French law and +abiding by the rules of distribution of free software. You can use, +modify and/ or redistribute the software under the terms of the CeCILL +license as circulated by CEA, CNRS and INRIA at the following URL +"http://www.cecill.info". + +As a counterpart to the access to the source code and rights to copy, +modify and redistribute granted by the license, users are provided only +with a limited warranty and the software's author, the holder of the +economic rights, and the successive licensors have only limited +liability. + +In this respect, the user's attention is drawn to the risks associated +with loading, using, modifying and/or developing or reproducing the +software by the user in light of its specific status of free software, +that may mean that it is complicated to manipulate, and that also +therefore means that it is reserved for developers and experienced +professionals having in-depth computer knowledge. Users are therefore +encouraged to load and test the software's suitability as regards their +requirements in conditions enabling the security of their systems and/or +data to be ensured and, more generally, to use and operate it in the +same conditions as regards security. + +The fact that you are presently reading this means that you have had +knowledge of the CeCILL license and that you accept its terms. ++*/ #include #include #include diff --git a/src/loadGadget.hpp b/src/loadGadget.hpp index be49ad4..d50816d 100644 --- a/src/loadGadget.hpp +++ b/src/loadGadget.hpp @@ -1,3 +1,37 @@ +/*+ +This is CosmoTool (./src/loadGadget.hpp) -- Copyright (C) Guilhem Lavaux (2007-2013) + +guilhem.lavaux@gmail.com + +This software is a computer program whose purpose is to provide a toolbox for cosmological +data analysis (e.g. filters, generalized Fourier transforms, power spectra, ...) + +This software is governed by the CeCILL license under French law and +abiding by the rules of distribution of free software. You can use, +modify and/ or redistribute the software under the terms of the CeCILL +license as circulated by CEA, CNRS and INRIA at the following URL +"http://www.cecill.info". + +As a counterpart to the access to the source code and rights to copy, +modify and redistribute granted by the license, users are provided only +with a limited warranty and the software's author, the holder of the +economic rights, and the successive licensors have only limited +liability. + +In this respect, the user's attention is drawn to the risks associated +with loading, using, modifying and/or developing or reproducing the +software by the user in light of its specific status of free software, +that may mean that it is complicated to manipulate, and that also +therefore means that it is reserved for developers and experienced +professionals having in-depth computer knowledge. Users are therefore +encouraged to load and test the software's suitability as regards their +requirements in conditions enabling the security of their systems and/or +data to be ensured and, more generally, to use and operate it in the +same conditions as regards security. + +The fact that you are presently reading this means that you have had +knowledge of the CeCILL license and that you accept its terms. ++*/ #ifndef __COSMO_LOAD_GADGET_HPP #define __COSMO_LOAD_GADGET_HPP diff --git a/src/loadRamses.cpp b/src/loadRamses.cpp index 5cd2e1e..530e8f4 100644 --- a/src/loadRamses.cpp +++ b/src/loadRamses.cpp @@ -1,3 +1,37 @@ +/*+ +This is CosmoTool (./src/loadRamses.cpp) -- Copyright (C) Guilhem Lavaux (2007-2013) + +guilhem.lavaux@gmail.com + +This software is a computer program whose purpose is to provide a toolbox for cosmological +data analysis (e.g. filters, generalized Fourier transforms, power spectra, ...) + +This software is governed by the CeCILL license under French law and +abiding by the rules of distribution of free software. You can use, +modify and/ or redistribute the software under the terms of the CeCILL +license as circulated by CEA, CNRS and INRIA at the following URL +"http://www.cecill.info". + +As a counterpart to the access to the source code and rights to copy, +modify and redistribute granted by the license, users are provided only +with a limited warranty and the software's author, the holder of the +economic rights, and the successive licensors have only limited +liability. + +In this respect, the user's attention is drawn to the risks associated +with loading, using, modifying and/or developing or reproducing the +software by the user in light of its specific status of free software, +that may mean that it is complicated to manipulate, and that also +therefore means that it is reserved for developers and experienced +professionals having in-depth computer knowledge. Users are therefore +encouraged to load and test the software's suitability as regards their +requirements in conditions enabling the security of their systems and/or +data to be ensured and, more generally, to use and operate it in the +same conditions as regards security. + +The fact that you are presently reading this means that you have had +knowledge of the CeCILL license and that you accept its terms. ++*/ #include #include #include diff --git a/src/loadRamses.hpp b/src/loadRamses.hpp index 15e6275..33f082d 100644 --- a/src/loadRamses.hpp +++ b/src/loadRamses.hpp @@ -1,3 +1,37 @@ +/*+ +This is CosmoTool (./src/loadRamses.hpp) -- Copyright (C) Guilhem Lavaux (2007-2013) + +guilhem.lavaux@gmail.com + +This software is a computer program whose purpose is to provide a toolbox for cosmological +data analysis (e.g. filters, generalized Fourier transforms, power spectra, ...) + +This software is governed by the CeCILL license under French law and +abiding by the rules of distribution of free software. You can use, +modify and/ or redistribute the software under the terms of the CeCILL +license as circulated by CEA, CNRS and INRIA at the following URL +"http://www.cecill.info". + +As a counterpart to the access to the source code and rights to copy, +modify and redistribute granted by the license, users are provided only +with a limited warranty and the software's author, the holder of the +economic rights, and the successive licensors have only limited +liability. + +In this respect, the user's attention is drawn to the risks associated +with loading, using, modifying and/or developing or reproducing the +software by the user in light of its specific status of free software, +that may mean that it is complicated to manipulate, and that also +therefore means that it is reserved for developers and experienced +professionals having in-depth computer knowledge. Users are therefore +encouraged to load and test the software's suitability as regards their +requirements in conditions enabling the security of their systems and/or +data to be ensured and, more generally, to use and operate it in the +same conditions as regards security. + +The fact that you are presently reading this means that you have had +knowledge of the CeCILL license and that you accept its terms. ++*/ #ifndef _LOAD_RAMSES_HPP #define _LOAD_RAMSES_HPP diff --git a/src/loadSimu.hpp b/src/loadSimu.hpp index 7a72259..c08f4cd 100644 --- a/src/loadSimu.hpp +++ b/src/loadSimu.hpp @@ -1,3 +1,37 @@ +/*+ +This is CosmoTool (./src/loadSimu.hpp) -- Copyright (C) Guilhem Lavaux (2007-2013) + +guilhem.lavaux@gmail.com + +This software is a computer program whose purpose is to provide a toolbox for cosmological +data analysis (e.g. filters, generalized Fourier transforms, power spectra, ...) + +This software is governed by the CeCILL license under French law and +abiding by the rules of distribution of free software. You can use, +modify and/ or redistribute the software under the terms of the CeCILL +license as circulated by CEA, CNRS and INRIA at the following URL +"http://www.cecill.info". + +As a counterpart to the access to the source code and rights to copy, +modify and redistribute granted by the license, users are provided only +with a limited warranty and the software's author, the holder of the +economic rights, and the successive licensors have only limited +liability. + +In this respect, the user's attention is drawn to the risks associated +with loading, using, modifying and/or developing or reproducing the +software by the user in light of its specific status of free software, +that may mean that it is complicated to manipulate, and that also +therefore means that it is reserved for developers and experienced +professionals having in-depth computer knowledge. Users are therefore +encouraged to load and test the software's suitability as regards their +requirements in conditions enabling the security of their systems and/or +data to be ensured and, more generally, to use and operate it in the +same conditions as regards security. + +The fact that you are presently reading this means that you have had +knowledge of the CeCILL license and that you accept its terms. ++*/ #ifndef __COSMOTOOLBOX_HPP #define __COSMOTOOLBOX_HPP diff --git a/src/load_data.cpp b/src/load_data.cpp index 28c7dc6..b5c0b22 100644 --- a/src/load_data.cpp +++ b/src/load_data.cpp @@ -1,3 +1,37 @@ +/*+ +This is CosmoTool (./src/load_data.cpp) -- Copyright (C) Guilhem Lavaux (2007-2013) + +guilhem.lavaux@gmail.com + +This software is a computer program whose purpose is to provide a toolbox for cosmological +data analysis (e.g. filters, generalized Fourier transforms, power spectra, ...) + +This software is governed by the CeCILL license under French law and +abiding by the rules of distribution of free software. You can use, +modify and/ or redistribute the software under the terms of the CeCILL +license as circulated by CEA, CNRS and INRIA at the following URL +"http://www.cecill.info". + +As a counterpart to the access to the source code and rights to copy, +modify and redistribute granted by the license, users are provided only +with a limited warranty and the software's author, the holder of the +economic rights, and the successive licensors have only limited +liability. + +In this respect, the user's attention is drawn to the risks associated +with loading, using, modifying and/or developing or reproducing the +software by the user in light of its specific status of free software, +that may mean that it is complicated to manipulate, and that also +therefore means that it is reserved for developers and experienced +professionals having in-depth computer knowledge. Users are therefore +encouraged to load and test the software's suitability as regards their +requirements in conditions enabling the security of their systems and/or +data to be ensured and, more generally, to use and operate it in the +same conditions as regards security. + +The fact that you are presently reading this means that you have had +knowledge of the CeCILL license and that you accept its terms. ++*/ #include #include #include diff --git a/src/load_data.hpp b/src/load_data.hpp index c4bc611..f657e13 100644 --- a/src/load_data.hpp +++ b/src/load_data.hpp @@ -1,3 +1,37 @@ +/*+ +This is CosmoTool (./src/load_data.hpp) -- Copyright (C) Guilhem Lavaux (2007-2013) + +guilhem.lavaux@gmail.com + +This software is a computer program whose purpose is to provide a toolbox for cosmological +data analysis (e.g. filters, generalized Fourier transforms, power spectra, ...) + +This software is governed by the CeCILL license under French law and +abiding by the rules of distribution of free software. You can use, +modify and/ or redistribute the software under the terms of the CeCILL +license as circulated by CEA, CNRS and INRIA at the following URL +"http://www.cecill.info". + +As a counterpart to the access to the source code and rights to copy, +modify and redistribute granted by the license, users are provided only +with a limited warranty and the software's author, the holder of the +economic rights, and the successive licensors have only limited +liability. + +In this respect, the user's attention is drawn to the risks associated +with loading, using, modifying and/or developing or reproducing the +software by the user in light of its specific status of free software, +that may mean that it is complicated to manipulate, and that also +therefore means that it is reserved for developers and experienced +professionals having in-depth computer knowledge. Users are therefore +encouraged to load and test the software's suitability as regards their +requirements in conditions enabling the security of their systems and/or +data to be ensured and, more generally, to use and operate it in the +same conditions as regards security. + +The fact that you are presently reading this means that you have had +knowledge of the CeCILL license and that you accept its terms. ++*/ #ifndef _LOAD_GADGET_DATA_HPP #define _LOAD_GADGET_DATA_HPP diff --git a/src/mach.hpp b/src/mach.hpp index abcb22a..e383574 100644 --- a/src/mach.hpp +++ b/src/mach.hpp @@ -1,3 +1,37 @@ +/*+ +This is CosmoTool (./src/mach.hpp) -- Copyright (C) Guilhem Lavaux (2007-2013) + +guilhem.lavaux@gmail.com + +This software is a computer program whose purpose is to provide a toolbox for cosmological +data analysis (e.g. filters, generalized Fourier transforms, power spectra, ...) + +This software is governed by the CeCILL license under French law and +abiding by the rules of distribution of free software. You can use, +modify and/ or redistribute the software under the terms of the CeCILL +license as circulated by CEA, CNRS and INRIA at the following URL +"http://www.cecill.info". + +As a counterpart to the access to the source code and rights to copy, +modify and redistribute granted by the license, users are provided only +with a limited warranty and the software's author, the holder of the +economic rights, and the successive licensors have only limited +liability. + +In this respect, the user's attention is drawn to the risks associated +with loading, using, modifying and/or developing or reproducing the +software by the user in light of its specific status of free software, +that may mean that it is complicated to manipulate, and that also +therefore means that it is reserved for developers and experienced +professionals having in-depth computer knowledge. Users are therefore +encouraged to load and test the software's suitability as regards their +requirements in conditions enabling the security of their systems and/or +data to be ensured and, more generally, to use and operate it in the +same conditions as regards security. + +The fact that you are presently reading this means that you have had +knowledge of the CeCILL license and that you accept its terms. ++*/ #ifndef __COSMO_MACHINE_TEST_HPP #define __COSMO_MACHINE_TEST_HPP diff --git a/src/miniargs.cpp b/src/miniargs.cpp index 4ad71c6..400760f 100644 --- a/src/miniargs.cpp +++ b/src/miniargs.cpp @@ -1,3 +1,37 @@ +/*+ +This is CosmoTool (./src/miniargs.cpp) -- Copyright (C) Guilhem Lavaux (2007-2013) + +guilhem.lavaux@gmail.com + +This software is a computer program whose purpose is to provide a toolbox for cosmological +data analysis (e.g. filters, generalized Fourier transforms, power spectra, ...) + +This software is governed by the CeCILL license under French law and +abiding by the rules of distribution of free software. You can use, +modify and/ or redistribute the software under the terms of the CeCILL +license as circulated by CEA, CNRS and INRIA at the following URL +"http://www.cecill.info". + +As a counterpart to the access to the source code and rights to copy, +modify and redistribute granted by the license, users are provided only +with a limited warranty and the software's author, the holder of the +economic rights, and the successive licensors have only limited +liability. + +In this respect, the user's attention is drawn to the risks associated +with loading, using, modifying and/or developing or reproducing the +software by the user in light of its specific status of free software, +that may mean that it is complicated to manipulate, and that also +therefore means that it is reserved for developers and experienced +professionals having in-depth computer knowledge. Users are therefore +encouraged to load and test the software's suitability as regards their +requirements in conditions enabling the security of their systems and/or +data to be ensured and, more generally, to use and operate it in the +same conditions as regards security. + +The fact that you are presently reading this means that you have had +knowledge of the CeCILL license and that you accept its terms. ++*/ #include #include #include diff --git a/src/miniargs.hpp b/src/miniargs.hpp index b746e55..db81c67 100644 --- a/src/miniargs.hpp +++ b/src/miniargs.hpp @@ -1,3 +1,37 @@ +/*+ +This is CosmoTool (./src/miniargs.hpp) -- Copyright (C) Guilhem Lavaux (2007-2013) + +guilhem.lavaux@gmail.com + +This software is a computer program whose purpose is to provide a toolbox for cosmological +data analysis (e.g. filters, generalized Fourier transforms, power spectra, ...) + +This software is governed by the CeCILL license under French law and +abiding by the rules of distribution of free software. You can use, +modify and/ or redistribute the software under the terms of the CeCILL +license as circulated by CEA, CNRS and INRIA at the following URL +"http://www.cecill.info". + +As a counterpart to the access to the source code and rights to copy, +modify and redistribute granted by the license, users are provided only +with a limited warranty and the software's author, the holder of the +economic rights, and the successive licensors have only limited +liability. + +In this respect, the user's attention is drawn to the risks associated +with loading, using, modifying and/or developing or reproducing the +software by the user in light of its specific status of free software, +that may mean that it is complicated to manipulate, and that also +therefore means that it is reserved for developers and experienced +professionals having in-depth computer knowledge. Users are therefore +encouraged to load and test the software's suitability as regards their +requirements in conditions enabling the security of their systems and/or +data to be ensured and, more generally, to use and operate it in the +same conditions as regards security. + +The fact that you are presently reading this means that you have had +knowledge of the CeCILL license and that you accept its terms. ++*/ #ifndef _MAK_MINIARGS_HPP #define _MAK_MINIARGS_HPP diff --git a/src/mykdtree.hpp b/src/mykdtree.hpp index c2087b5..1a691c6 100644 --- a/src/mykdtree.hpp +++ b/src/mykdtree.hpp @@ -1,3 +1,37 @@ +/*+ +This is CosmoTool (./src/mykdtree.hpp) -- Copyright (C) Guilhem Lavaux (2007-2013) + +guilhem.lavaux@gmail.com + +This software is a computer program whose purpose is to provide a toolbox for cosmological +data analysis (e.g. filters, generalized Fourier transforms, power spectra, ...) + +This software is governed by the CeCILL license under French law and +abiding by the rules of distribution of free software. You can use, +modify and/ or redistribute the software under the terms of the CeCILL +license as circulated by CEA, CNRS and INRIA at the following URL +"http://www.cecill.info". + +As a counterpart to the access to the source code and rights to copy, +modify and redistribute granted by the license, users are provided only +with a limited warranty and the software's author, the holder of the +economic rights, and the successive licensors have only limited +liability. + +In this respect, the user's attention is drawn to the risks associated +with loading, using, modifying and/or developing or reproducing the +software by the user in light of its specific status of free software, +that may mean that it is complicated to manipulate, and that also +therefore means that it is reserved for developers and experienced +professionals having in-depth computer knowledge. Users are therefore +encouraged to load and test the software's suitability as regards their +requirements in conditions enabling the security of their systems and/or +data to be ensured and, more generally, to use and operate it in the +same conditions as regards security. + +The fact that you are presently reading this means that you have had +knowledge of the CeCILL license and that you accept its terms. ++*/ #ifndef __HV_KDTREE_HPP #define __HV_KDTREE_HPP diff --git a/src/newton.hpp b/src/newton.hpp index 3e861f0..7a85b1a 100644 --- a/src/newton.hpp +++ b/src/newton.hpp @@ -1,3 +1,37 @@ +/*+ +This is CosmoTool (./src/newton.hpp) -- Copyright (C) Guilhem Lavaux (2007-2013) + +guilhem.lavaux@gmail.com + +This software is a computer program whose purpose is to provide a toolbox for cosmological +data analysis (e.g. filters, generalized Fourier transforms, power spectra, ...) + +This software is governed by the CeCILL license under French law and +abiding by the rules of distribution of free software. You can use, +modify and/ or redistribute the software under the terms of the CeCILL +license as circulated by CEA, CNRS and INRIA at the following URL +"http://www.cecill.info". + +As a counterpart to the access to the source code and rights to copy, +modify and redistribute granted by the license, users are provided only +with a limited warranty and the software's author, the holder of the +economic rights, and the successive licensors have only limited +liability. + +In this respect, the user's attention is drawn to the risks associated +with loading, using, modifying and/or developing or reproducing the +software by the user in light of its specific status of free software, +that may mean that it is complicated to manipulate, and that also +therefore means that it is reserved for developers and experienced +professionals having in-depth computer knowledge. Users are therefore +encouraged to load and test the software's suitability as regards their +requirements in conditions enabling the security of their systems and/or +data to be ensured and, more generally, to use and operate it in the +same conditions as regards security. + +The fact that you are presently reading this means that you have had +knowledge of the CeCILL license and that you accept its terms. ++*/ #ifndef _COSMOTOOL_NEWTON_HPP #define _COSMOTOOL_NEWTON_HPP diff --git a/src/octTree.cpp b/src/octTree.cpp index 4ef929d..ce3a97d 100644 --- a/src/octTree.cpp +++ b/src/octTree.cpp @@ -1,3 +1,37 @@ +/*+ +This is CosmoTool (./src/octTree.cpp) -- Copyright (C) Guilhem Lavaux (2007-2013) + +guilhem.lavaux@gmail.com + +This software is a computer program whose purpose is to provide a toolbox for cosmological +data analysis (e.g. filters, generalized Fourier transforms, power spectra, ...) + +This software is governed by the CeCILL license under French law and +abiding by the rules of distribution of free software. You can use, +modify and/ or redistribute the software under the terms of the CeCILL +license as circulated by CEA, CNRS and INRIA at the following URL +"http://www.cecill.info". + +As a counterpart to the access to the source code and rights to copy, +modify and redistribute granted by the license, users are provided only +with a limited warranty and the software's author, the holder of the +economic rights, and the successive licensors have only limited +liability. + +In this respect, the user's attention is drawn to the risks associated +with loading, using, modifying and/or developing or reproducing the +software by the user in light of its specific status of free software, +that may mean that it is complicated to manipulate, and that also +therefore means that it is reserved for developers and experienced +professionals having in-depth computer knowledge. Users are therefore +encouraged to load and test the software's suitability as regards their +requirements in conditions enabling the security of their systems and/or +data to be ensured and, more generally, to use and operate it in the +same conditions as regards security. + +The fact that you are presently reading this means that you have had +knowledge of the CeCILL license and that you accept its terms. ++*/ #include #include #include diff --git a/src/octTree.hpp b/src/octTree.hpp index 447a6b0..658d87b 100644 --- a/src/octTree.hpp +++ b/src/octTree.hpp @@ -1,3 +1,37 @@ +/*+ +This is CosmoTool (./src/octTree.hpp) -- Copyright (C) Guilhem Lavaux (2007-2013) + +guilhem.lavaux@gmail.com + +This software is a computer program whose purpose is to provide a toolbox for cosmological +data analysis (e.g. filters, generalized Fourier transforms, power spectra, ...) + +This software is governed by the CeCILL license under French law and +abiding by the rules of distribution of free software. You can use, +modify and/ or redistribute the software under the terms of the CeCILL +license as circulated by CEA, CNRS and INRIA at the following URL +"http://www.cecill.info". + +As a counterpart to the access to the source code and rights to copy, +modify and redistribute granted by the license, users are provided only +with a limited warranty and the software's author, the holder of the +economic rights, and the successive licensors have only limited +liability. + +In this respect, the user's attention is drawn to the risks associated +with loading, using, modifying and/or developing or reproducing the +software by the user in light of its specific status of free software, +that may mean that it is complicated to manipulate, and that also +therefore means that it is reserved for developers and experienced +professionals having in-depth computer knowledge. Users are therefore +encouraged to load and test the software's suitability as regards their +requirements in conditions enabling the security of their systems and/or +data to be ensured and, more generally, to use and operate it in the +same conditions as regards security. + +The fact that you are presently reading this means that you have had +knowledge of the CeCILL license and that you accept its terms. ++*/ #ifndef __COSMOTOOL_AMR_HPP #define __COSMOTOOL_AMR_HPP diff --git a/src/pool.hpp b/src/pool.hpp index 5d2203b..a09669b 100644 --- a/src/pool.hpp +++ b/src/pool.hpp @@ -1,3 +1,37 @@ +/*+ +This is CosmoTool (./src/pool.hpp) -- Copyright (C) Guilhem Lavaux (2007-2013) + +guilhem.lavaux@gmail.com + +This software is a computer program whose purpose is to provide a toolbox for cosmological +data analysis (e.g. filters, generalized Fourier transforms, power spectra, ...) + +This software is governed by the CeCILL license under French law and +abiding by the rules of distribution of free software. You can use, +modify and/ or redistribute the software under the terms of the CeCILL +license as circulated by CEA, CNRS and INRIA at the following URL +"http://www.cecill.info". + +As a counterpart to the access to the source code and rights to copy, +modify and redistribute granted by the license, users are provided only +with a limited warranty and the software's author, the holder of the +economic rights, and the successive licensors have only limited +liability. + +In this respect, the user's attention is drawn to the risks associated +with loading, using, modifying and/or developing or reproducing the +software by the user in light of its specific status of free software, +that may mean that it is complicated to manipulate, and that also +therefore means that it is reserved for developers and experienced +professionals having in-depth computer knowledge. Users are therefore +encouraged to load and test the software's suitability as regards their +requirements in conditions enabling the security of their systems and/or +data to be ensured and, more generally, to use and operate it in the +same conditions as regards security. + +The fact that you are presently reading this means that you have had +knowledge of the CeCILL license and that you accept its terms. ++*/ #ifndef __COSMO_POOL_HPP #define __COSMO_POOL_HPP diff --git a/src/powerSpectrum.cpp b/src/powerSpectrum.cpp index 02549d6..0bc741a 100644 --- a/src/powerSpectrum.cpp +++ b/src/powerSpectrum.cpp @@ -1,3 +1,37 @@ +/*+ +This is CosmoTool (./src/powerSpectrum.cpp) -- Copyright (C) Guilhem Lavaux (2007-2013) + +guilhem.lavaux@gmail.com + +This software is a computer program whose purpose is to provide a toolbox for cosmological +data analysis (e.g. filters, generalized Fourier transforms, power spectra, ...) + +This software is governed by the CeCILL license under French law and +abiding by the rules of distribution of free software. You can use, +modify and/ or redistribute the software under the terms of the CeCILL +license as circulated by CEA, CNRS and INRIA at the following URL +"http://www.cecill.info". + +As a counterpart to the access to the source code and rights to copy, +modify and redistribute granted by the license, users are provided only +with a limited warranty and the software's author, the holder of the +economic rights, and the successive licensors have only limited +liability. + +In this respect, the user's attention is drawn to the risks associated +with loading, using, modifying and/or developing or reproducing the +software by the user in light of its specific status of free software, +that may mean that it is complicated to manipulate, and that also +therefore means that it is reserved for developers and experienced +professionals having in-depth computer knowledge. Users are therefore +encouraged to load and test the software's suitability as regards their +requirements in conditions enabling the security of their systems and/or +data to be ensured and, more generally, to use and operate it in the +same conditions as regards security. + +The fact that you are presently reading this means that you have had +knowledge of the CeCILL license and that you accept its terms. ++*/ #include #include #include diff --git a/src/powerSpectrum.hpp b/src/powerSpectrum.hpp index de7ce53..ea19f5f 100644 --- a/src/powerSpectrum.hpp +++ b/src/powerSpectrum.hpp @@ -1,3 +1,37 @@ +/*+ +This is CosmoTool (./src/powerSpectrum.hpp) -- Copyright (C) Guilhem Lavaux (2007-2013) + +guilhem.lavaux@gmail.com + +This software is a computer program whose purpose is to provide a toolbox for cosmological +data analysis (e.g. filters, generalized Fourier transforms, power spectra, ...) + +This software is governed by the CeCILL license under French law and +abiding by the rules of distribution of free software. You can use, +modify and/ or redistribute the software under the terms of the CeCILL +license as circulated by CEA, CNRS and INRIA at the following URL +"http://www.cecill.info". + +As a counterpart to the access to the source code and rights to copy, +modify and redistribute granted by the license, users are provided only +with a limited warranty and the software's author, the holder of the +economic rights, and the successive licensors have only limited +liability. + +In this respect, the user's attention is drawn to the risks associated +with loading, using, modifying and/or developing or reproducing the +software by the user in light of its specific status of free software, +that may mean that it is complicated to manipulate, and that also +therefore means that it is reserved for developers and experienced +professionals having in-depth computer knowledge. Users are therefore +encouraged to load and test the software's suitability as regards their +requirements in conditions enabling the security of their systems and/or +data to be ensured and, more generally, to use and operate it in the +same conditions as regards security. + +The fact that you are presently reading this means that you have had +knowledge of the CeCILL license and that you accept its terms. ++*/ #ifndef _POWERSPECTRUM_HPP #define _POWERSPECTRUM_HPP diff --git a/src/sparseGrid.hpp b/src/sparseGrid.hpp index bbe3abf..b529a6d 100644 --- a/src/sparseGrid.hpp +++ b/src/sparseGrid.hpp @@ -1,3 +1,37 @@ +/*+ +This is CosmoTool (./src/sparseGrid.hpp) -- Copyright (C) Guilhem Lavaux (2007-2013) + +guilhem.lavaux@gmail.com + +This software is a computer program whose purpose is to provide a toolbox for cosmological +data analysis (e.g. filters, generalized Fourier transforms, power spectra, ...) + +This software is governed by the CeCILL license under French law and +abiding by the rules of distribution of free software. You can use, +modify and/ or redistribute the software under the terms of the CeCILL +license as circulated by CEA, CNRS and INRIA at the following URL +"http://www.cecill.info". + +As a counterpart to the access to the source code and rights to copy, +modify and redistribute granted by the license, users are provided only +with a limited warranty and the software's author, the holder of the +economic rights, and the successive licensors have only limited +liability. + +In this respect, the user's attention is drawn to the risks associated +with loading, using, modifying and/or developing or reproducing the +software by the user in light of its specific status of free software, +that may mean that it is complicated to manipulate, and that also +therefore means that it is reserved for developers and experienced +professionals having in-depth computer knowledge. Users are therefore +encouraged to load and test the software's suitability as regards their +requirements in conditions enabling the security of their systems and/or +data to be ensured and, more generally, to use and operate it in the +same conditions as regards security. + +The fact that you are presently reading this means that you have had +knowledge of the CeCILL license and that you accept its terms. ++*/ #ifndef __VOID_SPARSE_GRID_HPP #define __VOID_SPARSE_GRID_HPP diff --git a/src/sphSmooth.hpp b/src/sphSmooth.hpp index 7d14b8a..0e6cf55 100644 --- a/src/sphSmooth.hpp +++ b/src/sphSmooth.hpp @@ -1,3 +1,37 @@ +/*+ +This is CosmoTool (./src/sphSmooth.hpp) -- Copyright (C) Guilhem Lavaux (2007-2013) + +guilhem.lavaux@gmail.com + +This software is a computer program whose purpose is to provide a toolbox for cosmological +data analysis (e.g. filters, generalized Fourier transforms, power spectra, ...) + +This software is governed by the CeCILL license under French law and +abiding by the rules of distribution of free software. You can use, +modify and/ or redistribute the software under the terms of the CeCILL +license as circulated by CEA, CNRS and INRIA at the following URL +"http://www.cecill.info". + +As a counterpart to the access to the source code and rights to copy, +modify and redistribute granted by the license, users are provided only +with a limited warranty and the software's author, the holder of the +economic rights, and the successive licensors have only limited +liability. + +In this respect, the user's attention is drawn to the risks associated +with loading, using, modifying and/or developing or reproducing the +software by the user in light of its specific status of free software, +that may mean that it is complicated to manipulate, and that also +therefore means that it is reserved for developers and experienced +professionals having in-depth computer knowledge. Users are therefore +encouraged to load and test the software's suitability as regards their +requirements in conditions enabling the security of their systems and/or +data to be ensured and, more generally, to use and operate it in the +same conditions as regards security. + +The fact that you are presently reading this means that you have had +knowledge of the CeCILL license and that you accept its terms. ++*/ #ifndef __COSMOTOOL_SPH_SMOOTH_HPP #define __COSMOTOOL_SPH_SMOOTH_HPP diff --git a/src/yorick.hpp b/src/yorick.hpp index 25734f7..802d1cc 100644 --- a/src/yorick.hpp +++ b/src/yorick.hpp @@ -1,3 +1,37 @@ +/*+ +This is CosmoTool (./src/yorick.hpp) -- Copyright (C) Guilhem Lavaux (2007-2013) + +guilhem.lavaux@gmail.com + +This software is a computer program whose purpose is to provide a toolbox for cosmological +data analysis (e.g. filters, generalized Fourier transforms, power spectra, ...) + +This software is governed by the CeCILL license under French law and +abiding by the rules of distribution of free software. You can use, +modify and/ or redistribute the software under the terms of the CeCILL +license as circulated by CEA, CNRS and INRIA at the following URL +"http://www.cecill.info". + +As a counterpart to the access to the source code and rights to copy, +modify and redistribute granted by the license, users are provided only +with a limited warranty and the software's author, the holder of the +economic rights, and the successive licensors have only limited +liability. + +In this respect, the user's attention is drawn to the risks associated +with loading, using, modifying and/or developing or reproducing the +software by the user in light of its specific status of free software, +that may mean that it is complicated to manipulate, and that also +therefore means that it is reserved for developers and experienced +professionals having in-depth computer knowledge. Users are therefore +encouraged to load and test the software's suitability as regards their +requirements in conditions enabling the security of their systems and/or +data to be ensured and, more generally, to use and operate it in the +same conditions as regards security. + +The fact that you are presently reading this means that you have had +knowledge of the CeCILL license and that you accept its terms. ++*/ #ifndef __YORICK_HELPERS_HPP #define __YORICK_HELPERS_HPP diff --git a/src/yorick_nc3.cpp b/src/yorick_nc3.cpp index 92d55b6..9f814b6 100644 --- a/src/yorick_nc3.cpp +++ b/src/yorick_nc3.cpp @@ -1,3 +1,37 @@ +/*+ +This is CosmoTool (./src/yorick_nc3.cpp) -- Copyright (C) Guilhem Lavaux (2007-2013) + +guilhem.lavaux@gmail.com + +This software is a computer program whose purpose is to provide a toolbox for cosmological +data analysis (e.g. filters, generalized Fourier transforms, power spectra, ...) + +This software is governed by the CeCILL license under French law and +abiding by the rules of distribution of free software. You can use, +modify and/ or redistribute the software under the terms of the CeCILL +license as circulated by CEA, CNRS and INRIA at the following URL +"http://www.cecill.info". + +As a counterpart to the access to the source code and rights to copy, +modify and redistribute granted by the license, users are provided only +with a limited warranty and the software's author, the holder of the +economic rights, and the successive licensors have only limited +liability. + +In this respect, the user's attention is drawn to the risks associated +with loading, using, modifying and/or developing or reproducing the +software by the user in light of its specific status of free software, +that may mean that it is complicated to manipulate, and that also +therefore means that it is reserved for developers and experienced +professionals having in-depth computer knowledge. Users are therefore +encouraged to load and test the software's suitability as regards their +requirements in conditions enabling the security of their systems and/or +data to be ensured and, more generally, to use and operate it in the +same conditions as regards security. + +The fact that you are presently reading this means that you have had +knowledge of the CeCILL license and that you accept its terms. ++*/ #include "ctool_netcdf_ver.hpp" #include "config.hpp" #ifdef NETCDFCPP4 diff --git a/src/yorick_nc4.cpp b/src/yorick_nc4.cpp index 8bdeda0..7765093 100644 --- a/src/yorick_nc4.cpp +++ b/src/yorick_nc4.cpp @@ -1,3 +1,37 @@ +/*+ +This is CosmoTool (./src/yorick_nc4.cpp) -- Copyright (C) Guilhem Lavaux (2007-2013) + +guilhem.lavaux@gmail.com + +This software is a computer program whose purpose is to provide a toolbox for cosmological +data analysis (e.g. filters, generalized Fourier transforms, power spectra, ...) + +This software is governed by the CeCILL license under French law and +abiding by the rules of distribution of free software. You can use, +modify and/ or redistribute the software under the terms of the CeCILL +license as circulated by CEA, CNRS and INRIA at the following URL +"http://www.cecill.info". + +As a counterpart to the access to the source code and rights to copy, +modify and redistribute granted by the license, users are provided only +with a limited warranty and the software's author, the holder of the +economic rights, and the successive licensors have only limited +liability. + +In this respect, the user's attention is drawn to the risks associated +with loading, using, modifying and/or developing or reproducing the +software by the user in light of its specific status of free software, +that may mean that it is complicated to manipulate, and that also +therefore means that it is reserved for developers and experienced +professionals having in-depth computer knowledge. Users are therefore +encouraged to load and test the software's suitability as regards their +requirements in conditions enabling the security of their systems and/or +data to be ensured and, more generally, to use and operate it in the +same conditions as regards security. + +The fact that you are presently reading this means that you have had +knowledge of the CeCILL license and that you accept its terms. ++*/ #include "ctool_netcdf_ver.hpp" #include "config.hpp" #include From 1b06786e63e91cde4d229ea86f442516a59a486b Mon Sep 17 00:00:00 2001 From: Guilhem Lavaux Date: Mon, 4 Mar 2013 22:48:13 -0500 Subject: [PATCH 38/43] Started work to support periodic boundaries in KDTree --- src/mykdtree.hpp | 2 ++ src/mykdtree.tcc | 17 +++++++++++++++-- src/replicateGenerator.hpp | 37 +++++++++++++++++++++++++++++++++++++ 3 files changed, 54 insertions(+), 2 deletions(-) create mode 100644 src/replicateGenerator.hpp diff --git a/src/mykdtree.hpp b/src/mykdtree.hpp index 1a691c6..9d2c63c 100644 --- a/src/mykdtree.hpp +++ b/src/mykdtree.hpp @@ -184,6 +184,8 @@ namespace CosmoTool { Cell **sortingHelper; Cell *base_cell; + bool periodic; + Node *buildTree(Cell **cell0, uint32_t NumCells, uint32_t depth, diff --git a/src/mykdtree.tcc b/src/mykdtree.tcc index a5e3abb..27ea18b 100644 --- a/src/mykdtree.tcc +++ b/src/mykdtree.tcc @@ -31,7 +31,8 @@ namespace CosmoTool { template KDTree::KDTree(Cell *cells, uint32_t Ncells) { - + periodic = false; + base_cell = cells; numNodes = Ncells; nodes = new Node[numNodes]; @@ -365,7 +366,19 @@ namespace CosmoTool { CoordType R2 = INFINITY; Cell *best = 0; - recursiveNearest(root, 0, x, R2, best); + recursiveNearest(root, 0, x, R2, best); + if (periodic) + { +#if 0 + ReplicateGenerator replicate(x); + + do + { + recursiveNearest(root, 0, replicate.getPosition(), R2, best); + } + while (replicate.next()); +#endif + } return best; } diff --git a/src/replicateGenerator.hpp b/src/replicateGenerator.hpp new file mode 100644 index 0000000..270640f --- /dev/null +++ b/src/replicateGenerator.hpp @@ -0,0 +1,37 @@ +#ifndef __REPLICATE_GENERATOR_HPP +#define __REPLICATE_GENERATOR_HPP + +namespace CosmoTool +{ + + template + class ReplicateGenerator + { + public: + ReplicateGenerator(const Coord x[N]) + { + face = 0; + } + + bool next() + { + if (face == (2*N)) + return false; + + face++; + + } + + Coord getPosition() + { + return x_shifted; + } + + private: + Coord x_shifted[N]; + int face; + }; + +}; + +#endif From a0bf3dc2c2d2292cef01bef6feb648601dcd5c0b Mon Sep 17 00:00:00 2001 From: Guilhem Lavaux Date: Tue, 5 Mar 2013 11:08:19 -0500 Subject: [PATCH 39/43] Activated support for periodic box search --- src/mykdtree.hpp | 14 ++++++-- src/mykdtree.tcc | 73 ++++++++++++++++++++++++++++++++++---- src/replicateGenerator.hpp | 39 ++++++++++++++++---- 3 files changed, 110 insertions(+), 16 deletions(-) diff --git a/src/mykdtree.hpp b/src/mykdtree.hpp index 9d2c63c..dd912e1 100644 --- a/src/mykdtree.hpp +++ b/src/mykdtree.hpp @@ -99,15 +99,16 @@ namespace CosmoTool { class RecursionMultipleInfo { public: - const typename KDDef::KDCoordinates& x; + typename KDDef::KDCoordinates x; BoundedQueue< KDCell *, typename KDDef::CoordType> queue; int traversed; RecursionMultipleInfo(const typename KDDef::KDCoordinates& rx, KDCell **cells, uint32_t numCells) - : x(rx), queue(cells, numCells, INFINITY),traversed(0) - { + : queue(cells, numCells, INFINITY),traversed(0) + { + std::copy(rx, rx+N, x); } }; @@ -131,6 +132,12 @@ namespace CosmoTool { KDTree(Cell *cells, uint32_t Ncells); ~KDTree(); + void setPeriodic(bool on, CoordType replicate) + { + periodic = on; + this->replicate = replicate; + } + uint32_t getIntersection(const coords& x, CoordType r, Cell **cells, uint32_t numCells) @@ -185,6 +192,7 @@ namespace CosmoTool { Cell *base_cell; bool periodic; + CoordType replicate; Node *buildTree(Cell **cell0, uint32_t NumCells, diff --git a/src/mykdtree.tcc b/src/mykdtree.tcc index 27ea18b..cd72fe4 100644 --- a/src/mykdtree.tcc +++ b/src/mykdtree.tcc @@ -1,3 +1,4 @@ +#include "replicateGenerator.hpp" #include #include #include @@ -94,6 +95,19 @@ namespace CosmoTool { info.distances = 0; recursiveIntersectionCells(info, root, 0); + if (periodic) + { + ReplicateGenerator replicate(x); + + do + { + coords x_new; + replicate.getPosition(info.x); + recursiveIntersectionCells(info, root, 0); + } + while (replicate.next()); + } + return info.currentRank; } @@ -115,6 +129,18 @@ namespace CosmoTool { info.distances = distances; recursiveIntersectionCells(info, root, 0); + if (periodic) + { + ReplicateGenerator replicate(x); + + do + { + coords x_new; + replicate.getPosition(info.x); + recursiveIntersectionCells(info, root, 0); + } + while (replicate.next()); + } return info.currentRank; } @@ -132,6 +158,19 @@ namespace CosmoTool { info.distances = 0; recursiveIntersectionCells(info, root, 0); + if (periodic) + { + ReplicateGenerator replicate(x); + + do + { + coords x_new; + replicate.getPosition(info.x); + recursiveIntersectionCells(info, root, 0); + } + while (replicate.next()); + } + return info.currentRank; } @@ -369,15 +408,15 @@ namespace CosmoTool { recursiveNearest(root, 0, x, R2, best); if (periodic) { -#if 0 - ReplicateGenerator replicate(x); + ReplicateGenerator replicate(x); do { - recursiveNearest(root, 0, replicate.getPosition(), R2, best); + coords x_new; + replicate.getPosition(x_new); + recursiveNearest(root, 0, x_new, R2, best); } while (replicate.next()); -#endif } return best; @@ -450,6 +489,18 @@ namespace CosmoTool { cells[i] = 0; recursiveMultipleNearest(info, root, 0); + if (periodic) + { + ReplicateGenerator replicate(x); + + do + { + coords x_new; + replicate.getPosition(info.x); + recursiveMultipleNearest(info, root, 0); + } + while (replicate.next()); + } // std::cout << "Traversed = " << info.traversed << std::endl; } @@ -465,9 +516,19 @@ namespace CosmoTool { cells[i] = 0; recursiveMultipleNearest(info, root, 0); - memcpy(distances, info.queue.getPriorities(), sizeof(CoordType)*N2); + if (periodic) + { + ReplicateGenerator replicate(x); - // std::cout << "Traversed = " << info.traversed << std::endl; + do + { + coords x_new; + replicate.getPosition(info.x); + recursiveMultipleNearest(info, root, 0); + } + while (replicate.next()); + } + memcpy(distances, info.queue.getPriorities(), sizeof(CoordType)*N2); } #ifdef __KD_TREE_SAVE_ON_DISK diff --git a/src/replicateGenerator.hpp b/src/replicateGenerator.hpp index 270640f..75088c2 100644 --- a/src/replicateGenerator.hpp +++ b/src/replicateGenerator.hpp @@ -1,6 +1,9 @@ #ifndef __REPLICATE_GENERATOR_HPP #define __REPLICATE_GENERATOR_HPP +#include +#include "algo.hpp" + namespace CosmoTool { @@ -8,28 +11,50 @@ namespace CosmoTool class ReplicateGenerator { public: - ReplicateGenerator(const Coord x[N]) + typedef Coord Coords[N]; + + ReplicateGenerator(const Coords& x) { - face = 0; + face = 0; + numFaces = spower(3); + std::copy(x, x+N, x_base); } bool next() { - if (face == (2*N)) + if (face == numFaces) return false; face++; - + + bool no_move = true; + int q_face = face; + for (int i = 0; i < N; i++) + { + int c_face; + c_face = q_face % 3; + q_face /= 3; + x_shifted[i] = x_base[i] + (c_face-1); + no_move = no_move && (c_face == 1); + } + if (no_move) + return next(); + return true; } - Coord getPosition() + const Coord *getPosition() { return x_shifted; } + void getPosition(Coords& x_out) + { + std::copy(x_shifted, x_shifted+N, x_out); + } + private: - Coord x_shifted[N]; - int face; + Coord x_shifted[N], x_base[N]; + long face, numFaces; }; }; From 54d23331f31276ca44924b47cf163d2579707dcd Mon Sep 17 00:00:00 2001 From: Guilhem Lavaux Date: Tue, 5 Mar 2013 11:11:20 -0500 Subject: [PATCH 40/43] Added missing replication multiplicative factor --- src/mykdtree.tcc | 36 ++++++++++++++++++------------------ src/replicateGenerator.hpp | 6 ++++-- 2 files changed, 22 insertions(+), 20 deletions(-) diff --git a/src/mykdtree.tcc b/src/mykdtree.tcc index cd72fe4..e276cad 100644 --- a/src/mykdtree.tcc +++ b/src/mykdtree.tcc @@ -97,15 +97,15 @@ namespace CosmoTool { recursiveIntersectionCells(info, root, 0); if (periodic) { - ReplicateGenerator replicate(x); + ReplicateGenerator r(x, replicate); do { coords x_new; - replicate.getPosition(info.x); + r.getPosition(info.x); recursiveIntersectionCells(info, root, 0); } - while (replicate.next()); + while (r.next()); } return info.currentRank; @@ -131,15 +131,15 @@ namespace CosmoTool { recursiveIntersectionCells(info, root, 0); if (periodic) { - ReplicateGenerator replicate(x); + ReplicateGenerator r(x, replicate); do { coords x_new; - replicate.getPosition(info.x); + r.getPosition(info.x); recursiveIntersectionCells(info, root, 0); } - while (replicate.next()); + while (r.next()); } return info.currentRank; } @@ -160,15 +160,15 @@ namespace CosmoTool { recursiveIntersectionCells(info, root, 0); if (periodic) { - ReplicateGenerator replicate(x); + ReplicateGenerator r(x, replicate); do { coords x_new; - replicate.getPosition(info.x); + r.getPosition(info.x); recursiveIntersectionCells(info, root, 0); } - while (replicate.next()); + while (r.next()); } return info.currentRank; @@ -408,15 +408,15 @@ namespace CosmoTool { recursiveNearest(root, 0, x, R2, best); if (periodic) { - ReplicateGenerator replicate(x); + ReplicateGenerator r(x, replicate); do { coords x_new; - replicate.getPosition(x_new); + r.getPosition(x_new); recursiveNearest(root, 0, x_new, R2, best); } - while (replicate.next()); + while (r.next()); } return best; @@ -491,15 +491,15 @@ namespace CosmoTool { recursiveMultipleNearest(info, root, 0); if (periodic) { - ReplicateGenerator replicate(x); + ReplicateGenerator r(x, replicate); do { coords x_new; - replicate.getPosition(info.x); + r.getPosition(info.x); recursiveMultipleNearest(info, root, 0); } - while (replicate.next()); + while (r.next()); } // std::cout << "Traversed = " << info.traversed << std::endl; @@ -518,15 +518,15 @@ namespace CosmoTool { recursiveMultipleNearest(info, root, 0); if (periodic) { - ReplicateGenerator replicate(x); + ReplicateGenerator r(x, replicate); do { coords x_new; - replicate.getPosition(info.x); + r.getPosition(info.x); recursiveMultipleNearest(info, root, 0); } - while (replicate.next()); + while (r.next()); } memcpy(distances, info.queue.getPriorities(), sizeof(CoordType)*N2); } diff --git a/src/replicateGenerator.hpp b/src/replicateGenerator.hpp index 75088c2..8f52ace 100644 --- a/src/replicateGenerator.hpp +++ b/src/replicateGenerator.hpp @@ -12,10 +12,12 @@ namespace CosmoTool { public: typedef Coord Coords[N]; + Coord replicate; - ReplicateGenerator(const Coords& x) + ReplicateGenerator(const Coords& x, Coord shift) { face = 0; + replicate = shift; numFaces = spower(3); std::copy(x, x+N, x_base); } @@ -34,7 +36,7 @@ namespace CosmoTool int c_face; c_face = q_face % 3; q_face /= 3; - x_shifted[i] = x_base[i] + (c_face-1); + x_shifted[i] = x_base[i] + (c_face-1)*replicate; no_move = no_move && (c_face == 1); } if (no_move) From 81ab45d2281a3326a02614db210878b81274c880 Mon Sep 17 00:00:00 2001 From: Guilhem Lavaux Date: Tue, 5 Mar 2013 22:32:11 -0500 Subject: [PATCH 41/43] Added new test for periodic KDTree --- sample/CMakeLists.txt | 3 + sample/testkd3.cpp | 186 +++++++++++++++++++++++++++++++++++++ src/replicateGenerator.hpp | 2 + 3 files changed, 191 insertions(+) create mode 100644 sample/testkd3.cpp diff --git a/sample/CMakeLists.txt b/sample/CMakeLists.txt index 765e1b3..d158ae2 100644 --- a/sample/CMakeLists.txt +++ b/sample/CMakeLists.txt @@ -20,6 +20,9 @@ target_link_libraries(testkd ${tolink}) add_executable(testkd2 testkd2.cpp) target_link_libraries(testkd2 ${tolink}) +add_executable(testkd3 testkd3.cpp) +target_link_libraries(testkd3 ${tolink}) + add_executable(testDelaunay testDelaunay.cpp) target_link_libraries(testDelaunay ${tolink}) diff --git a/sample/testkd3.cpp b/sample/testkd3.cpp new file mode 100644 index 0000000..5744985 --- /dev/null +++ b/sample/testkd3.cpp @@ -0,0 +1,186 @@ +/*+ +This is CosmoTool (./sample/testkd2.cpp) -- Copyright (C) Guilhem Lavaux (2007-2013) + +guilhem.lavaux@gmail.com + +This software is a computer program whose purpose is to provide a toolbox for cosmological +data analysis (e.g. filters, generalized Fourier transforms, power spectra, ...) + +This software is governed by the CeCILL license under French law and +abiding by the rules of distribution of free software. You can use, +modify and/ or redistribute the software under the terms of the CeCILL +license as circulated by CEA, CNRS and INRIA at the following URL +"http://www.cecill.info". + +As a counterpart to the access to the source code and rights to copy, +modify and redistribute granted by the license, users are provided only +with a limited warranty and the software's author, the holder of the +economic rights, and the successive licensors have only limited +liability. + +In this respect, the user's attention is drawn to the risks associated +with loading, using, modifying and/or developing or reproducing the +software by the user in light of its specific status of free software, +that may mean that it is complicated to manipulate, and that also +therefore means that it is reserved for developers and experienced +professionals having in-depth computer knowledge. Users are therefore +encouraged to load and test the software's suitability as regards their +requirements in conditions enabling the security of their systems and/or +data to be ensured and, more generally, to use and operate it in the +same conditions as regards security. + +The fact that you are presently reading this means that you have had +knowledge of the CeCILL license and that you accept its terms. ++*/ +#include +#include +#include +#include +#include +#define __KD_TREE_NUMNODES +#include "mykdtree.hpp" +#include "kdtree_splitters.hpp" +#include + +#define NTRY 30 +#define NGB 24 +#define ND 3 + +using namespace std; +using namespace CosmoTool; + +typedef KDTree > MyTree; +//typedef KDTree MyTree; +typedef KDCell MyCell; + +static double periodic(double a) +{ + while (a < -0.5) + a+=1; + while (a > 0.5) + a -= 1; + return a; +} + +MyCell *findNearest(MyTree::coords& xc, MyCell *cells, uint32_t Ncells) +{ + MyCell *near2 = 0; + double R2 = INFINITY; + for (int i = 0; i < Ncells; i++) + { + double d2 = 0; + for (int j = 0; j < ND; j++) + { + double delta = periodic(xc[j]-cells[i].coord[j]); + d2 += delta*delta; + } + if (d2 < R2) + { + near2 = &cells[i]; + R2 = d2; + } + } + return near2; +} + +int main() +{ + uint32_t Ncells = 3000000; + MyCell *cells = new MyCell[Ncells]; + + for (int i = 0; i < Ncells; i++) + { + cells[i].active = true; + for (int l = 0; l < ND; l++) + cells[i].coord[l] = drand48(); + } + + // Check timing + clock_t startTimer = clock(); + MyTree tree(cells, Ncells); + clock_t endTimer = clock(); + + tree.setPeriodic(true, 1.0); + + clock_t delta = endTimer-startTimer; + double myTime = delta*1.0/CLOCKS_PER_SEC * 1.0; + + cout << "KDTree build = " << myTime << " s" << endl; + + MyTree::coords *xc = new MyTree::coords[NTRY]; + + cout << "Generating seeds..." << endl; + for (int k = 0; k < NTRY; k++) + { + for (int l = 0; l < ND; l++) + xc[k][l] = drand48(); + } + + // Check consistency + cout << "Check consistency..." << endl; + MyCell **ngb = new MyCell *[NGB]; + double *distances = new double[NGB]; + + ofstream fngb("nearest.txt"); + for (int k = 0; k < NTRY; k++) { + cout << "Seed = " << xc[k][0] << " " << xc[k][1] << " " << xc[k][2] << endl; + tree.getNearestNeighbours(xc[k], NGB, ngb, distances); + int last = -1; + + for (uint32_t i = 0; i < NGB; i++) + { + if (ngb[i] == 0) + continue; + + last = i; + + double d2 = 0; + for (int l = 0; l < 3; l++) + d2 += ({double delta = periodic(xc[k][l] - ngb[i]->coord[l]); delta*delta;}); + fngb << ngb[i]->coord[0] << " " << ngb[i]->coord[1] << " " << ngb[i]->coord[2] << " " << sqrt(d2) << " " << sqrt(distances[i]) << endl; + } + fngb << endl << endl; + double farther_dist = distances[last]; + for (uint32_t i = 0; i < Ncells; i++) + { + bool found = false; + // If the points is not in the list, it means it is farther than the farthest point + for (int j =0; j < NGB; j++) + { + if (&cells[i] == ngb[j]) { + found = true; + break; + } + } + double dist_to_seed = 0; + for (int l = 0; l < 3; l++) + { + double delta = periodic(xc[k][l]-cells[i].coord[l]); + dist_to_seed += delta*delta; + } + double delta_epsilon = fabs(farther_dist/dist_to_seed-1); + if (!found) + { + if (dist_to_seed <= farther_dist && + delta_epsilon > 1000*sqrt(numeric_limits::epsilon())) + { + cout << "SHOULD BE IN (d=" << dist_to_seed << "): Failed iteration " << k << " particle " << i << " (farthest=" << sqrt(farther_dist) << ")" << endl; + cout << "delta_epsilon = " << delta_epsilon << endl; + abort(); + } + } + else + { + if (dist_to_seed > farther_dist && + delta_epsilon > 1000*sqrt(numeric_limits::epsilon())) + { + cout << "SHOULD BE OUT (d=" << sqrt(dist_to_seed) << "): Failed iteration " << k << " particle " << i << " (farthest=" << sqrt(farther_dist) << ")" << endl; + cout << "delta_epsilon = " << delta_epsilon << " epsilon = " << 100*sqrt(numeric_limits::epsilon()) << endl; + abort(); + } + } + } + } + + return 0; +} diff --git a/src/replicateGenerator.hpp b/src/replicateGenerator.hpp index 8f52ace..3b6d3b8 100644 --- a/src/replicateGenerator.hpp +++ b/src/replicateGenerator.hpp @@ -20,6 +20,8 @@ namespace CosmoTool replicate = shift; numFaces = spower(3); std::copy(x, x+N, x_base); + if (!next()) + abort(); } bool next() From 50d830cb97ea6d2230171774487683533acb4d9b Mon Sep 17 00:00:00 2001 From: Guilhem Lavaux Date: Tue, 5 Mar 2013 22:36:03 -0500 Subject: [PATCH 42/43] Updated correctly the authorship of the flash file reader to P. M. Sutter --- src/h5_readFlash.cpp | 32 +++----------------------------- src/h5_readFlash.hpp | 31 +++---------------------------- src/hdf5_flash.h | 33 +++------------------------------ 3 files changed, 9 insertions(+), 87 deletions(-) diff --git a/src/h5_readFlash.cpp b/src/h5_readFlash.cpp index 8e312bb..e460bdb 100644 --- a/src/h5_readFlash.cpp +++ b/src/h5_readFlash.cpp @@ -1,36 +1,10 @@ /*+ -This is CosmoTool (./src/h5_readFlash.cpp) -- Copyright (C) Guilhem Lavaux (2007-2013) +!! -guilhem.lavaux@gmail.com +This file has been developped by P. M. Sutter -This software is a computer program whose purpose is to provide a toolbox for cosmological -data analysis (e.g. filters, generalized Fourier transforms, power spectra, ...) +!! -This software is governed by the CeCILL license under French law and -abiding by the rules of distribution of free software. You can use, -modify and/ or redistribute the software under the terms of the CeCILL -license as circulated by CEA, CNRS and INRIA at the following URL -"http://www.cecill.info". - -As a counterpart to the access to the source code and rights to copy, -modify and redistribute granted by the license, users are provided only -with a limited warranty and the software's author, the holder of the -economic rights, and the successive licensors have only limited -liability. - -In this respect, the user's attention is drawn to the risks associated -with loading, using, modifying and/or developing or reproducing the -software by the user in light of its specific status of free software, -that may mean that it is complicated to manipulate, and that also -therefore means that it is reserved for developers and experienced -professionals having in-depth computer knowledge. Users are therefore -encouraged to load and test the software's suitability as regards their -requirements in conditions enabling the security of their systems and/or -data to be ensured and, more generally, to use and operate it in the -same conditions as regards security. - -The fact that you are presently reading this means that you have had -knowledge of the CeCILL license and that you accept its terms. +*/ /* This file contains the functions that read the data from the HDF5 file * The functions accept the PARAMESH data through arguments. diff --git a/src/h5_readFlash.hpp b/src/h5_readFlash.hpp index d7e6906..abcf9aa 100644 --- a/src/h5_readFlash.hpp +++ b/src/h5_readFlash.hpp @@ -1,36 +1,11 @@ /*+ -This is CosmoTool (./src/h5_readFlash.hpp) -- Copyright (C) Guilhem Lavaux (2007-2013) -guilhem.lavaux@gmail.com +!!! NOTE !!! -This software is a computer program whose purpose is to provide a toolbox for cosmological -data analysis (e.g. filters, generalized Fourier transforms, power spectra, ...) +This file has been developped by P. M. Sutter. -This software is governed by the CeCILL license under French law and -abiding by the rules of distribution of free software. You can use, -modify and/ or redistribute the software under the terms of the CeCILL -license as circulated by CEA, CNRS and INRIA at the following URL -"http://www.cecill.info". +!!!! -As a counterpart to the access to the source code and rights to copy, -modify and redistribute granted by the license, users are provided only -with a limited warranty and the software's author, the holder of the -economic rights, and the successive licensors have only limited -liability. - -In this respect, the user's attention is drawn to the risks associated -with loading, using, modifying and/or developing or reproducing the -software by the user in light of its specific status of free software, -that may mean that it is complicated to manipulate, and that also -therefore means that it is reserved for developers and experienced -professionals having in-depth computer knowledge. Users are therefore -encouraged to load and test the software's suitability as regards their -requirements in conditions enabling the security of their systems and/or -data to be ensured and, more generally, to use and operate it in the -same conditions as regards security. - -The fact that you are presently reading this means that you have had -knowledge of the CeCILL license and that you accept its terms. +*/ /* This file contains the functions that read the data from the HDF5 file * The functions accept the PARAMESH data through arguments. diff --git a/src/hdf5_flash.h b/src/hdf5_flash.h index 2d0f29a..bf53f36 100644 --- a/src/hdf5_flash.h +++ b/src/hdf5_flash.h @@ -1,36 +1,9 @@ /*+ -This is CosmoTool (./src/hdf5_flash.h) -- Copyright (C) Guilhem Lavaux (2007-2013) +!! -guilhem.lavaux@gmail.com +This particular file has been developped by P. M. Sutter -This software is a computer program whose purpose is to provide a toolbox for cosmological -data analysis (e.g. filters, generalized Fourier transforms, power spectra, ...) - -This software is governed by the CeCILL license under French law and -abiding by the rules of distribution of free software. You can use, -modify and/ or redistribute the software under the terms of the CeCILL -license as circulated by CEA, CNRS and INRIA at the following URL -"http://www.cecill.info". - -As a counterpart to the access to the source code and rights to copy, -modify and redistribute granted by the license, users are provided only -with a limited warranty and the software's author, the holder of the -economic rights, and the successive licensors have only limited -liability. - -In this respect, the user's attention is drawn to the risks associated -with loading, using, modifying and/or developing or reproducing the -software by the user in light of its specific status of free software, -that may mean that it is complicated to manipulate, and that also -therefore means that it is reserved for developers and experienced -professionals having in-depth computer knowledge. Users are therefore -encouraged to load and test the software's suitability as regards their -requirements in conditions enabling the security of their systems and/or -data to be ensured and, more generally, to use and operate it in the -same conditions as regards security. - -The fact that you are presently reading this means that you have had -knowledge of the CeCILL license and that you accept its terms. +!! +*/ /* general header file for the HDF 5 IO in FLASH */ From e0e6ea7be21f867f92a8b9fd2417bf80bde66824 Mon Sep 17 00:00:00 2001 From: Guilhem Lavaux Date: Tue, 5 Mar 2013 22:39:33 -0500 Subject: [PATCH 43/43] Run gather_sources.py --- build_tools/gather_sources.py | 7 ++-- sample/testAlgo.cpp | 1 + sample/testBQueue.cpp | 1 + sample/testBSP.cpp | 1 + sample/testDelaunay.cpp | 1 + sample/testEskow.cpp | 1 + sample/testInterpolate.cpp | 1 + sample/testNewton.cpp | 1 + sample/testPool.cpp | 1 + sample/testReadFlash.cpp | 1 + sample/testSmooth.cpp | 1 + sample/test_cosmopower.cpp | 34 +++++++++++++++++++ sample/test_fft_calls.cpp | 1 + sample/test_healpix_calls.cpp | 1 + sample/testkd.cpp | 1 + sample/testkd2.cpp | 1 + sample/testkd3.cpp | 3 +- src/algo.hpp | 1 + src/bqueue.hpp | 1 + src/bsp_simple.hpp | 1 + src/cic.cpp | 1 + src/cic.hpp | 1 + src/config.hpp | 1 + src/cosmopower.cpp | 1 + src/cosmopower.hpp | 1 + src/dinterpolate.hpp | 1 + src/eskow.hpp | 1 + src/field.hpp | 1 + src/fixArray.hpp | 1 + src/fortran.cpp | 1 + src/fortran.hpp | 1 + src/fourier/base_types.hpp | 1 + src/fourier/details/euclidian_maps.hpp | 1 + src/fourier/details/euclidian_spectrum_1d.hpp | 1 + .../details/euclidian_spectrum_1d_bin.hpp | 1 + src/fourier/details/euclidian_transform.hpp | 1 + src/fourier/details/healpix_alms.hpp | 1 + src/fourier/details/healpix_map.hpp | 1 + src/fourier/details/healpix_spectrum.hpp | 1 + src/fourier/details/healpix_transform.hpp | 1 + src/fourier/details/healpix_utility.hpp | 1 + src/fourier/euclidian.hpp | 1 + src/fourier/fft/fftw_calls.hpp | 1 + src/fourier/healpix.hpp | 1 + src/growthFactor.cpp | 1 + src/growthFactor.hpp | 1 + src/interpolate.cpp | 1 + src/interpolate.hpp | 1 + src/interpolate3d.hpp | 1 + src/kdtree_leaf.hpp | 1 + src/kdtree_splitters.hpp | 1 + src/loadFlash.cpp | 1 + src/loadFlash.hpp | 1 + src/loadFlash_dummy.cpp | 1 + src/loadGadget.cpp | 1 + src/loadGadget.hpp | 1 + src/loadRamses.cpp | 1 + src/loadRamses.hpp | 1 + src/loadSimu.hpp | 1 + src/load_data.cpp | 1 + src/load_data.hpp | 1 + src/mach.hpp | 1 + src/miniargs.cpp | 1 + src/miniargs.hpp | 1 + src/mykdtree.hpp | 1 + src/newton.hpp | 1 + src/octTree.cpp | 1 + src/octTree.hpp | 1 + src/pool.hpp | 1 + src/powerSpectrum.cpp | 1 + src/powerSpectrum.hpp | 1 + src/replicateGenerator.hpp | 34 +++++++++++++++++++ src/sparseGrid.hpp | 1 + src/sphSmooth.hpp | 1 + src/yorick.hpp | 1 + src/yorick_nc3.cpp | 1 + src/yorick_nc4.cpp | 1 + 77 files changed, 148 insertions(+), 3 deletions(-) diff --git a/build_tools/gather_sources.py b/build_tools/gather_sources.py index f787975..ca8c3d1 100644 --- a/build_tools/gather_sources.py +++ b/build_tools/gather_sources.py @@ -5,7 +5,7 @@ # # This software is a computer program whose purpose is to provide a toolbox for cosmological # data analysis (e.g. filters, generalized Fourier transforms, power spectra, ...) - +# # This software is governed by the CeCILL license under French law and # abiding by the rules of distribution of free software. You can use, # modify and/ or redistribute the software under the terms of the CeCILL @@ -61,7 +61,7 @@ def apply_python_license(filename): # # This software is a computer program whose purpose is to provide a toolbox for cosmological # data analysis (e.g. filters, generalized Fourier transforms, power spectra, ...) - +# # This software is governed by the CeCILL license under French law and # abiding by the rules of distribution of free software. You can use, # modify and/ or redistribute the software under the terms of the CeCILL @@ -143,6 +143,9 @@ def analyze_tree(prefix, t): if type(entry) == Tree: analyze_tree(prefix + "/" + ename, entry) elif type(entry) == Blob: + if ename == './src/hdf5_flash.h' or ename == './src/h5_readFlash.cpp' or ename == './src/h5_readFlash.hpp': + continue + if re.match(".*\.(sh|py|pyx)$",ename) != None: fname=prefix+"/"+ename apply_python_license(fname) diff --git a/sample/testAlgo.cpp b/sample/testAlgo.cpp index 07cd7fe..cdf7971 100644 --- a/sample/testAlgo.cpp +++ b/sample/testAlgo.cpp @@ -32,6 +32,7 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL license and that you accept its terms. +*/ + #include #include #include "algo.hpp" diff --git a/sample/testBQueue.cpp b/sample/testBQueue.cpp index 261321e..08beb6d 100644 --- a/sample/testBQueue.cpp +++ b/sample/testBQueue.cpp @@ -32,6 +32,7 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL license and that you accept its terms. +*/ + #include #include "bqueue.hpp" diff --git a/sample/testBSP.cpp b/sample/testBSP.cpp index 92597a3..def0717 100644 --- a/sample/testBSP.cpp +++ b/sample/testBSP.cpp @@ -32,6 +32,7 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL license and that you accept its terms. +*/ + #if 0 #include "bsp_simple.hpp" diff --git a/sample/testDelaunay.cpp b/sample/testDelaunay.cpp index 59093db..8d2d9d4 100644 --- a/sample/testDelaunay.cpp +++ b/sample/testDelaunay.cpp @@ -32,6 +32,7 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL license and that you accept its terms. +*/ + #include #include #include "dinterpolate.hpp" diff --git a/sample/testEskow.cpp b/sample/testEskow.cpp index 318bb48..aa48d2b 100644 --- a/sample/testEskow.cpp +++ b/sample/testEskow.cpp @@ -32,6 +32,7 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL license and that you accept its terms. +*/ + #include #include #include diff --git a/sample/testInterpolate.cpp b/sample/testInterpolate.cpp index aa5eec0..b863170 100644 --- a/sample/testInterpolate.cpp +++ b/sample/testInterpolate.cpp @@ -32,6 +32,7 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL license and that you accept its terms. +*/ + #include #include "interpolate3d.hpp" diff --git a/sample/testNewton.cpp b/sample/testNewton.cpp index febb5af..5677bbc 100644 --- a/sample/testNewton.cpp +++ b/sample/testNewton.cpp @@ -32,6 +32,7 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL license and that you accept its terms. +*/ + #include #include diff --git a/sample/testPool.cpp b/sample/testPool.cpp index 53a6fb8..e4ff8c1 100644 --- a/sample/testPool.cpp +++ b/sample/testPool.cpp @@ -32,6 +32,7 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL license and that you accept its terms. +*/ + #include "pool.hpp" using namespace CosmoTool; diff --git a/sample/testReadFlash.cpp b/sample/testReadFlash.cpp index b1129ec..93a5b64 100644 --- a/sample/testReadFlash.cpp +++ b/sample/testReadFlash.cpp @@ -32,6 +32,7 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL license and that you accept its terms. +*/ + #include #include #include diff --git a/sample/testSmooth.cpp b/sample/testSmooth.cpp index 1bb1603..4f3011d 100644 --- a/sample/testSmooth.cpp +++ b/sample/testSmooth.cpp @@ -32,6 +32,7 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL license and that you accept its terms. +*/ + #include #include "sphSmooth.hpp" #include "yorick.hpp" diff --git a/sample/test_cosmopower.cpp b/sample/test_cosmopower.cpp index f87677b..1bf1ec8 100644 --- a/sample/test_cosmopower.cpp +++ b/sample/test_cosmopower.cpp @@ -1,3 +1,37 @@ +/*+ +This is CosmoTool (./sample/test_cosmopower.cpp) -- Copyright (C) Guilhem Lavaux (2007-2013) + +guilhem.lavaux@gmail.com + +This software is a computer program whose purpose is to provide a toolbox for cosmological +data analysis (e.g. filters, generalized Fourier transforms, power spectra, ...) + +This software is governed by the CeCILL license under French law and +abiding by the rules of distribution of free software. You can use, +modify and/ or redistribute the software under the terms of the CeCILL +license as circulated by CEA, CNRS and INRIA at the following URL +"http://www.cecill.info". + +As a counterpart to the access to the source code and rights to copy, +modify and redistribute granted by the license, users are provided only +with a limited warranty and the software's author, the holder of the +economic rights, and the successive licensors have only limited +liability. + +In this respect, the user's attention is drawn to the risks associated +with loading, using, modifying and/or developing or reproducing the +software by the user in light of its specific status of free software, +that may mean that it is complicated to manipulate, and that also +therefore means that it is reserved for developers and experienced +professionals having in-depth computer knowledge. Users are therefore +encouraged to load and test the software's suitability as regards their +requirements in conditions enabling the security of their systems and/or +data to be ensured and, more generally, to use and operate it in the +same conditions as regards security. + +The fact that you are presently reading this means that you have had +knowledge of the CeCILL license and that you accept its terms. ++*/ #include #include #include "cosmopower.hpp" diff --git a/sample/test_fft_calls.cpp b/sample/test_fft_calls.cpp index 0739328..b98fcea 100644 --- a/sample/test_fft_calls.cpp +++ b/sample/test_fft_calls.cpp @@ -32,6 +32,7 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL license and that you accept its terms. +*/ + #include #include "yorick.hpp" #include diff --git a/sample/test_healpix_calls.cpp b/sample/test_healpix_calls.cpp index ffd13fd..75473d8 100644 --- a/sample/test_healpix_calls.cpp +++ b/sample/test_healpix_calls.cpp @@ -32,6 +32,7 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL license and that you accept its terms. +*/ + #include #include "fourier/healpix.hpp" diff --git a/sample/testkd.cpp b/sample/testkd.cpp index 71c0000..f810571 100644 --- a/sample/testkd.cpp +++ b/sample/testkd.cpp @@ -32,6 +32,7 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL license and that you accept its terms. +*/ + #define __KD_TREE_SAVE_ON_DISK #include #include diff --git a/sample/testkd2.cpp b/sample/testkd2.cpp index 457c5b9..7c29b1e 100644 --- a/sample/testkd2.cpp +++ b/sample/testkd2.cpp @@ -32,6 +32,7 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL license and that you accept its terms. +*/ + #include #include #include diff --git a/sample/testkd3.cpp b/sample/testkd3.cpp index 5744985..50eba07 100644 --- a/sample/testkd3.cpp +++ b/sample/testkd3.cpp @@ -1,5 +1,5 @@ /*+ -This is CosmoTool (./sample/testkd2.cpp) -- Copyright (C) Guilhem Lavaux (2007-2013) +This is CosmoTool (./sample/testkd3.cpp) -- Copyright (C) Guilhem Lavaux (2007-2013) guilhem.lavaux@gmail.com @@ -32,6 +32,7 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL license and that you accept its terms. +*/ + #include #include #include diff --git a/src/algo.hpp b/src/algo.hpp index 927ef4c..2dce3eb 100644 --- a/src/algo.hpp +++ b/src/algo.hpp @@ -32,6 +32,7 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL license and that you accept its terms. +*/ + #ifndef __COSMOTOOL_ALGO_HPP #define __COSMOTOOL_ALGO_HPP diff --git a/src/bqueue.hpp b/src/bqueue.hpp index 97d346c..872830e 100644 --- a/src/bqueue.hpp +++ b/src/bqueue.hpp @@ -32,6 +32,7 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL license and that you accept its terms. +*/ + #ifndef __COSMO_QUEUE_HPP #define __COSMO_QUEUE_HPP diff --git a/src/bsp_simple.hpp b/src/bsp_simple.hpp index 3e4cce3..298256e 100644 --- a/src/bsp_simple.hpp +++ b/src/bsp_simple.hpp @@ -32,6 +32,7 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL license and that you accept its terms. +*/ + #ifndef __COSMOTOOL_SIMPLE_BSP_HPP #define __COSMOTOOL_SIMPLE_BSP_HPP diff --git a/src/cic.cpp b/src/cic.cpp index 9d7b77f..8a24597 100644 --- a/src/cic.cpp +++ b/src/cic.cpp @@ -32,6 +32,7 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL license and that you accept its terms. +*/ + #include #include #include diff --git a/src/cic.hpp b/src/cic.hpp index 3442c38..31ba069 100644 --- a/src/cic.hpp +++ b/src/cic.hpp @@ -32,6 +32,7 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL license and that you accept its terms. +*/ + #ifndef __CICFILTER_HPP #define __CICFILTER_HPP diff --git a/src/config.hpp b/src/config.hpp index afb43f6..8fd7b2d 100644 --- a/src/config.hpp +++ b/src/config.hpp @@ -32,6 +32,7 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL license and that you accept its terms. +*/ + #ifndef __COSMOTOOL_CONFIG_HPP #define __COSMOTOOL_CONFIG_HPP diff --git a/src/cosmopower.cpp b/src/cosmopower.cpp index 5d6b051..a96a6bb 100644 --- a/src/cosmopower.cpp +++ b/src/cosmopower.cpp @@ -32,6 +32,7 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL license and that you accept its terms. +*/ + #include #include #include diff --git a/src/cosmopower.hpp b/src/cosmopower.hpp index 1cacfba..dd86cf1 100644 --- a/src/cosmopower.hpp +++ b/src/cosmopower.hpp @@ -32,6 +32,7 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL license and that you accept its terms. +*/ + #ifndef _COSMOPOWER_HPP #define _COSMOPOWER_HPP diff --git a/src/dinterpolate.hpp b/src/dinterpolate.hpp index 29b3507..1bf3322 100644 --- a/src/dinterpolate.hpp +++ b/src/dinterpolate.hpp @@ -32,6 +32,7 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL license and that you accept its terms. +*/ + #ifndef __COSMO_DINTERPOLATE_HPP #define __COSMO_DINTERPOLATE_HPP diff --git a/src/eskow.hpp b/src/eskow.hpp index d6516d6..987cb88 100644 --- a/src/eskow.hpp +++ b/src/eskow.hpp @@ -32,6 +32,7 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL license and that you accept its terms. +*/ + #ifndef __ESKOW_CHOLESKY_HPP #define __ESKOW_CHOLESKY_HPP diff --git a/src/field.hpp b/src/field.hpp index e78e651..45f6eac 100644 --- a/src/field.hpp +++ b/src/field.hpp @@ -32,6 +32,7 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL license and that you accept its terms. +*/ + #ifndef __COSMOTOOL_FIELD #define __COSMOTOOL_FIELD diff --git a/src/fixArray.hpp b/src/fixArray.hpp index 2f8744f..0d2e26d 100644 --- a/src/fixArray.hpp +++ b/src/fixArray.hpp @@ -32,6 +32,7 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL license and that you accept its terms. +*/ + #ifndef __FIX_ARRAY_HPP #define __FIX_ARRAY_HPP diff --git a/src/fortran.cpp b/src/fortran.cpp index c8c38d6..79641ac 100644 --- a/src/fortran.cpp +++ b/src/fortran.cpp @@ -32,6 +32,7 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL license and that you accept its terms. +*/ + #include "config.hpp" #include #include diff --git a/src/fortran.hpp b/src/fortran.hpp index bb98cc3..d63e8d3 100644 --- a/src/fortran.hpp +++ b/src/fortran.hpp @@ -32,6 +32,7 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL license and that you accept its terms. +*/ + #ifndef __COSMO_FORTRAN_HPP #define __COSMO_FORTRAN_HPP diff --git a/src/fourier/base_types.hpp b/src/fourier/base_types.hpp index 5f805ec..f39e3a5 100644 --- a/src/fourier/base_types.hpp +++ b/src/fourier/base_types.hpp @@ -32,6 +32,7 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL license and that you accept its terms. +*/ + #ifndef __BASE_FOURIER_TYPES_HPP #define __BASE_FOURIER_TYPES_HPP diff --git a/src/fourier/details/euclidian_maps.hpp b/src/fourier/details/euclidian_maps.hpp index 8e78c80..53b0278 100644 --- a/src/fourier/details/euclidian_maps.hpp +++ b/src/fourier/details/euclidian_maps.hpp @@ -32,6 +32,7 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL license and that you accept its terms. +*/ + #ifndef __DETAILS_EUCLIDIAN_MAPS #define __DETAILS_EUCLIDIAN_MAPS diff --git a/src/fourier/details/euclidian_spectrum_1d.hpp b/src/fourier/details/euclidian_spectrum_1d.hpp index 613dde4..36b524a 100644 --- a/src/fourier/details/euclidian_spectrum_1d.hpp +++ b/src/fourier/details/euclidian_spectrum_1d.hpp @@ -32,6 +32,7 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL license and that you accept its terms. +*/ + #ifndef __DETAILS_EUCLIDIAN_SPECTRUM_1D #define __DETAILS_EUCLIDIAN_SPECTRUM_1D diff --git a/src/fourier/details/euclidian_spectrum_1d_bin.hpp b/src/fourier/details/euclidian_spectrum_1d_bin.hpp index 1200f83..ee6cd0b 100644 --- a/src/fourier/details/euclidian_spectrum_1d_bin.hpp +++ b/src/fourier/details/euclidian_spectrum_1d_bin.hpp @@ -32,6 +32,7 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL license and that you accept its terms. +*/ + #ifndef __DETAILS_EUCLIDIAN_SPECTRUM_1D_BIN #define __DETAILS_EUCLIDIAN_SPECTRUM_1D_BIN diff --git a/src/fourier/details/euclidian_transform.hpp b/src/fourier/details/euclidian_transform.hpp index 79bf75b..527d38b 100644 --- a/src/fourier/details/euclidian_transform.hpp +++ b/src/fourier/details/euclidian_transform.hpp @@ -32,6 +32,7 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL license and that you accept its terms. +*/ + #ifndef __DETAILS_EUCLIDIAN_TRANSFORM #define __DETAILS_EUCLIDIAN_TRANSFORM diff --git a/src/fourier/details/healpix_alms.hpp b/src/fourier/details/healpix_alms.hpp index 5aa31ce..fb438a8 100644 --- a/src/fourier/details/healpix_alms.hpp +++ b/src/fourier/details/healpix_alms.hpp @@ -32,6 +32,7 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL license and that you accept its terms. +*/ + #ifndef __COSMOTOOL_FOURIER_HEALPIX_DETAILS_ALM_HPP #define __COSMOTOOL_FOURIER_HEALPIX_DETAILS_ALM_HPP diff --git a/src/fourier/details/healpix_map.hpp b/src/fourier/details/healpix_map.hpp index 7e2479a..a2a3f18 100644 --- a/src/fourier/details/healpix_map.hpp +++ b/src/fourier/details/healpix_map.hpp @@ -32,6 +32,7 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL license and that you accept its terms. +*/ + #ifndef __COSMOTOOL_FOURIER_HEALPIX_DETAILS_MAP_HPP #define __COSMOTOOL_FOURIER_HEALPIX_DETAILS_MAP_HPP diff --git a/src/fourier/details/healpix_spectrum.hpp b/src/fourier/details/healpix_spectrum.hpp index 0ddd58b..92f7085 100644 --- a/src/fourier/details/healpix_spectrum.hpp +++ b/src/fourier/details/healpix_spectrum.hpp @@ -32,6 +32,7 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL license and that you accept its terms. +*/ + #ifndef __COSMOTOOL_FOURIER_HEALPIX_DETAILS_SPECTRUM_HPP #define __COSMOTOOL_FOURIER_HEALPIX_DETAILS_SPECTRUM_HPP diff --git a/src/fourier/details/healpix_transform.hpp b/src/fourier/details/healpix_transform.hpp index 564caff..6e89213 100644 --- a/src/fourier/details/healpix_transform.hpp +++ b/src/fourier/details/healpix_transform.hpp @@ -32,6 +32,7 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL license and that you accept its terms. +*/ + #ifndef __COSMOTOOL_FOURIER_HEALPIX_DETAILS_TRANSFORM_HPP #define __COSMOTOOL_FOURIER_HEALPIX_DETAILS_TRANSFORM_HPP diff --git a/src/fourier/details/healpix_utility.hpp b/src/fourier/details/healpix_utility.hpp index 5e9775a..8803ae9 100644 --- a/src/fourier/details/healpix_utility.hpp +++ b/src/fourier/details/healpix_utility.hpp @@ -32,6 +32,7 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL license and that you accept its terms. +*/ + #ifndef __COSMOTOOL_FOURIER_HEALPIX_DETAILS_SPECTRUM_HP #define __COSMOTOOL_FOURIER_HEALPIX_DETAILS_SPECTRUM_HP diff --git a/src/fourier/euclidian.hpp b/src/fourier/euclidian.hpp index ccaeced..efc76e7 100644 --- a/src/fourier/euclidian.hpp +++ b/src/fourier/euclidian.hpp @@ -32,6 +32,7 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL license and that you accept its terms. +*/ + #ifndef __COSMOTOOL_FOURIER_EUCLIDIAN_HPP #define __COSMOTOOL_FOURIER_EUCLIDIAN_HPP diff --git a/src/fourier/fft/fftw_calls.hpp b/src/fourier/fft/fftw_calls.hpp index 6cb39ea..c811728 100644 --- a/src/fourier/fft/fftw_calls.hpp +++ b/src/fourier/fft/fftw_calls.hpp @@ -32,6 +32,7 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL license and that you accept its terms. +*/ + #ifndef __FFTW_UNIFIED_CALLS_HPP #define __FFTW_UNIFIED_CALLS_HPP diff --git a/src/fourier/healpix.hpp b/src/fourier/healpix.hpp index 975ac00..e8b8b2d 100644 --- a/src/fourier/healpix.hpp +++ b/src/fourier/healpix.hpp @@ -32,6 +32,7 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL license and that you accept its terms. +*/ + #ifndef __COSMOTOOL_FOURIER_HEALPIX_HPP #define __COSMOTOOL_FOURIER_HEALPIX_HPP diff --git a/src/growthFactor.cpp b/src/growthFactor.cpp index d954000..b718d4e 100644 --- a/src/growthFactor.cpp +++ b/src/growthFactor.cpp @@ -32,6 +32,7 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL license and that you accept its terms. +*/ + #include #include #include "interpolate.hpp" diff --git a/src/growthFactor.hpp b/src/growthFactor.hpp index 01f0bd6..1a455df 100644 --- a/src/growthFactor.hpp +++ b/src/growthFactor.hpp @@ -32,6 +32,7 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL license and that you accept its terms. +*/ + #ifndef COSMO_GROWTH_FACTOR_HPP #define COSMO_GROWTH_FACTOR_HPP diff --git a/src/interpolate.cpp b/src/interpolate.cpp index 3c175da..ec6575c 100644 --- a/src/interpolate.cpp +++ b/src/interpolate.cpp @@ -32,6 +32,7 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL license and that you accept its terms. +*/ + #include #include #include diff --git a/src/interpolate.hpp b/src/interpolate.hpp index 4aa0573..2e30e29 100644 --- a/src/interpolate.hpp +++ b/src/interpolate.hpp @@ -32,6 +32,7 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL license and that you accept its terms. +*/ + #ifndef __CTOOL_INTERPOLATE_HPP #define __CTOOL_INTERPOLATE_HPP diff --git a/src/interpolate3d.hpp b/src/interpolate3d.hpp index c50a905..0f66d02 100644 --- a/src/interpolate3d.hpp +++ b/src/interpolate3d.hpp @@ -32,6 +32,7 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL license and that you accept its terms. +*/ + #ifndef __COSMO_INTERPOLATE3D_HPP #define __COSMO_INTERPOLATE3D_HPP diff --git a/src/kdtree_leaf.hpp b/src/kdtree_leaf.hpp index f89fa80..0481889 100644 --- a/src/kdtree_leaf.hpp +++ b/src/kdtree_leaf.hpp @@ -32,6 +32,7 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL license and that you accept its terms. +*/ + #ifndef __LEAF_KDTREE_HPP #define __LEAF_KDTREE_HPP diff --git a/src/kdtree_splitters.hpp b/src/kdtree_splitters.hpp index 0dbfff7..c0364a6 100644 --- a/src/kdtree_splitters.hpp +++ b/src/kdtree_splitters.hpp @@ -32,6 +32,7 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL license and that you accept its terms. +*/ + #ifndef __KDTREE_SPLITTERS_HPP #define __KDTREE_SPLITTERS_HPP diff --git a/src/loadFlash.cpp b/src/loadFlash.cpp index 6da91f6..d437f25 100644 --- a/src/loadFlash.cpp +++ b/src/loadFlash.cpp @@ -32,6 +32,7 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL license and that you accept its terms. +*/ + /* Reads in FLASH v3 files in HDF5 format */ #include diff --git a/src/loadFlash.hpp b/src/loadFlash.hpp index fbc017f..62f511b 100644 --- a/src/loadFlash.hpp +++ b/src/loadFlash.hpp @@ -32,6 +32,7 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL license and that you accept its terms. +*/ + #ifndef __COSMO_LOAD_FLASH_HPP #define __COSMO_LOAD_FLASH_HPP diff --git a/src/loadFlash_dummy.cpp b/src/loadFlash_dummy.cpp index f8a2a62..2c6a86c 100644 --- a/src/loadFlash_dummy.cpp +++ b/src/loadFlash_dummy.cpp @@ -32,6 +32,7 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL license and that you accept its terms. +*/ + #include "load_data.hpp" #include "loadFlash.hpp" diff --git a/src/loadGadget.cpp b/src/loadGadget.cpp index 60e04e6..47100c8 100644 --- a/src/loadGadget.cpp +++ b/src/loadGadget.cpp @@ -32,6 +32,7 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL license and that you accept its terms. +*/ + #include #include #include diff --git a/src/loadGadget.hpp b/src/loadGadget.hpp index d50816d..ad0e412 100644 --- a/src/loadGadget.hpp +++ b/src/loadGadget.hpp @@ -32,6 +32,7 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL license and that you accept its terms. +*/ + #ifndef __COSMO_LOAD_GADGET_HPP #define __COSMO_LOAD_GADGET_HPP diff --git a/src/loadRamses.cpp b/src/loadRamses.cpp index 2b98b0f..3eb909c 100644 --- a/src/loadRamses.cpp +++ b/src/loadRamses.cpp @@ -32,6 +32,7 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL license and that you accept its terms. +*/ + #include #include #include diff --git a/src/loadRamses.hpp b/src/loadRamses.hpp index 33f082d..5282a3c 100644 --- a/src/loadRamses.hpp +++ b/src/loadRamses.hpp @@ -32,6 +32,7 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL license and that you accept its terms. +*/ + #ifndef _LOAD_RAMSES_HPP #define _LOAD_RAMSES_HPP diff --git a/src/loadSimu.hpp b/src/loadSimu.hpp index 1899cb4..1c360a4 100644 --- a/src/loadSimu.hpp +++ b/src/loadSimu.hpp @@ -32,6 +32,7 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL license and that you accept its terms. +*/ + #ifndef __COSMOTOOLBOX_HPP #define __COSMOTOOLBOX_HPP diff --git a/src/load_data.cpp b/src/load_data.cpp index b5c0b22..f23f909 100644 --- a/src/load_data.cpp +++ b/src/load_data.cpp @@ -32,6 +32,7 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL license and that you accept its terms. +*/ + #include #include #include diff --git a/src/load_data.hpp b/src/load_data.hpp index f657e13..6be3bbb 100644 --- a/src/load_data.hpp +++ b/src/load_data.hpp @@ -32,6 +32,7 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL license and that you accept its terms. +*/ + #ifndef _LOAD_GADGET_DATA_HPP #define _LOAD_GADGET_DATA_HPP diff --git a/src/mach.hpp b/src/mach.hpp index e383574..6bea525 100644 --- a/src/mach.hpp +++ b/src/mach.hpp @@ -32,6 +32,7 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL license and that you accept its terms. +*/ + #ifndef __COSMO_MACHINE_TEST_HPP #define __COSMO_MACHINE_TEST_HPP diff --git a/src/miniargs.cpp b/src/miniargs.cpp index 400760f..7c23230 100644 --- a/src/miniargs.cpp +++ b/src/miniargs.cpp @@ -32,6 +32,7 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL license and that you accept its terms. +*/ + #include #include #include diff --git a/src/miniargs.hpp b/src/miniargs.hpp index db81c67..9f04b58 100644 --- a/src/miniargs.hpp +++ b/src/miniargs.hpp @@ -32,6 +32,7 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL license and that you accept its terms. +*/ + #ifndef _MAK_MINIARGS_HPP #define _MAK_MINIARGS_HPP diff --git a/src/mykdtree.hpp b/src/mykdtree.hpp index dd912e1..27d66ae 100644 --- a/src/mykdtree.hpp +++ b/src/mykdtree.hpp @@ -32,6 +32,7 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL license and that you accept its terms. +*/ + #ifndef __HV_KDTREE_HPP #define __HV_KDTREE_HPP diff --git a/src/newton.hpp b/src/newton.hpp index 7a85b1a..d3975fe 100644 --- a/src/newton.hpp +++ b/src/newton.hpp @@ -32,6 +32,7 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL license and that you accept its terms. +*/ + #ifndef _COSMOTOOL_NEWTON_HPP #define _COSMOTOOL_NEWTON_HPP diff --git a/src/octTree.cpp b/src/octTree.cpp index ce3a97d..2c76609 100644 --- a/src/octTree.cpp +++ b/src/octTree.cpp @@ -32,6 +32,7 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL license and that you accept its terms. +*/ + #include #include #include diff --git a/src/octTree.hpp b/src/octTree.hpp index 658d87b..425d8fd 100644 --- a/src/octTree.hpp +++ b/src/octTree.hpp @@ -32,6 +32,7 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL license and that you accept its terms. +*/ + #ifndef __COSMOTOOL_AMR_HPP #define __COSMOTOOL_AMR_HPP diff --git a/src/pool.hpp b/src/pool.hpp index a09669b..b3e2637 100644 --- a/src/pool.hpp +++ b/src/pool.hpp @@ -32,6 +32,7 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL license and that you accept its terms. +*/ + #ifndef __COSMO_POOL_HPP #define __COSMO_POOL_HPP diff --git a/src/powerSpectrum.cpp b/src/powerSpectrum.cpp index 0bc741a..b2a34be 100644 --- a/src/powerSpectrum.cpp +++ b/src/powerSpectrum.cpp @@ -32,6 +32,7 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL license and that you accept its terms. +*/ + #include #include #include diff --git a/src/powerSpectrum.hpp b/src/powerSpectrum.hpp index ea19f5f..d4c6761 100644 --- a/src/powerSpectrum.hpp +++ b/src/powerSpectrum.hpp @@ -32,6 +32,7 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL license and that you accept its terms. +*/ + #ifndef _POWERSPECTRUM_HPP #define _POWERSPECTRUM_HPP diff --git a/src/replicateGenerator.hpp b/src/replicateGenerator.hpp index 3b6d3b8..fd7035f 100644 --- a/src/replicateGenerator.hpp +++ b/src/replicateGenerator.hpp @@ -1,3 +1,37 @@ +/*+ +This is CosmoTool (./src/replicateGenerator.hpp) -- Copyright (C) Guilhem Lavaux (2007-2013) + +guilhem.lavaux@gmail.com + +This software is a computer program whose purpose is to provide a toolbox for cosmological +data analysis (e.g. filters, generalized Fourier transforms, power spectra, ...) + +This software is governed by the CeCILL license under French law and +abiding by the rules of distribution of free software. You can use, +modify and/ or redistribute the software under the terms of the CeCILL +license as circulated by CEA, CNRS and INRIA at the following URL +"http://www.cecill.info". + +As a counterpart to the access to the source code and rights to copy, +modify and redistribute granted by the license, users are provided only +with a limited warranty and the software's author, the holder of the +economic rights, and the successive licensors have only limited +liability. + +In this respect, the user's attention is drawn to the risks associated +with loading, using, modifying and/or developing or reproducing the +software by the user in light of its specific status of free software, +that may mean that it is complicated to manipulate, and that also +therefore means that it is reserved for developers and experienced +professionals having in-depth computer knowledge. Users are therefore +encouraged to load and test the software's suitability as regards their +requirements in conditions enabling the security of their systems and/or +data to be ensured and, more generally, to use and operate it in the +same conditions as regards security. + +The fact that you are presently reading this means that you have had +knowledge of the CeCILL license and that you accept its terms. ++*/ #ifndef __REPLICATE_GENERATOR_HPP #define __REPLICATE_GENERATOR_HPP diff --git a/src/sparseGrid.hpp b/src/sparseGrid.hpp index b529a6d..516be9d 100644 --- a/src/sparseGrid.hpp +++ b/src/sparseGrid.hpp @@ -32,6 +32,7 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL license and that you accept its terms. +*/ + #ifndef __VOID_SPARSE_GRID_HPP #define __VOID_SPARSE_GRID_HPP diff --git a/src/sphSmooth.hpp b/src/sphSmooth.hpp index 0e6cf55..f6fe582 100644 --- a/src/sphSmooth.hpp +++ b/src/sphSmooth.hpp @@ -32,6 +32,7 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL license and that you accept its terms. +*/ + #ifndef __COSMOTOOL_SPH_SMOOTH_HPP #define __COSMOTOOL_SPH_SMOOTH_HPP diff --git a/src/yorick.hpp b/src/yorick.hpp index 802d1cc..39fd20d 100644 --- a/src/yorick.hpp +++ b/src/yorick.hpp @@ -32,6 +32,7 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL license and that you accept its terms. +*/ + #ifndef __YORICK_HELPERS_HPP #define __YORICK_HELPERS_HPP diff --git a/src/yorick_nc3.cpp b/src/yorick_nc3.cpp index 9f814b6..d80781e 100644 --- a/src/yorick_nc3.cpp +++ b/src/yorick_nc3.cpp @@ -32,6 +32,7 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL license and that you accept its terms. +*/ + #include "ctool_netcdf_ver.hpp" #include "config.hpp" #ifdef NETCDFCPP4 diff --git a/src/yorick_nc4.cpp b/src/yorick_nc4.cpp index 7765093..9a6f501 100644 --- a/src/yorick_nc4.cpp +++ b/src/yorick_nc4.cpp @@ -32,6 +32,7 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL license and that you accept its terms. +*/ + #include "ctool_netcdf_ver.hpp" #include "config.hpp" #include