COPASI API  4.16.103
CEFMAlgorithm.h
Go to the documentation of this file.
1 /* Begin CVS Header
2 $Source: /Volumes/Home/Users/shoops/cvs/copasi_dev/copasi/elementaryFluxModes/CEFMAlgorithm.h,v $
3 $Revision: 1.20 $
4 $Name: $
5 $Author: shoops $
6 $Date: 2011/04/26 16:10:37 $
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 /**
19  * CEFMAlgorithm class.
20  * Used to calculate elementary flux modes
21  *
22  * Created for COPASI by Stefan Hoops 2002-05-08
23  * (C) Stefan Hoops 2002
24  */
25 
26 #ifndef COPASI_CEFMAlgorithm
27 #define COPASI_CEFMAlgorithm
28 
29 #include <vector>
30 
33 
34 #include "utilities/CMatrix.h"
35 #include "utilities/CCopasiNode.h"
36 
37 class CTableauMatrix;
38 
40 {
42 
43 private:
44  class CSpeciesOrderNode : public CCopasiNode< size_t >
45  {
46  private:
48 
49  public:
51 
52  CSpeciesOrderNode(const size_t & index,
53  const CTableauMatrix & matrix);
54 
56 
57  void update(const CTableauMatrix & matrix);
58 
59  private:
60  std::vector< size_t > mTableauLines;
61  };
62 
63 protected:
64  /**
65  * Default constructor
66  * @param const CCopasiContainer * pParent (Default: NULL)
67  */
68  CEFMAlgorithm(const CCopasiContainer * pParent = NULL);
69 
70  /**
71  * Constructor to be called by derived methods
72  * @param const CCopasiMethod::SubType subType
73  * @param const CCopasiContainer * pParent (Default: NULL)
74  */
76  const CCopasiContainer * pParent = NULL);
77 
78 public:
79  /**
80  * Copy Constructor
81  * @param const CEFMAlgorithm & src
82  */
83  CEFMAlgorithm(const CEFMAlgorithm & src,
84  const CCopasiContainer * pParent = NULL);
85 
86  /**
87  * Destructor
88  */
90 
91  /**
92  * Execute the optimization algorithm calling simulation routine
93  * when needed. It is noted that this procedure can give feedback
94  * of its progress by the callback function set with SetCallback.
95  * @ return success;
96  */
97  virtual bool calculate();
98 
99  /**
100  * Do the actual calculation
101  */
102  void calculateFluxModes();
103 
104  virtual bool initialize();
105 
106 private:
107  void initObjects();
108 
109  /**
110  * Initialize arrays and pointer called by calculate.
111  */
112  void calculateNextTableau();
113 
114  /**
115  * Construct the flux modes
116  */
117  void buildFluxModes();
118 
119  /**
120  * Find index containing smallest number of combinations
121  */
123 
124  /**
125  * Calculate number of combinations for an index
126  */
127  double calculateCombinations(size_t index);
128 
129  // Attributes
130 protected:
131  /**
132  * A pointer to the model
133  */
135 
136  /**
137  * Matrix containing the reordered stoichiometry matrix.
138  */
139  std::vector< std::vector< C_FLOAT64 > > mStoi;
140 
141  /**
142  * The number of reversible reactions.
143  */
144  size_t mReversible;
145 
146  /**
147  * A pointer to the current tableau matrix
148  */
150 
151  /**
152  * A pointer to the next tableaun matrix
153  */
155 
156  /**
157  * The current step used for process report.
158  */
159  unsigned C_INT32 mStep;
160 
161  /**
162  * The current step used for process report.
163  */
165 
166  /**
167  * The max step used for process report.
168  */
169  unsigned C_INT32 mMaxStep;
170 
171  /**
172  * Handle to the process report item "Current Step"
173  */
174  size_t mhSteps;
175 
176  /**
177  * Vector set containing all step indexes for iteration when calculating flux modes.
178  */
179  std::vector<size_t> mIndexSet;
180 
181 };
182 
183 #endif // COPASI_CEFMAlgorithm
double calculateCombinations(size_t index)
static CEFMMethod * createMethod(CCopasiMethod::SubType subType=CCopasiMethod::EFMAlgorithm)
Definition: CEFMMethod.cpp:47
unsigned C_INT32 mMaxStep
std::vector< std::vector< C_FLOAT64 > > mStoi
CEFMAlgorithm(const CCopasiContainer *pParent=NULL)
CTableauMatrix * mpNextTableau
#define C_INT32
Definition: copasi.h:90
virtual bool calculate()
bool findMinimalCombinationIndex()
std::vector< size_t > mIndexSet
void calculateFluxModes()
virtual bool initialize()
void update(const CTableauMatrix &matrix)
CTableauMatrix * mpCurrentTableau
void calculateNextTableau()
CModel * mpModel
unsigned C_INT32 mStep
unsigned C_INT32 mStepProcess
Definition: CModel.h:50
size_t mReversible
std::vector< size_t > mTableauLines
Definition: CEFMAlgorithm.h:60