class GSL::Poly

Overview

Poly class represents polinomial c0+c1x+c2x*x+...

See Also PolyDD for divided difference representation

Defined in:

gsl/maths/basic/poly.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(acoeffs) #

Creates polynomial from array of coefficients


[View source]

Instance Method Detail

def ==(other : Poly) #

compare coefficients with another polynomial


[View source]
def coeffs : Array(Float64) #

Returns coefficients of polynomial


[View source]
def diff #

differentiate polynomial


[View source]
def eval(x : Float64) : Float64 #

Returns value of polinomial at point x


[View source]
def eval(x : Complex) : Complex #

Returns complex value of polinomial at complex point x


[View source]
def eval_derivs(x : Float64) : Array(Float64) #

Returns array containing value at given point and all derivatives at this point.


[View source]
def integrate #

integrate polynomial


[View source]
def solve : Array(Float64) #

Returns sorted array containing real roots of polinomial. Roots of higher order will be returned as separate roots


[View source]
def solve_complex : Array(Complex) #

Returns array containing complex roots of polinomial. Always returns @coeffs.size-1 number of roots.


[View source]
def solve_distinct(tolerance = 1e-9) : Array(Float64) #

Returns sorted array containing real roots of polinomial. Roots that differs less then tolerance will be returned as one root


[View source]