Working on Element.mli

This commit is contained in:
Anthony Scemama 2018-03-03 21:33:32 +01:00
parent 6f633fe37e
commit ac3f079330
5 changed files with 35 additions and 7 deletions

View File

@ -1,13 +1,12 @@
(** This type should be used for all charges in the program (electrons, nuclei,...). *)
type t = private float
(** Float conversion functions *)
val to_float : t -> float
val of_float : float -> t
(** Int conversion functions *)
val to_int : t -> int
val of_int : int -> t
(** String conversion functions *)
val to_string: t -> string
val of_string: string -> t

View File

@ -1,3 +1,5 @@
(** Chemical elements. *)
exception ElementError of string
type t =
@ -10,10 +12,35 @@ type t =
|Pt
(** String conversion functions *)
val of_string : string -> t
(** Creates an {!Element.t} from a chemical symbol or from the full name of the
element (case insensitive).
@raise ElementError upon failure
Examples:
{[
Element.of_string "Fe" -> Element.Fe
Element.of_string "hydrogen" -> Element.H
Element.of_string "pouet" -> ElementError "Element pouet unknown"
]}
*)
val to_string : t -> string
(** Gets the chemical symbol of the {!Element.t} in a string.
Example:
[Element.(to_string Fe) -> "Fe"]
*)
val to_long_string : t -> string
(** Gets the full name of the {!Element.t} in a string.
Example:
[Element.(to_long_string Fe) -> "Iron"]
*)
(** Properties *)
val to_int : t -> int

View File

@ -8,4 +8,5 @@ type t = private {
val make : Point.t -> t
(** Create from a {!Point.t}. *)

View File

@ -8,5 +8,6 @@ type t = private {
val make : Point.t -> t
(** Create from a {!Point.t}. *)

View File

@ -1,9 +1,9 @@
(** Information related to electrons. *)
type t = {
n_alpha : int ; (** Number of alpha electrons *)
n_beta : int ; (** Number of beta electrons *)
multiplicity : int; (** Spin multiplicity: 2S+1 *)
n_alpha : int ; (** Number of alpha electrons *)
n_beta : int ; (** Number of beta electrons *)
multiplicity : int ; (** Spin multiplicity: 2S+1 *)
}