mirror of
https://gitlab.com/scemama/QCaml.git
synced 2024-08-28 23:42:00 +02:00
Optimization
This commit is contained in:
parent
9365e69488
commit
fb8fff6ee1
@ -92,8 +92,7 @@ let hvrr_two_e (angMom_a, angMom_b, angMom_c, angMom_d)
|
|||||||
Printf.printf "vrr : %d %d : %d %d %d %d %d %d\n" totAngMom_a totAngMom_c angMom_a.(0) angMom_a.(1) angMom_a.(2) angMom_c.(0) angMom_c.(1) angMom_c.(2);
|
Printf.printf "vrr : %d %d : %d %d %d %d %d %d\n" totAngMom_a totAngMom_c angMom_a.(0) angMom_a.(1) angMom_a.(2) angMom_c.(0) angMom_c.(1) angMom_c.(2);
|
||||||
|
|
||||||
match (totAngMom_a, totAngMom_c) with
|
match (totAngMom_a, totAngMom_c) with
|
||||||
| (0,0) -> zero_m_array
|
| (i,0) -> if (i>0) then vrr0 angMom_a totAngMom_a else zero_m_array
|
||||||
| (_,0) -> vrr0 angMom_a totAngMom_a
|
|
||||||
| (_,_) ->
|
| (_,_) ->
|
||||||
|
|
||||||
let maxsze = maxm+1 in
|
let maxsze = maxm+1 in
|
||||||
@ -190,7 +189,6 @@ let hvrr_two_e (angMom_a, angMom_b, angMom_c, angMom_d)
|
|||||||
in
|
in
|
||||||
v1.(0) +. f2 *. v2.(0)
|
v1.(0) +. f2 *. v2.(0)
|
||||||
| _ ->
|
| _ ->
|
||||||
|
|
||||||
let ap = [| angMom_a.(0) ; angMom_a.(1) ; angMom_a.(2) |]
|
let ap = [| angMom_a.(0) ; angMom_a.(1) ; angMom_a.(2) |]
|
||||||
and bm = [| angMom_b.(0) ; angMom_b.(1) ; angMom_b.(2) |]
|
and bm = [| angMom_b.(0) ; angMom_b.(1) ; angMom_b.(2) |]
|
||||||
and xyz =
|
and xyz =
|
||||||
|
@ -92,8 +92,10 @@ let hvrr_two_e_vector (angMom_a, angMom_b, angMom_c, angMom_d)
|
|||||||
and vrr_v m angMom_a angMom_c totAngMom_a totAngMom_c =
|
and vrr_v m angMom_a angMom_c totAngMom_a totAngMom_c =
|
||||||
|
|
||||||
match (totAngMom_a, totAngMom_c) with
|
match (totAngMom_a, totAngMom_c) with
|
||||||
| (0,0) -> Array.mapi (fun k c -> c *. zero_m_array.(k).(m)) coef_prod
|
| (i,0) -> if (i=0) then
|
||||||
| (_,0) -> vrr0_v m angMom_a totAngMom_a
|
Array.mapi (fun k c -> c *. zero_m_array.(k).(m)) coef_prod
|
||||||
|
else
|
||||||
|
vrr0_v m angMom_a totAngMom_a
|
||||||
| (_,_) ->
|
| (_,_) ->
|
||||||
|
|
||||||
let key = Zkey.of_int_tuple (Zkey.Six
|
let key = Zkey.of_int_tuple (Zkey.Six
|
||||||
|
5
Makefile
5
Makefile
@ -38,6 +38,11 @@ doc: qpackage.odocl
|
|||||||
$(OCAMLBUILD) $*.native -use-ocamlfind $(PKGS)
|
$(OCAMLBUILD) $*.native -use-ocamlfind $(PKGS)
|
||||||
ln -s $*.native $*
|
ln -s $*.native $*
|
||||||
|
|
||||||
|
%.p.native: $(MLFILES) $(MLIFILES) $(MLLFILES) $(MLYFILES)
|
||||||
|
rm -f -- $*
|
||||||
|
$(OCAMLBUILD) $*.p.native -use-ocamlfind $(PKGS)
|
||||||
|
ln -s $*.p.native $*
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -rf _build $(ALL_EXE) $(ALL_TESTS) *.native *.byte
|
rm -rf _build $(ALL_EXE) $(ALL_TESTS) *.native *.byte
|
||||||
|
|
||||||
|
@ -23,7 +23,7 @@ let rec p_gamma a x loggamma_a =
|
|||||||
else if x = 0. then 0.
|
else if x = 0. then 0.
|
||||||
else
|
else
|
||||||
let rec pg_loop prev res term k =
|
let rec pg_loop prev res term k =
|
||||||
if k > 1000. then failwith "p_gamma could not converge."
|
if k > 1000. then failwith "p_gamma did not converge."
|
||||||
else if prev = res then res
|
else if prev = res then res
|
||||||
else
|
else
|
||||||
let term = term *. x /. (a +. k) in
|
let term = term *. x /. (a +. k) in
|
||||||
@ -36,7 +36,7 @@ let rec p_gamma a x loggamma_a =
|
|||||||
if x < 1. +. a then 1. -. p_gamma a x loggamma_a
|
if x < 1. +. a then 1. -. p_gamma a x loggamma_a
|
||||||
else
|
else
|
||||||
let rec qg_loop prev res la lb w k =
|
let rec qg_loop prev res la lb w k =
|
||||||
if k > 1000. then failwith "q_gamma could not converge."
|
if k > 1000. then failwith "q_gamma did not converge."
|
||||||
else if prev = res then res
|
else if prev = res then res
|
||||||
else
|
else
|
||||||
let k_inv = 1. /. k in
|
let k_inv = 1. /. k in
|
||||||
@ -69,8 +69,6 @@ let rec boys_function ~maxm t =
|
|||||||
Array.init (maxm+1) (fun m -> 1. /. float_of_int (m+m+1))
|
Array.init (maxm+1) (fun m -> 1. /. float_of_int (m+m+1))
|
||||||
else
|
else
|
||||||
let incomplete_gamma ~alpha x =
|
let incomplete_gamma ~alpha x =
|
||||||
(* (gamma_float alpha) *. ( Gsl.Sf.gamma_inc_P alpha x )
|
|
||||||
*)
|
|
||||||
let gf = gamma_float alpha in
|
let gf = gamma_float alpha in
|
||||||
gf *. p_gamma alpha x (log gf)
|
gf *. p_gamma alpha x (log gf)
|
||||||
in
|
in
|
||||||
|
Loading…
Reference in New Issue
Block a user