mirror of
https://gitlab.com/scemama/QCaml.git
synced 2025-01-03 01:55:40 +01:00
Optimized
This commit is contained in:
parent
1677007e48
commit
92596d872b
@ -267,7 +267,7 @@ let hvrr_two_e_vector (angMom_a, angMom_b, angMom_c, angMom_d)
|
|||||||
else None
|
else None
|
||||||
in
|
in
|
||||||
|
|
||||||
let v2 =
|
let v3 =
|
||||||
let f2 =
|
let f2 =
|
||||||
Array.init nq (fun k ->
|
Array.init nq (fun k ->
|
||||||
let x = expo_inv_q.(k) *. f1.(k) in
|
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
|
if (!do_compute) then
|
||||||
match vrr_v (m+1) angMom_a cmm totAngMom_a (totAngMom_c-2) with
|
match vrr_v (m+1) angMom_a cmm totAngMom_a (totAngMom_c-2) with
|
||||||
| None -> None
|
| None -> None
|
||||||
| Some v2 ->
|
| Some v3 ->
|
||||||
begin
|
begin
|
||||||
let result = Array.make_matrix np nq 0. in
|
let result = Array.make_matrix np nq 0. in
|
||||||
for l=0 to np-1 do
|
for l=0 to np-1 do
|
||||||
for k=0 to nq-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
|
||||||
done;
|
done;
|
||||||
Some result
|
Some result
|
||||||
end
|
end
|
||||||
else None
|
else None
|
||||||
in
|
in
|
||||||
match p1, v1, v2 with
|
match p1, v1, v3 with
|
||||||
| None, None, None -> None
|
| None, None, None -> None
|
||||||
| Some p1, None, None -> Some p1
|
| Some p1, None, None -> Some p1
|
||||||
| None, Some v1, None -> Some v1
|
| None, Some v1, None -> Some v1
|
||||||
| None, None, Some v2 -> Some v2
|
| None, None, Some v3 -> Some v3
|
||||||
| Some p1, Some v1, Some v2 ->
|
| Some p1, Some v1, Some v3 ->
|
||||||
begin
|
begin
|
||||||
for l=0 to np-1 do
|
for l=0 to np-1 do
|
||||||
for k=0 to nq-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
|
||||||
done;
|
done;
|
||||||
Some v2
|
Some v3
|
||||||
end
|
end
|
||||||
| Some p1, Some v1, None ->
|
| Some p1, Some v1, None ->
|
||||||
begin
|
begin
|
||||||
@ -313,23 +313,23 @@ let hvrr_two_e_vector (angMom_a, angMom_b, angMom_c, angMom_d)
|
|||||||
done;
|
done;
|
||||||
Some p1
|
Some p1
|
||||||
end
|
end
|
||||||
| Some p1, None, Some v2 ->
|
| Some p1, None, Some v3 ->
|
||||||
begin
|
begin
|
||||||
for l=0 to np-1 do
|
for l=0 to np-1 do
|
||||||
for k=0 to nq-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
|
||||||
done;
|
done;
|
||||||
Some p1
|
Some p1
|
||||||
end
|
end
|
||||||
| None , Some v1, Some v2 ->
|
| None , Some v1, Some v3 ->
|
||||||
begin
|
begin
|
||||||
for l=0 to np-1 do
|
for l=0 to np-1 do
|
||||||
for k=0 to nq-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
|
||||||
done;
|
done;
|
||||||
Some v2
|
Some v3
|
||||||
end
|
end
|
||||||
in
|
in
|
||||||
if (axyz < 1) || (cxyz < 1) then p2 else
|
if (axyz < 1) || (cxyz < 1) then p2 else
|
||||||
|
1
Makefile
1
Makefile
@ -4,6 +4,7 @@ INCLUDE_DIRS=Nuclei,Utils,Basis
|
|||||||
LIBS=
|
LIBS=
|
||||||
PKGS=
|
PKGS=
|
||||||
OCAMLCFLAGS="-g -warn-error A"
|
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"
|
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)
|
OCAMLBUILD=ocamlbuild -j 0 -cflags $(OCAMLCFLAGS) -lflags $(OCAMLCFLAGS) -Is $(INCLUDE_DIRS) -ocamlopt $(OCAMLOPTFLAGS)
|
||||||
MLLFILES=$(wildcard */*.mll) $(wildcard *.mll) Utils/math_functions.c
|
MLLFILES=$(wildcard */*.mll) $(wildcard *.mll) Utils/math_functions.c
|
||||||
|
Loading…
Reference in New Issue
Block a user