00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #ifndef _VOXEL_POOLS_BASE_H
00011 #define _VOXEL_POOLS_BASE_H
00012
00021 class RateTerm;
00022 class Stoich;
00023 class VoxelPoolsBase
00024 {
00025 public:
00026 VoxelPoolsBase();
00027 virtual ~VoxelPoolsBase();
00028
00030
00033 void resizeArrays( unsigned int totNumPools );
00034
00038 unsigned int size() const;
00039
00044 const double* S() const;
00045
00047 vector< double >& Svec();
00048
00053 double* varS();
00054
00059 const double* Sinit() const;
00060
00065 double* varSinit();
00066
00070 void reinit();
00071
00073 void setVolume( double vol );
00075 double getVolume() const;
00076
00081 virtual void setVolumeAndDependencies( double vol );
00082
00084
00086
00087 void setN( unsigned int i, double v );
00088 double getN( unsigned int ) const;
00089 void setNinit( unsigned int, double v );
00090 double getNinit( unsigned int ) const;
00091 void setDiffConst( unsigned int, double v );
00092 double getDiffConst( unsigned int ) const;
00094
00096
00099 virtual void updateAllRateTerms( const vector< RateTerm* >& rates,
00100 unsigned int numCoreRates ) = 0;
00101
00107 virtual void updateRateTerms( const vector< RateTerm* >& rates,
00108 unsigned int numCoreRates, unsigned int index ) = 0;
00109
00113 void filterCrossRateTerms( const vector< Id >& offSolverReacs, const vector< pair< Id, Id > >& offSolverReacCompts );
00114
00116
00118
00122 void xferIn( const vector< unsigned int >& poolIndex,
00123 const vector< double >& values,
00124 const vector< double >& lastValues,
00125 unsigned int voxelIndex );
00126
00132 void xferInOnlyProxies(
00133 const vector< unsigned int >& poolIndex,
00134 const vector< double >& values,
00135 unsigned int numProxyPools,
00136 unsigned int voxelIndex );
00137
00139 void xferOut( unsigned int voxelIndex,
00140 vector< double >& values,
00141 const vector< unsigned int >& poolIndex );
00143 void addProxyVoxy( unsigned int comptIndex,
00144 Id comptId, unsigned int voxel );
00145 void addProxyTransferIndex( unsigned int comptIndex,
00146 unsigned int transferIndex );
00147
00154
00155 bool hasXfer( unsigned int comptIndex ) const;
00156
00161 bool isVoxelJunctionPresent( Id i1, Id i2 ) const;
00163
00165
00169 void resetXreacScale( unsigned int size );
00170
00176 void forwardReacVolumeFactor( unsigned int i, double volume );
00177
00183 void backwardReacVolumeFactor( unsigned int i, double volume );
00184
00189 double getXreacScaleSubstrates( unsigned int i ) const;
00190
00195 double getXreacScaleProducts( unsigned int i ) const;
00196
00197 void scaleVolsBufsRates( double ratio, const Stoich* stoichPtr );
00198
00200 void print() const;
00201
00202 protected:
00203 const Stoich* stoichPtr_;
00204 vector< RateTerm* > rates_;
00205
00206 private:
00222 vector< double > S_;
00223
00230 vector< double > Sinit_;
00231
00244 vector< vector< unsigned int > > proxyPoolVoxels_;
00251 vector< vector< unsigned int > > proxyTransferIndex_;
00252
00256 map< Id, unsigned int > proxyComptMap_;
00257
00266 double volume_;
00267
00274 vector< double > xReacScaleSubstrates_;
00275
00282 vector< double > xReacScaleProducts_;
00283 };
00284
00285 #endif // _VOXEL_POOLS_BASE_H