00001 #ifndef SCALAREXPRVALUE_H 00002 #define SCALAREXPRVALUE_H 00003 00004 #include "SundanceDefs.h" 00005 00006 #include "ExprValueBase.h" 00007 00008 00009 namespace Sundance 00010 { 00011 00012 using namespace TSF; 00013 using std::string; 00014 00015 using std::ostream; 00016 00017 /** \ingroup LowLevelSymbolics 00018 * The value of a scalar expression at a point 00019 */ 00020 00021 class ScalarExprValue : public ExprValueBase 00022 { 00023 public: 00024 /** \name DeveloperOnlyMethods */ 00025 //@{ 00026 /** no detailed doc */ 00027 ScalarExprValue(const double& v); 00028 /** */ 00029 virtual ~ScalarExprValue(); 00030 00031 /** */ 00032 virtual int listLength() const {return 1;} 00033 /** */ 00034 virtual int listSize() const {return 1;} 00035 00036 /** */ 00037 virtual const ExprValue& listElement(int i) const ; 00038 /** */ 00039 virtual ExprValue& listElement(int i) ; 00040 00041 /** */ 00042 virtual const double& value() const {return data_;} 00043 /** */ 00044 virtual void setValue(const double& v) {data_ = v;} 00045 00046 /** */ 00047 virtual bool isScalar() const {return true;} 00048 //@} 00049 private: 00050 double data_; 00051 static ExprValue dummyExprValue_; 00052 }; 00053 00054 } 00055 #endif 00056 00057 00058 00059 00060 00061