![]() ![]() | ![]() |
File: [local] / OpenXM_contrib / PHC / Ada / Math_Lib / Polynomials / standard_to_multprec_convertors.adb (download)
Revision 1.1.1.1 (vendor branch), Sun Oct 29 17:45:27 2000 UTC (23 years, 10 months ago) by maekawa
Import the second public release of PHCpack. OKed by Jan Verschelde. |
with Standard_Natural_Vectors; with Standard_Complex_Numbers; use Standard_Complex_Numbers; with Standard_Complex_Polynomials; with Standard_Complex_Poly_Systems; with Multprec_Complex_Numbers; use Multprec_Complex_Numbers; with Multprec_Complex_Number_Tools; use Multprec_Complex_Number_Tools; with Multprec_Complex_Polynomials; with Multprec_Complex_Poly_Systems; package body Standard_to_Multprec_Convertors is -- AUXILIARIES : function Convert ( d : Standard_Complex_Polynomials.Degrees ) return Multprec_Complex_Polynomials.Degrees is res : Multprec_Complex_Polynomials.Degrees; begin res := new Standard_Natural_Vectors.Vector(d'range); for i in res'range loop res(i) := d(i); end loop; return res; end Convert; function Convert ( t : Standard_Complex_Polynomials.Term ) return Multprec_Complex_Polynomials.Term is res : Multprec_Complex_Polynomials.Term; begin res.cf := Create(t.cf); res.dg := Convert(t.dg); return res; end Convert; -- TARGET FUNCTIONS : function Convert ( p : Standard_Complex_Polynomials.Poly ) return Multprec_Complex_Polynomials.Poly is res : Multprec_Complex_Polynomials.Poly := Multprec_Complex_Polynomials.Null_Poly; procedure Convert_Term ( t : in Standard_Complex_Polynomials.Term; continue : out boolean ) is ct : Multprec_Complex_Polynomials.Term := Convert(t); begin Multprec_Complex_Polynomials.Add(res,ct); Multprec_Complex_Polynomials.Clear(ct); continue := true; end Convert_Term; procedure Convert_Terms is new Standard_Complex_Polynomials.Visiting_Iterator(Convert_Term); begin Convert_Terms(p); return res; end Convert; function Convert ( p : Standard_Complex_Poly_Systems.Poly_Sys ) return Multprec_Complex_Poly_Systems.Poly_Sys is res : Multprec_Complex_Poly_Systems.Poly_Sys(p'range); begin for i in p'range loop res(i) := Convert(p(i)); end loop; return res; end Convert; end Standard_to_Multprec_Convertors;