From e49c3e1ed2cf8cc83515483d8733dfdfba3c4987 Mon Sep 17 00:00:00 2001 From: Guilhem Lavaux Date: Tue, 19 Feb 2013 11:28:50 -0500 Subject: [PATCH] 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; +}