Class Polynomial1f

  • All Implemented Interfaces:
    java.io.Serializable

    public class Polynomial1f
    extends java.lang.Object
    implements java.io.Serializable
    Limited implementation of a floating-point polynomial of 1 variable.
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      Polynomial1f()
      Creates a new Polynomial1f object.
      Polynomial1f​(int iDegree)
      Creates a new Polynomial1f object.
      Polynomial1f​(Polynomial1f kPoly)
      set this polynomial to have the same coefficients as those in the specified polynomial.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void Add​(Polynomial1f kPoly1, Polynomial1f kPoly2)
      sets this instance to the sum of two polynomial instances.
      boolean Bisection​(float fXMin, float fXMax, int iDigitsAccuracy, float[] afReturn)
      Returns Float which is null if no root is found; otherwise contains the value of the root.
      void Copy​(Polynomial1f kPoly)
      set this polynomial to have the same coefficients as those in the specified polynomial.
      float Eval​(float fT)
      evaluate this polynomial for the specified value.
      float GetCoeff​(int i)
      DOCUMENT ME!
      int GetDegree()
      DOCUMENT ME!
      Polynomial1f GetDerivative()
      return new instance which is the derivative of this instance.
      float GetRootBisection()
      Called by computeRadius, finds the root of the <= 8 degree polynomial through bisection method:
      int GetRootsOnInterval​(float fXMin, float fXMax, float[] afRoot, int iDigitsAccuracy)
      afRoot should have length 2; returns number roots found, which are returned in the afRoot array.
      void Mult​(Polynomial1f kPoly1, Polynomial1f kPoly2)
      set this polynomial to the product of two polynomials.
      int RootsDegree3​(float[] afRoot)
      afRoot should have length 3 which is used to return the real roots found; returns 0 if no root can be found, otherwise returns the number of real roots found (1 or 3);
      void Scale​(float fScalar)
      sets this instance to the scalar product with itself.
      void SetCoeff​(int i, float fValue)
      DOCUMENT ME!
      void Sub​(Polynomial1f kPoly1, Polynomial1f kPoly2)
      sets this instance to the difference of two polynomial instances.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • ms_fInvLog2

        private static final float ms_fInvLog2
        DOCUMENT ME!
      • ms_fLog10

        private static final float ms_fLog10
        DOCUMENT ME!
      • ms_fSqrt3

        private static final float ms_fSqrt3
        DOCUMENT ME!
      • ms_fTwentySeventh

        private static final float ms_fTwentySeventh
        DOCUMENT ME!
        See Also:
        Constant Field Values
      • m_afCoeff

        protected float[] m_afCoeff
        DOCUMENT ME!
      • m_iDegree

        protected int m_iDegree
        DOCUMENT ME!
    • Constructor Detail

      • Polynomial1f

        public Polynomial1f()
        Creates a new Polynomial1f object.
      • Polynomial1f

        public Polynomial1f​(int iDegree)
        Creates a new Polynomial1f object.
        Parameters:
        iDegree - DOCUMENT ME!
      • Polynomial1f

        public Polynomial1f​(Polynomial1f kPoly)
        set this polynomial to have the same coefficients as those in the specified polynomial.
        Parameters:
        kPoly - DOCUMENT ME!
    • Method Detail

      • Add

        public void Add​(Polynomial1f kPoly1,
                        Polynomial1f kPoly2)
        sets this instance to the sum of two polynomial instances.
        Parameters:
        kPoly1 - DOCUMENT ME!
        kPoly2 - DOCUMENT ME!
      • Bisection

        public boolean Bisection​(float fXMin,
                                 float fXMax,
                                 int iDigitsAccuracy,
                                 float[] afReturn)
        Returns Float which is null if no root is found; otherwise contains the value of the root.
        Parameters:
        fXMin - DOCUMENT ME!
        fXMax - DOCUMENT ME!
        iDigitsAccuracy - DOCUMENT ME!
        Returns:
        DOCUMENT ME!
      • Copy

        public void Copy​(Polynomial1f kPoly)
        set this polynomial to have the same coefficients as those in the specified polynomial.
        Parameters:
        kPoly - DOCUMENT ME!
      • Eval

        public float Eval​(float fT)
        evaluate this polynomial for the specified value.
        Parameters:
        fT - DOCUMENT ME!
        Returns:
        DOCUMENT ME!
      • GetCoeff

        public float GetCoeff​(int i)
        DOCUMENT ME!
        Parameters:
        i - DOCUMENT ME!
        Returns:
        DOCUMENT ME!
      • GetDegree

        public int GetDegree()
        DOCUMENT ME!
        Returns:
        DOCUMENT ME!
      • GetDerivative

        public Polynomial1f GetDerivative()
        return new instance which is the derivative of this instance.
        Returns:
        DOCUMENT ME!
      • GetRootBisection

        public float GetRootBisection()
        Called by computeRadius, finds the root of the <= 8 degree polynomial through bisection method:
        Returns:
        DOCUMENT ME!
      • GetRootsOnInterval

        public int GetRootsOnInterval​(float fXMin,
                                      float fXMax,
                                      float[] afRoot,
                                      int iDigitsAccuracy)
        afRoot should have length 2; returns number roots found, which are returned in the afRoot array.
        Parameters:
        fXMin - DOCUMENT ME!
        fXMax - DOCUMENT ME!
        afRoot - DOCUMENT ME!
        iDigitsAccuracy - DOCUMENT ME!
        Returns:
        DOCUMENT ME!
      • Mult

        public void Mult​(Polynomial1f kPoly1,
                         Polynomial1f kPoly2)
        set this polynomial to the product of two polynomials.
        Parameters:
        kPoly1 - DOCUMENT ME!
        kPoly2 - DOCUMENT ME!
      • RootsDegree3

        public int RootsDegree3​(float[] afRoot)
        afRoot should have length 3 which is used to return the real roots found; returns 0 if no root can be found, otherwise returns the number of real roots found (1 or 3);
        Parameters:
        afRoot - DOCUMENT ME!
        Returns:
        DOCUMENT ME!
      • Scale

        public void Scale​(float fScalar)
        sets this instance to the scalar product with itself.
        Parameters:
        fScalar - DOCUMENT ME!
      • SetCoeff

        public void SetCoeff​(int i,
                             float fValue)
        DOCUMENT ME!
        Parameters:
        i - DOCUMENT ME!
        fValue - DOCUMENT ME!
      • Sub

        public void Sub​(Polynomial1f kPoly1,
                        Polynomial1f kPoly2)
        sets this instance to the difference of two polynomial instances.
        Parameters:
        kPoly1 - DOCUMENT ME!
        kPoly2 - DOCUMENT ME!