Class Polynom
java.lang.Object
ch.nolix.base.math.algebra.Polynom
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionbooleandoublegetCoefficientForDegree(int degree) intgetDerived(int deriveCount) getIntegrated(int integrationCount) doublegetSlopeAt(double x) doublegetValueAt(double x) This method implements the Horner scheme to calculate the value.inthashCode()booleanhasSameDegreeAs(Polynom polynom) booleandouble[]toArray()toString()toVector()static PolynomwithCoefficients(double... coefficients)
-
Field Details
-
EMPTY_POLYNOM
-
DEFAULT_PARAMTER_SYMBOL
- See Also:
-
-
Method Details
-
withCoefficients
-
equals
-
getCoefficientForDegree
public double getCoefficientForDegree(int degree) - Parameters:
degree-- Returns:
- the coefficient for the given degree from the current
Polynom. - Throws:
RuntimeException- if the given degree is not between 0 and the degree of the currentPolynom.
-
getDerived
-
getDerived
- Parameters:
deriveCount-- Returns:
- a new
Polynomthat is derived from the currentPolynomas many times as the given deriveCount says. - Throws:
RuntimeException- if the given deriveCount is negative.
-
getDegree
public int getDegree()- Returns:
- the degree of the current
Polynom.
-
getIntegrated
-
getIntegrated
- Parameters:
integrationCount-- Returns:
- a new
Polynomthat is the integration from the currentPolynomas many times as the given integrationCount says. - Throws:
RuntimeException- if the given integrationCount is negative.
-
getSlopeAt
public double getSlopeAt(double x) - Parameters:
x-- Returns:
- the slope of the current
Polynomat the given x.
-
getValueAt
public double getValueAt(double x) This method implements the Horner scheme to calculate the value.- Parameters:
x-- Returns:
- the value of the current
Polynomat the given x.
-
hashCode
-
hasSameDegreeAs
-
isZeroPolynom
-
toArray
public double[] toArray()- Returns:
- a new array with the coefficients of the current
Polynom.
-
toString
-
toString
- Parameters:
parameterSymbol-- Returns:
- a
Stringrepresentation of the currentPolynomwith the given parameterSymbol - Throws:
RuntimeException- if the given parameterSymbol is null.
-
toVector
-