/** * Copyright (c): Uwe Schmidt, FH Wedel * * You may study, modify and distribute this source code * FOR NON-COMMERCIAL PURPOSES ONLY. * This copyright message has to remain unchanged. * * Note that this document is provided 'as is', * WITHOUT WARRANTY of any kind either expressed or implied. */ /** * abstract class for all methods * to find a 0 point in a given interval * for a real function */ abstract public class SearchZero { //-------------------- // precision of solution protected double precision; //-------------------- // // Constructors public SearchZero() { this(1e-10); } public SearchZero(double precision) { this.precision = precision; } //-------------------- // // the method for finding a zero abstract public double searchZero(double x1, double x2, RealFunction f) throws NoZeroFoundException; //-------------------- // performance measurement // count number of function calls // should be reset at start of every // call to searchZero protected int noOfCalls; public int getNoOfCalls() { return noOfCalls; } }