Klasse Polynom

java.lang.Object
ch.nolix.core.math.algebra.Polynom

public final class Polynom extends Object
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
  • Felddetails

    • EMPTY_POLYNOM

      public static final Polynom EMPTY_POLYNOM
    • DEFAULT_PARAMTER_SYMBOL

      public static final String DEFAULT_PARAMTER_SYMBOL
      Siehe auch:
  • Methodendetails

    • withCoefficient

      public static Polynom withCoefficient(double coefficient, double... coefficients)
    • withCoefficients

      public static Polynom withCoefficients(double[] coefficients)
    • equals

      public boolean equals(Object object)
      Setzt außer Kraft:
      equals in Klasse Object
    • 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 current Polynom.
    • getDerived

      public Polynom getDerived()
      Gibt zurück:
      a new Polynom that is derived from the current Polynom.
    • getDerived

      public Polynom getDerived(int deriveCount)
      Parameter:
      deriveCount -
      Gibt zurück:
      a new Polynom that is derived from the current Polynom as 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

      public Polynom getIntegrated()
      Gibt zurück:
      a new Polynom that is the integration of the current Polynom.
    • getIntegrated

      public Polynom getIntegrated(int integrationCount)
      Parameter:
      integrationCount -
      Gibt zurück:
      a new Polynom that is the integration from the current Polynom as 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 Polynom at 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 Polynom at the given x.
    • hashCode

      public int hashCode()
      Setzt außer Kraft:
      hashCode in Klasse Object
    • hasSameDegreeAs

      public boolean hasSameDegreeAs(Polynom polynom)
      Parameter:
      polynom -
      Gibt zurück:
      true if the current Polynom has the same degree as the given polynom.
    • isZeroPolynom

      public boolean isZeroPolynom()
      A Polynom is a zero Polynom if all its coefficients are 0.0.
      Gibt zurück:
      true if the current Polynom is a zero Polynom.
    • toArray

      public double[] toArray()
      Gibt zurück:
      a new array with the coefficients of the current Polynom.
    • toString

      public String toString()
      Setzt außer Kraft:
      toString in Klasse Object
    • toString

      public String toString(String parameterSymbol)
      Parameter:
      parameterSymbol -
      Gibt zurück:
      a String representation of the current Polynom with the given parameterSymbol
      Löst aus:
      ArgumentIsNullException - if the given parameterSymbol is null.
    • toVector

      public Vector toVector()
      Gibt zurück:
      a new Vector with the coefficients of the current Polynom.