Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

viongate.h

00001 #ifndef __VIONGATE_H__
00002 #define __VIONGATE_H__
00003 
00004 #include <math.h>
00005 #include <stdlib.h>
00006 #include "advanceable.h"
00007 #include "membranepatchsimple.h"
00008 #include "iongate.h"
00009 
00011 #define VIONGATE_VM_MIN -0.100     // -100mV
00012 
00014 #define VIONGATE_VM_MAX +0.100     // +100mV
00015 
00017 #define VIONGATE_VM_INC +0.00002   // 0.05mV
00018 
00019 #define VIONGATE_TABLE_SIZE      ((int)((VIONGATE_VM_MAX - VIONGATE_VM_MIN) / VIONGATE_VM_INC + 1))
00020 
00021 
00023 
00097 class VIonGate : public IonGate {
00098 
00099 public:
00101   VIonGate(void) { Vm=0; Vresting=0; VmScale=0; };
00102 
00103   // NOTE: The destructor comes within the macro IONGATE_TABLES
00104 
00106   virtual void reset(void);
00107 
00109   virtual int updateInternal(void);
00110 
00112   virtual int advance(void);
00113 
00115   virtual double alpha(double V) { return (infty(V))/tau(V); }
00116 
00118   virtual double beta(double V) { return (1.0-infty(V))/tau(V); }
00119 
00121   virtual double tau(double V) { return  1.0/(beta(V)+alpha(V)); }
00122 
00124   virtual double infty(double V) { return alpha(V)/(beta(V)+alpha(V)); }
00125 
00126   virtual double pInfty(MembranePatchSimple *m) { return infty(m->Vm);}
00127 
00129   virtual void ConnectToMembrane(MembranePatchSimple *m) { this->Vm = &(m->Vm); this->Vresting = &(m->Vresting); this->VmScale = &(m->VmScale);}
00130 
00131 protected:
00132 
00133   IONGATE_TABLES(VIonGate);
00134 
00136   float  *Vresting;
00137 
00139   double *Vm;
00140 
00142   float *VmScale;
00143 };
00144 
00145 #endif
00146 
00147 
00148