org.opensourcephysics.tools
Class KnownPolynomial

java.lang.Object
  extended by org.opensourcephysics.numerics.Polynomial
      extended by org.opensourcephysics.numerics.PolynomialLeastSquareFit
          extended by org.opensourcephysics.tools.KnownPolynomial
All Implemented Interfaces:
Function, KnownFunction

public class KnownPolynomial
extends PolynomialLeastSquareFit
implements KnownFunction

A polynomial that implements KnownFunction.


Method Summary
 java.lang.String getExpression(java.lang.String indepVarName)
          Gets the equation.
 java.lang.String getName()
          Gets the name of the function.
 int getParameterCount()
          Gets the parameter count.
 java.lang.String getParameterName(int i)
          Gets a parameter name.
 double getParameterValue(int i)
          Gets a parameter value.
 void setParameterValue(int i, double value)
          Sets a parameter value.
 
Methods inherited from class org.opensourcephysics.numerics.PolynomialLeastSquareFit
fitData
 
Methods inherited from class org.opensourcephysics.numerics.Polynomial
add, add, coefficient, deflate, degree, derivative, divide, divide, divideWithRemainder, evalPolynomial, evaluate, getCoefficients, integral, integral, multiply, multiply, roots, rootsReal, subtract, subtract, toString, valueAndDerivative
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.opensourcephysics.numerics.Function
evaluate
 

Method Detail

getParameterCount

public int getParameterCount()
Gets the parameter count.

Specified by:
getParameterCount in interface KnownFunction
Returns:
the number of parameters

getParameterName

public java.lang.String getParameterName(int i)
Gets a parameter name.

Specified by:
getParameterName in interface KnownFunction
Parameters:
i - the parameter index
Returns:
the name of the parameter

getParameterValue

public double getParameterValue(int i)
Gets a parameter value.

Specified by:
getParameterValue in interface KnownFunction
Parameters:
i - the parameter index
Returns:
the value of the parameter

setParameterValue

public void setParameterValue(int i,
                              double value)
Sets a parameter value.

Specified by:
setParameterValue in interface KnownFunction
Parameters:
i - the parameter index
value - the value

getExpression

public java.lang.String getExpression(java.lang.String indepVarName)
Gets the equation.

Specified by:
getExpression in interface KnownFunction
Parameters:
indepVarName - the name of the independent variable
Returns:
the equation

getName

public java.lang.String getName()
Gets the name of the function.

Specified by:
getName in interface KnownFunction
Returns:
the name