From e6f8e83d1697b779b05f61229ea9b85519459c83 Mon Sep 17 00:00:00 2001 From: Julian Weigt Date: Sun, 21 Dec 2025 17:37:54 +0000 Subject: Add documentation to charf.c. --- charf.c | 56 ++++++++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 46 insertions(+), 10 deletions(-) (limited to 'charf.c') diff --git a/charf.c b/charf.c index 64dd540..eaf1c07 100644 --- a/charf.c +++ b/charf.c @@ -3,16 +3,20 @@ #include +/*given function f on domain [0,D-1], compute derivatives f^{(0)} until f^{(K)} and store them in df*/ void differentiate(double* f, double** df, int D, int K){ df[0] = f; int i; for(int k=1; k<=K; k++){ + /*compute kth derivative of f from (k-1)th*/ + /*only compute derivatives at arguments i < D-k, because for larger i we would need data from outside the domain of f*/ for(i=0; i> i) & 1; //if(i%3==0) f[2*N+i+K/2] = 1; } - r = compute_derivatives(f, Sf, Af, Mf, df, dMf, p, intdf, intdMf, N, D, K); + /*Compute ||Mf^{(k)}||_p/||f^{(k)}||_p.*/ + r = compute_derivatives(f, Sf, Af, Mf, df, dMf, p, intdf, intdMf, D, K); //printf("%.3d: %.3f \n",t,r); + /*Print f and ||Mf^{(k)}||_p/||f^{(k)}||_p if the latter is close to 1/2.*/ if(r>.4997){ printf("f: "); for(int i=0;i