Annotation of OpenXM_contrib/PHC/Ada/Math_Lib/Polynomials/standard_complex_poly_randomizers.adb, Revision 1.1
1.1 ! maekawa 1: with Standard_Random_Numbers;
! 2: with Standard_Natural_Vectors;
! 3:
! 4: package body Standard_Complex_Poly_Randomizers is
! 5:
! 6: function Complex_Randomize ( p : Poly ) return Poly is
! 7:
! 8: res : Poly := Null_Poly;
! 9:
! 10: procedure Randomize_Term ( t : in Term; cont : out boolean ) is
! 11:
! 12: rt : Term;
! 13:
! 14: begin
! 15: rt.cf := Standard_Random_Numbers.Random;
! 16: rt.dg := new Standard_Natural_Vectors.Vector'(t.dg.all);
! 17: Add(res,rt);
! 18: Clear(rt);
! 19: cont := true;
! 20: end Randomize_Term;
! 21: procedure Randomize_Terms is new Visiting_Iterator (Randomize_Term);
! 22:
! 23: begin
! 24: Randomize_Terms(p);
! 25: return res;
! 26: end Complex_Randomize;
! 27:
! 28: function Complex_Randomize1 ( p : Poly ) return Poly is
! 29:
! 30: res : Poly := Null_Poly;
! 31:
! 32: procedure Randomize_Term ( t : in Term; cont : out boolean ) is
! 33:
! 34: rt : Term;
! 35:
! 36: begin
! 37: rt.cf := Standard_Random_Numbers.Random1;
! 38: rt.dg := new Standard_Natural_Vectors.Vector'(t.dg.all);
! 39: Add(res,rt);
! 40: Clear(rt);
! 41: cont := true;
! 42: end Randomize_Term;
! 43: procedure Randomize_Terms is new Visiting_Iterator (Randomize_Term);
! 44: begin
! 45: Randomize_Terms(p);
! 46: return res;
! 47: end Complex_Randomize1;
! 48:
! 49: function Complex_Randomize ( p : Poly_Sys ) return Poly_Sys is
! 50:
! 51: res : Poly_Sys(p'range);
! 52:
! 53: begin
! 54: for i in res'range loop
! 55: res(i) := Complex_Randomize(p(i));
! 56: end loop;
! 57: return res;
! 58: end Complex_Randomize;
! 59:
! 60: function Complex_Randomize1 ( p : Poly_Sys ) return Poly_Sys is
! 61:
! 62: res : Poly_Sys(p'range);
! 63:
! 64: begin
! 65: for i in res'range loop
! 66: res(i) := Complex_Randomize1(p(i));
! 67: end loop;
! 68: return res;
! 69: end Complex_Randomize1;
! 70:
! 71: end Standard_Complex_Poly_Randomizers;
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>