package lutin
Install
dune-project
Dependency
Authors
Maintainers
Sources
md5=4d07d1263dbc90ab18cbaec55a57dcfe
sha512=2e899aee5e44826827b3626771f7ce01241b1745d48f30b60404cc5cbaa44ac608920e9af3bf171275c429a8b823b3cee7542199b7c4c32919b6bb37e33bf8de
doc/lutin/Util/index.html
Module UtilSource
Miscellaneous general purposes functions.
rm x l returns l without x.
rm_first x l returns l without the left-most occurence of x.
list_is_included l1 l2 tests if elements of l1 are included into l2.
count_empty_list llist counts the number of empty list that occurs in the list of list llist
compare 2 elements according to the order defined by a list
Appends two lists and sorts the result
list_are_equals l1 l2 tests if l1 and l2 contains the same elements (in any order).
list_intersec l1 l2 returns all the elements that are both in l1 and l2.
diff_list_as_set l1 l2 returns all the elements that are in l1 and not in l2.
Checks is a list is sorted w.r.t. compare
power a b returns a to the power of b
val list_fold_left3 :
('a -> 'b -> 'c -> 'd -> 'a) ->
'a ->
'b list ->
'c list ->
'd list ->
'aval list_fold_left4 :
('a -> 'b -> 'c -> 'd -> 'e -> 'a) ->
'a ->
'b list ->
'c list ->
'd list ->
'e list ->
'aval list_fold_left5 :
('a -> 'b -> 'c -> 'd -> 'e -> 'f -> 'a) ->
'a ->
'b list ->
'c list ->
'd list ->
'e list ->
'f list ->
'aval list_map4 :
('a -> 'b -> 'c -> 'd -> 'e) ->
'a list ->
'b list ->
'c list ->
'd list ->
'e listval list_map6 :
('a -> 'b -> 'c -> 'd -> 'e -> 'f -> 'g) ->
'a list ->
'b list ->
'c list ->
'd list ->
'e list ->
'f list ->
'g listval list_split6 :
('a * 'b * 'c * 'd * 'e * 'f) list ->
'a list * 'b list * 'c list * 'd list * 'e list * 'f listval list_split7 :
('a * 'b * 'c * 'd * 'e * 'f * 'g) list ->
'a list * 'b list * 'c list * 'd list * 'e list * 'f list * 'g listchecks that a list does not contain any duplicate
Removes duplicates from a list (conserving its order)
Sorts a list of pair which lhs is a string lexicographically w.r.t. to this string.
Merges two lists without introducing duplicates, respecting the original elements ordering.
unfold f i n calls n times f i and returns the n results into a list, e.g., [(f i); (f i); ...; (f i)]. Of course, this makes more sense if f is not side effects free.
call_n_times f i n applies f n times , e.g., f(f(f(f...(f i)))).
is_substring ss s test whether ss a sub-string of s
gauss_draw m d generates a gaussian pseudo-random number of mean m and deviation d. The generation algorithm is based on the so-called << polar form of the Box-Muller transformation >> that I found it at the url http://www.taygeta.com/random/gaussian.html
Ditto, but returns 2 numbers. Indeed, the Box-Muller algorithm computes 2 of them anyway...
I define my own version of print_float to turn around a bug (or is it a bug in ocaml?) of sim2chro where it does not understand floats without digit (e.g., 4. instead of 4.0)
returns the extension of a filename
val my_create_process :
?std_in:Unix.file_descr ->
?std_out:Unix.file_descr ->
?std_err:Unix.file_descr ->
?wait:bool ->
string ->
string list ->
my_create_process_resultgv ps_file calls the post-script visualizer gv on ps_file.
pdf file calls the pdf visualizer xpdf on file.
dot dot_file ps_file calls dot on dot_file and produce its result in pd_file
val get_io_from_lustre :
string ->
string option ->
(string * string) list * (string * string) list