Package ch.nolix.core.math.algebra
Klasse Polynom
java.lang.Object
ch.nolix.core.math.algebra.Polynom
A
Polynom is not mutable.
A Polynom stores its coefficients in an array from the highest to the
lowest coefficient. -degree: n -array: [a_n,... ,a_0]- Version:
- 2016-03-01
- Autor:
- Silvan Wyss
-
Feldübersicht
Felder -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungbooleandoublegetCoefficientForDegree(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 PolynomwithCoefficient(double coefficient, double... coefficients) static PolynomwithCoefficients(double[] coefficients)
-
Felddetails
-
EMPTY_POLYNOM
-
DEFAULT_PARAMTER_SYMBOL
- Siehe auch:
-
-
Methodendetails
-
withCoefficient
-
withCoefficients
-
equals
-
getCoefficientForDegree
public double getCoefficientForDegree(int degree) - Parameter:
degree-- Gibt zurück:
- the coefficient for the given degree from the current
Polynom. - Löst aus:
ArgumentIsOutOfRangeException- if the given degree is not between 0 and the degree of the currentPolynom.
-
getDerived
-
getDerived
- Parameter:
deriveCount-- Gibt zurück:
- a new
Polynomthat is derived from the currentPolynomas many times as the given deriveCount says. - Löst aus:
NegativeArgumentException- if the given deriveCount is negative.
-
getDegree
public int getDegree()- Gibt zurück:
- the degree of the current
Polynom.
-
getIntegrated
-
getIntegrated
- Parameter:
integrationCount-- Gibt zurück:
- a new
Polynomthat is the integration from the currentPolynomas many times as the given integrationCount says. - Löst aus:
NegativeArgumentException- if the given integrationCount is negative.
-
getSlopeAt
public double getSlopeAt(double x) - Parameter:
x-- Gibt zurück:
- 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.- Parameter:
x-- Gibt zurück:
- the value of the current
Polynomat the given x.
-
hashCode
public int hashCode() -
hasSameDegreeAs
- Parameter:
polynom-- Gibt zurück:
- true if the current
Polynomhas the same degree as the given polynom.
-
isZeroPolynom
public boolean isZeroPolynom() -
toArray
public double[] toArray()- Gibt zurück:
- a new array with the coefficients of the current
Polynom.
-
toString
-
toString
- Parameter:
parameterSymbol-- Gibt zurück:
- a
Stringrepresentation of the currentPolynomwith the given parameterSymbol - Löst aus:
ArgumentIsNullException- if the given parameterSymbol is null.
-
toVector
-