pt.tumba.ngram.bayes
Class Bracketing

java.lang.Object
  extended by pt.tumba.ngram.bayes.Bracketing

 class Bracketing
extends java.lang.Object

Perform bisection to find the root of a function (described by an object that implements the MappingDouble interface), which must lie between x1 and x2. The root is refined until its accuracy is +/- x_accuracy.


Field Summary
private static int APPROXIMATE_ROOT_FOUND
           
private static int ERROR
           
private static int EXACT_ROOT_FOUND
           
private static int MAXIMUM_ITERATIONS
           
(package private)  int status
           
private static int TOO_MANY_BISECTIONS
           
 
Constructor Summary
Bracketing()
           
 
Method Summary
(package private)  double perform(MappingDouble function, double x1, double x2, double x_accuracy)
          Perform bisection.
(package private)  double perform(MappingDouble function, int function_type, double x1, double x2, double x_accuracy)
          Perform bisection.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

status

int status

MAXIMUM_ITERATIONS

private static final int MAXIMUM_ITERATIONS
See Also:
Constant Field Values

ERROR

private static final int ERROR
See Also:
Constant Field Values

TOO_MANY_BISECTIONS

private static final int TOO_MANY_BISECTIONS
See Also:
Constant Field Values

EXACT_ROOT_FOUND

private static final int EXACT_ROOT_FOUND
See Also:
Constant Field Values

APPROXIMATE_ROOT_FOUND

private static final int APPROXIMATE_ROOT_FOUND
See Also:
Constant Field Values
Constructor Detail

Bracketing

Bracketing()
Method Detail

perform

double perform(MappingDouble function,
               double x1,
               double x2,
               double x_accuracy)
Perform bisection.


perform

double perform(MappingDouble function,
               int function_type,
               double x1,
               double x2,
               double x_accuracy)
Perform bisection.