summaryrefslogtreecommitdiff
path: root/charf.c
diff options
context:
space:
mode:
authorJulian Weigt <juw@posteo.de>2026-01-07 20:03:55 +0000
committerJulian Weigt <juw@posteo.de>2026-02-04 15:55:50 +0100
commit48a934bb57524c589bfe69653058cca8e3be0a96 (patch)
tree75660dd34f6000f3afc06e71bf9d0c88558a1a7d /charf.c
parentc599e6b5c5bb1890311caf169d58eea97a12c9d6 (diff)
Give int conversion functions better names.
Diffstat (limited to 'charf.c')
-rw-r--r--charf.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/charf.c b/charf.c
index 6c8943b..3dd9d5e 100644
--- a/charf.c
+++ b/charf.c
@@ -28,7 +28,7 @@
#define EXPTYPE double
#endif
-/*length of the support of f*/
+/*maximum length of the support of f*/
static const int N=16;
/*given function df[0] on domain [0,M-1], compute derivatives f' until f^{(K)} and store f^{(K)} in df*/
@@ -54,7 +54,7 @@ void differentiate(VALUETYPE* f, VALUETYPE* df, int D, int K){
/*given function f on domain [0,D-1] compute pth root of integral of |f|^p*/
VALUETYPE integratep(VALUETYPE* f, EXPTYPE p, int D){
- VALUETYPE integralp = convert_int(0);
+ VALUETYPE integralp = int_to_valuetype(0);
for(int i=0;i<D;i++){
VALUETYPE padd = power(absolute(f[i]),p);
integralp = sum(integralp,padd);
@@ -84,7 +84,7 @@ void compute_maximalfunction(VALUETYPE* f, VALUETYPE* Mf, int D){
/*Recursively compute all integrals and averages over intervals of increasing length*/
for(int i=0; i<D; i++){
Sf[i][(i+n)%D] = sum(Sf[i][(i+n-1)%D], f[(i+n)%D]);
- Af[i][(i+n)%D] = ratio(Sf[i][(i+n)%D],convert_int(n+1));
+ Af[i][(i+n)%D] = ratio(Sf[i][(i+n)%D],int_to_valuetype(n+1));
}
}
@@ -177,7 +177,7 @@ int generate_function(VALUETYPE* f, int i){
else {
int t = i-s+1;
/*Set f to the values encoded in bit string t which is a value between 1 and powd = (1<<d)-2.*/
- for(int n=0; n<d; n++) f[n] = convert_int((t >> n) & 1);
+ for(int n=0; n<d; n++) f[n] = int_to_valuetype((t >> n) & 1);
return d;
}
}
@@ -189,7 +189,7 @@ int generate_function(VALUETYPE* f, int i){
void* compute_chunk(void* arguments){
int i = *((int*)arguments);
int K = 3;
- EXPTYPE p = to_exptype(1);
+ EXPTYPE p = int_to_exptype(1);
VALUETYPE f[N];
int d = generate_function(f,i);
@@ -202,7 +202,7 @@ void* compute_chunk(void* arguments){
int main() {
/*exponent p of the L^p norm to consider*/
- EXPTYPE p = to_exptype(1);
+ EXPTYPE p = int_to_exptype(1);
pthread_t threads[NUM_THREADS];
int args[NUM_THREADS];