Poly

scalation.calculus.Poly
See thePoly companion object
case class Poly(c: VectorD, x: String)

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.

Value parameters

c

the coefficients of the polynomial

x

the variable/indeterminate of the polynomial

Attributes

See also

`MPoly' for multivariate polynomials.

Companion
object
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

def *(q: Poly): Poly

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

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

Value parameters

q

the other polynomial

Attributes

def +(q: Poly): Poly

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

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

Value parameters

q

the other polynomial

Attributes

def -(q: Poly): Poly

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

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

Value parameters

q

the other polynomial

Attributes

def apply(x: Double): Double

Apply/evaluate the polynomial at 'x'.

Apply/evaluate the polynomial at 'x'.

Value parameters

x

the value of the variable

Attributes

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

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

Attributes

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

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

Attributes

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.

Value parameters

on

the interval of integration

Attributes

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.

Value parameters

str

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

Attributes

See also
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.

Value parameters

str

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

Attributes

See also
override def toString: String

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

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

Attributes

Definition Classes
Any
def toString2: String

Convert the polynomial to an compilable Scala expression string.

Convert the polynomial to an compilable Scala expression string.

Attributes

def trim: Poly

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

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

Attributes

def : Poly
def : Poly
def (on: Interval): Double

Inherited methods

def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product

Concrete fields

val deg: Int