10
1
mirror of https://gitlab.com/scemama/QCaml.git synced 2024-12-22 04:13:33 +01:00

Optimized

This commit is contained in:
Anthony Scemama 2018-02-11 01:17:37 +01:00
parent 1677007e48
commit 92596d872b
2 changed files with 14 additions and 13 deletions

View File

@ -267,7 +267,7 @@ let hvrr_two_e_vector (angMom_a, angMom_b, angMom_c, angMom_d)
else None
in
let v2 =
let v3 =
let f2 =
Array.init nq (fun k ->
let x = expo_inv_q.(k) *. f1.(k) in
@ -278,31 +278,31 @@ let hvrr_two_e_vector (angMom_a, angMom_b, angMom_c, angMom_d)
if (!do_compute) then
match vrr_v (m+1) angMom_a cmm totAngMom_a (totAngMom_c-2) with
| None -> None
| Some v2 ->
| Some v3 ->
begin
let result = Array.make_matrix np nq 0. in
for l=0 to np-1 do
for k=0 to nq-1 do
result.(l).(k) <- v2.(l).(k) *. f2.(k)
result.(l).(k) <- v3.(l).(k) *. f2.(k)
done
done;
Some result
end
else None
in
match p1, v1, v2 with
match p1, v1, v3 with
| None, None, None -> None
| Some p1, None, None -> Some p1
| None, Some v1, None -> Some v1
| None, None, Some v2 -> Some v2
| Some p1, Some v1, Some v2 ->
| None, None, Some v3 -> Some v3
| Some p1, Some v1, Some v3 ->
begin
for l=0 to np-1 do
for k=0 to nq-1 do
v2.(l).(k) <- p1.(l).(k) +. v1.(l).(k) +. v2.(l).(k)
v3.(l).(k) <- p1.(l).(k) +. v1.(l).(k) +. v3.(l).(k)
done
done;
Some v2
Some v3
end
| Some p1, Some v1, None ->
begin
@ -313,23 +313,23 @@ let hvrr_two_e_vector (angMom_a, angMom_b, angMom_c, angMom_d)
done;
Some p1
end
| Some p1, None, Some v2 ->
| Some p1, None, Some v3 ->
begin
for l=0 to np-1 do
for k=0 to nq-1 do
p1.(l).(k) <- p1.(l).(k) +. v2.(l).(k)
p1.(l).(k) <- p1.(l).(k) +. v3.(l).(k)
done
done;
Some p1
end
| None , Some v1, Some v2 ->
| None , Some v1, Some v3 ->
begin
for l=0 to np-1 do
for k=0 to nq-1 do
v2.(l).(k) <- v1.(l).(k) +. v2.(l).(k)
v3.(l).(k) <- v1.(l).(k) +. v3.(l).(k)
done
done;
Some v2
Some v3
end
in
if (axyz < 1) || (cxyz < 1) then p2 else

View File

@ -4,6 +4,7 @@ INCLUDE_DIRS=Nuclei,Utils,Basis
LIBS=
PKGS=
OCAMLCFLAGS="-g -warn-error A"
#OCAMLOPTFLAGS="opt -O3 -nodynlink -remove-unused-arguments -rounds 16 -inline 100 -inline-max-unroll 100 -noassert -unsafe"
OCAMLOPTFLAGS="opt -O3 -nodynlink -remove-unused-arguments -rounds 16 -inline 100 -inline-max-unroll 100"
OCAMLBUILD=ocamlbuild -j 0 -cflags $(OCAMLCFLAGS) -lflags $(OCAMLCFLAGS) -Is $(INCLUDE_DIRS) -ocamlopt $(OCAMLOPTFLAGS)
MLLFILES=$(wildcard */*.mll) $(wildcard *.mll) Utils/math_functions.c