Advertisement
Guest User

Untitled

a guest
May 8th, 2012
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. //define basering as follow
  2. //ring GZ=(0,i),x,dp;
  3. //minpoly=i2+1;
  4. //setring GZ;
  5.  
  6. proc re(poly f)
  7. {
  8. ring h=(0,i),x,dp;
  9. minpoly = i;
  10.  
  11. setring h;
  12. poly b=imap(GZ,f);
  13.  
  14.  
  15. setring GZ;
  16. return (imap(h,b));
  17. }
  18.  
  19. proc im(poly f)
  20. {
  21. return ((f-re(f))*(-i));
  22. }
  23.  
  24. proc conj(poly f)
  25. {
  26. return (re(f)-im(f)*i);
  27. }
  28.  
  29. proc abs(poly f)
  30. {
  31. return(re(f)^2+im(f)^2);
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement