Merge branch 'master' of ssh://bitbucket.org/glavaux/cosmotool

This commit is contained in:
Guilhem Lavaux 2013-03-07 17:24:18 -05:00
commit 6296f4c8cf
81 changed files with 377 additions and 100 deletions

View File

@ -5,7 +5,7 @@
# #
# This software is a computer program whose purpose is to provide a toolbox for cosmological # 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, ...) # data analysis (e.g. filters, generalized Fourier transforms, power spectra, ...)
#
# This software is governed by the CeCILL license under French law and # This software is governed by the CeCILL license under French law and
# abiding by the rules of distribution of free software. You can use, # abiding by the rules of distribution of free software. You can use,
# modify and/ or redistribute the software under the terms of the CeCILL # 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 # 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, ...) # data analysis (e.g. filters, generalized Fourier transforms, power spectra, ...)
#
# This software is governed by the CeCILL license under French law and # This software is governed by the CeCILL license under French law and
# abiding by the rules of distribution of free software. You can use, # abiding by the rules of distribution of free software. You can use,
# modify and/ or redistribute the software under the terms of the CeCILL # 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: if type(entry) == Tree:
analyze_tree(prefix + "/" + ename, entry) analyze_tree(prefix + "/" + ename, entry)
elif type(entry) == Blob: 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: if re.match(".*\.(sh|py|pyx)$",ename) != None:
fname=prefix+"/"+ename fname=prefix+"/"+ename
apply_python_license(fname) apply_python_license(fname)

View File

@ -20,6 +20,9 @@ target_link_libraries(testkd ${tolink})
add_executable(testkd2 testkd2.cpp) add_executable(testkd2 testkd2.cpp)
target_link_libraries(testkd2 ${tolink}) target_link_libraries(testkd2 ${tolink})
add_executable(testkd3 testkd3.cpp)
target_link_libraries(testkd3 ${tolink})
add_executable(testDelaunay testDelaunay.cpp) add_executable(testDelaunay testDelaunay.cpp)
target_link_libraries(testDelaunay ${tolink}) target_link_libraries(testDelaunay ${tolink})

View File

@ -32,6 +32,7 @@ same conditions as regards security.
The fact that you are presently reading this means that you have had The fact that you are presently reading this means that you have had
knowledge of the CeCILL license and that you accept its terms. knowledge of the CeCILL license and that you accept its terms.
+*/ +*/
#include <iostream> #include <iostream>
#include <stdio.h> #include <stdio.h>
#include "algo.hpp" #include "algo.hpp"

View File

@ -32,6 +32,7 @@ same conditions as regards security.
The fact that you are presently reading this means that you have had The fact that you are presently reading this means that you have had
knowledge of the CeCILL license and that you accept its terms. knowledge of the CeCILL license and that you accept its terms.
+*/ +*/
#include <iostream> #include <iostream>
#include "bqueue.hpp" #include "bqueue.hpp"

View File

@ -32,6 +32,7 @@ same conditions as regards security.
The fact that you are presently reading this means that you have had The fact that you are presently reading this means that you have had
knowledge of the CeCILL license and that you accept its terms. knowledge of the CeCILL license and that you accept its terms.
+*/ +*/
#if 0 #if 0
#include "bsp_simple.hpp" #include "bsp_simple.hpp"

View File

@ -32,6 +32,7 @@ same conditions as regards security.
The fact that you are presently reading this means that you have had The fact that you are presently reading this means that you have had
knowledge of the CeCILL license and that you accept its terms. knowledge of the CeCILL license and that you accept its terms.
+*/ +*/
#include <fstream> #include <fstream>
#include <iostream> #include <iostream>
#include "dinterpolate.hpp" #include "dinterpolate.hpp"

View File

@ -32,6 +32,7 @@ same conditions as regards security.
The fact that you are presently reading this means that you have had The fact that you are presently reading this means that you have had
knowledge of the CeCILL license and that you accept its terms. knowledge of the CeCILL license and that you accept its terms.
+*/ +*/
#include <fstream> #include <fstream>
#include <cstring> #include <cstring>
#include <iostream> #include <iostream>

View File

@ -32,6 +32,7 @@ same conditions as regards security.
The fact that you are presently reading this means that you have had The fact that you are presently reading this means that you have had
knowledge of the CeCILL license and that you accept its terms. knowledge of the CeCILL license and that you accept its terms.
+*/ +*/
#include <iostream> #include <iostream>
#include "interpolate3d.hpp" #include "interpolate3d.hpp"

View File

@ -32,6 +32,7 @@ same conditions as regards security.
The fact that you are presently reading this means that you have had The fact that you are presently reading this means that you have had
knowledge of the CeCILL license and that you accept its terms. knowledge of the CeCILL license and that you accept its terms.
+*/ +*/
#include <iostream> #include <iostream>
#include <cmath> #include <cmath>

View File

@ -32,6 +32,7 @@ same conditions as regards security.
The fact that you are presently reading this means that you have had The fact that you are presently reading this means that you have had
knowledge of the CeCILL license and that you accept its terms. knowledge of the CeCILL license and that you accept its terms.
+*/ +*/
#include "pool.hpp" #include "pool.hpp"
using namespace CosmoTool; using namespace CosmoTool;

View File

@ -32,6 +32,7 @@ same conditions as regards security.
The fact that you are presently reading this means that you have had The fact that you are presently reading this means that you have had
knowledge of the CeCILL license and that you accept its terms. knowledge of the CeCILL license and that you accept its terms.
+*/ +*/
#include <iostream> #include <iostream>
#include <assert.h> #include <assert.h>
#include <stdio.h> #include <stdio.h>

View File

@ -32,6 +32,7 @@ same conditions as regards security.
The fact that you are presently reading this means that you have had The fact that you are presently reading this means that you have had
knowledge of the CeCILL license and that you accept its terms. knowledge of the CeCILL license and that you accept its terms.
+*/ +*/
#include <iostream> #include <iostream>
#include "sphSmooth.hpp" #include "sphSmooth.hpp"
#include "yorick.hpp" #include "yorick.hpp"

View File

@ -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 <cmath> #include <cmath>
#include <iostream> #include <iostream>
#include "cosmopower.hpp" #include "cosmopower.hpp"

View File

@ -32,6 +32,7 @@ same conditions as regards security.
The fact that you are presently reading this means that you have had The fact that you are presently reading this means that you have had
knowledge of the CeCILL license and that you accept its terms. knowledge of the CeCILL license and that you accept its terms.
+*/ +*/
#include <boost/format.hpp> #include <boost/format.hpp>
#include "yorick.hpp" #include "yorick.hpp"
#include <gsl/gsl_rng.h> #include <gsl/gsl_rng.h>

View File

@ -32,6 +32,7 @@ same conditions as regards security.
The fact that you are presently reading this means that you have had The fact that you are presently reading this means that you have had
knowledge of the CeCILL license and that you accept its terms. knowledge of the CeCILL license and that you accept its terms.
+*/ +*/
#include <iostream> #include <iostream>
#include "fourier/healpix.hpp" #include "fourier/healpix.hpp"

View File

@ -32,6 +32,7 @@ same conditions as regards security.
The fact that you are presently reading this means that you have had The fact that you are presently reading this means that you have had
knowledge of the CeCILL license and that you accept its terms. knowledge of the CeCILL license and that you accept its terms.
+*/ +*/
#define __KD_TREE_SAVE_ON_DISK #define __KD_TREE_SAVE_ON_DISK
#include <ctime> #include <ctime>
#include <cassert> #include <cassert>

View File

@ -32,6 +32,7 @@ same conditions as regards security.
The fact that you are presently reading this means that you have had The fact that you are presently reading this means that you have had
knowledge of the CeCILL license and that you accept its terms. knowledge of the CeCILL license and that you accept its terms.
+*/ +*/
#include <ctime> #include <ctime>
#include <cassert> #include <cassert>
#include <cstdlib> #include <cstdlib>

187
sample/testkd3.cpp Normal file
View File

@ -0,0 +1,187 @@
/*+
This is CosmoTool (./sample/testkd3.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 <ctime>
#include <cassert>
#include <cstdlib>
#include <iostream>
#include <fstream>
#define __KD_TREE_NUMNODES
#include "mykdtree.hpp"
#include "kdtree_splitters.hpp"
#include <limits>
#define NTRY 30
#define NGB 24
#define ND 3
using namespace std;
using namespace CosmoTool;
typedef KDTree<ND,char,ComputePrecision,KD_homogeneous_cell_splitter<ND, char> > MyTree;
//typedef KDTree<ND,char,ComputePrecision > MyTree;
typedef KDCell<ND,char> 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<double>::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<double>::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<double>::epsilon()) << endl;
abort();
}
}
}
}
return 0;
}

View File

@ -32,6 +32,7 @@ same conditions as regards security.
The fact that you are presently reading this means that you have had The fact that you are presently reading this means that you have had
knowledge of the CeCILL license and that you accept its terms. knowledge of the CeCILL license and that you accept its terms.
+*/ +*/
#ifndef __COSMOTOOL_ALGO_HPP #ifndef __COSMOTOOL_ALGO_HPP
#define __COSMOTOOL_ALGO_HPP #define __COSMOTOOL_ALGO_HPP

View File

@ -32,6 +32,7 @@ same conditions as regards security.
The fact that you are presently reading this means that you have had The fact that you are presently reading this means that you have had
knowledge of the CeCILL license and that you accept its terms. knowledge of the CeCILL license and that you accept its terms.
+*/ +*/
#ifndef __COSMO_QUEUE_HPP #ifndef __COSMO_QUEUE_HPP
#define __COSMO_QUEUE_HPP #define __COSMO_QUEUE_HPP

View File

@ -32,6 +32,7 @@ same conditions as regards security.
The fact that you are presently reading this means that you have had The fact that you are presently reading this means that you have had
knowledge of the CeCILL license and that you accept its terms. knowledge of the CeCILL license and that you accept its terms.
+*/ +*/
#ifndef __COSMOTOOL_SIMPLE_BSP_HPP #ifndef __COSMOTOOL_SIMPLE_BSP_HPP
#define __COSMOTOOL_SIMPLE_BSP_HPP #define __COSMOTOOL_SIMPLE_BSP_HPP

View File

@ -32,6 +32,7 @@ same conditions as regards security.
The fact that you are presently reading this means that you have had The fact that you are presently reading this means that you have had
knowledge of the CeCILL license and that you accept its terms. knowledge of the CeCILL license and that you accept its terms.
+*/ +*/
#include <assert.h> #include <assert.h>
#include <math.h> #include <math.h>
#include <inttypes.h> #include <inttypes.h>

View File

@ -32,6 +32,7 @@ same conditions as regards security.
The fact that you are presently reading this means that you have had The fact that you are presently reading this means that you have had
knowledge of the CeCILL license and that you accept its terms. knowledge of the CeCILL license and that you accept its terms.
+*/ +*/
#ifndef __CICFILTER_HPP #ifndef __CICFILTER_HPP
#define __CICFILTER_HPP #define __CICFILTER_HPP

View File

@ -32,6 +32,7 @@ same conditions as regards security.
The fact that you are presently reading this means that you have had The fact that you are presently reading this means that you have had
knowledge of the CeCILL license and that you accept its terms. knowledge of the CeCILL license and that you accept its terms.
+*/ +*/
#ifndef __COSMOTOOL_CONFIG_HPP #ifndef __COSMOTOOL_CONFIG_HPP
#define __COSMOTOOL_CONFIG_HPP #define __COSMOTOOL_CONFIG_HPP

View File

@ -32,6 +32,7 @@ same conditions as regards security.
The fact that you are presently reading this means that you have had The fact that you are presently reading this means that you have had
knowledge of the CeCILL license and that you accept its terms. knowledge of the CeCILL license and that you accept its terms.
+*/ +*/
#include <cassert> #include <cassert>
#include <vector> #include <vector>
#include <algorithm> #include <algorithm>

View File

@ -32,6 +32,7 @@ same conditions as regards security.
The fact that you are presently reading this means that you have had The fact that you are presently reading this means that you have had
knowledge of the CeCILL license and that you accept its terms. knowledge of the CeCILL license and that you accept its terms.
+*/ +*/
#ifndef _COSMOPOWER_HPP #ifndef _COSMOPOWER_HPP
#define _COSMOPOWER_HPP #define _COSMOPOWER_HPP

View File

@ -32,6 +32,7 @@ same conditions as regards security.
The fact that you are presently reading this means that you have had The fact that you are presently reading this means that you have had
knowledge of the CeCILL license and that you accept its terms. knowledge of the CeCILL license and that you accept its terms.
+*/ +*/
#ifndef __COSMO_DINTERPOLATE_HPP #ifndef __COSMO_DINTERPOLATE_HPP
#define __COSMO_DINTERPOLATE_HPP #define __COSMO_DINTERPOLATE_HPP

View File

@ -32,6 +32,7 @@ same conditions as regards security.
The fact that you are presently reading this means that you have had The fact that you are presently reading this means that you have had
knowledge of the CeCILL license and that you accept its terms. knowledge of the CeCILL license and that you accept its terms.
+*/ +*/
#ifndef __ESKOW_CHOLESKY_HPP #ifndef __ESKOW_CHOLESKY_HPP
#define __ESKOW_CHOLESKY_HPP #define __ESKOW_CHOLESKY_HPP

View File

@ -32,6 +32,7 @@ same conditions as regards security.
The fact that you are presently reading this means that you have had The fact that you are presently reading this means that you have had
knowledge of the CeCILL license and that you accept its terms. knowledge of the CeCILL license and that you accept its terms.
+*/ +*/
#ifndef __COSMOTOOL_FIELD #ifndef __COSMOTOOL_FIELD
#define __COSMOTOOL_FIELD #define __COSMOTOOL_FIELD

View File

@ -32,6 +32,7 @@ same conditions as regards security.
The fact that you are presently reading this means that you have had The fact that you are presently reading this means that you have had
knowledge of the CeCILL license and that you accept its terms. knowledge of the CeCILL license and that you accept its terms.
+*/ +*/
#ifndef __FIX_ARRAY_HPP #ifndef __FIX_ARRAY_HPP
#define __FIX_ARRAY_HPP #define __FIX_ARRAY_HPP

View File

@ -32,6 +32,7 @@ same conditions as regards security.
The fact that you are presently reading this means that you have had The fact that you are presently reading this means that you have had
knowledge of the CeCILL license and that you accept its terms. knowledge of the CeCILL license and that you accept its terms.
+*/ +*/
#include "config.hpp" #include "config.hpp"
#include <iostream> #include <iostream>
#include <fstream> #include <fstream>

View File

@ -32,6 +32,7 @@ same conditions as regards security.
The fact that you are presently reading this means that you have had The fact that you are presently reading this means that you have had
knowledge of the CeCILL license and that you accept its terms. knowledge of the CeCILL license and that you accept its terms.
+*/ +*/
#ifndef __COSMO_FORTRAN_HPP #ifndef __COSMO_FORTRAN_HPP
#define __COSMO_FORTRAN_HPP #define __COSMO_FORTRAN_HPP

View File

@ -32,6 +32,7 @@ same conditions as regards security.
The fact that you are presently reading this means that you have had The fact that you are presently reading this means that you have had
knowledge of the CeCILL license and that you accept its terms. knowledge of the CeCILL license and that you accept its terms.
+*/ +*/
#ifndef __BASE_FOURIER_TYPES_HPP #ifndef __BASE_FOURIER_TYPES_HPP
#define __BASE_FOURIER_TYPES_HPP #define __BASE_FOURIER_TYPES_HPP

View File

@ -32,6 +32,7 @@ same conditions as regards security.
The fact that you are presently reading this means that you have had The fact that you are presently reading this means that you have had
knowledge of the CeCILL license and that you accept its terms. knowledge of the CeCILL license and that you accept its terms.
+*/ +*/
#ifndef __DETAILS_EUCLIDIAN_MAPS #ifndef __DETAILS_EUCLIDIAN_MAPS
#define __DETAILS_EUCLIDIAN_MAPS #define __DETAILS_EUCLIDIAN_MAPS

View File

@ -32,6 +32,7 @@ same conditions as regards security.
The fact that you are presently reading this means that you have had The fact that you are presently reading this means that you have had
knowledge of the CeCILL license and that you accept its terms. knowledge of the CeCILL license and that you accept its terms.
+*/ +*/
#ifndef __DETAILS_EUCLIDIAN_SPECTRUM_1D #ifndef __DETAILS_EUCLIDIAN_SPECTRUM_1D
#define __DETAILS_EUCLIDIAN_SPECTRUM_1D #define __DETAILS_EUCLIDIAN_SPECTRUM_1D

View File

@ -32,6 +32,7 @@ same conditions as regards security.
The fact that you are presently reading this means that you have had The fact that you are presently reading this means that you have had
knowledge of the CeCILL license and that you accept its terms. knowledge of the CeCILL license and that you accept its terms.
+*/ +*/
#ifndef __DETAILS_EUCLIDIAN_SPECTRUM_1D_BIN #ifndef __DETAILS_EUCLIDIAN_SPECTRUM_1D_BIN
#define __DETAILS_EUCLIDIAN_SPECTRUM_1D_BIN #define __DETAILS_EUCLIDIAN_SPECTRUM_1D_BIN

View File

@ -32,6 +32,7 @@ same conditions as regards security.
The fact that you are presently reading this means that you have had The fact that you are presently reading this means that you have had
knowledge of the CeCILL license and that you accept its terms. knowledge of the CeCILL license and that you accept its terms.
+*/ +*/
#ifndef __DETAILS_EUCLIDIAN_TRANSFORM #ifndef __DETAILS_EUCLIDIAN_TRANSFORM
#define __DETAILS_EUCLIDIAN_TRANSFORM #define __DETAILS_EUCLIDIAN_TRANSFORM

View File

@ -32,6 +32,7 @@ same conditions as regards security.
The fact that you are presently reading this means that you have had The fact that you are presently reading this means that you have had
knowledge of the CeCILL license and that you accept its terms. knowledge of the CeCILL license and that you accept its terms.
+*/ +*/
#ifndef __COSMOTOOL_FOURIER_HEALPIX_DETAILS_ALM_HPP #ifndef __COSMOTOOL_FOURIER_HEALPIX_DETAILS_ALM_HPP
#define __COSMOTOOL_FOURIER_HEALPIX_DETAILS_ALM_HPP #define __COSMOTOOL_FOURIER_HEALPIX_DETAILS_ALM_HPP

View File

@ -32,6 +32,7 @@ same conditions as regards security.
The fact that you are presently reading this means that you have had The fact that you are presently reading this means that you have had
knowledge of the CeCILL license and that you accept its terms. knowledge of the CeCILL license and that you accept its terms.
+*/ +*/
#ifndef __COSMOTOOL_FOURIER_HEALPIX_DETAILS_MAP_HPP #ifndef __COSMOTOOL_FOURIER_HEALPIX_DETAILS_MAP_HPP
#define __COSMOTOOL_FOURIER_HEALPIX_DETAILS_MAP_HPP #define __COSMOTOOL_FOURIER_HEALPIX_DETAILS_MAP_HPP

View File

@ -32,6 +32,7 @@ same conditions as regards security.
The fact that you are presently reading this means that you have had The fact that you are presently reading this means that you have had
knowledge of the CeCILL license and that you accept its terms. knowledge of the CeCILL license and that you accept its terms.
+*/ +*/
#ifndef __COSMOTOOL_FOURIER_HEALPIX_DETAILS_SPECTRUM_HPP #ifndef __COSMOTOOL_FOURIER_HEALPIX_DETAILS_SPECTRUM_HPP
#define __COSMOTOOL_FOURIER_HEALPIX_DETAILS_SPECTRUM_HPP #define __COSMOTOOL_FOURIER_HEALPIX_DETAILS_SPECTRUM_HPP

View File

@ -32,6 +32,7 @@ same conditions as regards security.
The fact that you are presently reading this means that you have had The fact that you are presently reading this means that you have had
knowledge of the CeCILL license and that you accept its terms. knowledge of the CeCILL license and that you accept its terms.
+*/ +*/
#ifndef __COSMOTOOL_FOURIER_HEALPIX_DETAILS_TRANSFORM_HPP #ifndef __COSMOTOOL_FOURIER_HEALPIX_DETAILS_TRANSFORM_HPP
#define __COSMOTOOL_FOURIER_HEALPIX_DETAILS_TRANSFORM_HPP #define __COSMOTOOL_FOURIER_HEALPIX_DETAILS_TRANSFORM_HPP

View File

@ -32,6 +32,7 @@ same conditions as regards security.
The fact that you are presently reading this means that you have had The fact that you are presently reading this means that you have had
knowledge of the CeCILL license and that you accept its terms. knowledge of the CeCILL license and that you accept its terms.
+*/ +*/
#ifndef __COSMOTOOL_FOURIER_HEALPIX_DETAILS_SPECTRUM_HP #ifndef __COSMOTOOL_FOURIER_HEALPIX_DETAILS_SPECTRUM_HP
#define __COSMOTOOL_FOURIER_HEALPIX_DETAILS_SPECTRUM_HP #define __COSMOTOOL_FOURIER_HEALPIX_DETAILS_SPECTRUM_HP

View File

@ -32,6 +32,7 @@ same conditions as regards security.
The fact that you are presently reading this means that you have had The fact that you are presently reading this means that you have had
knowledge of the CeCILL license and that you accept its terms. knowledge of the CeCILL license and that you accept its terms.
+*/ +*/
#ifndef __COSMOTOOL_FOURIER_EUCLIDIAN_HPP #ifndef __COSMOTOOL_FOURIER_EUCLIDIAN_HPP
#define __COSMOTOOL_FOURIER_EUCLIDIAN_HPP #define __COSMOTOOL_FOURIER_EUCLIDIAN_HPP

View File

@ -32,6 +32,7 @@ same conditions as regards security.
The fact that you are presently reading this means that you have had The fact that you are presently reading this means that you have had
knowledge of the CeCILL license and that you accept its terms. knowledge of the CeCILL license and that you accept its terms.
+*/ +*/
#ifndef __FFTW_UNIFIED_CALLS_HPP #ifndef __FFTW_UNIFIED_CALLS_HPP
#define __FFTW_UNIFIED_CALLS_HPP #define __FFTW_UNIFIED_CALLS_HPP

View File

@ -32,6 +32,7 @@ same conditions as regards security.
The fact that you are presently reading this means that you have had The fact that you are presently reading this means that you have had
knowledge of the CeCILL license and that you accept its terms. knowledge of the CeCILL license and that you accept its terms.
+*/ +*/
#ifndef __COSMOTOOL_FOURIER_HEALPIX_HPP #ifndef __COSMOTOOL_FOURIER_HEALPIX_HPP
#define __COSMOTOOL_FOURIER_HEALPIX_HPP #define __COSMOTOOL_FOURIER_HEALPIX_HPP

View File

@ -32,6 +32,7 @@ same conditions as regards security.
The fact that you are presently reading this means that you have had The fact that you are presently reading this means that you have had
knowledge of the CeCILL license and that you accept its terms. knowledge of the CeCILL license and that you accept its terms.
+*/ +*/
#include <cmath> #include <cmath>
#include <gsl/gsl_integration.h> #include <gsl/gsl_integration.h>
#include "interpolate.hpp" #include "interpolate.hpp"

View File

@ -32,6 +32,7 @@ same conditions as regards security.
The fact that you are presently reading this means that you have had The fact that you are presently reading this means that you have had
knowledge of the CeCILL license and that you accept its terms. knowledge of the CeCILL license and that you accept its terms.
+*/ +*/
#ifndef COSMO_GROWTH_FACTOR_HPP #ifndef COSMO_GROWTH_FACTOR_HPP
#define COSMO_GROWTH_FACTOR_HPP #define COSMO_GROWTH_FACTOR_HPP

View File

@ -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 /* This file contains the functions that read the data from the HDF5 file
* The functions accept the PARAMESH data through arguments. * The functions accept the PARAMESH data through arguments.

View File

@ -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 This file has been developped by P. M. Sutter.
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 /* This file contains the functions that read the data from the HDF5 file
* The functions accept the PARAMESH data through arguments. * The functions accept the PARAMESH data through arguments.

View File

@ -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 */ /* general header file for the HDF 5 IO in FLASH */

View File

@ -32,6 +32,7 @@ same conditions as regards security.
The fact that you are presently reading this means that you have had The fact that you are presently reading this means that you have had
knowledge of the CeCILL license and that you accept its terms. knowledge of the CeCILL license and that you accept its terms.
+*/ +*/
#include <cassert> #include <cassert>
#include <cmath> #include <cmath>
#include <algorithm> #include <algorithm>

View File

@ -32,6 +32,7 @@ same conditions as regards security.
The fact that you are presently reading this means that you have had The fact that you are presently reading this means that you have had
knowledge of the CeCILL license and that you accept its terms. knowledge of the CeCILL license and that you accept its terms.
+*/ +*/
#ifndef __CTOOL_INTERPOLATE_HPP #ifndef __CTOOL_INTERPOLATE_HPP
#define __CTOOL_INTERPOLATE_HPP #define __CTOOL_INTERPOLATE_HPP

View File

@ -32,6 +32,7 @@ same conditions as regards security.
The fact that you are presently reading this means that you have had The fact that you are presently reading this means that you have had
knowledge of the CeCILL license and that you accept its terms. knowledge of the CeCILL license and that you accept its terms.
+*/ +*/
#ifndef __COSMO_INTERPOLATE3D_HPP #ifndef __COSMO_INTERPOLATE3D_HPP
#define __COSMO_INTERPOLATE3D_HPP #define __COSMO_INTERPOLATE3D_HPP

View File

@ -32,6 +32,7 @@ same conditions as regards security.
The fact that you are presently reading this means that you have had The fact that you are presently reading this means that you have had
knowledge of the CeCILL license and that you accept its terms. knowledge of the CeCILL license and that you accept its terms.
+*/ +*/
#ifndef __LEAF_KDTREE_HPP #ifndef __LEAF_KDTREE_HPP
#define __LEAF_KDTREE_HPP #define __LEAF_KDTREE_HPP

View File

@ -32,6 +32,7 @@ same conditions as regards security.
The fact that you are presently reading this means that you have had The fact that you are presently reading this means that you have had
knowledge of the CeCILL license and that you accept its terms. knowledge of the CeCILL license and that you accept its terms.
+*/ +*/
#ifndef __KDTREE_SPLITTERS_HPP #ifndef __KDTREE_SPLITTERS_HPP
#define __KDTREE_SPLITTERS_HPP #define __KDTREE_SPLITTERS_HPP

View File

@ -32,6 +32,7 @@ same conditions as regards security.
The fact that you are presently reading this means that you have had The fact that you are presently reading this means that you have had
knowledge of the CeCILL license and that you accept its terms. knowledge of the CeCILL license and that you accept its terms.
+*/ +*/
/* Reads in FLASH v3 files in HDF5 format */ /* Reads in FLASH v3 files in HDF5 format */
#include <iostream> #include <iostream>

View File

@ -32,6 +32,7 @@ same conditions as regards security.
The fact that you are presently reading this means that you have had The fact that you are presently reading this means that you have had
knowledge of the CeCILL license and that you accept its terms. knowledge of the CeCILL license and that you accept its terms.
+*/ +*/
#ifndef __COSMO_LOAD_FLASH_HPP #ifndef __COSMO_LOAD_FLASH_HPP
#define __COSMO_LOAD_FLASH_HPP #define __COSMO_LOAD_FLASH_HPP

View File

@ -32,6 +32,7 @@ same conditions as regards security.
The fact that you are presently reading this means that you have had The fact that you are presently reading this means that you have had
knowledge of the CeCILL license and that you accept its terms. knowledge of the CeCILL license and that you accept its terms.
+*/ +*/
#include "load_data.hpp" #include "load_data.hpp"
#include "loadFlash.hpp" #include "loadFlash.hpp"

View File

@ -32,6 +32,7 @@ same conditions as regards security.
The fact that you are presently reading this means that you have had The fact that you are presently reading this means that you have had
knowledge of the CeCILL license and that you accept its terms. knowledge of the CeCILL license and that you accept its terms.
+*/ +*/
#include <cmath> #include <cmath>
#include <iostream> #include <iostream>
#include <assert.h> #include <assert.h>
@ -267,10 +268,10 @@ SimuData *CosmoTool::loadGadgetMulti(const char *fname, int id,
void CosmoTool::writeGadget(const char *fname, SimuData *data, int GadgetFormat) void CosmoTool::writeGadget(const std::string& fname, SimuData *data, int GadgetFormat)
{ {
UnformattedWrite *f; UnformattedWrite *f;
int npart[6]; int npart[6], npartTotal[6];
float mass[6]; float mass[6];
if (data->Pos[0] == 0 || data->Vel[0] == 0 || data->Id == 0) if (data->Pos[0] == 0 || data->Vel[0] == 0 || data->Id == 0)
@ -282,12 +283,12 @@ void CosmoTool::writeGadget(const char *fname, SimuData *data, int GadgetFormat)
for (int i = 0; i < 6; i++) for (int i = 0; i < 6; i++)
{ {
npart[i] = 0; npart[i] = npartTotal[i] = 0;
mass[i] = 0; mass[i] = 0;
} }
mass[1] = 1.0; mass[1] = 1.0;
npart[1] = data->NumPart; npart[1] = data->NumPart;
npartTotal[1] = data->TotalNumPart;
f->beginCheckpoint(); f->beginCheckpoint();
for (int i = 0; i < 6; i++) for (int i = 0; i < 6; i++)
@ -301,7 +302,7 @@ void CosmoTool::writeGadget(const char *fname, SimuData *data, int GadgetFormat)
f->writeInt32(0); f->writeInt32(0);
for (int i = 0; i < 6; i++) for (int i = 0; i < 6; i++)
f->writeInt32(npart[i]); f->writeInt32(npartTotal[i]);
f->writeInt32(0); f->writeInt32(0);
f->writeInt32(1); f->writeInt32(1);
f->writeReal64(data->BoxSize); f->writeReal64(data->BoxSize);

View File

@ -32,9 +32,12 @@ same conditions as regards security.
The fact that you are presently reading this means that you have had The fact that you are presently reading this means that you have had
knowledge of the CeCILL license and that you accept its terms. knowledge of the CeCILL license and that you accept its terms.
+*/ +*/
#ifndef __COSMO_LOAD_GADGET_HPP #ifndef __COSMO_LOAD_GADGET_HPP
#define __COSMO_LOAD_GADGET_HPP #define __COSMO_LOAD_GADGET_HPP
#include <string>
#include "load_data.hpp" #include "load_data.hpp"
#include "loadSimu.hpp" #include "loadSimu.hpp"
@ -44,7 +47,7 @@ namespace CosmoTool {
int GadgetFormat = 1, SimuFilter filter = 0); int GadgetFormat = 1, SimuFilter filter = 0);
// Only single snapshot supported // Only single snapshot supported
void writeGadget(const char *fname, SimuData *data, int GadgetFormat = 1); void writeGadget(const std::string& fname, SimuData *data, int GadgetFormat = 1);
}; };

View File

@ -32,6 +32,7 @@ same conditions as regards security.
The fact that you are presently reading this means that you have had The fact that you are presently reading this means that you have had
knowledge of the CeCILL license and that you accept its terms. knowledge of the CeCILL license and that you accept its terms.
+*/ +*/
#include <sys/types.h> #include <sys/types.h>
#include <regex.h> #include <regex.h>
#include <cmath> #include <cmath>

View File

@ -32,6 +32,7 @@ same conditions as regards security.
The fact that you are presently reading this means that you have had The fact that you are presently reading this means that you have had
knowledge of the CeCILL license and that you accept its terms. knowledge of the CeCILL license and that you accept its terms.
+*/ +*/
#ifndef _LOAD_RAMSES_HPP #ifndef _LOAD_RAMSES_HPP
#define _LOAD_RAMSES_HPP #define _LOAD_RAMSES_HPP

View File

@ -32,6 +32,7 @@ same conditions as regards security.
The fact that you are presently reading this means that you have had The fact that you are presently reading this means that you have had
knowledge of the CeCILL license and that you accept its terms. knowledge of the CeCILL license and that you accept its terms.
+*/ +*/
#ifndef __COSMOTOOLBOX_HPP #ifndef __COSMOTOOLBOX_HPP
#define __COSMOTOOLBOX_HPP #define __COSMOTOOLBOX_HPP

View File

@ -32,6 +32,7 @@ same conditions as regards security.
The fact that you are presently reading this means that you have had The fact that you are presently reading this means that you have had
knowledge of the CeCILL license and that you accept its terms. knowledge of the CeCILL license and that you accept its terms.
+*/ +*/
#include <assert.h> #include <assert.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>

View File

@ -32,6 +32,7 @@ same conditions as regards security.
The fact that you are presently reading this means that you have had The fact that you are presently reading this means that you have had
knowledge of the CeCILL license and that you accept its terms. knowledge of the CeCILL license and that you accept its terms.
+*/ +*/
#ifndef _LOAD_GADGET_DATA_HPP #ifndef _LOAD_GADGET_DATA_HPP
#define _LOAD_GADGET_DATA_HPP #define _LOAD_GADGET_DATA_HPP

View File

@ -32,6 +32,7 @@ same conditions as regards security.
The fact that you are presently reading this means that you have had The fact that you are presently reading this means that you have had
knowledge of the CeCILL license and that you accept its terms. knowledge of the CeCILL license and that you accept its terms.
+*/ +*/
#ifndef __COSMO_MACHINE_TEST_HPP #ifndef __COSMO_MACHINE_TEST_HPP
#define __COSMO_MACHINE_TEST_HPP #define __COSMO_MACHINE_TEST_HPP

View File

@ -32,6 +32,7 @@ same conditions as regards security.
The fact that you are presently reading this means that you have had The fact that you are presently reading this means that you have had
knowledge of the CeCILL license and that you accept its terms. knowledge of the CeCILL license and that you accept its terms.
+*/ +*/
#include <cstdlib> #include <cstdlib>
#include <cstdio> #include <cstdio>
#include <cstring> #include <cstring>

View File

@ -32,6 +32,7 @@ same conditions as regards security.
The fact that you are presently reading this means that you have had The fact that you are presently reading this means that you have had
knowledge of the CeCILL license and that you accept its terms. knowledge of the CeCILL license and that you accept its terms.
+*/ +*/
#ifndef _MAK_MINIARGS_HPP #ifndef _MAK_MINIARGS_HPP
#define _MAK_MINIARGS_HPP #define _MAK_MINIARGS_HPP

View File

@ -32,6 +32,7 @@ same conditions as regards security.
The fact that you are presently reading this means that you have had The fact that you are presently reading this means that you have had
knowledge of the CeCILL license and that you accept its terms. knowledge of the CeCILL license and that you accept its terms.
+*/ +*/
#ifndef __HV_KDTREE_HPP #ifndef __HV_KDTREE_HPP
#define __HV_KDTREE_HPP #define __HV_KDTREE_HPP
@ -135,7 +136,13 @@ namespace CosmoTool {
void setPeriodic(bool on, CoordType replicate) void setPeriodic(bool on, CoordType replicate)
{ {
periodic = on; periodic = on;
this->replicate = replicate; std::fill(this->replicate, this->replicate+N, replicate);
}
void setPeriodic(bool on, const coords& replicate)
{
periodic = on;
std::copy(replicate, replicate+N, this->replicate);
} }
uint32_t getIntersection(const coords& x, CoordType r, uint32_t getIntersection(const coords& x, CoordType r,
@ -192,7 +199,7 @@ namespace CosmoTool {
Cell *base_cell; Cell *base_cell;
bool periodic; bool periodic;
CoordType replicate; coords replicate;
Node *buildTree(Cell **cell0, Node *buildTree(Cell **cell0,
uint32_t NumCells, uint32_t NumCells,

View File

@ -32,6 +32,7 @@ same conditions as regards security.
The fact that you are presently reading this means that you have had The fact that you are presently reading this means that you have had
knowledge of the CeCILL license and that you accept its terms. knowledge of the CeCILL license and that you accept its terms.
+*/ +*/
#ifndef _COSMOTOOL_NEWTON_HPP #ifndef _COSMOTOOL_NEWTON_HPP
#define _COSMOTOOL_NEWTON_HPP #define _COSMOTOOL_NEWTON_HPP

View File

@ -32,6 +32,7 @@ same conditions as regards security.
The fact that you are presently reading this means that you have had The fact that you are presently reading this means that you have had
knowledge of the CeCILL license and that you accept its terms. knowledge of the CeCILL license and that you accept its terms.
+*/ +*/
#include <iostream> #include <iostream>
#include <cmath> #include <cmath>
#include <cassert> #include <cassert>

View File

@ -32,6 +32,7 @@ same conditions as regards security.
The fact that you are presently reading this means that you have had The fact that you are presently reading this means that you have had
knowledge of the CeCILL license and that you accept its terms. knowledge of the CeCILL license and that you accept its terms.
+*/ +*/
#ifndef __COSMOTOOL_AMR_HPP #ifndef __COSMOTOOL_AMR_HPP
#define __COSMOTOOL_AMR_HPP #define __COSMOTOOL_AMR_HPP

View File

@ -32,6 +32,7 @@ same conditions as regards security.
The fact that you are presently reading this means that you have had The fact that you are presently reading this means that you have had
knowledge of the CeCILL license and that you accept its terms. knowledge of the CeCILL license and that you accept its terms.
+*/ +*/
#ifndef __COSMO_POOL_HPP #ifndef __COSMO_POOL_HPP
#define __COSMO_POOL_HPP #define __COSMO_POOL_HPP

View File

@ -32,6 +32,7 @@ same conditions as regards security.
The fact that you are presently reading this means that you have had The fact that you are presently reading this means that you have had
knowledge of the CeCILL license and that you accept its terms. knowledge of the CeCILL license and that you accept its terms.
+*/ +*/
#include <cassert> #include <cassert>
#include <vector> #include <vector>
#include <algorithm> #include <algorithm>

View File

@ -32,6 +32,7 @@ same conditions as regards security.
The fact that you are presently reading this means that you have had The fact that you are presently reading this means that you have had
knowledge of the CeCILL license and that you accept its terms. knowledge of the CeCILL license and that you accept its terms.
+*/ +*/
#ifndef _POWERSPECTRUM_HPP #ifndef _POWERSPECTRUM_HPP
#define _POWERSPECTRUM_HPP #define _POWERSPECTRUM_HPP

View File

@ -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 #ifndef __REPLICATE_GENERATOR_HPP
#define __REPLICATE_GENERATOR_HPP #define __REPLICATE_GENERATOR_HPP
@ -12,16 +46,29 @@ namespace CosmoTool
{ {
public: public:
typedef Coord Coords[N]; typedef Coord Coords[N];
Coord replicate; Coords replicate;
ReplicateGenerator(const Coords& x, Coord shift) ReplicateGenerator(const Coords& x, Coord shift)
{ {
face = 0; face = 0;
replicate = shift; std::fill(replicate, replicate+N, shift);
numFaces = spower<N,long>(3); numFaces = spower<N,long>(3);
std::copy(x, x+N, x_base); std::copy(x, x+N, x_base);
if (!next())
abort();
} }
ReplicateGenerator(const Coords& x, Coords& shift)
{
face = 0;
std::copy(shift, shift+N, replicate);
numFaces = spower<N,long>(3);
std::copy(x, x+N, x_base);
if (!next())
abort();
}
bool next() bool next()
{ {
if (face == numFaces) if (face == numFaces)
@ -36,7 +83,7 @@ namespace CosmoTool
int c_face; int c_face;
c_face = q_face % 3; c_face = q_face % 3;
q_face /= 3; q_face /= 3;
x_shifted[i] = x_base[i] + (c_face-1)*replicate; x_shifted[i] = x_base[i] + (c_face-1)*replicate[i];
no_move = no_move && (c_face == 1); no_move = no_move && (c_face == 1);
} }
if (no_move) if (no_move)

View File

@ -32,6 +32,7 @@ same conditions as regards security.
The fact that you are presently reading this means that you have had The fact that you are presently reading this means that you have had
knowledge of the CeCILL license and that you accept its terms. knowledge of the CeCILL license and that you accept its terms.
+*/ +*/
#ifndef __VOID_SPARSE_GRID_HPP #ifndef __VOID_SPARSE_GRID_HPP
#define __VOID_SPARSE_GRID_HPP #define __VOID_SPARSE_GRID_HPP

View File

@ -32,6 +32,7 @@ same conditions as regards security.
The fact that you are presently reading this means that you have had The fact that you are presently reading this means that you have had
knowledge of the CeCILL license and that you accept its terms. knowledge of the CeCILL license and that you accept its terms.
+*/ +*/
#ifndef __COSMOTOOL_SPH_SMOOTH_HPP #ifndef __COSMOTOOL_SPH_SMOOTH_HPP
#define __COSMOTOOL_SPH_SMOOTH_HPP #define __COSMOTOOL_SPH_SMOOTH_HPP

View File

@ -32,6 +32,7 @@ same conditions as regards security.
The fact that you are presently reading this means that you have had The fact that you are presently reading this means that you have had
knowledge of the CeCILL license and that you accept its terms. knowledge of the CeCILL license and that you accept its terms.
+*/ +*/
#ifndef __YORICK_HELPERS_HPP #ifndef __YORICK_HELPERS_HPP
#define __YORICK_HELPERS_HPP #define __YORICK_HELPERS_HPP

View File

@ -32,6 +32,7 @@ same conditions as regards security.
The fact that you are presently reading this means that you have had The fact that you are presently reading this means that you have had
knowledge of the CeCILL license and that you accept its terms. knowledge of the CeCILL license and that you accept its terms.
+*/ +*/
#include "ctool_netcdf_ver.hpp" #include "ctool_netcdf_ver.hpp"
#include "config.hpp" #include "config.hpp"
#ifdef NETCDFCPP4 #ifdef NETCDFCPP4

View File

@ -32,6 +32,7 @@ same conditions as regards security.
The fact that you are presently reading this means that you have had The fact that you are presently reading this means that you have had
knowledge of the CeCILL license and that you accept its terms. knowledge of the CeCILL license and that you accept its terms.
+*/ +*/
#include "ctool_netcdf_ver.hpp" #include "ctool_netcdf_ver.hpp"
#include "config.hpp" #include "config.hpp"
#include <netcdf> #include <netcdf>