Attempts to fix the conjugation in the dot-product

This commit is contained in:
Guilhem Lavaux 2014-03-03 18:27:38 +01:00
parent c724700246
commit 126e1461b9
3 changed files with 11 additions and 4 deletions

View File

@ -212,7 +212,7 @@ double CosmoPower::powerBDM(double k)
double CosmoPower::powerTest(double k) double CosmoPower::powerTest(double k)
{ {
return 1/(1+k*k); return normPower;//1/(1+k*k);
} }
/* /*

View File

@ -254,8 +254,8 @@ namespace CosmoTool
for (long p = 0; p < plane_size; p++) for (long p = 0; p < plane_size; p++)
{ {
long q0 = N0*p, q1 = (p+1)*N0-1; long q0 = N0*p, q1 = (p+1)*N0-1;
result += conj(d1[q0]) * d2[q0]; result += 2*conj(d1[q0]) * d2[q0];
result += conj(d1[q1]) * d2[q1]; result += 2*conj(d1[q1]) * d2[q1];
} }
} }
return result; return result;

View File

@ -138,7 +138,7 @@ namespace CosmoTool
plane_size *= dims[q]; plane_size *= dims[q];
} }
for (long p = 1; p < plane_size/2; p++) for (long p = 1; p < plane_size/2+1; p++)
{ {
long q = (p+1)*dims[0]-1; long q = (p+1)*dims[0]-1;
long q2 = (plane_size-p+1)*dims[0]-1; long q2 = (plane_size-p+1)*dims[0]-1;
@ -147,6 +147,13 @@ namespace CosmoTool
d[q] = conj(d[q2]); d[q] = conj(d[q2]);
} }
for (long p = 1; p < plane_size/2+1; p++)
{
long q = (p)*dims[0];
long q2 = (plane_size-p)*dims[0];
d[q] = conj(d[q2]);
}
if (alleven) if (alleven)
{ {
long q = 0; long q = 0;