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

#include <CInterpolation.h>

Public Member Functions

 CStateRecord ()
 
 CStateRecord (size_t reactionNum)
 
 CStateRecord (const CStateRecord &src)
 
C_FLOAT64getArray () const
 
const size_t & getArrayLen () const
 
const C_FLOAT64getSlowPropensitySum () const
 
const C_FLOAT64getTime () const
 
CStateRecordoperator= (const CStateRecord &rhs)
 
 ~CStateRecord ()
 

Private Attributes

C_FLOAT64mpValues
 
size_t mSize
 

Friends

void printRecord (const CStateRecord &record)
 

Detailed Description

Definition at line 16 of file CInterpolation.h.

Constructor & Destructor Documentation

CStateRecord::CStateRecord ( )

Constructor

Definition at line 21 of file CInterpolation.cpp.

21  :
22  mpValues(NULL),
23  mSize(0)
24 {}
C_FLOAT64 * mpValues
CStateRecord::CStateRecord ( size_t  reactionNum)

Assignment Constructor

Definition at line 26 of file CInterpolation.cpp.

26  :
27  mpValues(new C_FLOAT64[speciesNum + 2]),
28  mSize(speciesNum + 2)
29 {}
#define C_FLOAT64
Definition: copasi.h:92
C_FLOAT64 * mpValues
CStateRecord::CStateRecord ( const CStateRecord src)

Copy constructor

Parameters
constCStateRecord & src

Definition at line 31 of file CInterpolation.cpp.

References C_FLOAT64, mpValues, and mSize.

31  :
32  mpValues(new C_FLOAT64[src.mSize]),
33  mSize(src.mSize)
34 {
35  memcpy(mpValues, src.mpValues, sizeof(C_FLOAT64)*mSize);
36 }
#define C_FLOAT64
Definition: copasi.h:92
C_FLOAT64 * mpValues
CStateRecord::~CStateRecord ( )

Destructor

Definition at line 38 of file CInterpolation.cpp.

References mpValues, and pdeletev.

Referenced by CInterpolation::~CInterpolation().

39 {
41 }
#define pdeletev(p)
Definition: copasi.h:216
C_FLOAT64 * mpValues

Member Function Documentation

C_FLOAT64 * CStateRecord::getArray ( ) const

Retrieve the pointer of the C_FLOAT64 array recording all the values,

Returns
const C_FLOAT64 *mpValue

Definition at line 60 of file CInterpolation.cpp.

References mpValues.

Referenced by CInterpolation::calculateFiringTime(), CInterpolation::calculateState(), CHybridMethodODE45::doInverseInterpolation(), and CInterpolation::recordState().

61 {
62  return mpValues;
63 }
C_FLOAT64 * mpValues
const size_t & CStateRecord::getArrayLen ( ) const

Retrieve the attibute mSize, the length of the array

Definition at line 75 of file CInterpolation.cpp.

References mSize.

Referenced by CInterpolation::calculateState(), and CInterpolation::recordState().

76 {
77  return mSize;
78 }
const C_FLOAT64 & CStateRecord::getSlowPropensitySum ( ) const

Retrieve the Sum of Slow Reaction Propensities

Returns
const C_FLOAT64 & mpValue(mSize-1)

Definition at line 70 of file CInterpolation.cpp.

References mpValues, and mSize.

Referenced by CInterpolation::calculateFiringTime().

71 {
72  return mpValues[mSize - 1];
73 }
C_FLOAT64 * mpValues
const C_FLOAT64 & CStateRecord::getTime ( ) const

Retrive the time of the state

Returns
const C_FLOAT64 & mpValue(0)

Definition at line 65 of file CInterpolation.cpp.

References mpValues.

Referenced by CInterpolation::calculateFiringTime(), CInterpolation::calculateState(), and CHybridMethodODE45::doInverseInterpolation().

66 {
67  return mpValues[0];
68 }
C_FLOAT64 * mpValues
CStateRecord & CStateRecord::operator= ( const CStateRecord rhs)

Assignment operator

Parameters
constCStateRecord & rhs
Returns
CStateRecord & lhs

Definition at line 43 of file CInterpolation.cpp.

References C_FLOAT64, mpValues, mSize, and pdeletev.

44 {
45  if (this != &rhs)
46  {
47  if (mSize != rhs.mSize)
48  {
50  mpValues = new C_FLOAT64[rhs.mSize];
51  mSize = rhs.mSize;
52  }
53 
54  memcpy(mpValues, rhs.mpValues, sizeof(C_FLOAT64)*mSize);
55  }
56 
57  return *this;
58 }
#define pdeletev(p)
Definition: copasi.h:216
#define C_FLOAT64
Definition: copasi.h:92
C_FLOAT64 * mpValues

Friends And Related Function Documentation

void printRecord ( const CStateRecord record)
friend

Friend Function for Debug

Definition at line 81 of file CInterpolation.cpp.

82 {
83  for (size_t i = 0; i < record.mSize; i++)
84  {
85  std::cout << record.mpValues[i] << " ";
86  }
87 
88  std::cout << std::endl;
89  return;
90 }
C_FLOAT64 * mpValues

Member Data Documentation

C_FLOAT64* CStateRecord::mpValues
private

Array of values

Definition at line 87 of file CInterpolation.h.

Referenced by CStateRecord(), getArray(), getSlowPropensitySum(), getTime(), operator=(), printRecord(), and ~CStateRecord().

size_t CStateRecord::mSize
private

Size of array

Definition at line 92 of file CInterpolation.h.

Referenced by CStateRecord(), getArrayLen(), getSlowPropensitySum(), operator=(), and printRecord().


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