diff --git a/src/Makefile b/src/Makefile index 295b783..7f78a9b 100644 --- a/src/Makefile +++ b/src/Makefile @@ -2,7 +2,7 @@ COMPILER=GNU #COMPILER=INTEL #COMPILER=LLVM -ifeq($(COMPILER),GNU) +ifeq ($(COMPILER),GNU) CC=gcc -g CFLAGS=-fPIC -fexceptions -Wall -Werror -Wpedantic -Wextra @@ -12,7 +12,7 @@ FFLAGS=-fPIC -fcheck=all -Waliasing -Wampersand -Wconversion -Wsurprising -Wint LIBS=-lgfortran -lm endif -ifeq($(COMPILER),INTEL) +ifeq ($(COMPILER),INTEL) CC=icc -xHost CFLAGS=-fPIC -g -O2 @@ -23,7 +23,7 @@ LIBS=-lm -lifcore -lirc endif #TODO -ifeq($(COMPILER),LLVM) +ifeq ($(COMPILER),LLVM) CC=clang CFLAGS=-fPIC -g -O2 diff --git a/src/qmckl.org b/src/qmckl.org index 7620883..ce5a3ce 100644 --- a/src/qmckl.org +++ b/src/qmckl.org @@ -12,6 +12,7 @@ #define QMCKL_H #include #include +#include #+END_SRC #+BEGIN_SRC f90 :tangle qmckl_f.f90 diff --git a/src/qmckl_ao.org b/src/qmckl_ao.org index fbf97b7..4371cd9 100644 --- a/src/qmckl_ao.org +++ b/src/qmckl_ao.org @@ -11,7 +11,6 @@ *** Test :noexport: #+BEGIN_SRC C :tangle test_qmckl_ao.c -#include #include "qmckl.h" #include "munit.h" MunitResult test_qmckl_ao() { @@ -308,10 +307,10 @@ integer function qmckl_ao_polynomial_vgl_f(context, X, R, lmax, n, L, ldl, VGL, n=1 dd = 1.d0 do d=1,lmax - da = 0.d0 - do a=0,d - db = 0.d0 - do b=0,d-a + da = dd + do a=d,0,-1 + db = dd-da + do b=d-a,0,-1 c = d - a - b dc = dd - da - db n = n+1 @@ -338,9 +337,9 @@ integer function qmckl_ao_polynomial_vgl_f(context, X, R, lmax, n, L, ldl, VGL, (db-1.d0) * pows(b-2,2) * xz + & (dc-1.d0) * pows(c-2,3) * xy - db = db + 1.d0 + db = db - 1.d0 end do - da = da + 1.d0 + da = da - 1.d0 end do dd = dd + 1.d0 end do @@ -413,7 +412,7 @@ integer(c_int32_t) function test_qmckl_ao_polynomial_vgl(context) bind(C) n = 0; ldl = 3; ldv = 100; - + d = (lmax+1)*(lmax+2)*(lmax+3)/6 allocate (L(ldl,d), VGL(ldv,d)) diff --git a/src/qmckl_context.org b/src/qmckl_context.org index e407466..5359470 100644 --- a/src/qmckl_context.org +++ b/src/qmckl_context.org @@ -461,7 +461,7 @@ int qmckl_context_get_range(const qmckl_context context) { ***** TODO Tests :noexport: **** =qmckl_context_get_epsilon= - Returns $\epsilon = 2 / \log_{10} 2^{n-1}$ where =n= is the precision + Returns $\epsilon = 2^{1-n}$ where =n= is the precision #+BEGIN_SRC C :comments org :tangle qmckl.h double qmckl_context_get_epsilon(const qmckl_context context); #+END_SRC @@ -470,7 +470,7 @@ double qmckl_context_get_epsilon(const qmckl_context context); #+BEGIN_SRC C :tangle qmckl_context.c double qmckl_context_get_epsilon(const qmckl_context context) { const qmckl_context_struct* ctx = (qmckl_context_struct*) context; - return 1.0 / ((double) ((int64_t) 1 << (ctx->precision-1))); + return pow(2.0,(double) 1-ctx->precision); } #+END_SRC diff --git a/src/qmckl_distance.org b/src/qmckl_distance.org index 06c8015..5eac91d 100644 --- a/src/qmckl_distance.org +++ b/src/qmckl_distance.org @@ -9,7 +9,6 @@ **** Headers :noexport: #+BEGIN_SRC C :comments link :tangle test_qmckl_distance.c -#include #include "qmckl.h" #include "munit.h" MunitResult test_qmckl_distance() {