COPASI API  4.16.103
Public Types | Public Member Functions | Private Attributes | List of all members
CFluxMode Class Reference

#include <CFluxMode.h>

Collaboration diagram for CFluxMode:
Collaboration graph
[legend]

Public Types

typedef std::map< size_t,
C_FLOAT64 >::const_iterator 
const_iterator
 

Public Member Functions

const_iterator begin () const
 
 CFluxMode ()
 
 CFluxMode (const CFluxMode &src)
 
 CFluxMode (const std::map< size_t, C_FLOAT64 > &reactions, const bool &reversible)
 
 CFluxMode (const CTableauLine *line)
 
const_iterator end () const
 
C_FLOAT64 getMultiplier (const size_t &index) const
 
bool isReversed (const CFluxMode &mode)
 
bool isReversible () const
 
size_t size () const
 
 ~CFluxMode ()
 

Private Attributes

std::map< size_t, C_FLOAT64mReactions
 
bool mReversible
 

Detailed Description

Definition at line 40 of file CFluxMode.h.

Member Typedef Documentation

typedef std::map< size_t, C_FLOAT64 >::const_iterator CFluxMode::const_iterator

Definition at line 43 of file CFluxMode.h.

Constructor & Destructor Documentation

CFluxMode::CFluxMode ( )

Default constructor

CFluxMode class. Used to return the flux modes in human readable form

Created for Copasi by Stefan Hoops 2002-05-10 (C) Stefan Hoops 2002

Definition at line 37 of file CFluxMode.cpp.

References CONSTRUCTOR_TRACE.

#define CONSTRUCTOR_TRACE
Definition: copasi.h:202
CFluxMode::CFluxMode ( const CFluxMode src)

Copy constructor

Parameters
const CFluxMode &src

Definition at line 39 of file CFluxMode.cpp.

39  :
42 {}
bool mReversible
Definition: CFluxMode.h:56
std::map< size_t, C_FLOAT64 > mReactions
Definition: CFluxMode.h:51
CFluxMode::CFluxMode ( const std::map< size_t, C_FLOAT64 > &  reactions,
const bool &  reversible 
)

Specific constructor

Parameters
conststd::map< size_t, C_FLOAT64 > & reactions
constbool & reversible

Definition at line 44 of file CFluxMode.cpp.

45  :
46  mReactions(reactions),
47  mReversible(reversible)
48 {}
bool mReversible
Definition: CFluxMode.h:56
std::map< size_t, C_FLOAT64 > mReactions
Definition: CFluxMode.h:51
CFluxMode::CFluxMode ( const CTableauLine line)

Specific constructor

Parameters
const CTableauLine &line

Definition at line 50 of file CFluxMode.cpp.

References CTableauLine::getFluxMode(), CTableauLine::isReversible(), mReactions, and mReversible.

51 {
52  const std::vector< C_FLOAT64 > & FluxMode = line->getFluxMode();
53  size_t i, imax = FluxMode.size();
54 
55  std::pair< size_t, C_FLOAT64 > Entry;
56 
57  for (i = 0; i < imax; i++)
58  if (FluxMode[i])
59  {
60  mReactions[i] = FluxMode[i];
61  }
62 
63  mReversible = line->isReversible();
64 }
bool mReversible
Definition: CFluxMode.h:56
const std::vector< C_FLOAT64 > & getFluxMode() const
bool isReversible() const
std::map< size_t, C_FLOAT64 > mReactions
Definition: CFluxMode.h:51
CFluxMode::~CFluxMode ( )

Destructor

Definition at line 66 of file CFluxMode.cpp.

67 {}

Member Function Documentation

CFluxMode::const_iterator CFluxMode::begin ( ) const

Retrieve the iterator to the first element of the flux mode

Returns
CFluxMode::const_iterator begin;

Definition at line 69 of file CFluxMode.cpp.

References mReactions.

Referenced by CQNewMainWindow::elementaryModeTriggeredSlot(), CEFMTask::getFluxModeDescription(), CEFMTask::getNetReactionData(), QFluxModeAnimation::getScales(), and CEFMTask::getSpeciesChanges().

70 {
71  return mReactions.begin();
72 }
std::map< size_t, C_FLOAT64 > mReactions
Definition: CFluxMode.h:51
CFluxMode::const_iterator CFluxMode::end ( ) const

Retrieve the iterator pointing beyond the last element of the flux mode

Returns
CFluxMode::const_iterator end;

Definition at line 74 of file CFluxMode.cpp.

References mReactions.

Referenced by CQNewMainWindow::elementaryModeTriggeredSlot(), CEFMTask::getFluxModeDescription(), CEFMTask::getNetReactionData(), QFluxModeAnimation::getScales(), and CEFMTask::getSpeciesChanges().

75 {
76  return mReactions.end();
77 }
std::map< size_t, C_FLOAT64 > mReactions
Definition: CFluxMode.h:51
C_FLOAT64 CFluxMode::getMultiplier ( const size_t &  index) const

Retrieve the multiplier for the indexed reaction

Parameters
constsize_t & index
Returns
C_FLOAT64 multiplier

Definition at line 111 of file CFluxMode.cpp.

References mReactions.

112 {
113  const_iterator it = mReactions.find(index);
114 
115  if (it != mReactions.end())
116  return it->second;
117 
118  return 0.0;
119 }
std::map< size_t, C_FLOAT64 >::const_iterator const_iterator
Definition: CFluxMode.h:43
std::map< size_t, C_FLOAT64 > mReactions
Definition: CFluxMode.h:51
bool CFluxMode::isReversed ( const CFluxMode mode)

Determine whether the current mode is the reversed mode

Parameters
constCFluxMode &mode
Returns
bool isReversed

Definition at line 89 of file CFluxMode.cpp.

References mReactions, and size().

90 {
91  if (mode.size() != mReactions.size())
92  {
93  return false;
94  }
95 
96  const_iterator itThis = mReactions.begin();
97  const_iterator endThis = mReactions.end();
98  const_iterator itMode = mode.mReactions.begin();
99 
100  for (; itThis != endThis; ++itThis, ++itMode)
101  {
102  if (itThis->first != itMode->first)
103  {
104  return false;
105  }
106  }
107 
108  return true;
109 }
size_t size() const
Definition: CFluxMode.cpp:84
std::map< size_t, C_FLOAT64 >::const_iterator const_iterator
Definition: CFluxMode.h:43
std::map< size_t, C_FLOAT64 > mReactions
Definition: CFluxMode.h:51
bool CFluxMode::isReversible ( ) const

Check whether the mode is reversible

Returns
"bool" isReversible

Definition at line 79 of file CFluxMode.cpp.

References mReversible.

Referenced by CEFMTask::getNetReaction().

80 {
81  return mReversible;
82 }
bool mReversible
Definition: CFluxMode.h:56
size_t CFluxMode::size ( ) const

Retrieves the size of the mode

Returns
"size_t" size

Definition at line 84 of file CFluxMode.cpp.

References mReactions.

Referenced by isReversed().

85 {
86  return mReactions.size();
87 }
std::map< size_t, C_FLOAT64 > mReactions
Definition: CFluxMode.h:51

Member Data Documentation

std::map< size_t, C_FLOAT64 > CFluxMode::mReactions
private

Vector containing an index to a reaction and the multiplier for that reaction.

Definition at line 51 of file CFluxMode.h.

Referenced by begin(), CFluxMode(), end(), getMultiplier(), isReversed(), and size().

bool CFluxMode::mReversible
private

Reversibility of the mode.

Definition at line 56 of file CFluxMode.h.

Referenced by CFluxMode(), and isReversible().


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