Package xal.extension.jels.tools.math
Class InverseRealPolynomial
java.lang.Object
xal.tools.math.fnc.poly.RealUnivariatePolynomial
xal.extension.jels.tools.math.InverseRealPolynomial
- All Implemented Interfaces:
IRealFunction,ISmoothRealFunction
- Direct Known Subclasses:
MeanFieldPolynomial
Represents a model function of the form: ( x1 + x2(x0/x-1) + x3/2(x0/x-1)^2 + ... + xn/(n-1)!(x0/x-1)^(n-1) ) / x1 where x0,x1,...,xn are parameters.
This is an encapsulation of a TTF function as is used in TraceWin. The class is extended from UnivariateRealPolynomial just so it can be easily switched with it.
- Author:
- Ivo List, Juan F. Esteban Müller <juanf.estebanmuller@esss.se>
-
Constructor Summary
ConstructorsConstructorDescriptionCreates an empty polynomial object, the zero polynomial.InverseRealPolynomial(double[] arrCoef) Creates and initializes a polynomial to the specified coefficients. -
Method Summary
Modifier and TypeMethodDescriptiondoublederivativeAt(double dblVal) Evaluate derivative of the model function for the specified value of the indeterminate.doubleevaluateAt(double dblVal) Evaluate the model function for the specified value: (x1 + x2(x0/x-1) + x3/2(x0/x-1)^2 + ... + xn/(n-1)!doublegetCoef(int iOrder) Get the specified coefficient value.double[]getCoefs()Return the entire array of coefficients.intReturn the degree of the polynomial.plus(InverseRealPolynomial polyAddend) voidsetCoefArray(double[] arrCoef) Set the entire coefficient array.times(InverseRealPolynomial polyFac) toString()Construct and return a textual representation of the contents of this model function as aStringobject.Methods inherited from class xal.tools.math.fnc.poly.RealUnivariatePolynomial
derivativeAt, main, plus, timesMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface xal.tools.math.fnc.IRealFunction
getDomain
-
Constructor Details
-
InverseRealPolynomial
public InverseRealPolynomial()Creates an empty polynomial object, the zero polynomial. -
InverseRealPolynomial
public InverseRealPolynomial(double[] arrCoef) Creates and initializes a polynomial to the specified coefficients.- Parameters:
arrCoef-
-
-
Method Details
-
setCoefArray
public void setCoefArray(double[] arrCoef) Set the entire coefficient array. The coefficient array is arranged in order of ascending indeterminate order.- Overrides:
setCoefArrayin classRealUnivariatePolynomial- Parameters:
arrCoef- double array of coefficients.
-
getDegree
public int getDegree()Description copied from class:RealUnivariatePolynomialReturn the degree of the polynomial. That is, the highest indeterminant order for all the nonzero coefficients.- Overrides:
getDegreein classRealUnivariatePolynomial- Returns:
- the degree of the polynomial. That is, the highest indeterminant order for all the nonzero coefficients.
-
getCoef
public double getCoef(int iOrder) Get the specified coefficient value. If the value ofiOrderis larger than the size of the coefficient array then the coefficient is assumed to have value zero.- Overrides:
getCoefin classRealUnivariatePolynomial- Parameters:
iOrder- index of coefficient- Returns:
- coefficient
-
getCoefs
public double[] getCoefs()Return the entire array of coefficients.- Overrides:
getCoefsin classRealUnivariatePolynomial- Returns:
- the entire coefficient array
-
evaluateAt
public double evaluateAt(double dblVal) Evaluate the model function for the specified value: (x1 + x2(x0/x-1) + x3/2(x0/x-1)^2 + ... + xn/(n-1)!(x0/x-1)^(n-1)) / x1 where x0,x1,...,xn are coefficients.- Specified by:
evaluateAtin interfaceIRealFunction- Overrides:
evaluateAtin classRealUnivariatePolynomial- Parameters:
dblVal- indeterminate value to evaluate the model function at- Returns:
-
derivativeAt
public double derivativeAt(double dblVal) Evaluate derivative of the model function for the specified value of the indeterminate. If the coefficient vector has not been specified, it return 0. (-x2(x0 x^-2) - x3(x0/x-1)(x0 x^-2) - ... - xn/(n-2)!(x0/x-1)^(n-2)(x0 x^-2)) / x1 where x0,x1,...,xn are coefficients.- Specified by:
derivativeAtin interfaceISmoothRealFunction- Overrides:
derivativeAtin classRealUnivariatePolynomial- Parameters:
dblVal- indeterminate value to evaluate the model function derivative- Returns:
- the derivative f'(x) of the function f
-
plus
-
times
-
toString
Construct and return a textual representation of the contents of this model function as aStringobject.- Overrides:
toStringin classRealUnivariatePolynomial- Returns:
- a String representation of the model function contents
- See Also:
-