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;