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
- Serializable
- Product
- Equals
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
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[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
- 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
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
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()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
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
-
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(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
- val x: String
- def Ⅾ: Poly
- def ∫(on: Interval): Double
- def ∫: Poly