Menu

Calling quadl from a class

2007-09-03
2012-09-15
  • Bogdan Cristea

    Bogdan Cristea - 2007-09-03

    Is there a way to call quad from a class using a function which is a member of that class?

    Minimal example:

    class Example
    {
    double fct_to_int(const double x);
    double integrate(double a, double b);
    };

    double integrate(double a, double b)
    {
    return quad(fct_to_int, a, b);
    }

     
    • Bogdan Cristea

      Bogdan Cristea - 2007-09-03

      I reply to myself: pointers to functions and to member functions are incompatible.
      Possible solution: define a templated version of this function to use pointers to member function.
      Is this possible?

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.