00001 #ifndef _BSInverse 00002 #define _BSInverse 00003 00004 #include <assert.h> 00005 #include "sfunctions.h" 00006 00007 class BSInverse : public Function1D 00008 { 00009 private: 00010 Function1D &_f; // 1D function that maps (a,b] , 0 <= a < b <=1 , onto (0, infty) 00011 // Note: f(a) may be +infty 00012 // f(b)=0 00013 // f must be decreasing on (a,b] 00014 double _a, _b; // (a,b] is the domain of f 00015 double _Tol; // tolerance for the bisection method 00016 00017 public: 00018 BSInverse(Function1D &f, double a, double b, double Tol); 00019 00020 virtual double operator()(double y, unsigned cmp) const; 00021 00022 virtual ~BSInverse(); 00023 00024 }; 00025 00026 #endif