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

File: [local] / OpenXM_contrib / PHC / Ada / Root_Counts / Product / m_homogeneous_start_systems.adb (download)

Revision 1.1.1.1 (vendor branch), Sun Oct 29 17:45:29 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 Standard_Complex_Numbers;           use Standard_Complex_Numbers;
with Standard_Random_Numbers;            use Standard_Random_Numbers;
with Standard_Complex_Vectors;           use Standard_Complex_Vectors;
with Standard_Integer_Matrices;
with Sets_of_Unknowns;                   use Sets_of_Unknowns;
with Degrees_in_Sets_of_Unknowns;        use Degrees_in_Sets_of_Unknowns;
with Random_Product_System;

package body m_Homogeneous_Start_Systems is

  procedure Create_Random_Hyperplanes ( index,n,d : in natural; s : in Set ) is
  begin
    for i in 1..d loop
      declare
        h : Standard_Complex_Vectors.Vector(0..n);
      begin
        h(0) := Random1;
        for j in 1..Dimension(s) loop
          if Is_In(s,j)
           then h(j) := Random1;
           else h(j) := Create(0.0);
          end if;
        end loop;
        Random_Product_System.Add_Hyperplane(index,h);
      end;
    end loop;
  end Create_Random_Hyperplanes;

  procedure Create_Random_System 
              ( n,m : natural; z : partition;
                d : Standard_Integer_Matrices.Matrix ) is

  begin
    for j in 1..m loop
      for i in 1..n loop
        Create_Random_Hyperplanes(i,n,d(i,j),z(j));
      end loop;
    end loop;
  end Create_Random_System;

  procedure m_Homogeneous_Start_System
                 ( p : in Poly_Sys; z : in partition;
                   q : out Poly_Sys; qsols : in out Solution_List ) is

    n : constant natural := p'length;
    m : constant natural := z'last;
    d : constant Standard_Integer_Matrices.Matrix := Degree_Table(p,z);
    nl : natural := 0;

  begin
    Random_Product_System.Init(n);
    Create_Random_System(n,m,z,d);
    Random_Product_System.Solve(qsols,nl);
    q := Random_Product_System.Polynomial_System;
  end m_Homogeneous_Start_System;

end m_Homogeneous_Start_Systems;