diff options
| author | Julian Weigt <juw@posteo.de> | 2025-12-21 17:48:45 +0000 |
|---|---|---|
| committer | Julian Weigt <juw@posteo.de> | 2026-02-04 15:55:45 +0100 |
| commit | f125289427088845a00994dfce6d0e31c1141195 (patch) | |
| tree | 7d8aec03bc9729da5f65221e23376e5108dd0e3e /charf.c | |
| parent | e6f8e83d1697b779b05f61229ea9b85519459c83 (diff) | |
formulations in charf.c
Diffstat (limited to 'charf.c')
| -rw-r--r-- | charf.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -103,7 +103,7 @@ int N=16; /*length of the domain*/ int D=5*N; -/*order of the derivative to consider*/ +/*order of the derivative to consider. Should not be larger than (D-N)/2 because then the support of f^{(K)} reaches outside of our domain.*/ int K=3; /*exponent p of the L^p norm to consider*/ @@ -135,8 +135,8 @@ for(int k=0;k<=K;k++){ dMf[0] = Mf; /*Allocate memory for integrals*/ -double* intdf = malloc(sizeof(double)*K); -double* intdMf = malloc(sizeof(double)*K); +double* intdf = malloc(K*sizeof(double)); +double* intdMf = malloc(K*sizeof(double)); /*Allocate memory for ||Mf^{(k)}||_p/||f^{(k)}||_p.*/ double r = 0.0; @@ -148,7 +148,7 @@ for(int t=1; t<=(1 << N)-1; t++){ //for(int i=0;i<N;i++) f[N+i] = rand() %2; /*In the middle of the domain set f to the values encoded in bit string t*/ for(int i=0;i<N;i++){ - /*Since we care about the Kth derivative, which in i depends on f on [i,i+K], shift f to the right by k/2 so that the most interesting part of f^{(K)} and Mf^{(K)} will be around the center of the domain*/ + /*Since we care about the Kth derivative, which in i depends on f on [i,i+K], shift f to the right by K/2 so that the most interesting part of f^{(K)} and Mf^{(K)} will be around the center of the domain*/ f[2*N+i+K/2] = (t >> i) & 1; //if(i%3==0) f[2*N+i+K/2] = 1; } |
