Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages   Examples  

ExprValue.h

Go to the documentation of this file.
00001 #ifndef EXPRVALUE_H
00002 #define EXPRVALUE_H
00003 
00004 #include "SundanceDefs.h"
00005 
00006 #include "TSFArray.h"
00007 #include "TSFSmartPtr.h"
00008 #include "ExprValueBase.h"
00009 
00010 #include "XMLObject.h"
00011 
00012 
00013 namespace Sundance
00014 {
00015 
00016   using namespace TSF;
00017   using std::string;
00018 
00019   using std::ostream;
00020 
00021   /** \ingroup UserLevelSymbolics
00022    * Heterogeneous list of doubles, for representation of the value of
00023    * an Expr at a point.
00024    */
00025 
00026   class ExprValue
00027     {
00028     public:
00029       /** \name User-level methods */
00030       //@{
00031       /** empty ctor*/
00032       ExprValue();
00033       /** */
00034       ExprValue(ExprValueBase* ptr);
00035       /** */
00036       ExprValue(const double& v);
00037       /** */
00038       ExprValue(const ExprValue& v1, const ExprValue& v2);
00039       /** */
00040       ExprValue(const ExprValue& v1, const ExprValue& v2,
00041                 const ExprValue& v3);
00042       /** */
00043       ExprValue(const ExprValue& v1, const ExprValue& v2,
00044                 const ExprValue& v3, const ExprValue& v4);
00045       /** */
00046       ExprValue(const TSFArray<ExprValue>& data);
00047 
00048       /** */
00049       int listLength() const ;
00050       /** */
00051       int listSize() const ;
00052 
00053       /** */
00054       ExprValue append(const ExprValue& other) const ;
00055       /** */
00056       const double& value() const ;
00057       /** */
00058       const double& value(const TSFArray<int>& indicies) const ;
00059 
00060       /** */
00061       const ExprValue& operator[](int i) const ;
00062       /** */
00063       ExprValue& operator[](int i);
00064 
00065       /** */
00066       friend ExprValue join(const ExprValue& L1, const ExprValue& L2);
00067       /*
00068         friend ExprValue List(const ExprValue& L1, const ExprValue& L2);
00069         friend ExprValue List(const ExprValue& L1, const ExprValue& L2,
00070         const ExprValue& L3);
00071         friend ExprValue List(const ExprValue& L1, const ExprValue& L2,
00072         const ExprValue& L3, const ExprValue& L4);
00073       */
00074 
00075       /** */
00076       ExprValue& operator+=(const ExprValue& other);
00077       /** */
00078       ExprValue& operator-=(const ExprValue& other);
00079       /** */
00080       ExprValue operator/(const double& s) const ;
00081       /** */
00082       ExprValue operator*(const double& s) const ;
00083 
00084       /** */
00085       string toString() const ;
00086       /** */
00087       XMLObject toXML() const ;
00088       //@}
00089     private:
00090       TSFSmartPtr<ExprValueBase> ptr_;
00091     };
00092 
00093   /**
00094    * \relates ExprValue
00095    * write to stream
00096    */
00097   inline ostream& operator<<(ostream& os, ExprValue& ev)
00098     {
00099       os << ev.toString();
00100       return os;
00101     }
00102 
00103   /**
00104    * \relates ExprValue
00105    * create a list
00106    */
00107   ExprValue List(const ExprValue& L1, const ExprValue& L2);
00108 
00109 
00110   /**
00111    * \relates ExprValue
00112    * create a list
00113    */
00114   ExprValue List(const ExprValue& L1, const ExprValue& L2,
00115                  const ExprValue& L3);
00116 
00117   /**
00118    * \relates ExprValue
00119    * create a list
00120    */
00121   ExprValue List(const ExprValue& L1, const ExprValue& L2,
00122                  const ExprValue& L3, const ExprValue& L4);
00123 
00124 
00125 }
00126 #endif
00127 
00128 
00129 
00130 
00131 
00132 
00133 
00134 
00135 

Contact:
Kevin Long (krlong@ca.sandia.gov)


Documentation generated by