getCoefficient function

Get a coefficient in a 'qspray' polynomial

Get a coefficient in a 'qspray' polynomial

Get the coefficient of the term with the given monomial. methods

## S4 method for signature 'qspray,numeric' getCoefficient(qspray, exponents)

Arguments

  • qspray: a qspray object
  • exponents: a vector of exponents, thereby defining a monomial; trailing zeros are ignored

Returns

The coefficient as a bigq number.

Examples

library(qspray) x <- qlone(1) y <- qlone(2) p <- 4*x^2 + 3*y - 5 getCoefficient(p, 2) # coefficient of x^2 getCoefficient(p, c(2, 0)) # same as getCoefficient(p, 2) getCoefficient(p, c(0, 1)) # coefficient of y because y=x^0*y^1 getCoefficient(p, 0) # the constant term getCoefficient(p, integer(0)) # the constant term getCoefficient(p, 3) # there's no x^3
  • Maintainer: Stéphane Laurent
  • License: GPL-3
  • Last published: 2024-07-27