Changeset 3409 in Sophya for trunk/SophyaLib/NTools
- Timestamp:
- Nov 25, 2007, 7:13:51 PM (18 years ago)
- Location:
- trunk/SophyaLib/NTools
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaLib/NTools/classfunc.h
r3108 r3409 14 14 public: 15 15 virtual ~ClassFunc(void) { } 16 virtual double operator()(double x) const=0;16 virtual double operator()(double x) =0; 17 17 }; 18 18 … … 23 23 public: 24 24 Function(double (*g)(double)):f(g){} 25 virtual double operator()(double x) const{ return f(x);}25 virtual double operator()(double x) { return f(x);} 26 26 }; 27 27 -
trunk/SophyaLib/NTools/genericfunc.h
r3406 r3409 9 9 10 10 //! Abstract interface definition for functions viewed as classes 11 class GenericFunc : public ClassFunc {11 class GenericFunc : public ClassFunc { 12 12 public: 13 13 GenericFunc(void) { } 14 14 virtual ~GenericFunc(void) { } 15 15 16 virtual double operator()(double x) const{16 virtual double operator()(double x) { 17 17 cout<<"GenericFunc::operator(double) not implemented"<<endl; 18 18 throw NotAvailableOperation("GenericFunc::operator(double) not implemented"); 19 19 } 20 20 21 virtual double operator()(double x,double y) const{21 virtual double operator()(double x,double y) { 22 22 cout<<"GenericFunc::operator(double,double) not implemented"<<endl; 23 23 throw NotAvailableOperation("GenericFunc::operator(double,double) not implemented"); 24 24 } 25 25 26 virtual double operator()(double x,double y,double z) const{26 virtual double operator()(double x,double y,double z) { 27 27 cout<<"GenericFunc::operator(double,double,double) not implemented"<<endl; 28 28 throw NotAvailableOperation("GenericFunc::operator(double,double,double) not implemented"); 29 29 } 30 30 31 virtual double operator()(double* x) const{31 virtual double operator()(double* x) { 32 32 cout<<"GenericFunc::operator(double*) not implemented"<<endl; 33 33 throw NotAvailableOperation("GenericFunc::operator(double*) not implemented"); 34 34 } 35 35 36 virtual double operator()(vector<double>& x) const{36 virtual double operator()(vector<double>& x) { 37 37 cout<<"GenericFunc::operator(vector<double>&) not implemented"<<endl; 38 38 throw NotAvailableOperation("GenericFunc::operator(vector<double>&) not implemented"); -
trunk/SophyaLib/NTools/integ.cc
r3098 r3409 35 35 36 36 //! Constructeur à partir d'une classe-fonction, et des bornes d'intégration. 37 Integrator::Integrator(ClassFunc const& f, double xmin, double xmax)37 Integrator::Integrator(ClassFunc & f, double xmin, double xmax) 38 38 : mFunc(NULL), mClFun(&f), mGFF(NULL), mGFFParm(NULL), 39 39 mNStep(50), mDX(-1), mReqPrec(-1), … … 54 54 à [0,1], et on pourra les modifier plus tard. 55 55 */ 56 Integrator::Integrator(ClassFunc const& f)56 Integrator::Integrator(ClassFunc & f) 57 57 : mFunc(NULL), mClFun(&f), mGFF(NULL), mGFFParm(NULL), 58 58 mNStep(50), mDX(-1), mReqPrec(-1), … … 159 159 //! Spécifie la fonction à intégrer, sous forme double f(double). 160 160 Integrator& 161 Integrator::SetFunc(ClassFunc const& f)161 Integrator::SetFunc(ClassFunc & f) 162 162 { 163 163 mFunc = NULL; … … 239 239 {} 240 240 241 TrpzInteg::TrpzInteg(ClassFunc const& f, double xmin, double xmax)241 TrpzInteg::TrpzInteg(ClassFunc & f, double xmin, double xmax) 242 242 : Integrator(f, xmin, xmax) 243 243 {} … … 247 247 {} 248 248 249 TrpzInteg::TrpzInteg(ClassFunc const& f)249 TrpzInteg::TrpzInteg(ClassFunc & f) 250 250 : Integrator(f) 251 251 {} … … 320 320 321 321 322 GLInteg::GLInteg(ClassFunc const& f, double xmin, double xmax)322 GLInteg::GLInteg(ClassFunc & f, double xmin, double xmax) 323 323 : Integrator(f, xmin, xmax), mXPos(NULL), mWeights(NULL), mOrder(8) 324 324 { … … 332 332 } 333 333 334 GLInteg::GLInteg(ClassFunc const& f)334 GLInteg::GLInteg(ClassFunc & f) 335 335 : Integrator(f), mXPos(NULL), mWeights(NULL), mOrder(8) 336 336 { -
trunk/SophyaLib/NTools/integ.h
r3098 r3409 21 21 22 22 Integrator(); 23 Integrator(ClassFunc const&, double xmin, double xmax);24 Integrator(ClassFunc const&);23 Integrator(ClassFunc &, double xmin, double xmax); 24 Integrator(ClassFunc &); 25 25 26 26 Integrator(FUNC, double xmin, double xmax); … … 39 39 virtual Integrator& ReqPrec(double); // NOT YET ! 40 40 virtual Integrator& Limits(double xmin, double xmax); 41 virtual Integrator& SetFunc(ClassFunc const&);41 virtual Integrator& SetFunc(ClassFunc &); 42 42 virtual Integrator& SetFunc(FUNC); 43 43 virtual Integrator& SetFunc(GeneralFunction*, double* par); … … 48 48 protected: 49 49 FUNC mFunc; 50 ClassFunc const*mClFun;50 ClassFunc * mClFun; 51 51 GeneralFunction* mGFF; 52 52 double* mGFFParm; … … 68 68 public: 69 69 TrpzInteg(); 70 TrpzInteg(ClassFunc const&, double xmin, double xmax);71 TrpzInteg(ClassFunc const&);70 TrpzInteg(ClassFunc &, double xmin, double xmax); 71 TrpzInteg(ClassFunc &); 72 72 TrpzInteg(FUNC, double xmin, double xmax); 73 73 TrpzInteg(FUNC); … … 83 83 public: 84 84 GLInteg(); 85 GLInteg(ClassFunc const&, double xmin, double xmax);86 GLInteg(ClassFunc const&);85 GLInteg(ClassFunc &, double xmin, double xmax); 86 GLInteg(ClassFunc &); 87 87 GLInteg(FUNC, double xmin, double xmax); 88 88 GLInteg(FUNC);
Note:
See TracChangeset
for help on using the changeset viewer.