00001 #ifndef DIFFOP_H
00002 #define DIFFOP_H
00003
00004 #include "SundanceDefs.h"
00005
00006 #include "Expr.h"
00007 #include "Derivative.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 DiffOp : public ExprBase
00024 {
00025 public:
00026
00027
00028
00029 DiffOp(const Expr& coeff, const Derivative& d);
00030
00031
00032
00033
00034
00035 virtual int sortPriority() const {return DIFFOP;}
00036
00037 virtual bool operator==(const Expr& other) const ;
00038
00039 virtual bool operator<(const Expr& other) const ;
00040
00041
00042
00043 virtual bool isDiffOp() const {return true;}
00044
00045
00046
00047 virtual ExprBase* clone() const ;
00048
00049 virtual void print(ostream& os, bool paren=false) const ;
00050
00051
00052
00053 Expr operate(const Expr& operand) const ;
00054
00055 Expr leftMultiply(const Expr& lhs) const ;
00056
00057
00058 virtual bool getMesh(Mesh& mesh) const ;
00059
00060 private:
00061 Expr coeff_;
00062 Derivative d_;
00063 };
00064
00065 }
00066 #endif