17 #include "../utility/numutil.h"
24 virtual double operator() (
const double* S )
const = 0;
29 virtual void setRates(
double k1,
double k2 ) = 0;
32 virtual void setR1(
double k1 ) = 0;
35 virtual void setR2(
double k2 ) = 0;
38 virtual double getR1()
const = 0;
41 virtual double getR2()
const = 0;
51 vector< unsigned int >& molIndex )
const = 0;
64 const vector< short >& compartmentLookup,
double ratio ) = 0;
76 double vol,
double sub,
double prd )
const = 0;
122 const vector< short >& compartmentLookup,
double ratio )
143 unsigned int enz,
unsigned int sub )
155 molIndex.resize( 2 );
162 double vol,
double sub,
double prd )
const
164 double ratio = vol * sub *
NA;
183 double sub = (*substrates_)( S );
191 molIndex.insert( molIndex.begin(),
enz_ );
192 return molIndex.size();
196 double vol,
double sub,
double prd )
const
198 double ratio = sub * vol *
NA;
235 molIndex.resize( 0 );
240 const vector< short >& compartmentLookup,
double ratio )
246 double vol,
double sub,
double prd )
const
260 assert( !std::isnan(
k_ ) );
264 assert( !std::isnan(
k_ ) );
269 assert( !std::isnan( k ) );
295 molIndex.resize( 0 );
300 const vector< short >& compartmentLookup,
double ratio )
306 double vol,
double sub,
double prd )
const
323 Flux(
double k,
unsigned int y )
328 assert( !std::isnan( S[
y_ ] ) );
333 molIndex.resize( 0 );
338 const vector< short >& compartmentLookup,
double ratio )
344 double vol,
double sub,
double prd )
const
361 assert( !std::isnan( S[
y_ ] ) );
366 molIndex.resize( 1 );
372 const vector< short >& compartmentLookup,
double ratio )
378 double vol,
double sub,
double prd )
const
395 assert( !std::isnan( S[
y1_ ] ) );
396 assert( !std::isnan( S[
y2_ ] ) );
401 molIndex.resize( 2 );
408 const vector< short >& compartmentLookup,
double ratio )
410 if ( comptIndex == compartmentLookup[
y1_ ] ||
411 comptIndex == compartmentLookup[
y2_ ] )
416 double vol,
double sub,
double prd )
const
418 double ratio = sub * vol *
NA;
443 assert( !std::isnan( y ) );
444 return k_ * ( y - 1 ) * y;
448 molIndex.resize( 2 );
455 const vector< short >& compartmentLookup,
double ratio )
457 if ( comptIndex == compartmentLookup[
y_ ] )
462 double vol,
double sub,
double prd )
const
464 double ratio = sub * vol *
NA;
469 const unsigned int y_;
475 NOrder(
double k, vector< unsigned int > v )
481 vector< unsigned int >::const_iterator i;
482 for ( i =
v_.begin(); i !=
v_.end(); i++) {
483 assert( !std::isnan( S[ *i ] ) );
495 const vector< short >& compartmentLookup,
double ratio )
497 for (
unsigned int i = 1; i <
v_.size(); ++i ) {
498 if ( comptIndex == compartmentLookup[
v_[i] ] )
504 double vol,
double sub,
double prd )
const
506 assert(
v_.size() > 0 );
507 double ratio = sub * pow(
NA * vol, (
int)(
v_.size() ) - 1 );
512 vector< unsigned int >
v_;
530 double vol,
double sub,
double prd )
const
532 assert(
v_.size() > 0 );
533 double ratio = sub * pow( vol *
NA, (
int)(
v_.size() ) -1);
584 unsigned int ret = molIndex.size();
585 vector< unsigned int > temp;
587 molIndex.insert( molIndex.end(), temp.begin(), temp.end() );
592 const vector< short >& compartmentLookup,
double ratio )
598 double vol,
double sub,
double prd )
const
unsigned int getReactants(vector< unsigned int > &molIndex) const
void setRates(double kf, double kb)
BidirectionalReaction(ZeroOrder *forward, ZeroOrder *backward)
Flux(double k, unsigned int y)
double operator()(const double *S) const
Computes the rate. The argument is the molecule array.
virtual void rescaleVolume(short comptIndex, const vector< short > &compartmentLookup, double ratio)=0
void setR1(double kf)
Used by Zombie to assign rate terms.
static const double EPSILON
void setRates(double k1, double k2)
virtual unsigned int getReactants(vector< unsigned int > &molIndex) const =0
RateTerm * copyWithVolScaling(double vol, double sub, double prd) const
unsigned int getReactants(vector< unsigned int > &molIndex) const
double getR2() const
Used by Zombie to return rate terms.
MMEnzyme1(double Km, double kcat, unsigned int enz, unsigned int sub)
void setR1(double k1)
Used by Zombie to assign rate terms.
double getR2() const
Used by Zombie to return rate terms.
StochSecondOrderSingleSubstrate(double k, unsigned int y)
MMEnzymeBase(double Km, double kcat, unsigned int enz)
void rescaleVolume(short comptIndex, const vector< short > &compartmentLookup, double ratio)
double getR1() const
Used by Zombie to return rate terms.
unsigned int getReactants(vector< unsigned int > &molIndex) const
unsigned int getReactants(vector< unsigned int > &molIndex) const
virtual double operator()(const double *S) const =0
Computes the rate. The argument is the molecule array.
void setR1(double Km)
Used by Zombie to assign rate terms.
virtual double getR2() const =0
Used by Zombie to return rate terms.
virtual void setRates(double k1, double k2)=0
RateTerm * copyWithVolScaling(double vol, double sub, double prd) const
unsigned int getReactants(vector< unsigned int > &molIndex) const
void rescaleVolume(short comptIndex, const vector< short > &compartmentLookup, double ratio)
void rescaleVolume(short comptIndex, const vector< short > &compartmentLookup, double ratio)
void setR2(double kcat)
Used by Zombie to assign rate terms.
void setR1(double k1)
Used by Zombie to assign rate terms.
RateTerm * copyWithVolScaling(double vol, double sub, double prd) const
unsigned int getEnzIndex() const
RateTerm * copyWithVolScaling(double vol, double sub, double prd) const
void rescaleVolume(short comptIndex, const vector< short > &compartmentLookup, double ratio)
virtual void setR2(double k2)=0
Used by Zombie to assign rate terms.
double operator()(const double *S) const
Computes the rate. The argument is the molecule array.
double getR2() const
Used by Zombie to return rate terms.
double operator()(const double *S) const
Computes the rate. The argument is the molecule array.
void setR2(double k2)
Used by Zombie to assign rate terms.
double operator()(const double *S) const
Computes the rate. The argument is the molecule array.
unsigned int getReactants(vector< unsigned int > &molIndex) const
double getR1() const
Used by Zombie to return rate terms.
void rescaleVolume(short comptIndex, const vector< short > &compartmentLookup, double ratio)
class ZeroOrder * makeHalfReaction(double k, vector< unsigned int > v)
void setKcat(double kcat)
RateTerm * copyWithVolScaling(double vol, double sub, double prd) const
double operator()(const double *S) const
Computes the rate. The argument is the molecule array.
RateTerm * copyWithVolScaling(double vol, double sub, double prd) const
void rescaleVolume(short comptIndex, const vector< short > &compartmentLookup, double ratio)
FirstOrder(double k, unsigned int y)
void setRates(double Km, double kcat)
double operator()(const double *S) const
Computes the rate. The argument is the molecule array.
virtual double getR1() const =0
Used by Zombie to return rate terms.
NOrder(double k, vector< unsigned int > v)
void rescaleVolume(short comptIndex, const vector< short > &compartmentLookup, double ratio)
unsigned int getReactants(vector< unsigned int > &molIndex) const
virtual RateTerm * copyWithVolScaling(double vol, double sub, double prd) const =0
StochNOrder(double k, vector< unsigned int > v)
double operator()(const double *S) const
Computes the rate. The argument is the molecule array.
double getR2() const
Used by Zombie to return rate terms.
double operator()(const double *S) const
Computes the rate. The argument is the molecule array.
MMEnzyme(double Km, double kcat, unsigned int enz, RateTerm *sub)
double getR1() const
Used by Zombie to return rate terms.
void rescaleVolume(short comptIndex, const vector< short > &compartmentLookup, double ratio)
double operator()(const double *S) const
Computes the rate. The argument is the molecule array.
unsigned int getReactants(vector< unsigned int > &molIndex) const
double operator()(const double *S) const
Computes the rate. The argument is the molecule array.
RateTerm * copyWithVolScaling(double vol, double sub, double prd) const
void setR2(double k2)
Used by Zombie to assign rate terms.
void setRates(double k1, double k2)
RateTerm * copyWithVolScaling(double vol, double sub, double prd) const
vector< unsigned int > v_
RateTerm * copyWithVolScaling(double vol, double sub, double prd) const
unsigned int getReactants(vector< unsigned int > &molIndex) const
RateTerm * copyWithVolScaling(double vol, double sub, double prd) const
SecondOrder(double k, unsigned int y1, unsigned int y2)
double operator()(const double *S) const
Computes the rate. The argument is the molecule array.
double getR1() const
Used by Zombie to return rate terms.
void setR2(double kb)
Used by Zombie to assign rate terms.
unsigned int getReactants(vector< unsigned int > &molIndex) const
void rescaleVolume(short comptIndex, const vector< short > &compartmentLookup, double ratio)
virtual void setR1(double k1)=0
Used by Zombie to assign rate terms.
RateTerm * copyWithVolScaling(double vol, double sub, double prd) const