mirror of
https://github.com/TREX-CoE/qmckl.git
synced 2024-08-17 02:41:43 +02:00
Reordering of powers in polynomials
This commit is contained in:
parent
abbc12e160
commit
3852dad53d
@ -2,7 +2,7 @@ COMPILER=GNU
|
|||||||
#COMPILER=INTEL
|
#COMPILER=INTEL
|
||||||
#COMPILER=LLVM
|
#COMPILER=LLVM
|
||||||
|
|
||||||
ifeq($(COMPILER),GNU)
|
ifeq ($(COMPILER),GNU)
|
||||||
CC=gcc -g
|
CC=gcc -g
|
||||||
CFLAGS=-fPIC -fexceptions -Wall -Werror -Wpedantic -Wextra
|
CFLAGS=-fPIC -fexceptions -Wall -Werror -Wpedantic -Wextra
|
||||||
|
|
||||||
@ -12,7 +12,7 @@ FFLAGS=-fPIC -fcheck=all -Waliasing -Wampersand -Wconversion -Wsurprising -Wint
|
|||||||
LIBS=-lgfortran -lm
|
LIBS=-lgfortran -lm
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq($(COMPILER),INTEL)
|
ifeq ($(COMPILER),INTEL)
|
||||||
CC=icc -xHost
|
CC=icc -xHost
|
||||||
CFLAGS=-fPIC -g -O2
|
CFLAGS=-fPIC -g -O2
|
||||||
|
|
||||||
@ -23,7 +23,7 @@ LIBS=-lm -lifcore -lirc
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
#TODO
|
#TODO
|
||||||
ifeq($(COMPILER),LLVM)
|
ifeq ($(COMPILER),LLVM)
|
||||||
CC=clang
|
CC=clang
|
||||||
CFLAGS=-fPIC -g -O2
|
CFLAGS=-fPIC -g -O2
|
||||||
|
|
||||||
|
@ -12,6 +12,7 @@
|
|||||||
#define QMCKL_H
|
#define QMCKL_H
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
#include <math.h>
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
#+BEGIN_SRC f90 :tangle qmckl_f.f90
|
#+BEGIN_SRC f90 :tangle qmckl_f.f90
|
||||||
|
@ -11,7 +11,6 @@
|
|||||||
|
|
||||||
*** Test :noexport:
|
*** Test :noexport:
|
||||||
#+BEGIN_SRC C :tangle test_qmckl_ao.c
|
#+BEGIN_SRC C :tangle test_qmckl_ao.c
|
||||||
#include <math.h>
|
|
||||||
#include "qmckl.h"
|
#include "qmckl.h"
|
||||||
#include "munit.h"
|
#include "munit.h"
|
||||||
MunitResult test_qmckl_ao() {
|
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
|
n=1
|
||||||
dd = 1.d0
|
dd = 1.d0
|
||||||
do d=1,lmax
|
do d=1,lmax
|
||||||
da = 0.d0
|
da = dd
|
||||||
do a=0,d
|
do a=d,0,-1
|
||||||
db = 0.d0
|
db = dd-da
|
||||||
do b=0,d-a
|
do b=d-a,0,-1
|
||||||
c = d - a - b
|
c = d - a - b
|
||||||
dc = dd - da - db
|
dc = dd - da - db
|
||||||
n = n+1
|
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 + &
|
(db-1.d0) * pows(b-2,2) * xz + &
|
||||||
(dc-1.d0) * pows(c-2,3) * xy
|
(dc-1.d0) * pows(c-2,3) * xy
|
||||||
|
|
||||||
db = db + 1.d0
|
db = db - 1.d0
|
||||||
end do
|
end do
|
||||||
da = da + 1.d0
|
da = da - 1.d0
|
||||||
end do
|
end do
|
||||||
dd = dd + 1.d0
|
dd = dd + 1.d0
|
||||||
end do
|
end do
|
||||||
@ -413,7 +412,7 @@ integer(c_int32_t) function test_qmckl_ao_polynomial_vgl(context) bind(C)
|
|||||||
n = 0;
|
n = 0;
|
||||||
ldl = 3;
|
ldl = 3;
|
||||||
ldv = 100;
|
ldv = 100;
|
||||||
|
|
||||||
d = (lmax+1)*(lmax+2)*(lmax+3)/6
|
d = (lmax+1)*(lmax+2)*(lmax+3)/6
|
||||||
|
|
||||||
allocate (L(ldl,d), VGL(ldv,d))
|
allocate (L(ldl,d), VGL(ldv,d))
|
||||||
|
@ -461,7 +461,7 @@ int qmckl_context_get_range(const qmckl_context context) {
|
|||||||
***** TODO Tests :noexport:
|
***** TODO Tests :noexport:
|
||||||
|
|
||||||
**** =qmckl_context_get_epsilon=
|
**** =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
|
#+BEGIN_SRC C :comments org :tangle qmckl.h
|
||||||
double qmckl_context_get_epsilon(const qmckl_context context);
|
double qmckl_context_get_epsilon(const qmckl_context context);
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
@ -470,7 +470,7 @@ double qmckl_context_get_epsilon(const qmckl_context context);
|
|||||||
#+BEGIN_SRC C :tangle qmckl_context.c
|
#+BEGIN_SRC C :tangle qmckl_context.c
|
||||||
double qmckl_context_get_epsilon(const qmckl_context context) {
|
double qmckl_context_get_epsilon(const qmckl_context context) {
|
||||||
const qmckl_context_struct* ctx = (qmckl_context_struct*) 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
|
#+END_SRC
|
||||||
|
|
||||||
|
@ -9,7 +9,6 @@
|
|||||||
|
|
||||||
**** Headers :noexport:
|
**** Headers :noexport:
|
||||||
#+BEGIN_SRC C :comments link :tangle test_qmckl_distance.c
|
#+BEGIN_SRC C :comments link :tangle test_qmckl_distance.c
|
||||||
#include <math.h>
|
|
||||||
#include "qmckl.h"
|
#include "qmckl.h"
|
||||||
#include "munit.h"
|
#include "munit.h"
|
||||||
MunitResult test_qmckl_distance() {
|
MunitResult test_qmckl_distance() {
|
||||||
|
Loading…
Reference in New Issue
Block a user