/********************************************************************/ /* Copyright (c) 2017 System fugen G.K. and Yuzi Mizuno */ /* All rights reserved. */ /********************************************************************/ #ifndef _MGBISECTION_HH_ #define _MGBISECTION_HH_ #include "mg/MGCL.h" ///A virtual super class to solve non-linear equations by the bicection method. ///Let f(t) be a function of one double parameter, and a solution of f(t) is known ///to exist between [ts,te]. Then MGBisect::solve() gets the solution, given the initial ///candidate t, the initial span, and the tolerance to halt the iteration. ///To use MGBisection, define a subclass of MGBisection, and prepare member functions ///set_initial_t() and compare_replace(), and use solve() method to get the solution. class MGBisection{ public: MGBisection( double ts, ///