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

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

Revision 1.1.1.1 (vendor branch), Sun Oct 29 17:45:29 2000 UTC (23 years, 8 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 text_io,integer_io;                 use text_io,integer_io;
with Communications_with_User;           use Communications_with_User;
with Standard_Floating_Numbers;          use Standard_Floating_Numbers;
with Numbers_io;                         use Numbers_io;
with Standard_Complex_Poly_Systems;      use Standard_Complex_Poly_Systems;
with Standard_Complex_Poly_Systems_io;   use Standard_Complex_Poly_Systems_io;
with Standard_Complex_Laur_Systems;      use Standard_Complex_Laur_Systems;
with Standard_Poly_Laur_Convertors;      use Standard_Poly_Laur_Convertors;
with Standard_Complex_Solutions;         use Standard_Complex_Solutions;
with Standard_Complex_Solutions_io;      use Standard_Complex_Solutions_io;
with Standard_Root_Refiners;             use Standard_Root_Refiners;
with Transforming_Laurent_Systems;       use Transforming_Laurent_Systems;
with Fewnomial_System_Solvers;           use Fewnomial_System_Solvers;

procedure ts_fewsolve is

-- DESCRIPTION :
--   Test on the resolution of fewnomial systems.

  ans : character;
  lp : Link_to_Poly_Sys;

  procedure Call_Root_Refiner ( file : in file_type; p : in Poly_Sys;
                                sols : in out Solution_List ) is

    epsxa,epsfa,tolsing : double_float;
    numit : natural;
    max : constant natural := 5;

  begin
    epsxa := 1.0E-14;
    epsfa := 1.0E-14;
    tolsing := 1.0E-08;
    Reporting_Root_Refiner(file,p,sols,epsxa,epsfa,tolsing,numit,max,false);
  end Call_Root_Refiner;

begin
  loop
    get(lp);
    declare
      l : Laur_Sys(lp'range) := Polynomial_to_Laurent_System(lp.all);
      sols : Solution_List;
      fail : boolean;
    begin
      Shift(l);
      if not Is_Fewnomial_System(l)
       then put_line("The system has too many terms ...");
       else Solve(l,sols,fail);
            if fail
             then put_line("A failure occured ...");
             else put_line("These are the solutions : ");
                  Call_Root_Refiner(Standard_Output,lp.all,sols);
            end if;
      end if;
      Clear(sols); Clear(lp); Clear(l);
    end;
    put("Do you want more tests ? (y/n) "); Ask_Yes_or_No(ans);
    exit when ans /= 'y';
  end loop;
end ts_fewsolve;