COPASI API  4.16.103
Public Member Functions | Static Private Member Functions | Private Attributes | Friends | List of all members
CTableauLine Class Reference

#include <CTableauLine.h>

Collaboration diagram for CTableauLine:
Collaboration graph
[legend]

Public Member Functions

 CTableauLine ()
 
 CTableauLine (const std::vector< C_FLOAT64 > &reaction, bool reversible, const size_t &reactionCounter, const size_t &reactionNumber)
 
 CTableauLine (C_FLOAT64 m1, const CTableauLine &src1, C_FLOAT64 m2, const CTableauLine &src2)
 
const std::vector< C_FLOAT64 > & getFluxMode () const
 
const C_FLOAT64getMultiplier (const size_t &index) const
 
const CFluxScoregetScore () const
 
bool isReversible () const
 
 ~CTableauLine ()
 

Static Private Member Functions

static void reduce (C_FLOAT64 &r1, C_FLOAT64 &r2)
 

Private Attributes

std::vector< C_FLOAT64mFluxMode
 
CFluxScorempFluxScore
 
std::vector< C_FLOAT64mReaction
 
bool mReversible
 

Friends

std::ostream & operator<< (std::ostream &, const CTableauLine &)
 

Detailed Description

CTableauLine class. This store one row of the Tableau Matrix

Created for COPASI by Stefan Hoops 2002-05-08 (C) Stefan Hoops 2002

Definition at line 37 of file CTableauLine.h.

Constructor & Destructor Documentation

CTableauLine::CTableauLine ( )

Default constructor

CTableauLine class. This store one row of the Tableau Matrix

Created for COPASI by Stefan Hoops 2002-05-08 (C) Stefan Hoops 2002

Definition at line 37 of file CTableauLine.cpp.

References CONSTRUCTOR_TRACE, and mpFluxScore.

CFluxScore * mpFluxScore
Definition: CTableauLine.h:61
#define CONSTRUCTOR_TRACE
Definition: copasi.h:202
CTableauLine::CTableauLine ( const std::vector< C_FLOAT64 > &  reaction,
bool  reversible,
const size_t &  reactionCounter,
const size_t &  reactionNumber 
)

Specific constructor

Definition at line 39 of file CTableauLine.cpp.

References CONSTRUCTOR_TRACE, mFluxMode, mpFluxScore, mReaction, and mReversible.

43 {
45  mReaction = reaction;
46  mReversible = reversible;
47 
48  mFluxMode.resize(reactionNumber, 0);
49  mFluxMode[reactionCounter] = 1;
50 
52 }
bool mReversible
Definition: CTableauLine.h:51
std::vector< C_FLOAT64 > mReaction
Definition: CTableauLine.h:46
CFluxScore * mpFluxScore
Definition: CTableauLine.h:61
std::vector< C_FLOAT64 > mFluxMode
Definition: CTableauLine.h:56
#define CONSTRUCTOR_TRACE
Definition: copasi.h:202
CTableauLine::CTableauLine ( C_FLOAT64  m1,
const CTableauLine src1,
C_FLOAT64  m2,
const CTableauLine src2 
)

Specific constructor

Definition at line 54 of file CTableauLine.cpp.

References CONSTRUCTOR_TRACE, mFluxMode, mpFluxScore, mReaction, mReversible, and reduce().

58 {
60 
61  // We need to remove common factors in m1 and m2
62  reduce(m1, m2);
63 
64  mReversible = (src1.mReversible && src2.mReversible);
65 
66  mReaction.resize(src1.mReaction.size());
67  mFluxMode.resize(src1.mFluxMode.size());
68 
69  std::vector< C_FLOAT64 >::const_iterator it1 = src1.mReaction.begin();
70  std::vector< C_FLOAT64 >::const_iterator it2 = src2.mReaction.begin();
71  std::vector< C_FLOAT64 >::iterator it = mReaction.begin();
72  std::vector< C_FLOAT64 >::iterator end = mReaction.end();
73 
74  for (; it != end; ++it, ++it1, ++it2)
75  *it = m1 * *it1 + m2 * *it2;
76 
77  it1 = src1.mFluxMode.begin();
78  it2 = src2.mFluxMode.begin();
79  it = mFluxMode.begin();
80  end = mFluxMode.end();
81 
82  for (; it != end; ++it, ++it1, ++it2)
83  *it = m1 * *it1 + m2 * *it2;
84 
86 }
bool mReversible
Definition: CTableauLine.h:51
std::vector< C_FLOAT64 > mReaction
Definition: CTableauLine.h:46
static void reduce(C_FLOAT64 &r1, C_FLOAT64 &r2)
CFluxScore * mpFluxScore
Definition: CTableauLine.h:61
std::vector< C_FLOAT64 > mFluxMode
Definition: CTableauLine.h:56
#define CONSTRUCTOR_TRACE
Definition: copasi.h:202
CTableauLine::~CTableauLine ( )

Destructor

Definition at line 87 of file CTableauLine.cpp.

References DESTRUCTOR_TRACE, mpFluxScore, and pdelete.

#define pdelete(p)
Definition: copasi.h:215
#define DESTRUCTOR_TRACE
Definition: copasi.h:206
CFluxScore * mpFluxScore
Definition: CTableauLine.h:61

Member Function Documentation

const std::vector< C_FLOAT64 > & CTableauLine::getFluxMode ( ) const

Retrieves the flux mode

Definition at line 97 of file CTableauLine.cpp.

References mFluxMode.

Referenced by CFluxMode::CFluxMode().

98 {
99  return mFluxMode;
100 }
std::vector< C_FLOAT64 > mFluxMode
Definition: CTableauLine.h:56
const C_FLOAT64 & CTableauLine::getMultiplier ( const size_t &  index) const

Retrieve the multiplier for this reaction for the indexed species

Parameters
constsize_t & index
Returns
const C_FLOAT64 & multiplier

Definition at line 94 of file CTableauLine.cpp.

References mReaction.

95 {return mReaction[mReaction.size() - index - 1];}
std::vector< C_FLOAT64 > mReaction
Definition: CTableauLine.h:46
const CFluxScore & CTableauLine::getScore ( ) const

Retrieves the flux score

Definition at line 89 of file CTableauLine.cpp.

References mpFluxScore.

Referenced by CTableauMatrix::isValid().

90 {
91  return *mpFluxScore;
92 }
CFluxScore * mpFluxScore
Definition: CTableauLine.h:61
bool CTableauLine::isReversible ( ) const

Checks whether the reaction is reversible

Returns
"bool" isReversible

Definition at line 102 of file CTableauLine.cpp.

References mReversible.

Referenced by CTableauMatrix::addLine(), CFluxMode::CFluxMode(), and operator<<().

103 {
104  return mReversible;
105 }
bool mReversible
Definition: CTableauLine.h:51
void CTableauLine::reduce ( C_FLOAT64 r1,
C_FLOAT64 r2 
)
staticprivate

Remove the first entry from the reaction vector Divides m1 and m2 by the largest common factor.

Definition at line 137 of file CTableauLine.cpp.

References C_FLOAT64, and C_INT32.

Referenced by CTableauLine().

138 {
139  if (floor(r1) != r1 || floor(r2) != r2)
140  return;
141 
142  C_INT32 GCD1 = (C_INT32) fabs(r1);
143  C_INT32 GCD2 = (C_INT32) fabs(r2);
144 
145  while (GCD1 != GCD2)
146  {
147  if (GCD1 > GCD2)
148  {
149  GCD1 %= GCD2;
150 
151  if (GCD1 == 0)
152  {
153  GCD1 = GCD2;
154  }
155  }
156  else
157  {
158  GCD2 %= GCD1;
159 
160  if (GCD2 == 0)
161  {
162  GCD2 = GCD1;
163  }
164  }
165  }
166 
167  r1 /= (C_FLOAT64) GCD1;
168  r2 /= (C_FLOAT64) GCD2;
169 }
#define C_INT32
Definition: copasi.h:90
#define C_FLOAT64
Definition: copasi.h:92

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  os,
const CTableauLine l 
)
friend

Definition at line 113 of file CTableauLine.cpp.

114 {
115  size_t i, imax = l.mReaction.size();
116  size_t j, jmax = l.mFluxMode.size();
117 
118  if (l.isReversible())
119  os << "reversible: ";
120  else
121  os << "irreversible:";
122 
123  for (i = 0; i < imax; i++)
124  os << " " << l.mReaction[i];
125 
126  os << "\t";
127 
128  for (j = 0; j < jmax; j++)
129  os << " " << l.mFluxMode[j];
130 
131  os << std::endl;
132 
133  return os;
134 }
std::vector< C_FLOAT64 > mReaction
Definition: CTableauLine.h:46
bool isReversible() const
std::vector< C_FLOAT64 > mFluxMode
Definition: CTableauLine.h:56

Member Data Documentation

std::vector<C_FLOAT64> CTableauLine::mFluxMode
private

Definition at line 56 of file CTableauLine.h.

Referenced by CTableauLine(), getFluxMode(), and operator<<().

CFluxScore* CTableauLine::mpFluxScore
private

Definition at line 61 of file CTableauLine.h.

Referenced by CTableauLine(), getScore(), and ~CTableauLine().

std::vector<C_FLOAT64> CTableauLine::mReaction
private

Definition at line 46 of file CTableauLine.h.

Referenced by CTableauLine(), getMultiplier(), and operator<<().

bool CTableauLine::mReversible
private

Definition at line 51 of file CTableauLine.h.

Referenced by CTableauLine(), and isReversible().


The documentation for this class was generated from the following files: