From e41103218c5790f192b190dd4d80aec9569ebc01 Mon Sep 17 00:00:00 2001 From: Julian Weigt Date: Fri, 9 Jan 2026 17:45:18 +0000 Subject: Use triangle example instead. --- charf.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'charf.c') diff --git a/charf.c b/charf.c index c849c55..9c3dc70 100644 --- a/charf.c +++ b/charf.c @@ -29,10 +29,10 @@ #endif /*maximum length of the support of f*/ -static const int N=24; +static const int N=128; /*maximal order of derivative*/ -static const int K=24; +static const int K=1; /*given function df[0] on domain [0,M-1], compute derivatives f' until f^{(K)} and store f^{(K)} in df*/ void differentiate(VALUETYPE* f, VALUETYPE* df, int D, int k){ @@ -138,9 +138,7 @@ void compute(EXPTYPE p, int D, VALUETYPE* f, VALUETYPE* records){ } - differentiate(df[0],df[1],D,1); - differentiate(dMf[0],dMf[1],D,1); - for(int k=2; k<=K; k++){ + for(int k=1; k<=K; k++){ /*Compute kth derivative of f and Mf from (k-1)th derivative*/ differentiate(df[(k+1)%2],df[k%2],D,1); differentiate(dMf[(k+1)%2],dMf[k%2],D,1); @@ -222,8 +220,8 @@ int generate_triangle(VALUETYPE* f, int i){ /*Writes into f the values of the function indexed by i. Returns the size of the support of f, or -1 if there is no function with that index.*/ int generate_function(VALUETYPE* f, int i){ - return generate_each_charf(f,i); - //return generate_triangle(f,i); + //return generate_each_charf(f,i); + return generate_triangle(f,i); } typedef struct { VALUETYPE* records; int num_thread; int* domain_current; } Args; @@ -235,7 +233,7 @@ void* compute_chunk(void* arguments){ VALUETYPE* records = args -> records; int* domain_current = args -> domain_current; /*exponent p of the L^p norm to consider*/ - EXPTYPE p = int_to_exptype(1); + EXPTYPE p = int_to_exptype(2); VALUETYPE f[N]; int d = generate_function(f,i); -- cgit v1.2.3