[BACK]Return to generic_position.adb CVS log [TXT][DIR] Up to [local] / OpenXM_contrib / PHC / Ada / Root_Counts / Implift

File: [local] / OpenXM_contrib / PHC / Ada / Root_Counts / Implift / generic_position.adb (download)

Revision 1.1.1.1 (vendor branch), Sun Oct 29 17:45:28 2000 UTC (23 years, 7 months ago) by maekawa
Branch: PHC, MAIN
CVS Tags: v2, maekawa-ipv6, RELEASE_1_2_3, RELEASE_1_2_2_KNOPPIX_b, RELEASE_1_2_2_KNOPPIX, RELEASE_1_2_2, RELEASE_1_2_1, HEAD
Changes since 1.1: +0 -0 lines

Import the second public release of PHCpack.

OKed by Jan Verschelde.

with Lists_of_Integer_Vectors;           use Lists_of_Integer_Vectors;
with Integer_Support_Functions;          use Integer_Support_Functions;
with Power_Lists;                        use Power_Lists;

function Generic_Position ( p : Poly_Sys; tv : Tree_of_Vectors )
                          return boolean is

-- ALGORITHM :
--   Because tv contains the useful directions for the mixed volume,
--   only the cardinality of the faces of the first support list will be 
--   checked, for all top directions in tv.

  res : boolean := true;
  tmp : Tree_of_Vectors := tv;
  l : List := Create(p(p'first));

begin
  while not Is_Null(tmp) loop
    declare
      nd : Node := Head_Of(tmp);
      fc : List;
    begin
      exit when nd.d'length < Head_Of(l)'length;
      fc := Outer_Face(l,nd.d.all);
      res := (Length_Of(fc) <= 1);
      Deep_Clear(fc);
    end;
    exit when not res;
    tmp := Tail_Of(tmp);
  end loop;
  return res;
end Generic_Position;