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

private type

This commit is contained in:
Anthony Scemama 2018-02-13 13:55:16 +01:00
parent fe3fcd7a12
commit a892f2f125
5 changed files with 13 additions and 40 deletions

View File

@ -18,7 +18,7 @@ let of_nuclei_and_general_basis n b =
and coef = Array.map (fun General_basis.{exponent ; coefficient} ->
coefficient) shell
in
Contracted_shell.create ~expo ~coef ~totAngMom ~center ~index:0)
Contracted_shell.make ~expo ~coef ~totAngMom ~center ~index:0)
) n
|> Array.to_list
|> Array.concat

View File

@ -1,17 +1,8 @@
open Util
open Constants
open Contracted_shell_type
type t = {
expo : float array;
coef : float array;
center : Coordinate.t;
totAngMom : Angular_momentum.t;
size : int;
norm_coef : float array;
norm_coef_scale : float array;
index : int;
powers : Zkey.t array;
}
type t = Contracted_shell_type.t
let size a = a.size
let expo a i = a.expo.(i)
@ -21,10 +12,9 @@ let totAngMom a = a.totAngMom
let norm_coef a i = a.norm_coef.(i)
let norm_coef_scale a = a.norm_coef_scale
let index a = a.index
let with_index a i = { a with index = i }
let with_index = Contracted_shell_type.with_index
let powers a = a.powers
let to_string s =
let coord =
Coordinate.to_Bohr s.center
@ -72,24 +62,5 @@ let compute_norm_coef expo totAngMom =
Array.map (fun x -> let f a = x *. (factor a) in f) expo
let create ~index ~expo ~coef ~center ~totAngMom =
assert (Array.length expo = Array.length coef);
assert (Array.length expo > 0);
let norm_coef_func =
compute_norm_coef expo totAngMom
in
let powers =
Angular_momentum.zkey_array (Angular_momentum.Singlet totAngMom)
in
let norm_coef =
Array.map (fun f -> f [| Angular_momentum.to_int totAngMom ; 0 ; 0 |]) norm_coef_func
in
let norm_coef_scale =
Array.map (fun a ->
(norm_coef_func.(0) (Zkey.to_int_array ~kind:Zkey.Kind_3 a)) /. norm_coef.(0)
) powers
in
{ index ; expo ; coef ; center ; totAngMom ; size=Array.length expo ; norm_coef ;
norm_coef_scale ; powers }
let make = Contracted_shell_type.make

View File

@ -1,4 +1,4 @@
type t
type t = Contracted_shell_type.t
(** Returns the number of contracted Gaussians *)
@ -46,7 +46,7 @@ val powers : t -> Zkey.t array
val to_string : t -> string
(** Creates a contracted shell *)
val create :
val make :
index:int ->
expo:float array ->
coef:float array ->

View File

@ -4,9 +4,11 @@ let of_float x =
assert ( x >= 0. );
x
let to_float x = x
external to_float : t -> float = "%identity"
let to_string x = string_of_float @@ to_float x
let to_string x =
let f = to_float x in string_of_float f
let of_string x = of_float @@ float_of_string x
let of_string x =
let f = float_of_string x in of_float f

View File

@ -1,4 +1,4 @@
type t
type t = private float
val of_float : float -> t
val to_float : t -> float
val to_string : t -> string