// RootFindLinear.h #ifndef RootFindLinear_H #define RootFindLinear_H // Search for solution by linear interpolation. The solution is // required to lie between the two starting guesses. #include "RootFinder.h" class RootFindLinear : public RootFinder { public: // enums // Return status values. enum { OK=0, INVALID_LIMITS=1, INVALID_FUNCTION_CALL=2, OUT_OF_RANGE=3, TOO_MANY_ITERATIONS=4 }; private: // attributes // maximum # iterations int _max_iter; public: // methods // constructor RootFindLinear(); // destructor ~RootFindLinear(); // Find a root. StatusDouble solve(double x1, double x2) const; }; #endif