![]() ![]() | ![]() |
File: [local] / OpenXM_contrib / PHC / Ada / Math_Lib / Polynomials / standard_poly_laur_convertors.adb (download)
Revision 1.1.1.1 (vendor branch), Sun Oct 29 17:45:26 2000 UTC (23 years, 10 months ago) by maekawa
Import the second public release of PHCpack. OKed by Jan Verschelde. |
with Standard_Complex_Numbers; use Standard_Complex_Numbers; with Standard_Integer_Vectors; package body Standard_Poly_Laur_Convertors is function Polynomial_to_Laurent_Polynomial ( p : Standard_Complex_Polynomials.Poly ) return Standard_Complex_Laur_Polys.Poly is res : Standard_Complex_Laur_Polys.Poly := Standard_Complex_Laur_Polys.Null_Poly; use Standard_Complex_Polynomials; procedure Term_to_Laurent_Term ( t : in Term; cont : out boolean ) is rt : Standard_Complex_Laur_Polys.Term; begin rt.cf := t.cf; rt.dg := new Standard_Integer_Vectors.Vector(t.dg'range); for i in t.dg'range loop rt.dg(i) := t.dg(i); end loop; Standard_Complex_Laur_Polys.Add(res,rt); Standard_Complex_Laur_Polys.Clear(rt); cont := true; end Term_to_Laurent_Term; procedure P2LP is new Visiting_Iterator(Term_to_Laurent_Term); begin P2LP(p); return res; end Polynomial_to_Laurent_Polynomial; function Polynomial_to_Laurent_System ( p : Poly_Sys ) return Laur_Sys is res : Laur_Sys(p'range); begin for i in p'range loop res(i) := Polynomial_to_Laurent_Polynomial(p(i)); end loop; return res; end Polynomial_to_Laurent_System; end Standard_Poly_Laur_Convertors;