next up previous contents
Next: Computers and compilers Up: Polynomial Homotopy Continuation: a Previous: The design: PHC

PHCPACK: calling from other programs

To facilitate the use of PHC from other Ada programs, we have created one package that contains all routines necessary to solve polynomial systems by homotopy continuation.

To illustrate the ease of using PHCPACK, consider the following little program.

with text_io,Solutions;              use text_io,Solutions;
with Complex_Polynomial_Systems;     use Complex_Polynomial_Systems;
with Complex_Polynomial_Systems_io;  use Complex_Polynomial_Systems_io;
with PHCPACK;

procedure use_phc is

  infile,outfile : file_type;        -- input and output file
  p,q : Link_to_Poly_Sys;            -- target and start system
  mixed_volume : natural;            -- root count is mixed volume
  sols : Solution_List;              -- list of solutions

begin
  Open(infile,in_file,"test.in");
  get(infile,p); q := new Poly_Sys(p'range);
  Create(outfile,out_file,"test.out");
  PHCPACK.Static_Lifting(outfile,p.all,mixed_volume,q.all,sols);
  PHCPACK.Artificial_Parameter_Continuation(outfile,p.all,q.all,sols);
  PHCPACK.Refine_Roots(outfile,p.all,sols);
end use_phc;

Of course, the PHCPACK-routines used in the little program are the simplest ones available, with default values for the parameters. The aim of PHCPACK is mainly to provide a high-level interface to other software systems. More sophisticated use of PHC has to go through the specialized packages.

The application of PHCPACK from other languages requires the definition of equivalent types for polynomial systems and lists of solutions. Eventually, instead of passing systems and solution lists, strings can be used as argument.



Jan Verschelde
Thu Nov 21 10:50:01 MET 1996