PolyDense

class PolyDense[@specialized(Double) C] extends Polynomial[C]
Companion
object
trait Polynomial[C]
class Object
trait Matchable
class Any

Type members

Classlikes

class TermIterator extends Iterator[Term[C]]

Value members

Concrete methods

def *(rhs: Polynomial[C])(implicit ring: Semiring[C], eq: Eq[C]): Polynomial[C]
def *:(k: C)(implicit ring: Semiring[C], eq: Eq[C]): Polynomial[C]
def +(rhs: Polynomial[C])(implicit ring: Semiring[C], eq: Eq[C]): Polynomial[C]
def apply(x: C)(implicit ring: Semiring[C]): C
def coeffsArray(implicit ring: Semiring[C]): Array[C]
def degree: Int
def derivative(implicit ring: Ring[C], eq: Eq[C]): Polynomial[C]
def foreach[U](f: (Int, C) => U): Unit
override
def foreachNonZero[U](f: (Int, C) => U)(implicit ring: Semiring[C], eq: Eq[C]): Unit
Definition Classes
def integral(implicit field: Field[C], eq: Eq[C]): Polynomial[C]
def isZero: Boolean
def maxOrderTermCoeff(implicit ring: Semiring[C]): C
def nth(n: Int)(implicit ring: Semiring[C]): C
def reductum(implicit e: Eq[C], ring: Semiring[C], ct: ClassTag[C]): Polynomial[C]
def termsIterator: Iterator[Term[C]]
def toDense(implicit ring: Semiring[C], eq: Eq[C]): PolyDense[C]
def toSparse(implicit ring: Semiring[C], eq: Eq[C]): PolySparse[C]
def unary_-(implicit ring: Rng[C]): Polynomial[C]

Inherited methods

def **(k: Int)(implicit ring: Rig[C], eq: Eq[C]): Polynomial[C]
Inherited from
Polynomial
def -(rhs: Polynomial[C])(implicit ring: Rng[C], eq: Eq[C]): Polynomial[C]
Inherited from
Polynomial
def :*(k: C)(implicit ring: Semiring[C], eq: Eq[C]): Polynomial[C]
Inherited from
Polynomial
def :/(k: C)(implicit field: Field[C], eq: Eq[C]): Polynomial[C]
Inherited from
Polynomial
def compose(y: Polynomial[C])(implicit ring: Rig[C], eq: Eq[C]): Polynomial[C]

Compose this polynomial with another.

Compose this polynomial with another.

Inherited from
Polynomial
def data(implicit ring: Semiring[C], eq: Eq[C]): Map[Int, C]

Returns a map from exponent to coefficient of this polynomial.

Returns a map from exponent to coefficient of this polynomial.

Inherited from
Polynomial
override
def equals(that: Any): Boolean
Definition Classes
Polynomial -> Any
Inherited from
Polynomial
def evalWith[A : ClassTag](x: A)(f: C => A): A
Inherited from
Polynomial
def flip(implicit ring: Rng[C], eq: Eq[C]): Polynomial[C]

This will flip/mirror the polynomial about the y-axis. It is equivalent to poly.compose(-Polynomial.x), but will likely be faster to calculate.

This will flip/mirror the polynomial about the y-axis. It is equivalent to poly.compose(-Polynomial.x), but will likely be faster to calculate.

Inherited from
Polynomial
override
def hashCode: Int
Definition Classes
Polynomial -> Any
Inherited from
Polynomial
def isConstant: Boolean

Returns true iff this polynomial is constant.

Returns true iff this polynomial is constant.

Inherited from
Polynomial
def map[D : ClassTag](f: C => D): Polynomial[D]
Inherited from
Polynomial
def mapTerms[D : ClassTag](f: Term[C] => Term[D]): Polynomial[D]
Inherited from
Polynomial
def maxTerm(implicit ring: Semiring[C]): Term[C]

Returns the term of the highest degree in this polynomial.

Returns the term of the highest degree in this polynomial.

Inherited from
Polynomial
@nowarn
def minTerm(implicit ring: Semiring[C], eq: Eq[C]): Term[C]

Returns the non-zero term of the minimum degree in this polynomial, unless it is zero. If this polynomial is zero, then this returns a zero term.

Returns the non-zero term of the minimum degree in this polynomial, unless it is zero. If this polynomial is zero, then this returns a zero term.

Inherited from
Polynomial
def monic(implicit f: Field[C], eq: Eq[C]): Polynomial[C]

Returns this polynomial as a monic polynomial, where the leading coefficient (ie. maxOrderTermCoeff) is 1.

Returns this polynomial as a monic polynomial, where the leading coefficient (ie. maxOrderTermCoeff) is 1.

Inherited from
Polynomial
def pow(k: Int)(implicit ring: Rig[C], eq: Eq[C]): Polynomial[C]
Inherited from
Polynomial
def reciprocal(implicit ring: Semiring[C], eq: Eq[C]): Polynomial[C]

Returns the reciprocal of this polynomial. Essentially, if this polynomial is p with degree n, then returns a polynomial q(x) = x^n*p(1/x).

Returns the reciprocal of this polynomial. Essentially, if this polynomial is p with degree n, then returns a polynomial q(x) = x^n*p(1/x).

See also
Inherited from
Polynomial
def removeZeroRoots(implicit ring: Semiring[C], eq: Eq[C]): Polynomial[C]

Removes all zero roots from this polynomial.

Removes all zero roots from this polynomial.

Inherited from
Polynomial
def roots(implicit finder: RootFinder[C]): Roots[C]

Returns the real roots of this polynomial.

Returns the real roots of this polynomial.

Depending on C, the finder argument may need to be passed "explicitly" via an implicit conversion. This is because some types (eg BigDecimal, Rational, etc) require an error bound, and so provide implicit conversions to RootFinders from the error type. For instance, BigDecimal requires either a scale or MathContext. So, we'd call this method with poly.roots(MathContext.DECIMAL128), which would return a Roots[BigDecimal whose roots are approximated to the precision specified in DECIMAL128 and rounded appropriately.

On the other hand, a type like Double doesn't require an error bound and so can be called without specifying the RootFinder.

Value Params
finder

a root finder to extract roots with

Returns

the real roots of this polynomial

Inherited from
Polynomial
def shift(h: C)(implicit ring: Ring[C], eq: Eq[C]): Polynomial[C]

Shift this polynomial along the x-axis by h, so that this(x + h) == this.shift(h).apply(x). This is equivalent to calling this.compose(Polynomial.x + h), but is likely to compute the shifted polynomial much faster.

Shift this polynomial along the x-axis by h, so that this(x + h) == this.shift(h).apply(x). This is equivalent to calling this.compose(Polynomial.x + h), but is likely to compute the shifted polynomial much faster.

Inherited from
Polynomial
def signVariations(implicit ring: Semiring[C], order: Order[C], signed: Signed[C]): Int

Returns the number of sign variations in the coefficients of this polynomial. Given 2 consecutive terms (ignoring 0 terms), a sign variation is indicated when the terms have differing signs.

Returns the number of sign variations in the coefficients of this polynomial. Given 2 consecutive terms (ignoring 0 terms), a sign variation is indicated when the terms have differing signs.

Inherited from
Polynomial
def terms(implicit ring: Semiring[C], eq: Eq[C]): List[Term[C]]

Returns a list of non-zero terms.

Returns a list of non-zero terms.

Inherited from
Polynomial
override
def toString: String
Definition Classes
Polynomial -> Any
Inherited from
Polynomial

Concrete fields

val coeffs: Array[C]

Implicits

Implicits

implicit
val ct: ClassTag[C]