gov.nasa.ial.mde.solver.classifier
Class QuadraticClassifier

java.lang.Object
  extended by gov.nasa.ial.mde.solver.classifier.MDEClassifier
      extended by gov.nasa.ial.mde.solver.classifier.QuadraticClassifier

public class QuadraticClassifier
extends MDEClassifier

A classifier for Quadratics.

Since:
1.0
Version:
1.0
Author:
Dr. Robert Shelton

Field Summary
static int ALL_POINTS
          A type of quadratic.
static int CROSS
          A type of quadratic.
static int ELLIPSE
          A type of quadratic.
static int HORIZONTAL_LINE
          A type of quadratic.
static int HYPERBOLA
          A type of quadratic.
static int NULL_SET
          A type of quadratic.
static int PARABOLA
          A type of quadratic.
static int SINGLE_POINT
          A type of quadratic.
static int SLOPING_LINE
          A type of quadratic.
static int TWO_HORIZONTAL_LINES
          A type of quadratic.
static int TWO_POINTS
          A type of quadratic.
static int TWO_VERTICAL_LINES
          A type of quadratic.
static int UNKNOWN
          A type of quadratic.
static int VERTICAL_LINE
          A type of quadratic.
 
Constructor Summary
QuadraticClassifier(Polynomial lhs)
          Creates a quadratic classifier for the specified polynomial.
 
Method Summary
 String[] getActualVariables()
          Returns the actual variables in the quadratic.
static String getEquationOfALine(double x, String[] vars)
          Returns the equation of a line.
static String getEquationOfALine(PointXY p, double inc, String[] vars)
          Obtains equation of a line in the form a*x + strBuff applies logic to find integral values of coefficients if possible Pretty-prints the result.
 SolvedGraph getFeatures(AnalyzedEquation analyzedEquation)
          Returns the solved graph features of the analyzed equation.
 int getIdentity()
          Returns the identity.
 double[][] getNewAxes()
          Returns the new axes.
 double[] getNormalizedCoefficients()
          Returns the normalized coefficients.
 String getNormalizedEquation()
          Returns the normalized equation.
 double[] getOriginalCoefficients()
          Returns the original coefficients.
 int getReason()
          Get the reason for the failure to classify.
 double getRotation()
          Returns the rotation.
 String getRotationTransform()
          Returns the rotation transform.
 double[] getTranslation()
          Returns the translation.
static boolean isNearlyInteger(double x)
          Returns true if the floating point value is nearly an integer.
static double[] makeInteger(double[] x, int lim)
          Makes the array of floating point values an integer.
static double normalizeAngleInDegrees(double angle)
          Returns a value v such that -180 < v <= 180 by adding/subtracting the appropriate multiple of 360.
 String toString()
          A text description of the equation.
 double[] UV2XY(double[] uv)
          Returns the XY array converted from the UV array.
 double[] XY2UV(double[] xy)
          Returns the UV array converted from the XY array.
 
Methods inherited from class gov.nasa.ial.mde.solver.classifier.MDEClassifier
addGraphBoundariesFeature, getFeatures
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

UNKNOWN

public static final int UNKNOWN
A type of quadratic.

See Also:
Constant Field Values

NULL_SET

public static final int NULL_SET
A type of quadratic.

See Also:
Constant Field Values

SINGLE_POINT

public static final int SINGLE_POINT
A type of quadratic.

See Also:
Constant Field Values

TWO_POINTS

public static final int TWO_POINTS
A type of quadratic.

See Also:
Constant Field Values

ALL_POINTS

public static final int ALL_POINTS
A type of quadratic.

See Also:
Constant Field Values

VERTICAL_LINE

public static final int VERTICAL_LINE
A type of quadratic.

See Also:
Constant Field Values

HORIZONTAL_LINE

public static final int HORIZONTAL_LINE
A type of quadratic.

See Also:
Constant Field Values

TWO_VERTICAL_LINES

public static final int TWO_VERTICAL_LINES
A type of quadratic.

See Also:
Constant Field Values

TWO_HORIZONTAL_LINES

public static final int TWO_HORIZONTAL_LINES
A type of quadratic.

See Also:
Constant Field Values

SLOPING_LINE

public static final int SLOPING_LINE
A type of quadratic.

See Also:
Constant Field Values

PARABOLA

public static final int PARABOLA
A type of quadratic.

See Also:
Constant Field Values

CROSS

public static final int CROSS
A type of quadratic.

See Also:
Constant Field Values

HYPERBOLA

public static final int HYPERBOLA
A type of quadratic.

See Also:
Constant Field Values

ELLIPSE

public static final int ELLIPSE
A type of quadratic.

See Also:
Constant Field Values
Constructor Detail

QuadraticClassifier

public QuadraticClassifier(Polynomial lhs)
Creates a quadratic classifier for the specified polynomial.

Parameters:
lhs - Left hand side polynomial.
Method Detail

getActualVariables

public String[] getActualVariables()
Returns the actual variables in the quadratic.

Returns:
the actual variables in the quadratic.

getOriginalCoefficients

public double[] getOriginalCoefficients()
Returns the original coefficients.

Returns:
the original coefficients.

getNormalizedCoefficients

public double[] getNormalizedCoefficients()
Returns the normalized coefficients.

Returns:
the normalized coefficients.

getNewAxes

public double[][] getNewAxes()
Returns the new axes.

Returns:
the new axes.

getRotation

public double getRotation()
Returns the rotation.

Returns:
the rotation.

getTranslation

public double[] getTranslation()
Returns the translation.

Returns:
the translation.

getIdentity

public int getIdentity()
Returns the identity.

Returns:
the identity.

getFeatures

public SolvedGraph getFeatures(AnalyzedEquation analyzedEquation)
Returns the solved graph features of the analyzed equation.

Overrides:
getFeatures in class MDEClassifier
Parameters:
analyzedEquation - the analyzed equation.
Returns:
the solved graph features for the analyzed equation.
See Also:
MDEClassifier.getFeatures(gov.nasa.ial.mde.solver.symbolic.AnalyzedEquation)

getReason

public int getReason()
Get the reason for the failure to classify.

Returns:
the reason for the failure to classify.

getNormalizedEquation

public String getNormalizedEquation()
Returns the normalized equation.

Returns:
the normalized equation.

getRotationTransform

public String getRotationTransform()
Returns the rotation transform.

Returns:
the rotation transform.

UV2XY

public double[] UV2XY(double[] uv)
Returns the XY array converted from the UV array.

Parameters:
uv - the uv array of length 2.
Returns:
the XY array of length 2.

XY2UV

public double[] XY2UV(double[] xy)
Returns the UV array converted from the XY array.

Parameters:
xy - the XY array of length 2.
Returns:
the UV array converted from the XY array.

getEquationOfALine

public static String getEquationOfALine(PointXY p,
                                        double inc,
                                        String[] vars)
Obtains equation of a line in the form a*x + strBuff applies logic to find integral values of coefficients if possible Pretty-prints the result.

Parameters:
p - a point.
inc - an increment.
vars - the variables.
Returns:
the equation of a line.

getEquationOfALine

public static String getEquationOfALine(double x,
                                        String[] vars)
Returns the equation of a line.

Parameters:
x - a value of X.
vars - the variables.
Returns:
the equation of a line.

normalizeAngleInDegrees

public static double normalizeAngleInDegrees(double angle)
Returns a value v such that -180 < v <= 180 by adding/subtracting the appropriate multiple of 360.

Parameters:
angle - an angle in degrees.
Returns:
the normalized angle in degrees.

toString

public String toString()
A text description of the equation.

Overrides:
toString in class Object
Returns:
text description of the equation.
See Also:
Object.toString()

isNearlyInteger

public static boolean isNearlyInteger(double x)
Returns true if the floating point value is nearly an integer.

Parameters:
x - a floating point value.
Returns:
true if the floating point value is nearly an integer, false otherwise.

makeInteger

public static double[] makeInteger(double[] x,
                                   int lim)
Makes the array of floating point values an integer.

Parameters:
x - floating point values.
lim - the try limit.
Returns:
an arrary of floating point values converted to an integer.


NASA Johnson Space Center Learning Technologies Project

Copyright 2006, United States Government as represented by the Administrator for the National Aeronautics and Space Administration. No copyright is claimed in the United States under Title 17, U.S. Code. All Other Rights Reserved. Use is subject to license terms.