00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 
00019 
00020 
00021 
00022 
00023 
00024 
00025 
00026 
00027 
00028 
00029 
00030 
00031 #ifndef SUNDANCE_STDSUMTRANSFORMATION_H
00032 #define SUNDANCE_STDSUMTRANSFORMATION_H
00033 
00034 #include "SundanceDefs.hpp"
00035 #include "SundanceSumTransformationSequence.hpp"
00036 
00037 namespace Sundance
00038 {
00039 using namespace Sundance;
00040 using namespace Teuchos;
00041 using namespace Sundance;
00042 
00043 
00044 
00045 
00046 
00047 
00048 
00049 class StdSumTransformations : public SumTransformationSequence
00050 {
00051 public:
00052   StdSumTransformations();
00053 
00054   virtual ~StdSumTransformations(){;}
00055 };
00056 
00057 
00058 
00059 
00060 class IdentifyPolynomialSum : public SumTransformation
00061 {
00062 public:
00063 
00064   IdentifyPolynomialSum() : SumTransformation() {;}
00065 
00066 
00067   virtual ~IdentifyPolynomialSum(){;}
00068 
00069 
00070   virtual bool doTransform(const RCP<ScalarExpr>& left, 
00071     const RCP<ScalarExpr>& right,
00072     int sign, RCP<ScalarExpr>& rtn) const ;
00073 };
00074 
00075 
00076 
00077 
00078 class ReorderSum : public SumTransformation
00079 {
00080 public:
00081 
00082   ReorderSum() : SumTransformation() {;}
00083 
00084 
00085   virtual ~ReorderSum(){;}
00086 
00087 
00088   virtual bool doTransform(const RCP<ScalarExpr>& left, 
00089     const RCP<ScalarExpr>& right,
00090     int sign, RCP<ScalarExpr>& rtn) const ;
00091 };
00092     
00093 
00094 
00095 
00096 
00097 
00098 
00099 
00100 
00101 
00102 
00103 
00104 
00105 
00106 class RemoveUnaryMinusFromSum : public SumTransformation
00107 {
00108 public:
00109 
00110   RemoveUnaryMinusFromSum() : SumTransformation() {;}
00111 
00112 
00113   virtual ~RemoveUnaryMinusFromSum(){;}
00114 
00115 
00116   virtual bool doTransform(const RCP<ScalarExpr>& left, 
00117     const RCP<ScalarExpr>& right,
00118     int sign, RCP<ScalarExpr>& rtn) const ;
00119 };
00120     
00121 
00122 
00123 
00124 
00125 
00126 
00127 class RemoveZeroFromSum : public SumTransformation
00128 {
00129 public:
00130 
00131   RemoveZeroFromSum() : SumTransformation() {;}
00132 
00133 
00134   virtual ~RemoveZeroFromSum(){;}
00135 
00136 
00137   virtual bool doTransform(const RCP<ScalarExpr>& left, 
00138     const RCP<ScalarExpr>& right,
00139     int sign, RCP<ScalarExpr>& rtn) const ;
00140 };
00141 
00142 
00143 
00144 
00145 class SumConstants : public SumTransformation
00146 {
00147 public:
00148 
00149   SumConstants() : SumTransformation() {;}
00150 
00151 
00152   virtual ~SumConstants(){;}
00153 
00154 
00155   virtual bool doTransform(const RCP<ScalarExpr>& left, 
00156     const RCP<ScalarExpr>& right,
00157     int sign, RCP<ScalarExpr>& rtn) const ;
00158 };
00159 
00160 
00161 
00162 
00163 
00164 
00165 
00166 class MoveConstantsToLeftOfSum : public SumTransformation
00167 {
00168 public:
00169 
00170   MoveConstantsToLeftOfSum() : SumTransformation() {;}
00171 
00172 
00173   virtual ~MoveConstantsToLeftOfSum(){;}
00174 
00175 
00176   virtual bool doTransform(const RCP<ScalarExpr>& left, 
00177     const RCP<ScalarExpr>& right,
00178     int sign, RCP<ScalarExpr>& rtn) const ;
00179 };
00180 
00181 
00182 
00183 
00184 
00185 
00186 
00187 
00188 
00189 
00190 
00191 
00192 class RearrangeRightSumWithConstant : public SumTransformation
00193 {
00194 public:
00195 
00196   RearrangeRightSumWithConstant() : SumTransformation() {;}
00197 
00198 
00199   virtual ~RearrangeRightSumWithConstant(){;}
00200 
00201 
00202   virtual bool doTransform(const RCP<ScalarExpr>& left, 
00203     const RCP<ScalarExpr>& right,
00204     int sign, RCP<ScalarExpr>& rtn) const ;
00205 };
00206 
00207 
00208 
00209 
00210 
00211 
00212 
00213 
00214 
00215 
00216 
00217 class RearrangeLeftSumWithConstant : public SumTransformation
00218 {
00219 public:
00220 
00221   RearrangeLeftSumWithConstant() : SumTransformation() {;}
00222 
00223 
00224   virtual ~RearrangeLeftSumWithConstant(){;}
00225 
00226 
00227   virtual bool doTransform(const RCP<ScalarExpr>& left, 
00228     const RCP<ScalarExpr>& right,
00229     int sign, RCP<ScalarExpr>& rtn) const ;
00230 };
00231 
00232 
00233 
00234 
00235 
00236 class SumIntegrals : public SumTransformation
00237 {
00238 public:
00239 
00240   SumIntegrals() : SumTransformation() {;}
00241 
00242 
00243   virtual ~SumIntegrals(){;}
00244 
00245 
00246   virtual bool doTransform(const RCP<ScalarExpr>& left, 
00247     const RCP<ScalarExpr>& right,
00248     int sign, RCP<ScalarExpr>& rtn) const ;
00249 };
00250 }
00251 
00252 
00253 #endif