COPASI API  4.16.103
CNormalLcm.h
Go to the documentation of this file.
1 // Begin CVS Header
2 // $Source: /Volumes/Home/Users/shoops/cvs/copasi_dev/copasi/compareExpressions/CNormalLcm.h,v $
3 // $Revision: 1.5 $
4 // $Name: $
5 // $Author: gauges $
6 // $Date: 2009/03/03 15:57:53 $
7 // End CVS Header
8 
9 // Copyright (C) 2008 by Pedro Mendes, Virginia Tech Intellectual
10 // Properties, Inc., EML Research, gGmbH, University of Heidelberg,
11 // and The University of Manchester.
12 // All rights reserved.
13 
14 // Copyright (C) 2001 - 2007 by Pedro Mendes, Virginia Tech Intellectual
15 // Properties, Inc. and EML Research, gGmbH.
16 // All rights reserved.
17 
18 #ifndef COPASI_CNormalLcm_H__
19 #define COPASI_CNormalLcm_H__
20 
21 class CNormalItemPower;
22 class CNormalSum;
23 class CNormalLcm;
24 
25 #include <vector>
26 #include <string>
27 
29 
30 /**
31  * The class for lcms used in CNormal
32  */
34  {
35  private:
36  /**
37  * Enumeration of members
38  */
39  std::set <CNormalItemPower*, compareItemPowers > mItemPowers;
40  std::vector<CNormalSum*> mSums; //mSums do not contain fractions!!
41 #ifdef COPASI_DEBUG
42  std::string mInfix;
43 #endif /* COPASI_DEBUG */
44 
45  public:
46  /**
47  * Default constructor
48  */
49  CNormalLcm();
50 
51  /**
52  * Copy contructor
53  */
54  CNormalLcm(const CNormalLcm& src);
55 
56  /**
57  * Assignment operator
58  */
59  CNormalLcm & operator=(const CNormalLcm& src);
60 
61  /**
62  * Destructor
63  */
64  ~CNormalLcm();
65 
66  /**
67  * Add an itempower to this lcm,
68  * ie. lcm := LeastCommonMultiple(lcm,itempower)
69  * @return true.
70  */
71  bool add(const CNormalItemPower& itemPower);
72 
73  /**
74  * Add a fractionless sum to this lcm,
75  * ie. lcm := LeastCommonMultiple(lcm,sum)
76  * @return true.
77  */
78  bool add(const CNormalSum& sum);
79 
80  /**
81  * Remove an itempower from this lcm, provided it is a factor
82  * @return true.
83  */
84  bool remove(const CNormalItemPower& itemPower);
85 
86  /**
87  * Remove a fractionless sum from this lcm, provided it is a factor
88  * @return true.
89  */
90  bool remove(const CNormalSum& sum); //sum must not contain fractions!!
91 
92  /**
93  * Retrieve the set of itempowers of this lcm.
94  * @return mItemPowers.
95  */
96  const std::set <CNormalItemPower*, compareItemPowers >& getItemPowers() const;
97 
98  /**
99  * Retrieve the vector of sums of this lcm.
100  * @return mSums.
101  */
102  const std::vector<CNormalSum*>& getSums() const;
103 
104  std::string toString() const;
105 
106 #ifdef COPASI_DEBUG
107  void refresh();
108 #endif /* COPASI_DEBUG */
109  friend std::ostream & operator<< (std::ostream &os, const CNormalLcm & d);
110  };
111 
112 #endif // COPASI_CNormalLcm_H__
friend std::ostream & operator<<(std::ostream &os, const CNormalLcm &d)
Definition: CNormalLcm.cpp:287
const std::vector< CNormalSum * > & getSums() const
Definition: CNormalLcm.cpp:275
bool add(const CNormalItemPower &itemPower)
Definition: CNormalLcm.cpp:105
std::string toString() const
Definition: CNormalLcm.cpp:280
std::set< CNormalItemPower *, compareItemPowers > mItemPowers
Definition: CNormalLcm.h:39
std::vector< CNormalSum * > mSums
Definition: CNormalLcm.h:40
CNormalLcm & operator=(const CNormalLcm &src)
Definition: CNormalLcm.cpp:65
const std::set< CNormalItemPower *, compareItemPowers > & getItemPowers() const
Definition: CNormalLcm.cpp:266