diff --git a/Basis/TwoElectronIntegralsNonSeparable.ml b/Basis/TwoElectronIntegralsNonSeparable.ml index 39b12b8..5d73675 100644 --- a/Basis/TwoElectronIntegralsNonSeparable.ml +++ b/Basis/TwoElectronIntegralsNonSeparable.ml @@ -235,7 +235,7 @@ module Make(Zero_m : Zero_mType) = struct let t0 = Unix.gettimeofday () in let ishell = ref max_int in - let input_stream = Stream.of_list (List.rev shell_pairs) in + let input_stream = Stream.of_list shell_pairs in let f shell_p = let () = @@ -248,31 +248,33 @@ module Make(Zero_m : Zero_mType) = struct in let result = ref [] in - try - List.iter (fun shell_q -> - let () = - if Cs.index (Csp.shell_a shell_q) > - Cs.index (Csp.shell_a shell_p) then - raise Exit - in - let sq = Csp.shell_pairs shell_q in - let cspc = - if Array.length sp < Array.length sq then - Cspc.make ~cutoff shell_p shell_q - else - Cspc.make ~cutoff shell_q shell_p - in - - match cspc with - | Some cspc -> - let cls = - class_of_contracted_shell_pair_couple cspc + let () = + try + List.iter (fun shell_q -> + let () = + if Cs.index (Csp.shell_a shell_q) > + Cs.index (Csp.shell_a shell_p) then + raise Exit in - result := (store_class_parallel ~cutoff cspc cls) :: !result; - | None -> () - ) shell_pairs; - raise Exit - with Exit -> List.concat !result |> Array.of_list + let sq = Csp.shell_pairs shell_q in + let cspc = + if Array.length sp < Array.length sq then + Cspc.make ~cutoff shell_p shell_q + else + Cspc.make ~cutoff shell_q shell_p + in + + match cspc with + | Some cspc -> + let cls = + class_of_contracted_shell_pair_couple cspc + in + result := (store_class_parallel ~cutoff cspc cls) :: !result; + | None -> () + ) shell_pairs; + with Exit -> () + in + List.concat !result |> Array.of_list in let eri_array =