00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #ifndef _HSOLVE_STRUCT_H
00011 #define _HSOLVE_STRUCT_H
00012
00013 typedef double ( *PFDD )( double, double );
00014
00015 struct CompartmentStruct
00016 {
00017 double CmByDt;
00018 double EmByRm;
00019 };
00020
00032 struct InjectStruct
00033 {
00034 InjectStruct()
00035 :
00036 injectVarying( 0.0 ),
00037 injectBasal( 0.0 )
00038 { ; }
00039
00040 double injectVarying;
00041 double injectBasal;
00042 };
00043
00048 struct CurrentStruct
00049 {
00050 double Gk;
00051 double Ek;
00052 };
00053
00055 struct ChannelStruct
00056 {
00057 public:
00058 double Gbar_;
00059 PFDD takeXpower_;
00060 PFDD takeYpower_;
00061 PFDD takeZpower_;
00062 double Xpower_;
00063 double Ypower_;
00064 double Zpower_;
00065
00071 int instant_;
00072
00077 double modulation_;
00078
00082 void setPowers( double Xpower, double Ypower, double Zpower );
00083
00089 void process( double*& state, CurrentStruct& current );
00090
00091 private:
00092 static PFDD selectPower( double power );
00093
00095 static double power1( double x, double p ) {
00096 return x;
00097 }
00098 static double power2( double x, double p ) {
00099 return x * x;
00100 }
00101 static double power3( double x, double p ) {
00102 return x * x * x;
00103 }
00104 static double power4( double x, double p ) {
00105 return power2( x * x, p );
00106 }
00107 static double powerN( double x, double p );
00108 };
00109
00114 struct SpikeGenStruct
00115 {
00116 SpikeGenStruct( double* Vm, Eref e )
00117 :
00118 Vm_( Vm ),
00119 e_( e )
00120 { ; }
00121
00122 double* Vm_;
00123 Eref e_;
00124
00126 void reinit( ProcPtr info );
00127 void send( ProcPtr info );
00128 };
00129
00130 struct SynChanStruct
00131 {
00132
00133 unsigned int compt_;
00134 Id elm_;
00135 };
00136
00137 struct CaConcStruct
00138 {
00139 double c_;
00140 double CaBasal_;
00141 double factor1_;
00142 double factor2_;
00143 double ceiling_;
00144 double floor_;
00145
00146 CaConcStruct();
00147 CaConcStruct(
00148 double Ca,
00149 double CaBasal,
00150 double tau,
00151 double B,
00152 double ceiling,
00153 double floor,
00154 double dt );
00155
00156 void setCa( double Ca );
00157
00159 void setCaBasal( double CaBasal );
00160
00162 void setTauB( double tau, double B, double dt );
00163
00168 double process( double activation );
00169 };
00170
00171 #endif // _HSOLVE_STRUCT_H