Return to floating_support_functions.adb CVS log | Up to [local] / OpenXM_contrib / PHC / Ada / Math_Lib / Supports |
File: [local] / OpenXM_contrib / PHC / Ada / Math_Lib / Supports / floating_support_functions.adb (download)
Revision 1.1.1.1 (vendor branch), Sun Oct 29 17:45:27 2000 UTC (23 years, 10 months ago) by maekawa
Import the second public release of PHCpack. OKed by Jan Verschelde. |
package body Floating_Support_Functions is function Maximal_Support ( l : List; v : Vector ) return double_float is sp,max : double_float; tmp : List; begin if not Is_Null(l) then max := Head_Of(l).all*v; tmp := Tail_Of(l); while not Is_Null(tmp) loop sp := Head_Of(tmp).all*v; if sp > max then max := sp; end if; tmp := Tail_Of(tmp); end loop; return max; else return 0.0; end if; end Maximal_Support; function Minimal_Support ( l : List; v : Vector ) return double_float is sp,min : double_float; tmp : List; begin if not Is_Null(l) then min := Head_Of(l).all*v; tmp := Tail_Of(l); while not Is_Null(tmp) loop sp := Head_Of(tmp).all*v; if sp < min then min := sp; end if; tmp := Tail_Of(tmp); end loop; return min; else return 0.0; end if; end Minimal_Support; function Face ( l : List; v : Vector; m,tol : double_float ) return List is res,tmp,res_last : List; d : Vector(v'range); begin tmp := l; while not Is_Null(tmp) loop d := Head_Of(tmp).all; if abs(d*v - m) < tol then Append(res,res_last,d); end if; tmp := Tail_Of(tmp); end loop; return res; end Face; end Floating_Support_Functions;