Documentation of 'joptima.functions.Quadratic' Java class
Quadratic
joptima.functions

Class Quadratic

  • All Implemented Interfaces:
    Function


    public class Quadratic
    extends ConstrainableFunction
    Function a * x^2 + b * x + c. A concrete implementation of joptima.Function that calculates a quadratic function of one argument.
    • Field Summary

      Fields 
      Modifier and Type Field and Description
      double m_a 
      double m_b 
      double m_c 
    • Constructor Summary

      Constructors 
      Constructor and Description
      Quadratic()
      Default constructor: a = 1, b = 0, c = 0.
      Quadratic(double a, double b, double c)
      Constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      double calculate(double x)
      Calculates the value of the function at the given point using the preset parameters.
      void constrain(java.lang.String parametername)
      Removes the given parameter from the parameter list.
      double getA() 
      double getB() 
      double getC() 
      java.lang.String getName()
      Gets the (user-settable) name of this function.
      Parameter[] getParameters()
      Lists all the mutable parameters to this function.
      void setA(double a) 
      void setB(double b) 
      void setC(double c) 
      void setName(java.lang.String newname)
      Overrides the default function name.
      • Methods inherited from class java.lang.Object

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

      • m_a

        public double m_a
      • m_b

        public double m_b
      • m_c

        public double m_c
    • Constructor Detail

      • Quadratic

        public Quadratic()
        Default constructor: a = 1, b = 0, c = 0.
      • Quadratic

        public Quadratic(double a,
                         double b,
                         double c)
        Constructor.
    • Method Detail

      • getParameters

        public Parameter[] getParameters()
        Description copied from interface: Function
        Lists all the mutable parameters to this function.
        Returns:
        a Parameter[] of delegates that access the proper member variables.
      • constrain

        public void constrain(java.lang.String parametername)
        Description copied from class: ConstrainableFunction
        Removes the given parameter from the parameter list. This constraint is mandatory to implement.
        Specified by:
        constrain in class ConstrainableFunction
      • getName

        public java.lang.String getName()
        Description copied from interface: Function
        Gets the (user-settable) name of this function.
        Returns:
        the name of the function
      • setName

        public void setName(java.lang.String newname)
        Description copied from interface: Function
        Overrides the default function name.
        Parameters:
        newname - the new name for the function
      • calculate

        public double calculate(double x)
        Description copied from interface: Function
        Calculates the value of the function at the given point using the preset parameters.
        Parameters:
        x - the x coordinate to calculate the function at
        Returns:
        the value of the function at the given coordinate
      • getA

        public double getA()
      • setA

        public void setA(double a)
      • getB

        public double getB()
      • setB

        public void setB(double b)
      • getC

        public double getC()
      • setC

        public void setC(double c)

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.