Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | Related Pages | Search for

# MultiFuncs.cpp

    00001
    00002 namespace multi_function {
    00003
    00004 double plus(arg_ptr args) {
    00005     return *args[0] + *args[1];
    00006 }
    00007
    00008 double mult(arg_ptr args) {
    00009     return *args[0] * *args[1];
    00010 }
    00011
    00012 double min(arg_ptr args) {
    00013     return -**args;
    00014 }
    00015
    00016 double inv(arg_ptr args) {
    00017     return 1 / **args;
    00018 }
    00019
    00020 //template <typename f> class F { public: double operator()(double a) { return f(a); } };
    00021
    00022 double exp(arg_ptr args) {
    00023     return ::exp(**args);
    00024 }
    00025
    00026 } // namespace