00001 #ifndef DERIVATIVE_H
00002 #define DERIVATIVE_H
00003
00004 #include "SundanceDefs.h"
00005
00006 #include "Expr.h"
00007 #include "MultiIndex.h"
00008
00009
00010 namespace Sundance
00011 {
00012
00013 using namespace TSF;
00014 using std::string;
00015
00016 using std::ostream;
00017
00018
00019
00020
00021
00022
00023 class Derivative : public ExprBase
00024 {
00025 public:
00026
00027
00028
00029 Derivative(int direction, int order = 1);
00030
00031
00032
00033
00034
00035 Derivative(const MultiIndex& d) : d_(d) {;}
00036
00037
00038
00039
00040 const MultiIndex& multiIndex() const {return d_;}
00041
00042
00043
00044
00045 virtual int sortPriority() const {return DERIVATIVE;}
00046
00047 virtual bool operator==(const Expr& other) const ;
00048
00049 virtual bool operator<(const Expr& other) const ;
00050
00051
00052
00053 virtual bool isDerivative() const {return true;}
00054
00055
00056
00057 virtual ExprBase* clone() const ;
00058
00059 virtual void print(ostream& os, bool paren=false) const ;
00060
00061 private:
00062 MultiIndex d_;
00063 };
00064
00065 }
00066 #endif
00067
00068
00069
00070
00071
00072