[top][index]
search for:

random(ZZ,Ring) -- a random ring element of a given degree

Synopsis:

  • Usage: r = random(n,R)
  • Function: random -- get a random element
  • Input:
  • n, an instance of class ZZ.
  • R, an instance of class Ring.
  • Output:
  • r, an instance of class RingElement: a random homogeneous element of degree n
  • i1 : R = GF(9,Variable=>a)[x,y];
    i2 : random(3,R)

          7 3    6 2         2      3
    o2 = a x  + a x y + a*x*y  + a*y 

    o2 : R

    Code:

         -- ../m2/genmat.m2:54
         random(ZZ,Ring) := RingElement => (n,R) -> random({n},R)

    [top][index]
    search for: