parameters: (cs)
return_statement: return prd
docstring: Multiply a Laguerre series by x.
  
      Multiply the Laguerre series `cs` by x, where x is the independent
      variable.
  
  
      Parameters
      ----------
      cs : array_like
          1-d array of Laguerre series coefficients ordered from low to
          high.
  
      Returns
      -------
      out : ndarray
          Array representing the result of the multiplication.
  
      Notes
      -----
      The multiplication uses the recursion relationship for Laguerre
      polynomials in the form
  
      .. math::
  
      xP_i(x) = (-(i + 1)*P_{i + 1}(x) + (2i + 1)P_{i}(x) - iP_{i - 1}(x))
  
      Examples
      --------
      >>> from numpy.polynomial.laguerre import lagmulx
      >>> lagmulx([1, 2, 3])
      array([ -1.,  -1.,  11.,  -9.])
docstring_summary: Multiply a Laguerre series by x.
docstring_tokens: Multiply a Laguerre series by x .
function: def lagmulx(cs):
      """Multiply a Laguerre series by x.
  
      Multiply the Laguerre series `cs` by x, where x is the independent
      variable.
  
  
      Parameters
      ----------
      cs : array_like
          1-d array of Laguerre series coefficients ordered from low to
          high.
  
      Returns
      -------
      out : ndarray
          Array representing the result of the multiplication.
  
      Notes
      -----
      The multiplication uses the recursion relationship for Laguerre
      polynomials in the form
  
      .. math::
  
      xP_i(x) = (-(i + 1)*P_{i + 1}(x) + (2i + 1)P_{i}(x) - iP_{i - 1}(x))
  
      Examples
      --------
      >>> from numpy.polynomial.laguerre import lagmulx
      >>> lagmulx([1, 2, 3])
      array([ -1.,  -1.,  11.,  -9.])
  
      """
      # cs is a trimmed copy
      [cs] = pu.as_series([cs])
      # The zero series needs special treatment
      if len(cs) == 1 and cs[0] == 0:
          return cs
  
      prd = np.empty(len(cs) + 1, dtype=cs.dtype)
      prd[0] = cs[0]
      prd[1] = -cs[0]
      for i in range(1, len(cs)):
          prd[i + 1] = -cs[i]*(i + 1)
          prd[i] += cs[i]*(2*i + 1)
          prd[i - 1] -= cs[i]*i
      return prd
function_tokens: def lagmulx ( cs ) : # cs is a trimmed copy [ cs ] = pu . as_series ( [ cs ] ) # The zero series needs special treatment if len ( cs ) == 1 and cs [ 0 ] == 0 : return cs prd = np . empty ( len ( cs ) + 1 , dtype = cs . dtype ) prd [ 0 ] = cs [ 0 ] prd [ 1 ] = - cs [ 0 ] for i in range ( 1 , len ( cs ) ) : prd [ i + 1 ] = - cs [ i ] * ( i + 1 ) prd [ i ] += cs [ i ] * ( 2 * i + 1 ) prd [ i - 1 ] -= cs [ i ] * i return prd