00001 #ifndef _HHGate_h
00002 #define _HHGate_h
00003
00004
00005
00006
00007
00008
00009
00010
00011
00031 class HHGate
00032 {
00033 friend void testHHGateLookup();
00034 friend void testHHGateSetup();
00035 public:
00039 HHGate();
00040
00047 HHGate( Id originalChanId, Id originalGateId );
00048
00050
00052
00061 double lookupA( double v ) const;
00062
00066 double lookupB( double v ) const;
00067
00069
00071 void setAlpha( const Eref& e, vector< double > val);
00072 vector< double > getAlpha( const Eref& e) const;
00073 void setBeta( const Eref& e, vector< double > val );
00074 vector< double > getBeta( const Eref& e) const;
00075 void setTau( const Eref& e, vector< double > val );
00076 vector< double > getTau( const Eref& e) const;
00077 void setMinfinity( const Eref& e,
00078 vector< double > val );
00079 vector< double > getMinfinity( const Eref& e) const;
00080
00081 void setMin( const Eref& e, double val );
00082 double getMin( const Eref& e) const;
00083 void setMax( const Eref& e, double val );
00084 double getMax( const Eref& e) const;
00085 void setDivs( const Eref& e, unsigned int val );
00086 unsigned int getDivs( const Eref& e) const;
00087
00088 void setTableA( const Eref& e, vector< double > v);
00089 vector< double > getTableA( const Eref& e) const;
00090
00091 void setTableB( const Eref& e, vector< double > v);
00092 vector< double > getTableB( const Eref& e) const;
00093
00094 void setUseInterpolation( const Eref& e, bool val );
00095 bool getUseInterpolation( const Eref& e) const;
00096
00097 void setupAlpha( const Eref& e, vector< double > parms );
00098 vector< double > getAlphaParms( const Eref& e ) const;
00099
00101
00103 void setupTau( const Eref& e,
00104 vector< double > parms );
00105 void tweakAlpha();
00106 void tweakTau();
00107 void setupGate( const Eref& e,
00108 vector< double > parms );
00109 void setupTables( const vector< double >& parms, bool doTau );
00110 void tweakTables( bool doTau );
00111
00115 void lookupBoth( double v, double* A, double* B ) const;
00116
00117
00119
00121
00124 double lookupTable( const vector< double >& tab, double v ) const;
00125
00131 bool checkOriginal( Id id, const string& field ) const;
00132
00137 bool isOriginalChannel( Id id ) const;
00138
00143 bool isOriginalGate( Id id ) const;
00144
00148 Id originalChannelId() const;
00149
00153 Id originalGateId() const;
00154
00163 void tabFill( vector< double >& table,
00164 unsigned int newXdivs, double newXmin, double newXmax );
00165
00170 void updateTauMinf();
00171
00176 void updateAlphaBeta();
00177
00182 void updateTables();
00183
00184 static const Cinfo* initCinfo();
00185 private:
00187 vector< double > alpha_;
00188
00190 vector< double > beta_;
00191
00193 vector< double > tau_;
00194
00196 vector< double > mInfinity_;
00197
00199 vector< double > A_;
00200
00202 vector< double > B_;
00203
00205 double xmin_;
00206
00208 double xmax_;
00209
00211 double invDx_;
00212
00217 Id originalChanId_;
00218
00224 Id originalGateId_;
00225
00230 bool lookupByInterpolation_;
00231
00238 bool isDirectTable_;
00239 };
00240
00241 #endif // _HHGate_h