summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulian Weigt <juw@posteo.de>2026-01-09 17:45:18 +0000
committerJulian Weigt <juw@posteo.de>2026-02-04 16:01:09 +0100
commite41103218c5790f192b190dd4d80aec9569ebc01 (patch)
treec44f7c203416f0cd17bafb2e6e7e7b68e13e4908
parent6f1ba57b3f0b4121ee4806b6c1a3aa578bfb4d97 (diff)
Use triangle example instead.triangle
-rw-r--r--charf.c14
1 files changed, 6 insertions, 8 deletions
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);