Packages

case class Poly(c: VectorD, x: String = "x") extends Product with Serializable

The Poly class provides operations on univariate polynomials.

Poly (2, 3) => 3 x + 2

Note, reverse order of coefficients, i.e., coefficients for smallest terms first.

c

the coefficients of the polynomial

x

the variable/indeterminate of the polynomial

See also

MPoly' for multivariate polynomials.

Linear Supertypes
Serializable, Serializable, Product, Equals, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Poly
  2. Serializable
  3. Serializable
  4. Product
  5. Equals
  6. AnyRef
  7. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Poly(c: VectorD, x: String = "x")

    c

    the coefficients of the polynomial

    x

    the variable/indeterminate of the polynomial

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. def *(q: Poly): Poly

    Add 'this' polynomial and the 'q' polynomial.

    Add 'this' polynomial and the 'q' polynomial.

    q

    the other polynomial

  4. def +(q: Poly): Poly

    Add 'this' polynomial and the 'q' polynomial.

    Add 'this' polynomial and the 'q' polynomial.

    q

    the other polynomial

  5. def -(q: Poly): Poly

    Subtract the 'q' polynomial from 'this' polynomial.

    Subtract the 'q' polynomial from 'this' polynomial.

    q

    the other polynomial

  6. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  7. def apply(x: Double): Double

    Apply/evaluate the polynomial at 'x'.

    Apply/evaluate the polynomial at 'x'.

    x

    the value of the variable

  8. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  9. val c: VectorD
  10. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native() @HotSpotIntrinsicCandidate()
  11. val deg: Int
  12. def derivative: Poly

    Take the derivative of 'this' polynomial, returning the result as a polynomial.

  13. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  14. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  15. def integrate(on: Interval): Double

    Integrate 'this' polynomial on the interval 'on', returning its value as a double.

    Integrate 'this' polynomial on the interval 'on', returning its value as a double.

    on

    the interval of integration

  16. def integrate: Poly

    Integrate 'this' polynomial, returning the result as a polynomial.

    Integrate 'this' polynomial, returning the result as a polynomial. Note, the arbitrary constant 'c' for the indefinite integral is set to 1.

  17. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  18. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  19. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  20. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  21. def parse(str: String): Poly

    Parse a readable/LaTeX-compatible string to create a polynomial, using a PEG parser.

    Parse a readable/LaTeX-compatible string to create a polynomial, using a PEG parser.

    str

    the string to parse, e.g., "2.0 x3 + 3.0 x2 + 4.0 x + 5.0"

    See also

    https://github.com/sirthias/parboiled2

  22. def parse2(str: String): Poly

    Parse a compilable Scala expression string to create a polynomial, using a PEG parser.

    Parse a compilable Scala expression string to create a polynomial, using a PEG parser.

    str

    the string to parse, e.g., "2.0*x~3 + 3.0*x~2 + 4.0*x + 5.0"

    See also

    https://github.com/sirthias/parboiled2

  23. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  24. def toString(): String

    Convert the polynomial to a readable/LaTeX-compatible string.

    Convert the polynomial to a readable/LaTeX-compatible string.

    Definition Classes
    Poly → AnyRef → Any
  25. def toString2: String

    Convert the polynomial to an compilable Scala expression string.

  26. def trim: Poly

    Trim away trailing zero coefficients (i.e., those on highest order terms), returning the resulting polynomial of possibly lower degree.

  27. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  28. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  29. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  30. val x: String
  31. def : Poly
  32. def (on: Interval): Double
  33. def : Poly

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] ) @Deprecated
    Deprecated

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from AnyRef

Inherited from Any

Ungrouped