Fix for interpolation class. KDTree leaf counting fix.

This commit is contained in:
Your Name 2011-01-15 16:01:50 +01:00
parent 36cd54193f
commit f4aac855a2
3 changed files with 6 additions and 2 deletions

View File

@ -75,6 +75,8 @@ const Interpolate& Interpolate::operator=(const Interpolate& a)
spline = gsl_spline_alloc (gsl_interp_linear, a.spline->size);
accel_interp = gsl_interp_accel_alloc ();
gsl_spline_init(spline, a.spline->x, a.spline->y, a.spline->size);
logx = a.logx;
logy = a.logy;
}
double Interpolate::getMaxX() const

View File

@ -70,9 +70,11 @@ namespace CosmoTool {
uint32_t getNumberInNode(const Node *n) const { return n->numNodes; }
#else
uint32_t getNumberInNode(const Node *n) const {
if (n->leaf)
return 1;
if (n == 0)
return 0;
return 1+getNumberInNode(n->children[0])+getNumberInNode(n->children[1]);
return getNumberInNode(n->children[0])+getNumberInNode(n->children[1]);
}
#endif

View File

@ -21,7 +21,7 @@ using namespace std;
#define POWER_BDM 7
#define POWER_TEST 8
#define POWER_SPECTRUM HU_BARYON
#define POWER_SPECTRUM HU_WIGGLES
namespace Cosmology {