Class/Object

spire.math.poly

PolySparse

Related Docs: object PolySparse | package poly

Permalink

case class PolySparse[C] extends Polynomial[C] with Product with Serializable

Self Type
PolySparse[C]
Linear Supertypes
Serializable, Serializable, Product, Equals, Polynomial[C], AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. PolySparse
  2. Serializable
  3. Serializable
  4. Product
  5. Equals
  6. Polynomial
  7. AnyRef
  8. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. class TermIterator extends Iterator[Term[C]]

    Permalink

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. def *(rhs0: Polynomial[C])(implicit ring: Semiring[C], eq: Eq[C]): Polynomial[C]

    Permalink
    Definition Classes
    PolySparsePolynomial
  4. def **(k: Int)(implicit ring: Rig[C], eq: Eq[C]): Polynomial[C]

    Permalink
    Definition Classes
    Polynomial
  5. def *:(k: C)(implicit ring: Semiring[C], eq: Eq[C]): Polynomial[C]

    Permalink
    Definition Classes
    PolySparsePolynomial
  6. def +(rhs0: Polynomial[C])(implicit ring: Semiring[C], eq: Eq[C]): Polynomial[C]

    Permalink
    Definition Classes
    PolySparsePolynomial
  7. def -(rhs: Polynomial[C])(implicit ring: Rng[C], eq: Eq[C]): Polynomial[C]

    Permalink
    Definition Classes
    Polynomial
  8. def :*(k: C)(implicit ring: Semiring[C], eq: Eq[C]): Polynomial[C]

    Permalink
    Definition Classes
    Polynomial
  9. def :/(k: C)(implicit field: Field[C], eq: Eq[C]): Polynomial[C]

    Permalink
    Definition Classes
    Polynomial
  10. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  11. def apply(x: C)(implicit ring: Semiring[C]): C

    Permalink

    Evaluate the polynomial at x.

    Evaluate the polynomial at x.

    Definition Classes
    PolySparsePolynomial
  12. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  13. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  14. val coeff: Array[C]

    Permalink
  15. def coeffsArray(implicit ring: Semiring[C]): Array[C]

    Permalink

    Returns the coefficients in little-endian order.

    Returns the coefficients in little-endian order. So, the i-th element is coeffsArray(i) * (x ** i).

    Definition Classes
    PolySparsePolynomial
  16. def compose(y: Polynomial[C])(implicit ring: Rig[C], eq: Eq[C]): Polynomial[C]

    Permalink

    Compose this polynomial with another.

    Compose this polynomial with another.

    Definition Classes
    Polynomial
  17. implicit val ct: ClassTag[C]

    Permalink
    Definition Classes
    PolySparsePolynomial
  18. def data(implicit ring: Semiring[C], eq: Eq[C]): Map[Int, C]

    Permalink

    Returns a map from exponent to coefficient of this polynomial.

    Returns a map from exponent to coefficient of this polynomial.

    Definition Classes
    Polynomial
  19. def degree: Int

    Permalink

    Returns the degree of this polynomial.

    Returns the degree of this polynomial.

    Definition Classes
    PolySparsePolynomial
  20. def derivative(implicit ring: Ring[C], eq: Eq[C]): Polynomial[C]

    Permalink
    Definition Classes
    PolySparsePolynomial
  21. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  22. def equals(that: Any): Boolean

    Permalink
    Definition Classes
    Polynomial → AnyRef → Any
  23. def evalWith[A](x: A)(f: (C) ⇒ A)(implicit arg0: Semiring[A], arg1: Eq[A], arg2: ClassTag[A], ring: Semiring[C], eq: Eq[C]): A

    Permalink
    Definition Classes
    Polynomial
  24. val exp: Array[Int]

    Permalink
  25. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  26. def flip(implicit ring: Rng[C], eq: Eq[C]): Polynomial[C]

    Permalink

    This will flip/mirror the polynomial about the y-axis.

    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.

    Definition Classes
    Polynomial
  27. def foreach[U](f: (Int, C) ⇒ U): Unit

    Permalink

    Traverses each term in this polynomial, in order of degree, lowest to highest (eg.

    Traverses each term in this polynomial, in order of degree, lowest to highest (eg. constant term would be first) and calls f with the degree of term and its coefficient. This may skip zero terms, or it may not.

    Definition Classes
    PolySparsePolynomial
  28. def foreachNonZero[U](f: (Int, C) ⇒ U)(implicit ring: Semiring[C], eq: Eq[C]): Unit

    Permalink

    Traverses each non-zero term in this polynomial, in order of degree, lowest to highest (eg.

    Traverses each non-zero term in this polynomial, in order of degree, lowest to highest (eg. constant term would be first) and calls f with the degree of term and its coefficient.

    Definition Classes
    PolySparsePolynomial
  29. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  30. def hashCode(): Int

    Permalink
    Definition Classes
    Polynomial → AnyRef → Any
  31. def integral(implicit field: Field[C], eq: Eq[C]): Polynomial[C]

    Permalink
    Definition Classes
    PolySparsePolynomial
  32. def isConstant: Boolean

    Permalink

    Returns true iff this polynomial is constant.

    Returns true iff this polynomial is constant.

    Definition Classes
    Polynomial
  33. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  34. def isZero: Boolean

    Permalink

    Returns true if this polynomial is ring.zero.

    Returns true if this polynomial is ring.zero.

    Definition Classes
    PolySparsePolynomial
  35. def map[D](f: (C) ⇒ D)(implicit arg0: Semiring[D], arg1: Eq[D], arg2: ClassTag[D], ring: Semiring[C], eq: Eq[C]): Polynomial[D]

    Permalink
    Definition Classes
    Polynomial
  36. def mapTerms[D](f: (Term[C]) ⇒ Term[D])(implicit arg0: Semiring[D], arg1: Eq[D], arg2: ClassTag[D], ring: Semiring[C], eq: Eq[C]): Polynomial[D]

    Permalink
    Definition Classes
    Polynomial
  37. def maxOrderTermCoeff(implicit ring: Semiring[C]): C

    Permalink

    Returns the coefficient of max term of this polynomial.

    Returns the coefficient of max term of this polynomial.

    Definition Classes
    PolySparsePolynomial
  38. def maxTerm(implicit ring: Semiring[C]): Term[C]

    Permalink

    Returns the term of the highest degree in this polynomial.

    Returns the term of the highest degree in this polynomial.

    Definition Classes
    Polynomial
  39. def minTerm(implicit ring: Semiring[C], eq: Eq[C]): Term[C]

    Permalink

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

    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.

    Definition Classes
    Polynomial
  40. def monic(implicit f: Field[C], eq: Eq[C]): Polynomial[C]

    Permalink

    Returns this polynomial as a monic polynomial, where the leading coefficient (ie.

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

    Definition Classes
    Polynomial
  41. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  42. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  43. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  44. def nth(n: Int)(implicit ring: Semiring[C]): C

    Permalink

    Returns the coefficient of the n-th degree term.

    Returns the coefficient of the n-th degree term.

    Definition Classes
    PolySparsePolynomial
  45. def pow(k: Int)(implicit ring: Rig[C], eq: Eq[C]): Polynomial[C]

    Permalink
    Definition Classes
    Polynomial
  46. def reciprocal(implicit ring: Semiring[C], eq: Eq[C]): Polynomial[C]

    Permalink

    Returns the reciprocal of this polynomial.

    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).

    Definition Classes
    Polynomial
    See also

    http://en.wikipedia.org/wiki/Reciprocal_polynomial

  47. def reductum(implicit e: Eq[C], ring: Semiring[C], ct: ClassTag[C]): Polynomial[C]

    Permalink

    Returns a polynomial with the max term removed.

    Returns a polynomial with the max term removed.

    Definition Classes
    PolySparsePolynomial
  48. def removeZeroRoots(implicit ring: Semiring[C], eq: Eq[C]): Polynomial[C]

    Permalink

    Removes all zero roots from this polynomial.

    Removes all zero roots from this polynomial.

    Definition Classes
    Polynomial
  49. def roots(implicit finder: RootFinder[C]): Roots[C]

    Permalink

    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.

    finder

    a root finder to extract roots with

    returns

    the real roots of this polynomial

    Definition Classes
    Polynomial
  50. def shift(h: C)(implicit ring: Ring[C], eq: Eq[C]): Polynomial[C]

    Permalink

    Shift this polynomial along the x-axis by h, so that this(x + h) == this.shift(h).apply(x).

    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.

    Definition Classes
    Polynomial
  51. def signVariations(implicit ring: Semiring[C], eq: Eq[C], signed: Signed[C]): Int

    Permalink

    Returns the number of sign variations in the coefficients of this polynomial.

    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.

    Definition Classes
    Polynomial
  52. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  53. def terms(implicit ring: Semiring[C], eq: Eq[C]): List[Term[C]]

    Permalink

    Returns a list of non-zero terms.

    Returns a list of non-zero terms.

    Definition Classes
    Polynomial
  54. def termsIterator: Iterator[Term[C]]

    Permalink

    Return an iterator of non-zero terms.

    Return an iterator of non-zero terms.

    This method is used to implement equals and hashCode.

    NOTE: This method uses a (_ == 0) test to prune zero values. This makes sense in a context where Semiring[C] and Eq[C] are unavailable, but not other places.

    Definition Classes
    PolySparsePolynomial
  55. def toDense(implicit ring: Semiring[C], eq: Eq[C]): PolyDense[C]

    Permalink

    Returns a polynmial that has a dense representation.

    Returns a polynmial that has a dense representation.

    Definition Classes
    PolySparsePolynomial
  56. def toSparse(implicit ring: Semiring[C], eq: Eq[C]): PolySparse[C]

    Permalink

    Returns a polynomial that has a sparse representation.

    Returns a polynomial that has a sparse representation.

    Definition Classes
    PolySparsePolynomial
  57. def toString(): String

    Permalink
    Definition Classes
    Polynomial → AnyRef → Any
  58. def unary_-()(implicit ring: Rng[C]): Polynomial[C]

    Permalink
    Definition Classes
    PolySparsePolynomial
  59. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  60. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  61. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from Polynomial[C]

Inherited from AnyRef

Inherited from Any

Ungrouped