Annotation of OpenXM_contrib/PHC/Ada/Root_Counts/Product/m_homogeneous_start_systems.adb, Revision 1.1
1.1 ! maekawa 1: with Standard_Complex_Numbers; use Standard_Complex_Numbers;
! 2: with Standard_Random_Numbers; use Standard_Random_Numbers;
! 3: with Standard_Complex_Vectors; use Standard_Complex_Vectors;
! 4: with Standard_Integer_Matrices;
! 5: with Sets_of_Unknowns; use Sets_of_Unknowns;
! 6: with Degrees_in_Sets_of_Unknowns; use Degrees_in_Sets_of_Unknowns;
! 7: with Random_Product_System;
! 8:
! 9: package body m_Homogeneous_Start_Systems is
! 10:
! 11: procedure Create_Random_Hyperplanes ( index,n,d : in natural; s : in Set ) is
! 12: begin
! 13: for i in 1..d loop
! 14: declare
! 15: h : Standard_Complex_Vectors.Vector(0..n);
! 16: begin
! 17: h(0) := Random1;
! 18: for j in 1..Dimension(s) loop
! 19: if Is_In(s,j)
! 20: then h(j) := Random1;
! 21: else h(j) := Create(0.0);
! 22: end if;
! 23: end loop;
! 24: Random_Product_System.Add_Hyperplane(index,h);
! 25: end;
! 26: end loop;
! 27: end Create_Random_Hyperplanes;
! 28:
! 29: procedure Create_Random_System
! 30: ( n,m : natural; z : partition;
! 31: d : Standard_Integer_Matrices.Matrix ) is
! 32:
! 33: begin
! 34: for j in 1..m loop
! 35: for i in 1..n loop
! 36: Create_Random_Hyperplanes(i,n,d(i,j),z(j));
! 37: end loop;
! 38: end loop;
! 39: end Create_Random_System;
! 40:
! 41: procedure m_Homogeneous_Start_System
! 42: ( p : in Poly_Sys; z : in partition;
! 43: q : out Poly_Sys; qsols : in out Solution_List ) is
! 44:
! 45: n : constant natural := p'length;
! 46: m : constant natural := z'last;
! 47: d : constant Standard_Integer_Matrices.Matrix := Degree_Table(p,z);
! 48: nl : natural := 0;
! 49:
! 50: begin
! 51: Random_Product_System.Init(n);
! 52: Create_Random_System(n,m,z,d);
! 53: Random_Product_System.Solve(qsols,nl);
! 54: q := Random_Product_System.Polynomial_System;
! 55: end m_Homogeneous_Start_System;
! 56:
! 57: end m_Homogeneous_Start_Systems;
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>