public class PolynomialMath
extends java.lang.Object
Constructor and Description |
---|
PolynomialMath() |
Modifier and Type | Method and Description |
---|---|
static Complex |
evalPolynomial(Complex[] coeff,
Complex t)
Same as above for complex numbers
|
static double |
evalPolynomial(double[] coeff,
double t)
Eval a polynomial by Horner's schema
|
static ComplexSquareMatrix |
getFrobeniusMatrix(Polynomial p)
Get the (complex) frobenius matrix for a given polynomial.
|
static Complex[] |
getNullPoints(Polynomial p)
Calculate the null points of a given polynomial by solving the
eigenvalue problem for the frobenius matrix
This is not yet implemented (depends on a QR- decomposition)
|
static Complex[] |
interpolateLagrange(Complex[][] samplingPoints)
Get the coefficients of the interpolation polynomial
Caveat: this method is brute-force, slow and not very stable.
|
static Complex |
interpolateLagrange(Complex[][] samplingPoints,
Complex t)
Interpolate a value by given sampling points.
|
static double[] |
interpolateLagrange(double[][] samplingPoints)
Get the coefficients of the interpolation polynomial
Caveat: this method is brute-force, slow and not very stable.
|
static double |
interpolateLagrange(double[][] samplingPoints,
double t)
Interpolate a value by given sampling points.
|
static int |
maxDegree(Polynomial p1,
Polynomial p2)
Get the maximum degree of two polynomials
|
static int |
minDegree(Polynomial p1,
Polynomial p2)
Get the minimal degree of two polynomials
|
static ComplexPolynomial |
normalize(ComplexPolynomial p)
Normalize a given complex polynomial, i.e.
|
static ComplexPolynomial |
toComplex(Polynomial p)
Try to cast a Polynomial to a complex polynomial
|
public static ComplexSquareMatrix getFrobeniusMatrix(Polynomial p)
p
- the polynomialpublic static int maxDegree(Polynomial p1, Polynomial p2)
p1
- p2
- public static int minDegree(Polynomial p1, Polynomial p2)
p1
- p2
- public static Complex[] getNullPoints(Polynomial p)
p
- the polynomialpublic static double evalPolynomial(double[] coeff, double t)
coeff
- t
- public static Complex evalPolynomial(Complex[] coeff, Complex t)
coeff
- t
- public static double[] interpolateLagrange(double[][] samplingPoints)
samplingPoints
- an array[2][n] where array[0] denotes x-values, array[1] y-valuespublic static double interpolateLagrange(double[][] samplingPoints, double t)
samplingPoints
- an array[2][n] where array[0] denotes x-values, array[1] y-valuespublic static Complex[] interpolateLagrange(Complex[][] samplingPoints)
samplingPoints
- an array[2][n] where array[0] denotes x-values, array[1] y-valuespublic static Complex interpolateLagrange(Complex[][] samplingPoints, Complex t)
samplingPoints
- an array[2][n] where array[0] denotes x-values, array[1] y-valuespublic static ComplexPolynomial normalize(ComplexPolynomial p)
p
- public static ComplexPolynomial toComplex(Polynomial p)