#ifndef PiFunction_CCA_H #define PiFunction_CCA_H #include "ports/Function_CCA.h" namespace functions { namespace ccaimpl { /** * This class implements the Function interface * for the 4 / (1 + x^2), which can be integrated * to compute pi (the integral over the region 0..1 * is arctan(1), which is approximately Pi/4. */ class PiFunction: public virtual functions::ccaports::Function, public virtual gov::cca::Component { public: PiFunction (); ~PiFunction (); virtual double evaluate (double x); virtual void setServices (gov::cca::Services * services); private: gov::cca::Services * frameworkServices; }; } } #endif // PiFunction_CCA_H