00001 // This file is part of ff3d - http://www.freefem.org/ff3d 00002 // Copyright (C) 2001, 2002, 2003 Stéphane Del Pino 00003 00004 // This program is free software; you can redistribute it and/or modify 00005 // it under the terms of the GNU General Public License as published by 00006 // the Free Software Foundation; either version 2, or (at your option) 00007 // any later version. 00008 00009 // This program is distributed in the hope that it will be useful, 00010 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 // GNU General Public License for more details. 00013 00014 // You should have received a copy of the GNU General Public License 00015 // along with this program; if not, write to the Free Software Foundation, 00016 // Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00017 00018 // $Id: MultiLinearExpressionSum.hpp,v 1.1 2007/06/10 14:59:56 delpinux Exp $ 00019 00020 #ifndef MULTI_LINEAR_EXPRESSION_SUM_HPP 00021 #define MULTI_LINEAR_EXPRESSION_SUM_HPP 00022 00023 #include <Expression.hpp> 00024 00025 #include <MultiLinearExpression.hpp> 00026 00027 #include <LinearExpression.hpp> 00028 00029 #include <list> 00030 00031 class MultiLinearExpressionSum 00032 : public Expression 00033 { 00034 private: 00035 typedef std::list<ReferenceCounting<MultiLinearExpression> > ListType; 00036 00037 public: 00038 typedef ListType::iterator iterator; 00039 00040 MultiLinearExpressionSum::iterator beginPlus() 00041 { 00042 return __listPlus.begin(); 00043 } 00044 00045 MultiLinearExpressionSum::iterator endPlus() 00046 { 00047 return __listPlus.end(); 00048 } 00049 00050 MultiLinearExpressionSum::iterator beginMinus() 00051 { 00052 return __listMinus.begin(); 00053 } 00054 00055 MultiLinearExpressionSum::iterator endMinus() 00056 { 00057 return __listMinus.end(); 00058 } 00059 00060 private: 00061 ListType __listPlus; 00062 ListType __listMinus; 00063 00064 std::ostream& put(std::ostream& os) const; 00065 00066 public: 00067 void plus(ReferenceCounting<MultiLinearExpression> m) { 00068 __listPlus.push_back(m); 00069 } 00070 00071 void minus(ReferenceCounting<MultiLinearExpression> m) { 00072 __listMinus.push_back(m); 00073 } 00074 00075 void check(); 00076 00077 void execute(); 00078 00079 MultiLinearExpressionSum() 00080 : Expression(Expression::multiLinearExpSum) 00081 { 00082 ; 00083 } 00084 00085 MultiLinearExpressionSum(const MultiLinearExpressionSum& M) 00086 : Expression(M), 00087 __listPlus(M.__listPlus), 00088 __listMinus(M.__listMinus) 00089 { 00090 ; 00091 } 00092 00093 ~MultiLinearExpressionSum() 00094 { 00095 ; 00096 } 00097 }; 00098 00099 #endif // MULTI_LINEAR_EXPRESSION_SUM_HPP
1.5.6