00001 #ifndef __INTEGRATEVEC_H
00002 #define __INTEGRATEVEC_H
00003
00004
00005 enum CallMethod{a_function,a_class};
00006
00007
00008
00009
00010
00011
00012 class CIntegrateVector{
00013
00014 public:
00015
00016 CIntegrateVector(void);
00017 ~CIntegrateVector(void);
00018
00019
00020 void SetNDim(int n){_ndim=n;CheckNDim();NewLimits();}
00021 void SetNumFunc(int n){_numfunc=n;NewResults();}
00022 void SetMinPts(int n){_minpts=n;}
00023 void SetMaxPts(int n){_maxpts=n;}
00024 void SetKey(int n){_key=n;CheckKey();}
00025 void SetAbsErr(double n){_abserr=n;}
00026 void SetRelErr(double n){_relerr=n;}
00027 void SetLimits(int n, double lolim, double uplim)
00028 {_lowerlimits[n]=lolim;_upperlimits[n]=uplim;}
00029
00030
00031 int GetNDim(void){return _ndim;}
00032 int GetNumFunc(void){return _numfunc;}
00033 int GetMinPts(void){return _minpts;}
00034 int GetMaxPts(void){return _maxpts;}
00035 int GetKey(void){return _key;}
00036 int GetNW(void){return _nw;}
00037 int GetRestart(void){return _restart;}
00038 double GetAbsErr(void){return _abserr;}
00039 double GetRelErr(void){return _relerr;}
00040 double GetUpperLimit(int n){return _upperlimits[n];}
00041 double GetLowerLimit(int n){return _lowerlimits[n];}
00042 int GetNumEvals(void){return _neval;}
00043 int GetIFail(void){return _ifail;}
00044 double GetResults(int n){return _results[n];}
00045 double GetError(int n){return _error[n];}
00046
00047
00048 void Compute(void (*_func)(int*,double*,int*,double*));
00049 void Compute(void* classptr, void (*_func)(void*, int*,double*,int*,double*));
00050
00051 private:
00052
00053 void SetNW(void);
00054 void SetNumFtnCalls(void);
00055 void SetRestart(int n){_restart=n;}
00056
00057
00058 void CheckNDim(void);
00059 void CheckKey(void);
00060 void CheckMaxPts(void);
00061
00062
00063 void NewLimits(void);
00064 void DeleteLimits(void);
00065 void NewResults(void);
00066 void DeleteResults(void);
00067 void NewWorkArray(void);
00068 void DeleteWorkArray(void);
00069
00070
00071 int _ndim;
00072 int _numfunc;
00073 double *_lowerlimits;
00074 double *_upperlimits;
00075 int _minpts;
00076 int _maxpts;
00077 double _abserr;
00078 double _relerr;
00079 int _key;
00080 int _nw;
00081 int _restart;
00082
00083
00084 double *_results;
00085 double *_error;
00086 int _neval;
00087 int _ifail;
00088 double *_work;
00089 int _numftncalls;
00090 };
00091 #endif