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.
- Alphabetic
- By Inheritance
- Poly
- Serializable
- Product
- Equals
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new Poly(c: VectorD, x: String = "x")
- c
the coefficients of the polynomial
- x
the variable/indeterminate of the polynomial
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- def *(q: Poly): Poly
Add 'this' polynomial and the 'q' polynomial.
Add 'this' polynomial and the 'q' polynomial.
- q
the other polynomial
- def +(q: Poly): Poly
Add 'this' polynomial and the 'q' polynomial.
Add 'this' polynomial and the 'q' polynomial.
- q
the other polynomial
- def -(q: Poly): Poly
Subtract the 'q' polynomial from 'this' polynomial.
Subtract the 'q' polynomial from 'this' polynomial.
- q
the other polynomial
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- def apply(x: Double): Double
Apply/evaluate the polynomial at 'x'.
Apply/evaluate the polynomial at 'x'.
- x
the value of the variable
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- val c: VectorD
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native() @HotSpotIntrinsicCandidate()
- val deg: Int
- def derivative: Poly
Take the derivative of 'this' polynomial, returning the result as a polynomial.
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- 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
- 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.
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- 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
- 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
- def productElementNames: Iterator[String]
- Definition Classes
- Product
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- 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
- def toString2: String
Convert the polynomial to an compilable Scala expression string.
- def trim: Poly
Trim away trailing zero coefficients (i.e., those on highest order terms), returning the resulting polynomial of possibly lower degree.
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- val x: String
- def Ⅾ: Poly
- def ∫(on: Interval): Double
- def ∫: Poly
Deprecated Value Members
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable]) @Deprecated
- Deprecated