

PREV CLASS NEXT CLASS  FRAMES NO FRAMES  
SUMMARY: NESTED  FIELD  CONSTR  METHOD  DETAIL: FIELD  CONSTR  METHOD 
java.lang.Object gov.sandia.cognition.util.AbstractCloneableSerializable gov.sandia.cognition.math.AbstractScalarFunction<Double> gov.sandia.cognition.math.AbstractUnivariateScalarFunction gov.sandia.cognition.math.AbstractDifferentiableUnivariateScalarFunction gov.sandia.cognition.learning.function.scalar.PolynomialFunction.Linear gov.sandia.cognition.learning.function.scalar.PolynomialFunction.Quadratic
public static class PolynomialFunction.Quadratic
Utilities for algebraic treatment of a quadratic polynomial of the form y(x) = q0 + q1*x + q2*x^2.
Field Summary 

Fields inherited from class gov.sandia.cognition.learning.function.scalar.PolynomialFunction.Linear 

COLLINEAR_TOLERANCE 
Constructor Summary  

PolynomialFunction.Quadratic(double q0,
double q1,
double q2)
Creates a new instance of Quadratic 

PolynomialFunction.Quadratic(PolynomialFunction.Quadratic other)
Copy constructor 
Method Summary  

PolynomialFunction.Quadratic 
clone()
This makes public the clone method on the Object class and
removes the exception that it throws. 
double 
differentiate(double input)
Differentiates the output of the function about the given input 
double 
evaluate(double input)
Produces a double output for the given double input 
static double 
evaluate(double x,
double q0,
double q1,
double q2)
Evaluates a quadratic polynomial of the form y(x) = q0 + q1*x + q2*x^2 for a given value of "x" 
static PolynomialFunction.Quadratic 
fit(InputOutputPair<Double,Double> p0,
InputOutputPair<Double,Double> p1,
InputOutputPair<Double,Double> p2)
Fits a quadratic to three points 
static PolynomialFunction.Quadratic 
fit(InputOutputSlopeTriplet p0,
InputOutputPair<Double,Double> p1)
Fits a quadratic to two points, one of which has slope information. 
double 
getQ2()
Getter for q2 
Double[] 
roots()
Finds the roots (zerocrossings) of the quadratic, which has at most two, but possibly one or zero 
static Double[] 
roots(double q0,
double q1,
double q2)
Finds the roots of the quadratic equation using the quadratic formula. 
void 
setQ2(double q2)
Setter for q2 
Double[] 
stationaryPoints()
Finds the realvalued stationary points (zeroderivatives) of the quadratic. 
static Double[] 
stationaryPoints(double q0,
double q1,
double q2)
Finds the stationary point of the quadratic equation. 
String 
toString()

Methods inherited from class gov.sandia.cognition.learning.function.scalar.PolynomialFunction.Linear 

fit, fit, getQ0, getQ1, setQ0, setQ1 
Methods inherited from class gov.sandia.cognition.math.AbstractDifferentiableUnivariateScalarFunction 

differentiate 
Methods inherited from class gov.sandia.cognition.math.AbstractUnivariateScalarFunction 

evaluate, evaluateAsDouble 
Methods inherited from class java.lang.Object 

equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait 
Methods inherited from interface gov.sandia.cognition.math.ScalarFunction 

evaluateAsDouble 
Methods inherited from interface gov.sandia.cognition.evaluator.Evaluator 

evaluate 
Methods inherited from interface gov.sandia.cognition.math.DifferentiableEvaluator 

differentiate 
Constructor Detail 

public PolynomialFunction.Quadratic(double q0, double q1, double q2)
q0
 Constant (zerothorder) coefficientq1
 Linear (firstorder) coefficientq2
 Quadratic (secondorder) coefficientpublic PolynomialFunction.Quadratic(PolynomialFunction.Quadratic other)
other
 Quadratic to copyMethod Detail 

public PolynomialFunction.Quadratic clone()
AbstractCloneableSerializable
Object
class and
removes the exception that it throws. Its default behavior is to
automatically create a clone of the exact type of object that the
clone is called on and to copy all primitives but to keep all references,
which means it is a shallow copy.
Extensions of this class may want to override this method (but call
super.clone()
to implement a "smart copy". That is, to target
the most common use case for creating a copy of the object. Because of
the default behavior being a shallow copy, extending classes only need
to handle fields that need to have a deeper copy (or those that need to
be reset). Some of the methods in ObjectUtil
may be helpful in
implementing a custom clone method.
Note: The contract of this method is that you must use
super.clone()
as the basis for your implementation.
clone
in interface CloneableSerializable
clone
in class PolynomialFunction.Linear
public String toString()
toString
in class PolynomialFunction.Linear
public double evaluate(double input)
UnivariateScalarFunction
evaluate
in interface UnivariateScalarFunction
evaluate
in class PolynomialFunction.Linear
input
 Input to the Evaluator
public double differentiate(double input)
DifferentiableUnivariateScalarFunction
differentiate
in interface DifferentiableUnivariateScalarFunction
differentiate
in class PolynomialFunction.Linear
input
 Input about which to compute the derivative of the function output
public Double[] roots()
roots
in interface PolynomialFunction.ClosedForm
roots
in class PolynomialFunction.Linear
public Double[] stationaryPoints()
stationaryPoints
in interface PolynomialFunction.ClosedForm
stationaryPoints
in class PolynomialFunction.Linear
public static double evaluate(double x, double q0, double q1, double q2)
x
 Value at which to evaluate the polynomialq0
 Constantterm coefficientq1
 Linearterm coefficientq2
 Quadraticterm coefficient
public static PolynomialFunction.Quadratic fit(InputOutputPair<Double,Double> p0, InputOutputPair<Double,Double> p1, InputOutputPair<Double,Double> p2)
p0
 First pointp1
 Second pointp2
 Third point
public static PolynomialFunction.Quadratic fit(InputOutputSlopeTriplet p0, InputOutputPair<Double,Double> p1)
p0
 p1

@PublicationReference(author="Wikipedia", title="Quadratic formula", type=WebPage, year=2008, url="http://en.wikipedia.org/wiki/Quadratic_formula#Quadratic_formula") public static Double[] roots(double q0, double q1, double q2)
q0
 Constantterm coefficientq1
 Linearterm coefficientq2
 Quadraticterm coefficient
public static Double[] stationaryPoints(double q0, double q1, double q2)
q0
 Constantterm coefficientq1
 Linearterm coefficientq2
 Quadraticterm coefficient
public double getQ2()
public void setQ2(double q2)
q2
 Secondorder coefficient


PREV CLASS NEXT CLASS  FRAMES NO FRAMES  
SUMMARY: NESTED  FIELD  CONSTR  METHOD  DETAIL: FIELD  CONSTR  METHOD 