1
0
mirror of https://github.com/TREX-CoE/qmckl.git synced 2024-12-22 12:23:56 +01:00

Reordering of powers in polynomials

This commit is contained in:
Anthony Scemama 2020-11-06 12:10:20 +01:00
parent abbc12e160
commit 3852dad53d
5 changed files with 13 additions and 14 deletions

View File

@ -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

View File

@ -12,6 +12,7 @@
#define QMCKL_H
#include <stdlib.h>
#include <stdint.h>
#include <math.h>
#+END_SRC
#+BEGIN_SRC f90 :tangle qmckl_f.f90

View File

@ -11,7 +11,6 @@
*** Test :noexport:
#+BEGIN_SRC C :tangle test_qmckl_ao.c
#include <math.h>
#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))

View File

@ -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

View File

@ -9,7 +9,6 @@
**** Headers :noexport:
#+BEGIN_SRC C :comments link :tangle test_qmckl_distance.c
#include <math.h>
#include "qmckl.h"
#include "munit.h"
MunitResult test_qmckl_distance() {