Module Value


module Value: sig .. end
Module: Value Description: basic data type in the vectorial faust interpreter.
Author(s): WANG Haisheng Created: 31/05/2013 Modified: 03/06/2013

exception Convert_Error of string
Exception raised in convertions between float/int and type 'Value'.
exception Value_operation of string
Exception raised in type 'Value' operations.

type value_macro =
| Faust_Max_int
| Faust_Min_int
| Faust_Bits_int
Macro constants of the file.
val value_macro_to_int : value_macro -> int
val value_macro_to_value : value_macro -> int.
val return_N : int -> Types.value
val return_N : int -> value, convert from int to value N.
val return_R : float -> Types.value
val return_R : float -> value, convert from float to value R.
val return_Vec : int * (int -> Types.value) -> Types.value
val return_Vec : int * (int -> value) -> value, convert (size, vec) to value Vec.
val fail : Types.value
val fail, return value W.
val take_off_N : Types.value -> int
val take_off_N : value -> int, convert from value N to int. Attention: Zero and W are converted to 0.
val take_off_R : Types.value -> float
val take_off_R : value -> float, convert from value R to float. Attention: Zero and W are converted to 0.0, int converted to float.
val convert_back_R : Types.value -> float array
val convert_back_r : value -> float array, return a float array of size 1 if v is N|R|Zero|W, a float array of size n if v is Vec.
val string_of_value : Types.value -> string
val string_of_value : value -> string, converts value to following strings "N i" | "R f" | "Vec" | "Zero" | "W".
val print_value_list : Types.value list -> unit
val print_value_list: value list -> unit, prints to console the value list.
val factory_add_memory : (int -> 'a) -> int -> int -> 'a
val factory_add_memory : (int -> 'b) -> int -> (int -> 'b), factory_add_memory f n adds a memory of size n to fun f.
val v_memory : Types.value -> Types.value
val v_memory : value -> value, returns value Vec with memory.
val v_list_memory : Types.value list -> Types.value list
val v_list_memory : value list -> value list, returns value list with memory.
val make_vector : int -> (int -> Types.value) -> Types.value
val make_vector : int -> (int -> value) -> value, make_vector size vec, return a value Vec of (size, vec).
val normalize : Types.value -> Types.value
val normalize: value -> value, normalize value to bounded -2147483648,2147483647.
val v_add : Types.value -> Types.value -> Types.value
val v_add : value -> value -> value, value addition, recursive for value.Vec.
val (+~) : Types.value -> Types.value -> Types.value
val (+~) : value -> value -> value, operator of v_add.
val v_neg : Types.value -> Types.value
val v_neg : value -> value, v_neg v = -v.
val v_sub : Types.value -> Types.value -> Types.value
val v_sub : value -> value -> value, returns (v1 - v2).
val (-~) : Types.value -> Types.value -> Types.value
val (-~) : value -> value -> value, operator of v_sub.
val v_mul : Types.value -> Types.value -> Types.value
val v_mul : value -> value -> value, returns (v1 * v2), recursive for value.Vec.
val ( *~ ) : Types.value -> Types.value -> Types.value
val ( *~ ) : value -> value -> value, operator of v_mul.
val v_recip : Types.value -> Types.value
val v_recip : value -> value, v_recip v = 1./.v.
val v_div : Types.value -> Types.value -> Types.value
val v_div : value -> value -> value, value division, returns (v1/.v2).
val (/~) : Types.value -> Types.value -> Types.value
val (/~) : value -> value -> value, operator of v_div.
val v_zero : Types.value -> Types.value
val v_zero : value -> value, Attention: N i -> N 0 | R f -> R 0. | Zero -> Zero | W -> R 0., and recursive for value.Vec.
val v_floor : Types.value -> Types.value
val v_floor : value -> value, returns floor of float, converts int to float, Zero to 0., error to error, recursive for value.Vec.
val v_int : Types.value -> Types.value
val v_int : value -> value, converts value to value.N, error to error, recursive for value.Vec.
val v_sin : Types.value -> Types.value
val v_sin : value -> value, returns sin(v), recursive for value.Vec.
val v_cos : Types.value -> Types.value
val v_cos : value -> value, returns cos(v), recursive for value.Vec.
val v_atan : Types.value -> Types.value
val v_atan : value -> value, returns atan(v), recursive for value.Vec.
val v_atantwo : Types.value -> Types.value -> Types.value
val v_atantwo : value -> value, returns atantwo(v), recursive for value.Vec.
val v_sqrt : Types.value -> Types.value
val v_sqrt : value -> value, returns sqrt(v), recursive for value.Vec.
val v_mod : Types.value -> Types.value -> Types.value
val v_mod : value -> value -> value, returns (v1 % v2), recursive for value.Vec.
val v_larger_than_zero : Types.value -> Types.value
val v_larger_than_zero : value -> value, primitive comparison between value and zero, returns value.N 1 if true, value.N 0 if false.
val v_sup : Types.value -> Types.value -> Types.value
val v_sup : value -> value -> value, comparison of two values, returns value.N 1 if (v1 > v2), value.N 0 else.
val v_inf : Types.value -> Types.value -> Types.value
val v_inf : value -> value -> value, comparison of two values, returns value.N 1 if (v1 < v2), value.N 0 else.