Added possibility to do partial normalization
This commit is contained in:
parent
535f25d710
commit
b7392204ad
3 changed files with 10 additions and 6 deletions
|
@ -262,12 +262,16 @@ double CosmoPower::integrandNormalize(double x)
|
|||
return power(k)*k*k*f*f/(x*x);
|
||||
}
|
||||
|
||||
void CosmoPower::normalize()
|
||||
void CosmoPower::normalize(double k_max)
|
||||
{
|
||||
double normVal = 0;
|
||||
double abserr;
|
||||
gsl_integration_workspace *w = gsl_integration_workspace_alloc(NUM_ITERATION);
|
||||
gsl_function f;
|
||||
double x_min = 0;
|
||||
|
||||
if (k_max > 0)
|
||||
x_min = 1/(1+k_max);
|
||||
|
||||
f.function = gslPowSpecNorm;
|
||||
f.params = this;
|
||||
|
@ -282,7 +286,7 @@ void CosmoPower::normalize()
|
|||
}
|
||||
|
||||
// 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_qag(&f, x_min, 1, 0, TOLERANCE, NUM_ITERATION, GSL_INTEG_GAUSS61, w, &normVal, &abserr);
|
||||
gsl_integration_workspace_free(w);
|
||||
|
||||
normVal /= (2*M_PI*M_PI);
|
||||
|
|
|
@ -92,7 +92,7 @@ namespace CosmoTool {
|
|||
|
||||
void updateCosmology();
|
||||
void updatePhysicalCosmology();
|
||||
void normalize();
|
||||
void normalize(double k_max = -1);
|
||||
void setNormalization(double A_K);
|
||||
void updateHuWigglesConsts();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue