Changeset 3409 in Sophya for trunk/SophyaLib


Ignore:
Timestamp:
Nov 25, 2007, 7:13:51 PM (18 years ago)
Author:
cmv
Message:

operator(double) de ClassFunc et GenericFunc n'est plus const , cmv 25/11/2007

Location:
trunk/SophyaLib/NTools
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaLib/NTools/classfunc.h

    r3108 r3409  
    1414public:
    1515  virtual ~ClassFunc(void) { }
    16   virtual double operator()(double x) const =0;
     16  virtual double operator()(double x) =0;
    1717};
    1818
     
    2323 public:
    2424  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);}
    2626};
    2727
  • trunk/SophyaLib/NTools/genericfunc.h

    r3406 r3409  
    99
    1010//! Abstract interface definition for functions viewed as classes
    11 class GenericFunc : public ClassFunc {
     11  class GenericFunc : public ClassFunc {
    1212public:
    1313  GenericFunc(void) { }
    1414  virtual ~GenericFunc(void) { }
    1515
    16   virtual double operator()(double x) const {
     16  virtual double operator()(double x) {
    1717    cout<<"GenericFunc::operator(double) not implemented"<<endl;
    1818    throw NotAvailableOperation("GenericFunc::operator(double) not implemented");
    1919  }
    2020
    21   virtual double operator()(double x,double y) const {
     21  virtual double operator()(double x,double y) {
    2222    cout<<"GenericFunc::operator(double,double) not implemented"<<endl;
    2323    throw NotAvailableOperation("GenericFunc::operator(double,double) not implemented");
    2424  }
    2525
    26   virtual double operator()(double x,double y,double z) const {
     26  virtual double operator()(double x,double y,double z) {
    2727    cout<<"GenericFunc::operator(double,double,double) not implemented"<<endl;
    2828    throw NotAvailableOperation("GenericFunc::operator(double,double,double) not implemented");
    2929  }
    3030
    31   virtual double operator()(double* x) const {
     31  virtual double operator()(double* x) {
    3232    cout<<"GenericFunc::operator(double*) not implemented"<<endl;
    3333    throw NotAvailableOperation("GenericFunc::operator(double*) not implemented");
    3434  }
    3535
    36   virtual double operator()(vector<double>& x) const {
     36  virtual double operator()(vector<double>& x) {
    3737    cout<<"GenericFunc::operator(vector<double>&) not implemented"<<endl;
    3838    throw NotAvailableOperation("GenericFunc::operator(vector<double>&) not implemented");
  • trunk/SophyaLib/NTools/integ.cc

    r3098 r3409  
    3535
    3636//! Constructeur à partir d'une classe-fonction, et des bornes d'intégration.
    37 Integrator::Integrator(ClassFunc const & f, double xmin, double xmax)
     37Integrator::Integrator(ClassFunc & f, double xmin, double xmax)
    3838: mFunc(NULL), mClFun(&f), mGFF(NULL), mGFFParm(NULL),
    3939  mNStep(50), mDX(-1), mReqPrec(-1),
     
    5454  à [0,1], et on pourra les modifier plus tard.
    5555*/
    56 Integrator::Integrator(ClassFunc const & f)
     56Integrator::Integrator(ClassFunc & f)
    5757: mFunc(NULL), mClFun(&f), mGFF(NULL), mGFFParm(NULL),
    5858  mNStep(50), mDX(-1), mReqPrec(-1),
     
    159159//! Spécifie la fonction à intégrer, sous forme double f(double).
    160160Integrator&
    161 Integrator::SetFunc(ClassFunc const & f)
     161Integrator::SetFunc(ClassFunc & f)
    162162{
    163163  mFunc = NULL;
     
    239239{}
    240240
    241 TrpzInteg::TrpzInteg(ClassFunc const & f, double xmin, double xmax)
     241TrpzInteg::TrpzInteg(ClassFunc & f, double xmin, double xmax)
    242242: Integrator(f, xmin, xmax)
    243243{}
     
    247247{}
    248248
    249 TrpzInteg::TrpzInteg(ClassFunc const & f)
     249TrpzInteg::TrpzInteg(ClassFunc & f)
    250250: Integrator(f)
    251251{}
     
    320320
    321321
    322 GLInteg::GLInteg(ClassFunc const & f, double xmin, double xmax)
     322GLInteg::GLInteg(ClassFunc & f, double xmin, double xmax)
    323323: Integrator(f, xmin, xmax), mXPos(NULL), mWeights(NULL), mOrder(8)
    324324{
     
    332332}
    333333
    334 GLInteg::GLInteg(ClassFunc const & f)
     334GLInteg::GLInteg(ClassFunc & f)
    335335: Integrator(f), mXPos(NULL), mWeights(NULL), mOrder(8)
    336336{
  • trunk/SophyaLib/NTools/integ.h

    r3098 r3409  
    2121
    2222  Integrator();
    23   Integrator(ClassFunc const &, double xmin, double xmax);
    24   Integrator(ClassFunc const &);
     23  Integrator(ClassFunc &, double xmin, double xmax);
     24  Integrator(ClassFunc &);
    2525
    2626  Integrator(FUNC, double xmin, double xmax);
     
    3939  virtual Integrator& ReqPrec(double);   // NOT YET !
    4040  virtual Integrator& Limits(double xmin, double xmax);
    41   virtual Integrator& SetFunc(ClassFunc const &);
     41  virtual Integrator& SetFunc(ClassFunc &);
    4242  virtual Integrator& SetFunc(FUNC);
    4343  virtual Integrator& SetFunc(GeneralFunction*, double* par);
     
    4848protected:
    4949  FUNC             mFunc;
    50   ClassFunc const* mClFun;
     50  ClassFunc *      mClFun;
    5151  GeneralFunction* mGFF;
    5252  double*          mGFFParm;
     
    6868public:
    6969  TrpzInteg();
    70   TrpzInteg(ClassFunc const &, double xmin, double xmax);
    71   TrpzInteg(ClassFunc const &);
     70  TrpzInteg(ClassFunc &, double xmin, double xmax);
     71  TrpzInteg(ClassFunc &);
    7272  TrpzInteg(FUNC, double xmin, double xmax);
    7373  TrpzInteg(FUNC);
     
    8383public:
    8484  GLInteg();
    85   GLInteg(ClassFunc const &, double xmin, double xmax);
    86   GLInteg(ClassFunc const &);
     85  GLInteg(ClassFunc &, double xmin, double xmax);
     86  GLInteg(ClassFunc &);
    8787  GLInteg(FUNC, double xmin, double xmax);
    8888  GLInteg(FUNC);
Note: See TracChangeset for help on using the changeset viewer.