10
1
mirror of https://gitlab.com/scemama/QCaml.git synced 2024-08-29 07:51:59 +02:00

Optimizations swap

This commit is contained in:
Anthony Scemama 2018-01-29 23:51:58 +01:00
parent 9262688642
commit b0a6353ade

View File

@ -89,12 +89,22 @@ let to_file ~filename basis =
let let
shell_q = shell_pairs.(k).(l) shell_q = shell_pairs.(k).(l)
in in
let swap =
Array.length shell_q < Array.length shell_p
in
(* Compute all the integrals of the class *) (* Compute all the integrals of the class *)
let cls = let cls =
if Array.length shell_q < 2 then if swap then
contracted_class_shell_pairs ~schwartz_p ~schwartz_q shell_p shell_q if Array.length shell_p < 2 then
contracted_class_shell_pairs ~schwartz_p:schwartz_q ~schwartz_q:schwartz_p shell_q shell_p
else
contracted_class_shell_pairs_vec ~schwartz_p:schwartz_q ~schwartz_q:schwartz_p shell_q shell_p
else else
contracted_class_shell_pairs_vec ~schwartz_p ~schwartz_q shell_p shell_q if Array.length shell_q < 2 then
contracted_class_shell_pairs ~schwartz_p ~schwartz_q shell_p shell_q
else
contracted_class_shell_pairs_vec ~schwartz_p ~schwartz_q shell_p shell_q
in in
(* Write the data in the output file *) (* Write the data in the output file *)
@ -111,7 +121,10 @@ let to_file ~filename basis =
let l_c = basis.(l).Contracted_shell.indice + l_c + 1 in let l_c = basis.(l).Contracted_shell.indice + l_c + 1 in
let xl = to_int_tuple powers_l in let xl = to_int_tuple powers_l in
let key = let key =
Zkey.of_int_tuple (Zkey.Twelve (xi,xj,xk,xl)) if swap then
Zkey.of_int_tuple (Zkey.Twelve (xk,xl,xi,xj))
else
Zkey.of_int_tuple (Zkey.Twelve (xi,xj,xk,xl))
in in
let value = let value =
Zmap.find cls key Zmap.find cls key