1- // Begin CVS Header
2- // $Source: /Volumes/Home/Users/shoops/cvs/copasi_dev/copasi/compareExpressions/CNormalProduct.h,v $
3- // $Revision: 1.9 $
4- // $Name: $
5- // $Author: gauges $
6- // $Date: 2008/07/07 18:26:49 $
7- // End CVS Header
8-
9- // Copyright (C) 2008 by Pedro Mendes, Virginia Tech Intellectual
1+ // Copyright (C) 2019 by Pedro Mendes, Rector and Visitors of the
2+ // University of Virginia, University of Heidelberg, and University
3+ // of Connecticut School of Medicine.
4+ // All rights reserved.
5+
6+ // Copyright (C) 2017 - 2018 by Pedro Mendes, Virginia Tech Intellectual
7+ // Properties, Inc., University of Heidelberg, and University of
8+ // of Connecticut School of Medicine.
9+ // All rights reserved.
10+
11+ // Copyright (C) 2010 - 2016 by Pedro Mendes, Virginia Tech Intellectual
12+ // Properties, Inc., University of Heidelberg, and The University
13+ // of Manchester.
14+ // All rights reserved.
15+
16+ // Copyright (C) 2008 - 2009 by Pedro Mendes, Virginia Tech Intellectual
1017// Properties, Inc., EML Research, gGmbH, University of Heidelberg,
1118// and The University of Manchester.
1219// All rights reserved.
1320
14- // Copyright (C) 2001 - 2007 by Pedro Mendes, Virginia Tech Intellectual
21+ // Copyright (C) 2007 by Pedro Mendes, Virginia Tech Intellectual
1522// Properties, Inc. and EML Research, gGmbH.
1623// All rights reserved.
1724
@@ -32,168 +39,168 @@ class CNormalGeneralPower;
3239class CNormalChoice ;
3340
3441class compareItemPowers
35- {
36- public:
37- bool operator ()(const CNormalItemPower* itemPower1, const CNormalItemPower* itemPower2);
38- };
42+ {
43+ public:
44+ bool operator ()(const CNormalItemPower* itemPower1, const CNormalItemPower* itemPower2) const ;
45+ };
3946
4047/* *
4148 * The class for products used in CNormal
4249 */
4350class CNormalProduct : public CNormalBase
44- {
45- private:
46- /* *
47- * Enumeration of members
48- */
49- C_FLOAT64 mFactor ;
50- std::set<CNormalItemPower*, compareItemPowers > mItemPowers ;
51-
52- public:
53-
54- /* *
55- * Default constructor
56- */
57- CNormalProduct ();
58-
59- /* *
60- * Copy contructor
61- */
62- CNormalProduct (const CNormalProduct& src);
63-
64- virtual CNormalBase * copy () const ;
65-
66- /* *
67- * Assignment operator
68- */
69- CNormalProduct & operator =(const CNormalProduct& src);
70-
71- /* *
72- * Smaller operator
73- */
74- bool operator <(const CNormalProduct& rhs) const ;
75-
76- /* *
77- * Destructor
78- */
79- virtual ~CNormalProduct ();
80-
81- /* *
82- * Set the factor for this product.
83- * @return true.
84- */
85- bool setFactor (const C_FLOAT64& number);
86-
87- /* *
88- * Multiply this product with a number.
89- * @return true.
90- */
91- bool multiply (const C_FLOAT64& number);
92-
93- /* *
94- * Multiply an item to this product.
95- * @return true.
96- */
97- bool multiply (const CNormalItem& item);
98-
99- /* *
100- * Multiply a function to this product.
101- * @return true.
102- */
103- bool multiply (const CNormalFunction& fun);
104-
105- /* *
106- * Multiply a function to this product.
107- * @return true.
108- */
109- bool multiply (const CNormalChoice& choice);
110-
111- /* *
112- * Multiply a general power to this product.
113- * @return true.
114- */
115- bool multiply (const CNormalGeneralPower& pow);
116-
117- /* *
118- * Multiply an itempower to this product.
119- * @return true.
120- */
121- bool multiply (const CNormalItemPower& itemPower);
122-
123- /* *
124- * Multiply a list of itempowers to this product.
125- * @return true.
126- */
127- bool multiply (const std::set <CNormalItemPower*, compareItemPowers >& itemPowers);
128-
129- /* *
130- * Remove an itempower from this product, provided it is a factor of it.
131- * @return true.
132- */
133- bool remove (std::set<CNormalItemPower*, compareItemPowers >::iterator it);
134-
135- /* *
136- * Remove an itempower from this product, provided it is a factor of it.
137- * -used in multiplication with lcm-
138- * @return true.
139- */
140- bool remove (const CNormalItemPower& itemPower);
141-
142- /* *
143- * Multiply this product with another product.
144- * @return true
145- */
146- bool multiply (const CNormalProduct& product);
147-
148- /* *
149- * Multiply this product with a sum NOT CONTAINING FRACTIONS!.
150- * @return sum.
151- */
152- CNormalSum* multiply (const CNormalSum& sum);
153-
154- /* *
155- * Multiply this product with a lcm.
156- * @return true
157- */
158- const CNormalSum* multiply (const CNormalLcm& lcm);
159-
160- /* *
161- * Retrieve the factor of this product.
162- * @return mFactor.
163- */
164- const C_FLOAT64 & getFactor () const ;
165-
166- /* *
167- * Retrieve the set of itempowers of this product.
168- * @return mItemPowers.
169- */
170- const std::set <CNormalItemPower*, compareItemPowers >& getItemPowers () const ;
171-
172- /* *
173- * Sets the item powers of this product.
174- */
175- void setItemPowers (const std::set<CNormalItemPower*, compareItemPowers>& set);
176-
177- bool checkSamePowerList (const CNormalProduct & rhs) const ;
178-
179- bool operator ==(const CNormalProduct & rhs) const ;
180-
181- virtual std::string toString () const ;
182-
183- virtual bool simplify ();
184-
185- CNormalGeneralPower* getDenominator () const ;
186-
187- void setDenominatorsOne ();
188-
189- /* *
190- * Returns a product that is 1.
191- * In this case it only creates a new product instance with new.
192- */
193- static CNormalProduct* createUnitProduct ();
194-
195- friend std::ostream & operator << (std::ostream &os,
196- const CNormalProduct & d);
197- };
51+ {
52+ private:
53+ /* *
54+ * Enumeration of members
55+ */
56+ C_FLOAT64 mFactor ;
57+ std::set<CNormalItemPower*, compareItemPowers > mItemPowers ;
58+
59+ public:
60+
61+ /* *
62+ * Default constructor
63+ */
64+ CNormalProduct ();
65+
66+ /* *
67+ * Copy contructor
68+ */
69+ CNormalProduct (const CNormalProduct& src);
70+
71+ virtual CNormalBase * copy () const ;
72+
73+ /* *
74+ * Assignment operator
75+ */
76+ CNormalProduct & operator =(const CNormalProduct& src);
77+
78+ /* *
79+ * Smaller operator
80+ */
81+ bool operator <(const CNormalProduct& rhs) const ;
82+
83+ /* *
84+ * Destructor
85+ */
86+ virtual ~CNormalProduct ();
87+
88+ /* *
89+ * Set the factor for this product.
90+ * @return true.
91+ */
92+ bool setFactor (const C_FLOAT64& number);
93+
94+ /* *
95+ * Multiply this product with a number.
96+ * @return true.
97+ */
98+ bool multiply (const C_FLOAT64& number);
99+
100+ /* *
101+ * Multiply an item to this product.
102+ * @return true.
103+ */
104+ bool multiply (const CNormalItem& item);
105+
106+ /* *
107+ * Multiply a function to this product.
108+ * @return true.
109+ */
110+ bool multiply (const CNormalFunction& fun);
111+
112+ /* *
113+ * Multiply a function to this product.
114+ * @return true.
115+ */
116+ bool multiply (const CNormalChoice& choice);
117+
118+ /* *
119+ * Multiply a general power to this product.
120+ * @return true.
121+ */
122+ bool multiply (const CNormalGeneralPower& pow);
123+
124+ /* *
125+ * Multiply an itempower to this product.
126+ * @return true.
127+ */
128+ bool multiply (const CNormalItemPower& itemPower);
129+
130+ /* *
131+ * Multiply a list of itempowers to this product.
132+ * @return true.
133+ */
134+ bool multiply (const std::set <CNormalItemPower*, compareItemPowers >& itemPowers);
135+
136+ /* *
137+ * Remove an itempower from this product, provided it is a factor of it.
138+ * @return true.
139+ */
140+ bool remove (std::set<CNormalItemPower*, compareItemPowers >::iterator it);
141+
142+ /* *
143+ * Remove an itempower from this product, provided it is a factor of it.
144+ * -used in multiplication with lcm-
145+ * @return true.
146+ */
147+ bool remove (const CNormalItemPower& itemPower);
148+
149+ /* *
150+ * Multiply this product with another product.
151+ * @return true
152+ */
153+ bool multiply (const CNormalProduct& product);
154+
155+ /* *
156+ * Multiply this product with a sum NOT CONTAINING FRACTIONS!.
157+ * @return sum.
158+ */
159+ CNormalSum* multiply (const CNormalSum& sum);
160+
161+ /* *
162+ * Multiply this product with a lcm.
163+ * @return true
164+ */
165+ const CNormalSum* multiply (const CNormalLcm& lcm);
166+
167+ /* *
168+ * Retrieve the factor of this product.
169+ * @return mFactor.
170+ */
171+ const C_FLOAT64 & getFactor () const ;
172+
173+ /* *
174+ * Retrieve the set of itempowers of this product.
175+ * @return mItemPowers.
176+ */
177+ const std::set <CNormalItemPower*, compareItemPowers >& getItemPowers () const ;
178+
179+ /* *
180+ * Sets the item powers of this product.
181+ */
182+ void setItemPowers (const std::set<CNormalItemPower*, compareItemPowers>& set);
183+
184+ bool checkSamePowerList (const CNormalProduct & rhs) const ;
185+
186+ bool operator ==(const CNormalProduct & rhs) const ;
187+
188+ virtual std::string toString () const ;
189+
190+ virtual bool simplify ();
191+
192+ CNormalGeneralPower* getDenominator () const ;
193+
194+ void setDenominatorsOne ();
195+
196+ /* *
197+ * Returns a product that is 1.
198+ * In this case it only creates a new product instance with new.
199+ */
200+ static CNormalProduct* createUnitProduct ();
201+
202+ friend std::ostream & operator << (std::ostream &os,
203+ const CNormalProduct & d);
204+ };
198205
199206#endif // COPASI_CNormalProduct_H__
0 commit comments