Merge branch 'master' of bitbucket.org:glavaux/cosmotool
This commit is contained in:
commit
d724a7be66
11 changed files with 71 additions and 11 deletions
|
@ -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})
|
||||
|
||||
|
|
29
sample/test_cosmopower.cpp
Normal file
29
sample/test_cosmopower.cpp
Normal file
|
@ -0,0 +1,29 @@
|
|||
#include <cmath>
|
||||
#include <iostream>
|
||||
#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;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue