Class CSTClassFunction

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, javolution.lang.Immutable, javolution.lang.ValueType, javolution.xml.XMLSerializable

    public final class CSTClassFunction
    extends java.lang.Object
    implements java.lang.Cloneable, javolution.xml.XMLSerializable, javolution.lang.ValueType
    A generic Class-Shape-Transform (CST) class function implementation. The "class" of the function is determined by the input exponents: C(s) = (s)^N1*(1 - s)^N2.

    Modified by: Joseph A. Huwaldt

    Version:
    November 28, 2015
    Author:
    Joseph A. Huwaldt Date: March 14, 2014
    See Also:
    Serialized Form
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      CSTClassFunction copy()
      Returns a copy of this CSTClassFunction instance allocated by the calling thread (possibly on the stack).
      boolean equals​(java.lang.Object obj)
      Compares this CSTClassFunction against the specified object for strict equality (same values).
      double[] getDerivatives​(double s, int grade)
      Calculate all the derivatives from 0 to grade with respect to parametric distance on the class function for the given parametric distance along the class function, d^{grade}p(s)/d^{grade}s.
      double getN1()
      Return the first exponent of the class function, N1.
      double getN2()
      Return the second exponent of the class function, N2.
      double getValue​(double s)
      Return the value of this class function at the specified parametric location.
      int hashCode()
      Returns the hash code for this object.
      static CSTClassFunction newInstance​(double N1, double N2)
      Construct a new CST Class Function using the specified exponents.
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • newInstance

        public static CSTClassFunction newInstance​(double N1,
                                                   double N2)
        Construct a new CST Class Function using the specified exponents.
        Parameters:
        N1 - The 1st exponent of the class function (leading edge exponent).
        N2 - The 2nd exponent of the class function (trailing edge exponent).
        Returns:
      • getN1

        public double getN1()
        Return the first exponent of the class function, N1.
        Returns:
        The first exponent of the class function.
      • getN2

        public double getN2()
        Return the second exponent of the class function, N2.
        Returns:
        The second exponent of the class function.
      • getValue

        public double getValue​(double s)
        Return the value of this class function at the specified parametric location.
        Parameters:
        s - The parametric distance to calculate this class functions value for (0 to 1 inclusive).
        Returns:
        The value of this class function at the specified parametric location.
      • getDerivatives

        public double[] getDerivatives​(double s,
                                       int grade)
        Calculate all the derivatives from 0 to grade with respect to parametric distance on the class function for the given parametric distance along the class function, d^{grade}p(s)/d^{grade}s.

        Example:
        1st derivative (grade = 1), this returns [p(s), dp(s)/ds];
        2nd derivative (grade = 2), this returns [p(s), dp(s)/ds, d^2p(s)/d^2s]; etc.

        Parameters:
        s - Parametric distance to calculate derivatives for (0.0 to 1.0 inclusive).
        grade - The maximum grade to calculate the derivatives for (0 = value only, 1=value + 1st derivative, 2=value + 1st derivative + 2nd derivative, etc)
        Returns:
        A list of derivatives up to the specified grade of the class function at the specified parametric position.
        Throws:
        java.lang.IllegalArgumentException - if the grade is < 0.
      • equals

        public boolean equals​(java.lang.Object obj)
        Compares this CSTClassFunction against the specified object for strict equality (same values).
        Overrides:
        equals in class java.lang.Object
        Parameters:
        obj - the object to compare with.
        Returns:
        true if this object is identical to that object; false otherwise.
      • hashCode

        public int hashCode()
        Returns the hash code for this object.
        Overrides:
        hashCode in class java.lang.Object
        Returns:
        the hash code value.
      • copy

        public CSTClassFunction copy()
        Returns a copy of this CSTClassFunction instance allocated by the calling thread (possibly on the stack).
        Specified by:
        copy in interface javolution.lang.ValueType
        Returns:
        an identical and independent copy of this object.