[BACK]Return to reduction_of_nonsquare_systems.adb CVS log [TXT][DIR] Up to [local] / OpenXM_contrib / PHC / Ada / Homotopy

File: [local] / OpenXM_contrib / PHC / Ada / Homotopy / reduction_of_nonsquare_systems.adb (download)

Revision 1.1.1.1 (vendor branch), Sun Oct 29 17:45:23 2000 UTC (23 years, 6 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 Standard_Complex_Numbers;           use Standard_Complex_Numbers; 
with Standard_Random_Numbers;            use Standard_Random_Numbers;
with Standard_Complex_Polynomials;       use Standard_Complex_Polynomials;
with Reduction_of_Polynomials;           use Reduction_of_Polynomials;

package body Reduction_of_Nonsquare_Systems is

  function Random_Square ( p : in Poly_Sys ) return Poly_Sys is

    m : constant natural := Number_of_Unknowns(p(p'first));
    res : Poly_Sys(1..m);

  begin
    for i in res'range loop
      Copy(p(i),res(i));
      for j in m+1..p'last loop
        declare
          a : Complex_Number := Random1;
          tmp : Poly := a*p(j);
        begin
          Add(res(i),tmp);
          Clear(tmp);
        end;
      end loop;
    end loop;
    return res;
  end Random_Square;

  function Reduced_Square ( p : in Poly_Sys ) return Poly_Sys is

    m : constant natural := Number_of_Unknowns(p(p'first));
    res : Poly_Sys(1..m);

  begin
    for i in res'range loop
      Copy(p(i),res(i));
      for j in m+1..p'last loop
        declare
          tmp : Poly := Rpoly(res(i),p(j));
        begin
          Copy(tmp,res(i)); Clear(tmp);
        end;
      end loop;
    end loop;
    return res;
  end Reduced_Square;

end Reduction_of_Nonsquare_Systems;