COPASI API  4.16.103
CSimSummaryInfo.cpp
Go to the documentation of this file.
1 // Begin CVS Header
2 // $Source: /Volumes/Home/Users/shoops/cvs/copasi_dev/copasi/layoutUI/CSimSummaryInfo.cpp,v $
3 // $Revision: 1.3 $
4 // $Name: $
5 // $Author: shoops $
6 // $Date: 2011/03/07 19:29:16 $
7 // End CVS Header
8 
9 // Copyright (C) 2011 - 2010 by Pedro Mendes, Virginia Tech Intellectual
10 // Properties, Inc., University of Heidelberg, and The University
11 // 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 #include "CSimSummaryInfo.h"
19 
21 {
22  mNumberOfSteps = 0;
24  mTotalTime = 0.0;
26 }
27 
28 CSimSummaryInfo::CSimSummaryInfo(size_t steps, size_t numReactants, C_FLOAT32 time)
29 {
30  mNumberOfSteps = steps;
31  mNumberOfReactants = numReactants;
32  mTotalTime = time;
34 }
35 
36 void CSimSummaryInfo::storeMax(std::string ndKey, C_FLOAT64 maxR)
37 {
38  maxMap.insert(std::pair<std::string, C_FLOAT64>
39  (ndKey, maxR));
40 }
41 
42 void CSimSummaryInfo::storeMin(std::string ndKey, C_FLOAT64 minR)
43 {
44  minMap.insert(std::pair<std::string, C_FLOAT64>
45  (ndKey, minR));
46 }
47 
49 {
50  std::map<std::string, C_FLOAT64>::const_iterator iter = maxMap.find(ndKey);
51 
52  if (iter != maxMap.end())
53  return (*iter).second;
54  else
55  return 0.0;
56 }
57 
59 {
60  std::map<std::string, C_FLOAT64>::const_iterator iter = minMap.find(ndKey);
61 
62  if (iter != minMap.end())
63  return (*iter).second;
64  else
65  return 0.0;
66 }
67 
68 std::ostream & operator<<(std::ostream &os, const CSimSummaryInfo & inf)
69 {
70  os << "number of steps: " << inf.mNumberOfSteps << std::endl;
71  os << "number of reactants: " << inf.mNumberOfReactants << std::endl;
72  os << "total time: " << inf.mTotalTime << std::endl;
73  os << "maximum overall concentration: " << inf.mMaxOverallConcentration << std::endl;
74  os << "range of values for species: " << std::endl;
75 
76  std::map<std::string, C_FLOAT64>::const_iterator iter = inf.maxMap.begin();
77  std::map<std::string, C_FLOAT64>::const_iterator iter2 = inf.minMap.begin();
78 
79  while ((iter != inf.maxMap.end()) && (iter2 != inf.minMap.end()))
80  {
81  os << " node: " << iter->first << " : [" << iter2->second;
82  os << " - " << iter->second << "]" << std::endl;
83  iter2++;
84  iter++;
85  }
86 
87  return os;
88 }
std::map< std::string, C_FLOAT64 > maxMap
void storeMin(std::string ndKey, C_FLOAT64 minR)
void storeMax(std::string ndKey, C_FLOAT64 maxR)
C_FLOAT64 getMinForSpecies(std::string ndKey)
C_FLOAT64 getMaxForSpecies(std::string ndKey)
#define C_FLOAT64
Definition: copasi.h:92
C_FLOAT64 mTotalTime
size_t mNumberOfReactants
std::ostream & operator<<(std::ostream &os, const CSimSummaryInfo &inf)
std::map< std::string, C_FLOAT64 > minMap
#define C_FLOAT32
Definition: copasi.h:93
C_FLOAT64 mMaxOverallConcentration