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

File: [local] / OpenXM_contrib / PHC / Ada / Homotopy / mainred.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 text_io,integer_io;                 use text_io,integer_io;
with Communications_with_User;           use Communications_with_User;
with Standard_Complex_Poly_Systems;      use Standard_Complex_Poly_Systems;
with Standard_Complex_Poly_Systems_io;   use Standard_Complex_Poly_Systems_io;
with Drivers_for_Reduction;              use Drivers_for_Reduction;

procedure mainred ( infilename,outfilename : in string ) is

  lp : Link_to_Poly_Sys;
  outfile : file_type;
  d : natural;
  ans : character;

  procedure Read_System ( filename : in string ) is

    file : file_type;

  begin
    if filename /= ""
     then Open(file,in_file,filename);
          get(file,lp);
          Close(file);
    end if;
  exception
    when others => 
      new_line;
      put("Could not open file with name "); put_line(filename);
      lp := null; return;
  end Read_System;

begin
  Read_System(infilename);
  if lp = null
   then new_line; get(lp);
  end if;
  Create_Output_File(outfile,outfilename);
  put(outfile,lp.all); new_line(outfile);
  Driver_for_Reduction(outfile,lp.all,d,false);
  Close(outfile);
  new_line;
  put("Do you want the reduced system on separate file ? (y/n) ");
  Ask_Yes_or_No(ans);
  if ans = 'y'
   then 
     declare
       redfile : file_type;
     begin
       put_line("Reading the name of the output file.");
       Read_Name_and_Create_File(redfile);
       put(redfile,lp.all);
       Close(redfile);
     end;
  end if;
end mainred;