00001 #ifndef _MY_ProbeFunction1D_
00002 #define _MY_ProbeFunction1D_
00003
00004 #include <vector>
00005 #include "sfunctions.h"
00013 class ProbeFunction1D
00014 {
00015 private:
00016 Function1D *m_f;
00017 double m_a,m_b;
00018 unsigned m_cmp;
00019 std::vector<double> m_vX;
00020 std::vector<double> m_vF;
00021 enum FunctionBehavour {INCREASING,DECREASING};
00022 std::vector<FunctionBehavour> m_vType;
00023
00024
00025 void add(double x,double fx);
00026 void setType(FunctionBehavour beh);
00027 FunctionBehavour getType(unsigned i) const{assert(i<m_vType.size());return m_vType[i];}
00028 unsigned find(double c) const;
00029 protected:
00030
00031 public:
00032 ProbeFunction1D(){m_f=NULL;m_a=m_b=NAN;}
00033 void sampleFunction(Function1D &f,unsigned cmp,double a,double b,unsigned nPoints);
00034
00035 ProbeFunction1D(Function1D &f,unsigned cmp,double a,double b,unsigned nPoints);
00036 ~ProbeFunction1D(){}
00037 void getMinMaxValues(double c1,double c2,double &min,double &max) const;
00038 void getMaxValues(double c1,double c2,double &max);
00039
00040 void print();
00041 };
00042
00043 #endif