1 package org.lcsim.recon.tracking.trfutil; 2 3 /** 4 * Abstract interface for classes which find a root of an 5 * equation, i.e. x for which f(x) = 0. 6 * 7 * Different root-finding algorithms inherit from this base and 8 * implement methods solve(double,double) and status(). 9 * 10 * Equations are solved by inheriting from those methods and 11 * implementing method evaluate(double). It may also optionally 12 * implement method no_solution() which should return a value that 13 * the function cannot reach. 14 * 15 * @version 1.0 16 * @author Norman A. Graf 17 */ 18 public interface RootFinder 19 { 20 // Find solution starting with two guesses. 21 // Return no_solution() for failure. 22 public StatusDouble solve(double x1, double x2); 23 24 // Evaluate the function. 25 public StatusDouble evaluate(double x); 26 27 28 }