123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566(******************************************************************************)(* This file is an extension for the Generator1 module from the apron Library *)(******************************************************************************)openApron(* It only adds function, nothing is removed *)includeApron.Generator1includeArray_maker.GeneratorExttypefloat_point=floatarray(* Converts a Generator0 into an array of floats. *)letto_float_array(gen:Generator0.t)size:float_point=letgen_lin=gen.Generator0.linexpr0inArray.init size(funi->letcoeff=Linexpr0.get_coeffgen_liniinCoeffext.to_floatcoeff)(* Converts a Generator1.earray into an array of float_points *)letto_float_array(gens:Generator1.earray):float_pointarray=letsize=Environmentext.size(array_getgens0).envinletgen_tab=gens.Generator1.generator0_arrayinArray.init(Array.lengthgen_tab)(funi->to_float_arraygen_tab.(i)size)(* constructs a new generator in opposite direction *)letneg(d:Generator1.t):Generator1.t=letd=Generator1.copydinGenerator1.iter(funcv->Generator1.set_coeffdv(Coeff.negc))d;d(*returns a generator corresponding to a float point*)letof_rational_pointenvcoeffs=letl=Linexpr1.makeenvinletcoeffs=List.mapi(funie->(Coeff.s_of_mpqfe),Environmentext.var_of_dimenvi)coeffsinLinexpr1.set_listlcoeffsNone;makelVERTEX(*returns a generator corresponding to a float point*)letof_float_pointenvcoeffs=letl=Linexpr1.makeenvinletcoeffs=List.mapi(funie->(Coeff.s_of_floate),Environmentext.var_of_dimenvi)coeffsinLinexpr1.set_listlcoeffsNone;makelVERTEXletto_vertices2D(g:t)xy=letl=get_linexpr1ginLinexpr1.(Coeffext.(to_float(get_coefflx),to_float(get_coeffly)))letto_vertices2D_s(g:t)xy=to_vertices2Dg(Apron.Var.of_stringx)(Apron.Var.of_stringy)letto_vertices3D(g:t)xyz=letl=get_linexpr1ginLinexpr1.(Coeffext.(to_float(get_coefflx),to_float(get_coeffly),to_float(get_coefflz)))letto_vertices3D_s(g:t)xyz=to_vertices3Dg(Apron.Var.of_stringx)(Apron.Var.of_stringy)(Apron.Var.of_stringz)