sig
type schema_t = int array
type variable =
BnType.variable = {
vname : string;
idx : int;
range : int;
valnames : string array;
}
type cpnode =
BnType.cpnode =
Leaf of float array
| Vertex of int * int * Bn.cpnode * Bn.cpnode
type cpd =
BnType.cpd =
Table of float array array
| Tree of Bn.cpnode
| FactorSet of Mn.Factor.factor list
type network =
BnType.network = {
name : string;
mutable acyclic : bool;
vars : Bn.variable array;
parents : int list array;
dists : Bn.cpd array;
children : int list array;
name_to_varidx : (string, int) Ext.Hashtbl.t;
name_to_validx : (string, int) Ext.Hashtbl.t array;
topo_vars : Bn.variable array;
}
val get_range : Bn.network -> int -> int
val schema : Bn.network -> Bn.schema_t
val tree_params : Bn.cpnode -> int
val dist_params : Bn.cpd -> int
val tree_parents : int -> Bn.cpnode -> int list
val numvars : Bn.network -> int
val varname : Bn.network -> int -> string
val idx : Bn.variable -> int
val parents : Bn.network -> int -> int list
val children : Bn.network -> int -> int list
val numparents : Bn.network -> int -> int
val numchildren : Bn.network -> int -> int
val numparams : Bn.network -> int -> int
val create_var : int -> int -> Bn.variable
val create_default_cpt : Bn.variable -> Bn.cpd
val build_namehashes :
Bn.variable array ->
(string, int) Ext.Hashtbl.t * (string, int) Ext.Hashtbl.t array
val make_children : int list array -> int list array
val make_topo_vars :
Bn.variable array -> 'a list array -> int list array -> Bn.variable array
val create_empty_network : int array -> Bn.network
val update_children_and_topo_vars : Bn.network -> unit
val set_cpt : Bn.network -> int -> int list -> float array array -> unit
val set_cptree : Bn.network -> int -> Bn.cpnode -> unit
val set_factorset : Bn.network -> int -> Mn.Factor.factor list -> unit
val cpd_to_factors :
Bn.network -> Mn.Factor.variable -> Bn.cpd -> Mn.Factor.factor list
val to_mn : Bn.network -> Mn.network
val simplify : Bn.network -> Mn.Factor.varvalue array -> Bn.network
val tree_logprob : int array -> Bn.cpnode -> float array
val node_logscore : Bn.network -> Mn.Factor.varvalue array -> int -> float
val mb_logprob :
Bn.network -> Mn.Factor.varvalue array -> int -> float array
val mb_prob : Bn.network -> Mn.Factor.varvalue array -> int -> float array
val cond_prob :
Bn.network -> Mn.Factor.varvalue array -> int -> float array
val loglikelihood : Bn.network -> Mn.Factor.varvalue array -> float
val pll : Bn.network -> Mn.Factor.varvalue array -> float
val sample_array : float array -> int
val sample : Bn.network -> Mn.Factor.varvalue array
val load_bif : Pervasives.in_channel -> BnType.network
val output_bif : Pervasives.out_channel -> BnType.network -> unit
val load_xmod : Pervasives.in_channel -> BnType.network
val output_xmod : Pervasives.out_channel -> BnType.network -> unit
val load_cn : Pervasives.in_channel -> BnType.network
val output_cn : Pervasives.out_channel -> BnType.network -> unit
val filename_is_xmod : string -> bool
val filename_is_bif : string -> bool
val filename_is_cn : string -> bool
val filename_is_dn : string -> bool
val load_auto : string -> BnType.network
val write_auto : string -> BnType.network -> unit
end