gov.sandia.cognition.learning.algorithm.minimization.line
Class LineBracket

java.lang.Object
  extended by gov.sandia.cognition.util.AbstractCloneableSerializable
      extended by gov.sandia.cognition.learning.algorithm.minimization.line.LineBracket
All Implemented Interfaces:
CloneableSerializable, Serializable, Cloneable

@CodeReviews(reviews={@CodeReview(reviewer="Kevin R. Dixon",date="2009-07-06",changesNeeded=false,comments={"Made clone() call super.clone().","Fixed the brittleness in the copy constructor.","Looks fine."}),@CodeReview(reviewer="Justin Basilico",date="2006-10-05",changesNeeded=false,comments="Class looks fine. Compared against the code it is based on from Numerical Recipies in C and it looks fine.")})
public class LineBracket
extends AbstractCloneableSerializable

Class that defines a bracket for a scalar function. This consists of a lower bound, upper bound, and an optional third point.

Since:
1.0
Author:
Kevin R. Dixon
See Also:
Serialized Form

Constructor Summary
LineBracket()
          Creates a new instance of LineBracket
LineBracket(InputOutputSlopeTriplet lowerBound, InputOutputSlopeTriplet upperBound, InputOutputSlopeTriplet otherPoint)
          Creates a new instance of LineBracket
LineBracket(LineBracket other)
          Copy Constructor
 
Method Summary
 LineBracket clone()
          This makes public the clone method on the Object class and removes the exception that it throws.
 InputOutputSlopeTriplet getLowerBound()
          Getter for lowerBound
 InputOutputSlopeTriplet getOtherPoint()
          Getter for otherPoint
 InputOutputSlopeTriplet getUpperBound()
          Getter for upperBound
 void setLowerBound(InputOutputSlopeTriplet lowerBound)
          Setter for lowerBound
 void setOtherPoint(InputOutputSlopeTriplet otherPoint)
          Setter for otherPoint
 void setUpperBound(InputOutputSlopeTriplet upperBound)
          Setter for upperBound
 String toString()
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LineBracket

public LineBracket()
Creates a new instance of LineBracket


LineBracket

public LineBracket(InputOutputSlopeTriplet lowerBound,
                   InputOutputSlopeTriplet upperBound,
                   InputOutputSlopeTriplet otherPoint)
Creates a new instance of LineBracket

Parameters:
lowerBound - Lower bound of the bracket.
upperBound - Upper bound of the bracket.
otherPoint - Another (optional) point associated with the bracket.

LineBracket

public LineBracket(LineBracket other)
Copy Constructor

Parameters:
other - LineBracket to copy
Method Detail

clone

public LineBracket clone()
Description copied from class: AbstractCloneableSerializable
This makes public the clone method on the 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.

Specified by:
clone in interface CloneableSerializable
Overrides:
clone in class AbstractCloneableSerializable
Returns:
A clone of this object.

toString

public String toString()
Overrides:
toString in class Object

getLowerBound

public InputOutputSlopeTriplet getLowerBound()
Getter for lowerBound

Returns:
Lower bound of the bracket.

setLowerBound

public void setLowerBound(InputOutputSlopeTriplet lowerBound)
Setter for lowerBound

Parameters:
lowerBound - Lower bound of the bracket.

getUpperBound

public InputOutputSlopeTriplet getUpperBound()
Getter for upperBound

Returns:
Upper bound of the bracket.

setUpperBound

public void setUpperBound(InputOutputSlopeTriplet upperBound)
Setter for upperBound

Parameters:
upperBound - Upper bound of the bracket.

getOtherPoint

public InputOutputSlopeTriplet getOtherPoint()
Getter for otherPoint

Returns:
Another (optional) point associated with the bracket.

setOtherPoint

public void setOtherPoint(InputOutputSlopeTriplet otherPoint)
Setter for otherPoint

Parameters:
otherPoint - Another (optional) point associated with the bracket.