[top][index]
search for:

RingElement _ {...}

Synopsis:

  • Usage: g = f_d
  • Operator: _
  • Input:
  • f, an instance of class RingElement: a polynomial
  • d, an instance of class List: a list of integers
  • Output:
  • g, an instance of class RingElement: the sum of those terms of f whose multi-degree is d.
  • The length of d should be the same as the degree length of f.

    See also:

  • RingElement _ ZZ
  • degreeLength -- the number of degrees
  • Code:

         -- ../../../Macaulay2/m2/enginering.m2:214-220
         RingElement _ List := RingElement => (f,d) -> (
              if degreeLength ring f =!= #d
              then error ("degree length of ring element doesn't match specified degree");
              u := select(terms f, t -> d === degree t);
              if #u === 0 then 0_(ring f)
              else sum u
              )

    [top][index]
    search for: