From 2594e50c0b2034977e361a5955e478fe13fb87c3 Mon Sep 17 00:00:00 2001 From: Srinivas Gorur-Shandilya Date: Sat, 12 Dec 2020 10:36:25 -0500 Subject: [PATCH 1/4] removed getFullStateSize from mechanism --- +xolotl/version.m | 2 +- c++/compartment.hpp | 4 +- c++/mechanism.hpp | 11 +---- c++/mechanisms/ChannelProbe.hpp | 5 +-- .../gorur-shandilya/CalciumSensor.hpp | 9 +--- c++/mechanisms/liu/DCSensor.hpp | 7 +--- c++/mechanisms/liu/FastSensor.hpp | 4 +- c++/mechanisms/liu/LiuController.hpp | 5 +-- c++/mechanisms/liu/SlowSensor.hpp | 6 +-- c++/mechanisms/oleary/IntegralController.hpp | 5 +-- .../soto-trevino/ProportionalController.hpp | 18 +------- c++/mexTemplate.cpp | 2 +- docs/how-to/make-own-models.md | 42 +------------------ docs/reference/c++/mechanism.md | 42 ++++--------------- 14 files changed, 31 insertions(+), 131 deletions(-) diff --git a/+xolotl/version.m b/+xolotl/version.m index 94c03c98..2619cdc7 100644 --- a/+xolotl/version.m +++ b/+xolotl/version.m @@ -1,2 +1,2 @@ function version() -disp('v20.12.11'); \ No newline at end of file +disp('v20.12.12'); \ No newline at end of file diff --git a/c++/compartment.hpp b/c++/compartment.hpp index 0d99bc6b..63d24342 100644 --- a/c++/compartment.hpp +++ b/c++/compartment.hpp @@ -453,7 +453,7 @@ void compartment::addMechanism(mechanism *mech_) { n_mech++; // also store the mechanism's full state size - mechanism_sizes.push_back(mech_->getFullStateSize()); + mechanism_sizes.push_back(mech_->fullStateSize); } /* @@ -640,7 +640,7 @@ what their data dimension is, and adding up all those numbers. int compartment::getFullMechanismSize(void) { int full_size = 0; for (int i=0; igetFullStateSize(); + full_size += mech[i]->fullStateSize; } return full_size; } diff --git a/c++/mechanism.hpp b/c++/mechanism.hpp index ab0b601b..bc2f8d85 100644 --- a/c++/mechanism.hpp +++ b/c++/mechanism.hpp @@ -52,6 +52,8 @@ class mechanism { int verbosity = -1; + int fullStateSize = 0; + mechanism() { // null pointers to all @@ -66,7 +68,6 @@ class mechanism { virtual void integrate(void); virtual void integrateMS(int, double, double); - virtual int getFullStateSize(void); virtual int getFullState(double*, int); virtual double getState(int); virtual string getClass(void) = 0; @@ -172,14 +173,6 @@ double mechanism::getState(int i) { } -/* This virtual method does nothing, but should return the full state -size of your mechanism -*/ - -int mechanism::getFullStateSize() { - return 0; -} - /* This virtual method does nothing, but can return as many dynamic variables as you want diff --git a/c++/mechanisms/ChannelProbe.hpp b/c++/mechanisms/ChannelProbe.hpp index 0192d5bf..f4372a0f 100644 --- a/c++/mechanisms/ChannelProbe.hpp +++ b/c++/mechanisms/ChannelProbe.hpp @@ -21,11 +21,11 @@ class ChannelProbe: public mechanism { // specify parameters + initial conditions for ChannelProbe(double dummy_) { dummy = dummy_; + fullStateSize = 2; } void connectConductance(conductance *); - int getFullStateSize(void); int getFullState(double * cont_state, int idx); string getClass(void); @@ -40,9 +40,6 @@ string ChannelProbe::getClass() { -int ChannelProbe::getFullStateSize(){return 2; } - - int ChannelProbe::getFullState(double *cont_state, int idx) { // read out m and h cont_state[idx] = channel->m; diff --git a/c++/mechanisms/gorur-shandilya/CalciumSensor.hpp b/c++/mechanisms/gorur-shandilya/CalciumSensor.hpp index 5a661d01..4c07fa44 100644 --- a/c++/mechanisms/gorur-shandilya/CalciumSensor.hpp +++ b/c++/mechanisms/gorur-shandilya/CalciumSensor.hpp @@ -25,12 +25,12 @@ class CalciumSensor: public mechanism { // specify parameters + initial conditions for // mechanism that controls a conductance - CalciumSensor(double tau_, double Ca_average_) - { + CalciumSensor(double tau_, double Ca_average_) { tau = tau_; controlling_class = "unset"; Ca_average = Ca_average_; + fullStateSize = 1; } @@ -40,7 +40,6 @@ class CalciumSensor: public mechanism { void connectCompartment(compartment*); - int getFullStateSize(void); int getFullState(double * cont_state, int idx); string getClass(void); @@ -51,10 +50,6 @@ string CalciumSensor::getClass() { } -int CalciumSensor::getFullStateSize() { - return 1; -} - int CalciumSensor::getFullState(double *cont_state, int idx) { // return internal variable diff --git a/c++/mechanisms/liu/DCSensor.hpp b/c++/mechanisms/liu/DCSensor.hpp index 29090da0..11431693 100644 --- a/c++/mechanisms/liu/DCSensor.hpp +++ b/c++/mechanisms/liu/DCSensor.hpp @@ -43,8 +43,9 @@ class DCSensor: public mechanism { X = X_; m = m_; + fullStateSize = 1; - // these defaults make it a "F" type sensor + // these defaults make it a "DC" type sensor if (isnan(ZM)) {ZM = 3;} if (isnan(tau_m)) {tau_m = 500; } // ms if (isnan(G)) {G = 1;} @@ -62,8 +63,6 @@ class DCSensor: public mechanism { double boltzmann(double); - - int getFullStateSize(void); int getFullState(double * cont_state, int idx); double getState(int); string getClass(void); @@ -78,8 +77,6 @@ string DCSensor::getClass() { double DCSensor::getState(int idx){return X;} -int DCSensor::getFullStateSize(){return 1; } - int DCSensor::getFullState(double *cont_state, int idx) { cont_state[idx] = X; diff --git a/c++/mechanisms/liu/FastSensor.hpp b/c++/mechanisms/liu/FastSensor.hpp index b3708614..cf87d855 100644 --- a/c++/mechanisms/liu/FastSensor.hpp +++ b/c++/mechanisms/liu/FastSensor.hpp @@ -48,6 +48,8 @@ class FastSensor: public mechanism { X = X_; + fullStateSize = 1; + // these defaults make it a "F" type sensor if (isnan(ZM)) {ZM = 14.2;} if (isnan(ZH)) {ZH = 9.8;} @@ -84,8 +86,6 @@ string FastSensor::getClass() { double FastSensor::getState(int idx){return X;} -int FastSensor::getFullStateSize(){return 1; } - int FastSensor::getFullState(double *cont_state, int idx) { cont_state[idx] = X; diff --git a/c++/mechanisms/liu/LiuController.hpp b/c++/mechanisms/liu/LiuController.hpp index ae275979..98f4f3a7 100644 --- a/c++/mechanisms/liu/LiuController.hpp +++ b/c++/mechanisms/liu/LiuController.hpp @@ -47,7 +47,7 @@ class LiuController: public mechanism { // defaults if (isnan(tau)) {tau = 5000; } // ms - + fullStateSize = 1; } @@ -61,7 +61,6 @@ class LiuController: public mechanism { double boltzmann(double); - int getFullStateSize(void); int getFullState(double * cont_state, int idx); string getClass(void); @@ -121,8 +120,6 @@ string LiuController::getClass() { -int LiuController::getFullStateSize(){return 1; } - int LiuController::getFullState(double *cont_state, int idx) { cont_state[idx] = channel->gbar; diff --git a/c++/mechanisms/liu/SlowSensor.hpp b/c++/mechanisms/liu/SlowSensor.hpp index b24a53a5..4b055547 100644 --- a/c++/mechanisms/liu/SlowSensor.hpp +++ b/c++/mechanisms/liu/SlowSensor.hpp @@ -46,6 +46,8 @@ class SlowSensor: public mechanism { G = G_; X = X_; + fullStateSize = 1; + // these defaults make it a "S" type sensor if (isnan(ZM)) {ZM = 7.2;} if (isnan(ZH)) {ZH = 2.8;} @@ -67,7 +69,6 @@ class SlowSensor: public mechanism { double boltzmann(double); - int getFullStateSize(void); int getFullState(double * cont_state, int idx); double getState(int); string getClass(void); @@ -82,9 +83,6 @@ string SlowSensor::getClass() { double SlowSensor::getState(int idx){return X;} -int SlowSensor::getFullStateSize(){return 1; } - - int SlowSensor::getFullState(double *cont_state, int idx) { cont_state[idx] = X; idx++; diff --git a/c++/mechanisms/oleary/IntegralController.hpp b/c++/mechanisms/oleary/IntegralController.hpp index 36c4e59d..0d86b72c 100644 --- a/c++/mechanisms/oleary/IntegralController.hpp +++ b/c++/mechanisms/oleary/IntegralController.hpp @@ -42,6 +42,8 @@ class IntegralController: public mechanism { m = m_; + fullStateSize = 2; + // if (tau_m<=0) {mexErrMsgTxt("[IntegralController] tau_m must be > 0. Perhaps you meant to set it to Inf?\n");} if (tau_g<=0) {mexErrMsgTxt("[IntegralController] tau_g must be > 0. Perhaps you meant to set it to Inf?\n");} } @@ -55,7 +57,6 @@ class IntegralController: public mechanism { void connectConductance(conductance*); void connectSynapse(synapse*); - int getFullStateSize(void); int getFullState(double * cont_state, int idx); double getState(int); string getClass(void); @@ -116,8 +117,6 @@ double IntegralController::getState(int idx) { } -int IntegralController::getFullStateSize(){return 2; } - int IntegralController::getFullState(double *cont_state, int idx) { // give it the current mRNA level diff --git a/c++/mechanisms/soto-trevino/ProportionalController.hpp b/c++/mechanisms/soto-trevino/ProportionalController.hpp index 0cf177cf..69d9d1bb 100644 --- a/c++/mechanisms/soto-trevino/ProportionalController.hpp +++ b/c++/mechanisms/soto-trevino/ProportionalController.hpp @@ -45,18 +45,17 @@ class ProportionalController: public mechanism { m = m_; tau_m = tau_m_; if (isnan(tau_m)) {tau_m = 10e3;}; + + fullStateSize = 1; } void integrate(void); - void checkSolvers(int); - void connect(conductance *); void connect(synapse*); void connect(compartment*); - int getFullStateSize(void); int getFullState(double * cont_state, int idx); double getState(int); string getClass(void); @@ -76,8 +75,6 @@ double ProportionalController::getState(int idx) { } -int ProportionalController::getFullStateSize(){return 1; } - int ProportionalController::getFullState(double *cont_state, int idx) { @@ -115,9 +112,6 @@ void ProportionalController::connect(conductance * channel_) { } -void ProportionalController::connect(compartment* comp_) { - mexErrMsgTxt("[ProportionalController] This mechanism cannot connect to a compartment object"); -} void ProportionalController::connect(synapse* syn_) { @@ -211,14 +205,6 @@ void ProportionalController::integrate(void) { -void ProportionalController::checkSolvers(int k) { - if (k == 0){ - return; - } else { - mexErrMsgTxt("[ProportionalController] unsupported solver order\n"); - } -} - diff --git a/c++/mexTemplate.cpp b/c++/mexTemplate.cpp index 651ac9d3..bab27259 100644 --- a/c++/mexTemplate.cpp +++ b/c++/mexTemplate.cpp @@ -209,7 +209,7 @@ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) int idx = 0; for(int j = 0; j < n_comp; j++) { for (int k = 0; k < xolotl_network.comp[j]->n_mech; k++) { - int mech_size = (xolotl_network.comp[j]->getMechanismPointer(k))->getFullStateSize(); + int mech_size = (xolotl_network.comp[j]->getMechanismPointer(k))->fullStateSize; mech_sizes_out[idx] = mech_size; idx++; } diff --git a/docs/how-to/make-own-models.md b/docs/how-to/make-own-models.md index 4f191454..45c49a7f 100644 --- a/docs/how-to/make-own-models.md +++ b/docs/how-to/make-own-models.md @@ -109,8 +109,6 @@ public: // defaults if (isnan(gbar)) { gbar = 0; } - - if (isnan (E)) { E = 30; } // specify exponents of m and h @@ -190,16 +188,12 @@ public: double B = 1; // constructor - NewMech(double A_, B_) - { + NewMech(double A_, B_) { A = A_; B = B_; controlling_class = "unset"; } - // declare methods - void checkSolvers(int); - void integrate(void); void integrateMS(int, double, double); @@ -214,19 +208,12 @@ public: // these methods allow reading out of the mechanism // state - int getFullStateSize(void); int getFullState(double * mech_state, int idx); double getState(int); }; -double NewMech::getState(int idx){return std::numeric_limits::quiet_NaN();} - -// specify the dimensions of your mechanism -// this size must match the getState method -int NewMech::getFullStateSize(){return 0; } - // this does nothing since our state size is 0 // otherwise we should increment idx, and // fill in values in the mech_state array @@ -236,19 +223,12 @@ int NewMech::getFullState(double *mech_state, int idx) { // connection methods // we allow the mechanism to connect to a compartment +// all other connection attempts will lead to a runtime error void NewMech::connect(compartment* comp_) { comp = comp_; comp->addMechanism(this); } -// disallow other connections -void NewMech::connect(conductance* cond_) { - mexErrMsgTxt("[NewMech] This mechanism cannot connect to a conductance object"); -} - -void NewMech::connect(synapse* syn_) { - mexErrMsgTxt("[NewMech] This mechanism cannot connect to a synapse object"); -} // specify how we integrate it with the default @@ -263,24 +243,6 @@ double NewMech::NewMechCustomMethod(double X_) { // insert your code here } -// Runge-Kutta 4 integrator -// you don't have to code this...see checkSolvers -void NewMech::integrateMS(int k, double V, double Ca_) { - if (k == 4){return;} - // insert RK4 code here -} - -// throw an error to disallow solver_orders -// 0 must always work, though -void NewMech::checkSolvers(int k) { - if (k == 0){ - return; - } else if (k == 4){ - return; - } else { - mexErrMsgTxt("[CalciumMech] unsupported solver order\n"); - } -} #endif diff --git a/docs/reference/c++/mechanism.md b/docs/reference/c++/mechanism.md index f9c0387a..af84f326 100644 --- a/docs/reference/c++/mechanism.md +++ b/docs/reference/c++/mechanism.md @@ -37,7 +37,7 @@ method, which will be used instead of this. **Code** -[Click here to view this method's code](https://github.com/sg-s/xolotl/blob/master/c%2B%2B/mechanism.hpp#L93) +[Click here to view this method's code](https://github.com/sg-s/xolotl/blob/master/c%2B%2B/mechanism.hpp#L94) ------- @@ -64,7 +64,7 @@ method, which will be used instead of this. **Code** -[Click here to view this method's code](https://github.com/sg-s/xolotl/blob/master/c%2B%2B/mechanism.hpp#L105) +[Click here to view this method's code](https://github.com/sg-s/xolotl/blob/master/c%2B%2B/mechanism.hpp#L106) ------- @@ -91,7 +91,7 @@ method, which will be used instead of this. **Code** -[Click here to view this method's code](https://github.com/sg-s/xolotl/blob/master/c%2B%2B/mechanism.hpp#L119) +[Click here to view this method's code](https://github.com/sg-s/xolotl/blob/master/c%2B%2B/mechanism.hpp#L120) ------- @@ -118,7 +118,7 @@ method, which will be used instead of this. **Code** -[Click here to view this method's code](https://github.com/sg-s/xolotl/blob/master/c%2B%2B/mechanism.hpp#L133) +[Click here to view this method's code](https://github.com/sg-s/xolotl/blob/master/c%2B%2B/mechanism.hpp#L134) ------- @@ -145,7 +145,7 @@ method, which will be used instead of this. **Code** -[Click here to view this method's code](https://github.com/sg-s/xolotl/blob/master/c%2B%2B/mechanism.hpp#L149) +[Click here to view this method's code](https://github.com/sg-s/xolotl/blob/master/c%2B%2B/mechanism.hpp#L150) ------- @@ -172,7 +172,7 @@ good place to put code that you need to run once before the simulation. **Code** -[Click here to view this method's code](https://github.com/sg-s/xolotl/blob/master/c%2B%2B/mechanism.hpp#L162) +[Click here to view this method's code](https://github.com/sg-s/xolotl/blob/master/c%2B%2B/mechanism.hpp#L163) ------- @@ -195,31 +195,7 @@ out of your mechanism, make sure this returns something sensible. **Code** -[Click here to view this method's code](https://github.com/sg-s/xolotl/blob/master/c%2B%2B/mechanism.hpp#L170) - -------- - - - -### getFullStateSize - -**Function Signature** - -```C++ -int getFullStateSize() -``` - -**Description** - - This virtual method does nothing, but should return the full state -size of your mechanism - - - - - **Code** - -[Click here to view this method's code](https://github.com/sg-s/xolotl/blob/master/c%2B%2B/mechanism.hpp#L179) +[Click here to view this method's code](https://github.com/sg-s/xolotl/blob/master/c%2B%2B/mechanism.hpp#L171) ------- @@ -243,7 +219,7 @@ variables as you want **Code** -[Click here to view this method's code](https://github.com/sg-s/xolotl/blob/master/c%2B%2B/mechanism.hpp#L188) +[Click here to view this method's code](https://github.com/sg-s/xolotl/blob/master/c%2B%2B/mechanism.hpp#L181) ------- @@ -268,7 +244,7 @@ to override this. **Code** -[Click here to view this method's code](https://github.com/sg-s/xolotl/blob/master/c%2B%2B/mechanism.hpp#L198) +[Click here to view this method's code](https://github.com/sg-s/xolotl/blob/master/c%2B%2B/mechanism.hpp#L191) ------- From 23b089d012c995553dbc3bf2486aef3cf1957b2c Mon Sep 17 00:00:00 2001 From: Srinivas Gorur-Shandilya Date: Sat, 12 Dec 2020 11:56:43 -0500 Subject: [PATCH 2/4] stripped out getClass() methods from all objects --- c++/compartment.hpp | 8 +-- c++/conductance.hpp | 13 ++--- c++/conductances/GenericKdLike.hpp | 5 +- c++/conductances/GenericNaVLike.hpp | 6 +-- c++/conductances/Leak.hpp | 5 +- c++/conductances/bronk/EAGes.hpp | 5 +- c++/conductances/bronk/EAGmut.hpp | 6 +-- c++/conductances/bronk/EAGwt.hpp | 6 +-- c++/conductances/brookings/ACurrent.hpp | 7 ++- c++/conductances/caplan/MICurrent.hpp | 7 ++- c++/conductances/chow/Kd.hpp | 9 ++-- c++/conductances/chow/NaV.hpp | 8 +-- c++/conductances/clay00/Kd2.hpp | 8 ++- c++/conductances/destexhe/CaN.hpp | 8 ++- c++/conductances/destexhe/CaT.hpp | 6 +-- c++/conductances/destexhe/KCa.hpp | 7 ++- c++/conductances/destexhe98/CaT.hpp | 7 +-- c++/conductances/dethier/CaT.hpp | 16 +----- c++/conductances/dethier/HCurrent.hpp | 8 +-- c++/conductances/dethier/Kd.hpp | 9 ++-- c++/conductances/dethier/NaV.hpp | 4 +- c++/conductances/generic/HCurrent.hpp | 6 ++- c++/conductances/giovannini/CaN.hpp | 7 ++- c++/conductances/giovannini/CaT.hpp | 8 +-- c++/conductances/giovannini/Kd.hpp | 7 +-- c++/conductances/giovannini/MCurrent.hpp | 8 ++- c++/conductances/giovannini/NaV.hpp | 9 ++-- c++/conductances/goldman/Ap.hpp | 8 ++- c++/conductances/goldman/At.hpp | 6 +-- c++/conductances/goldman/Cal.hpp | 21 +------- c++/conductances/goldman/Proc.hpp | 6 +-- c++/conductances/golowasch/HCurrent.hpp | 9 ++-- c++/conductances/hardie-laughlin/Shaker.hpp | 9 ++-- c++/conductances/heras/Novel.hpp | 7 ++- c++/conductances/heras/Shab.hpp | 8 ++- c++/conductances/hodgkin-huxley/Kd.hpp | 8 ++- c++/conductances/hodgkin-huxley/NaV.hpp | 8 +-- c++/conductances/jochems/CaN.hpp | 5 +- c++/conductances/jochems/CaT.hpp | 6 +-- c++/conductances/jochems/Kd.hpp | 7 ++- c++/conductances/jochems/MCurrent.hpp | 8 ++- c++/conductances/jochems/NaV.hpp | 6 ++- c++/conductances/kispersky/ACurrent.hpp | 5 +- c++/conductances/kispersky/CaS.hpp | 19 +------ c++/conductances/kispersky/CaT.hpp | 20 ++----- c++/conductances/kispersky/HCurrent.hpp | 7 +-- c++/conductances/kispersky/KCa.hpp | 7 +-- c++/conductances/kispersky/Kd.hpp | 9 ++-- c++/conductances/kispersky/NaV.hpp | 8 +-- c++/conductances/lin/NaT.hpp | 6 +-- c++/conductances/liu-temperature/ACurrent.hpp | 4 +- c++/conductances/liu-temperature/CaS.hpp | 5 +- c++/conductances/liu-temperature/CaT.hpp | 6 ++- c++/conductances/liu-temperature/HCurrent.hpp | 7 ++- c++/conductances/liu-temperature/KCa.hpp | 6 ++- c++/conductances/liu-temperature/Kd.hpp | 6 ++- c++/conductances/liu-temperature/NaV.hpp | 6 ++- c++/conductances/liu/ACurrent.hpp | 8 +-- c++/conductances/liu/CaS.hpp | 8 ++- c++/conductances/liu/CaT.hpp | 8 +-- c++/conductances/liu/HCurrent.hpp | 6 +-- c++/conductances/liu/KCa.hpp | 6 +-- c++/conductances/liu/Kd.hpp | 6 +-- c++/conductances/liu/NaV.hpp | 4 +- c++/conductances/morris-lecar/CaCurrent.hpp | 5 +- c++/conductances/morris-lecar/Potassium.hpp | 4 +- c++/conductances/nadim98/GenericChannel.hpp | 5 +- c++/conductances/nadim98/int1/Kd.hpp | 7 +-- c++/conductances/nadim98/int1/NaV.hpp | 8 +-- c++/conductances/nadim98/lg/Kd.hpp | 7 +-- c++/conductances/nadim98/lg/NaV.hpp | 10 ++-- c++/conductances/nadim98/mcn1/Kd.hpp | 7 +-- c++/conductances/nadim98/mcn1/NaV.hpp | 8 +-- c++/conductances/nadim99/Cal.hpp | 19 ++----- c++/conductances/odowd-aldrich/DmNaV.hpp | 7 ++- .../prinz-temperature/ACurrent.hpp | 4 +- c++/conductances/prinz-temperature/CaS.hpp | 6 ++- c++/conductances/prinz-temperature/CaT.hpp | 6 +-- .../prinz-temperature/HCurrent.hpp | 8 ++- c++/conductances/prinz-temperature/KCa.hpp | 6 ++- c++/conductances/prinz-temperature/Kd.hpp | 6 ++- c++/conductances/prinz-temperature/NaV.hpp | 6 ++- c++/conductances/prinz/ACurrent.hpp | 4 +- c++/conductances/prinz/CaS.hpp | 5 +- c++/conductances/prinz/CaT.hpp | 5 +- c++/conductances/prinz/HCurrent.hpp | 7 +-- c++/conductances/prinz/KCa.hpp | 6 ++- c++/conductances/prinz/Kd.hpp | 6 ++- c++/conductances/prinz/NaV.hpp | 6 ++- c++/conductances/rodriguez/Int1/KCurrent.hpp | 6 +-- c++/conductances/rodriguez/Int1/NaV.hpp | 6 ++- c++/conductances/rodriguez/LG/MICurrent.hpp | 5 +- c++/conductances/rodriguez/LG/TransLTS.hpp | 5 +- c++/conductances/sharp/MICurrent.hpp | 6 +-- c++/conductances/sharp96/HCurrent.hpp | 6 ++- c++/conductances/soplata/CaN.hpp | 4 +- c++/conductances/soplata/CaT.hpp | 6 +-- c++/conductances/soplata/Kd.hpp | 5 +- c++/conductances/soplata/MCurrent.hpp | 5 +- c++/conductances/soplata/NaV.hpp | 5 +- c++/conductances/soplata/legacy/MCurrent.hpp | 7 +-- .../soplata/legacy/reticular/CaT.hpp | 54 +------------------ .../soplata/legacy/reticular/Kd.hpp | 8 ++- .../soplata/legacy/reticular/NaV.hpp | 7 ++- .../soplata/legacy/thalamocortical/CaT.hpp | 53 +----------------- .../legacy/thalamocortical/HCurrent.hpp | 8 ++- .../soplata/legacy/thalamocortical/NaV.hpp | 5 +- c++/conductances/soto-trevino01/ABPD/Cal.hpp | 20 ++----- c++/conductances/soto-trevino01/ABPD/Kd.hpp | 6 ++- c++/conductances/soto-trevino01/LP/Cal.hpp | 19 +------ c++/conductances/soto-trevino01/LP/Kd.hpp | 6 ++- c++/conductances/soto-trevino01/PY/Cal.hpp | 20 ++----- c++/conductances/soto-trevino01/PY/Kd.hpp | 6 ++- .../soto-trevino05/AB/ACurrentAB.hpp | 5 +- c++/conductances/soto-trevino05/AB/CaTAB.hpp | 19 ++----- c++/conductances/soto-trevino05/AB/KCaAB.hpp | 5 +- c++/conductances/soto-trevino05/CaS.hpp | 20 ++----- c++/conductances/soto-trevino05/HCurrent.hpp | 5 +- c++/conductances/soto-trevino05/Kd.hpp | 6 ++- c++/conductances/soto-trevino05/NaP.hpp | 4 +- c++/conductances/soto-trevino05/NaV.hpp | 8 +-- .../soto-trevino05/PD/ACurrentPD.hpp | 5 +- c++/conductances/soto-trevino05/PD/CaTPD.hpp | 6 +-- c++/conductances/soto-trevino05/PD/KCaPD.hpp | 6 +-- c++/conductances/soto-trevino05/Proc.hpp | 5 +- c++/conductances/swensen/MICurrent.hpp | 4 +- c++/conductances/templates/Ca_exact.hpp | 3 +- c++/conductances/templates/generic_exact.hpp | 3 +- c++/conductances/traub/ACurrent.hpp | 7 +-- c++/conductances/traub/Cal.hpp | 25 ++------- c++/conductances/traub/KCa.hpp | 12 ++--- c++/conductances/traub/Kahp.hpp | 9 ++-- c++/conductances/traub/Kd.hpp | 8 ++- c++/conductances/traub/NaV.hpp | 8 ++- c++/conductances/turrigiano/ACurrent.hpp | 6 +-- c++/conductances/turrigiano/ASlow.hpp | 8 ++- c++/conductances/turrigiano/Ca1.hpp | 23 ++------ c++/conductances/turrigiano/Ca2.hpp | 22 ++------ c++/conductances/turrigiano/HCurrent.hpp | 7 +-- c++/conductances/turrigiano/KCa.hpp | 9 ++-- c++/conductances/turrigiano/Kd.hpp | 6 +-- c++/conductances/turrigiano/NaP.hpp | 4 +- c++/conductances/turrigiano/NaV.hpp | 6 ++- c++/conductances/wicher/DmNaV.hpp | 5 +- c++/mechanism.hpp | 12 ++--- c++/mechanisms/CalciumTarget.hpp | 7 +-- c++/mechanisms/ChannelProbe.hpp | 13 +---- .../buchholtz-temperature/CalciumMech.hpp | 14 +---- c++/mechanisms/buchholtz/CalciumMech.hpp | 13 +---- c++/mechanisms/destexhe/CalciumMech.hpp | 8 +-- c++/mechanisms/goldwyn/CurrentNoise.hpp | 7 +-- c++/mechanisms/goldwyn/CurrentNoise2.hpp | 8 +-- c++/mechanisms/goldwyn/SubunitNoise.hpp | 9 ++-- .../gorur-shandilya/CalciumSensor.hpp | 7 ++- c++/mechanisms/liu/DCSensor.hpp | 7 ++- c++/mechanisms/liu/FSDTarget.hpp | 8 ++- c++/mechanisms/liu/FastSensor.hpp | 9 ++-- c++/mechanisms/liu/IntegralController.hpp | 12 ++--- c++/mechanisms/liu/LiuController.hpp | 11 ++-- c++/mechanisms/liu/SlowSensor.hpp | 6 +-- c++/mechanisms/oleary/IntegralController.hpp | 12 ++--- .../prinz-temperature/CalciumMech.hpp | 8 +-- c++/mechanisms/prinz/CalciumMech.hpp | 7 +-- .../soto-trevino/ProportionalController.hpp | 10 ++-- c++/mechanisms/traub/CalciumMech.hpp | 6 +-- c++/mexTemplate.cpp | 2 +- c++/synapse.hpp | 28 ++++++++-- c++/synapses/Axial.hpp | 14 ----- c++/synapses/Electrical.hpp | 12 ++--- c++/synapses/borgers/AMPAergic.hpp | 5 +- c++/synapses/borgers/NMDAergic.hpp | 7 +-- c++/synapses/cymbalyuk/Inhibitory.hpp | 7 ++- c++/synapses/dayan-abbott/AlphaSynapse.hpp | 5 +- c++/synapses/generic/Graded.hpp | 5 +- c++/synapses/nadim/A2ASynapse.hpp | 4 +- c++/synapses/nadim/NeuriteSyn.hpp | 7 ++- c++/synapses/nadim/Soma.hpp | 7 ++- c++/synapses/nadim98/GenericSynapse.hpp | 8 +-- .../prinz-temperature/Cholinergic.hpp | 25 ++++----- .../prinz-temperature/Glutamatergic.hpp | 23 +++----- c++/synapses/prinz/Cholinergic.hpp | 10 ++-- c++/synapses/prinz/Glutamatergic.hpp | 7 ++- docs/how-to/make-own-models.md | 11 ++-- docs/reference/c++/compartment.md | 2 +- docs/reference/c++/conductance.md | 36 ++++++------- docs/reference/c++/synapse.md | 34 ++++++++++-- 186 files changed, 641 insertions(+), 1019 deletions(-) diff --git a/c++/compartment.hpp b/c++/compartment.hpp index 63d24342..c83e6749 100644 --- a/c++/compartment.hpp +++ b/c++/compartment.hpp @@ -436,7 +436,7 @@ It does the following things: 1. Adds a pointer to the conductance to a vector of pointers called `mech` 2. Updates various attributes of the conductance like verbosity, etc. 3. Tells the mechanism what its ordering in `mech` is by updating `mechanism_idx` in that mechanism object -4. Determines the data frame size of this object by calling `getFullStateSize` and storing this in `mechanism_sizes` +4. Determines the data frame size of this object by reading out `fullStateSize` and storing this in `mechanism_sizes` **See Also** @@ -473,7 +473,7 @@ void compartment::addSynapse(synapse *syn_) { n_syn ++; // also store the synapse's full state size - synapse_sizes.push_back(syn_->getFullStateSize()); + synapse_sizes.push_back(syn_->fullStateSize); } /* @@ -569,7 +569,7 @@ conductance* compartment::getConductancePointer(const char* cond_class) { conductance* req_cond = NULL; for (int i = 0; i < n_cond; i ++) { - if ((cond[i]->getClass()) == cond_class) { + if ((cond[i]->name) == cond_class) { req_cond = cond[i]; } } @@ -687,7 +687,7 @@ what their data dimension is, and adding up all those numbers. int compartment::getFullSynapseSize(void) { int full_size = 0; for (int i=0; igetFullStateSize(); + full_size += syn[i]->fullStateSize; } return full_size; } diff --git a/c++/conductance.hpp b/c++/conductance.hpp index 0efa8381..39b701e0 100644 --- a/c++/conductance.hpp +++ b/c++/conductance.hpp @@ -111,6 +111,8 @@ class conductance { double m = 0; double h = 1; + string name = "unset"; + int verbosity = -1; int p = 1; @@ -162,7 +164,6 @@ class conductance { virtual void integrateLangevin(double, double); virtual void connect(compartment*); - virtual string getClass(void) = 0; virtual double getState(int); virtual double getCurrent(double); void checkSolvers(int); @@ -222,7 +223,7 @@ void conductance::buildLUT(double approx_channels) { if (verbosity==0) { - mexPrintf("%s NOT using approximate activation functions because approx_channels is set to 0.\n", getClass().c_str()); + mexPrintf("%s NOT using approximate activation functions because approx_channels is set to 0.\n", name.c_str()); } return; @@ -237,7 +238,7 @@ void conductance::buildLUT(double approx_channels) { if (UseMInfApproximation == 1) { if (verbosity==0) { - mexPrintf("%s using approximate activation functions\n", getClass().c_str()); + mexPrintf("%s using approximate activation functions\n", name.c_str()); } @@ -248,13 +249,13 @@ void conductance::buildLUT(double approx_channels) { } } else { if (verbosity==0) { - mexPrintf("%s NOT USING approximate activation functions\n", getClass().c_str()); + mexPrintf("%s NOT USING approximate activation functions\n", name.c_str()); } } if (UseHInfApproximation == 1) { if (verbosity==0) { - mexPrintf("%s using approximate in-activation functions\n", getClass().c_str()); + mexPrintf("%s using approximate in-activation functions\n", name.c_str()); } for (int V_int = -999; V_int < 1001; V_int++) { @@ -342,7 +343,7 @@ void conductance::checkSolvers(int solver_order) { } else if (solver_order == 4) { return; } else { - mexPrintf("Error using %s", getClass().c_str()); + mexPrintf("Error using %s", name.c_str()); mexErrMsgTxt("Unsupported solver order \n"); } } diff --git a/c++/conductances/GenericKdLike.hpp b/c++/conductances/GenericKdLike.hpp index ab113483..daed54aa 100644 --- a/c++/conductances/GenericKdLike.hpp +++ b/c++/conductances/GenericKdLike.hpp @@ -51,14 +51,15 @@ class GenericKdLike: public conductance { p = 4; + name = "GenericKdLike"; + } double m_inf(double, double); double tau_m(double, double); - string getClass(void); + }; -string GenericKdLike::getClass(){return "GenericKdLike";} double GenericKdLike::m_inf(double V, double Ca) {return 1.0/(1.0+exp((V-m_V_half)/m_V_slope));} diff --git a/c++/conductances/GenericNaVLike.hpp b/c++/conductances/GenericNaVLike.hpp index 1094db45..c26569b9 100644 --- a/c++/conductances/GenericNaVLike.hpp +++ b/c++/conductances/GenericNaVLike.hpp @@ -76,17 +76,17 @@ class GenericNaVLike: public conductance { p = 3; q = 1; + name = "GenericNaVLike"; + } double m_inf(double, double); double h_inf(double, double); double tau_m(double, double); double tau_h(double, double); - string getClass(void); + }; -string GenericNaVLike::getClass(){return "GenericNaVLike";} - double GenericNaVLike::m_inf(double V, double Ca) {return 1.0/(1.0+exp((V-m_V_half)/m_V_slope));} double GenericNaVLike::h_inf(double V, double Ca) {return 1.0/(1.0+exp((V-h_V_half)/h_V_slope));} diff --git a/c++/conductances/Leak.hpp b/c++/conductances/Leak.hpp index 15720e1b..48d3f9d4 100644 --- a/c++/conductances/Leak.hpp +++ b/c++/conductances/Leak.hpp @@ -22,6 +22,8 @@ class Leak: public conductance { if (isnan (E)) { E = -55; } + name = "Leak"; + } @@ -29,11 +31,10 @@ class Leak: public conductance { void integrateMS(int, double, double); void integrateLangevin(double, double); - string getClass(void); + }; -string Leak::getClass(){return "Leak";} void Leak::integrate(double V, double Ca) { // do nothing diff --git a/c++/conductances/bronk/EAGes.hpp b/c++/conductances/bronk/EAGes.hpp index 1826a22e..ff3beb1e 100644 --- a/c++/conductances/bronk/EAGes.hpp +++ b/c++/conductances/bronk/EAGes.hpp @@ -26,15 +26,16 @@ class EAGes: public conductance { p = 1; + name = "EAGes"; + } double m_inf(double V, double Ca); double tau_m(double, double); - string getClass(void); + }; -string EAGes::getClass(){return "EAG";} double EAGes::m_inf(double V, double Ca) { return (9.29e-4/(Ca+9.29e-4))/(1.0+exp((V+23.12)/-16.94)); } diff --git a/c++/conductances/bronk/EAGmut.hpp b/c++/conductances/bronk/EAGmut.hpp index 9ac4cc84..7f493cd5 100644 --- a/c++/conductances/bronk/EAGmut.hpp +++ b/c++/conductances/bronk/EAGmut.hpp @@ -27,6 +27,8 @@ class EAGmut: public conductance { if (isnan (E)) { E = -80; } + name = "EAGmut"; + p = 1; } @@ -34,12 +36,10 @@ class EAGmut: public conductance { double m_inf(double V, double Ca); double tau_m(double, double); - string getClass(void); + }; -string EAGmut::getClass(){return "EAG";} - double EAGmut::m_inf(double V, double Ca) { return (.92*(1-.05)/(Ca+.92) + .05)/(1.0+exp((V+23.12)/-16.94)); } double EAGmut::tau_m(double V, double Ca) {return 5497 - 5500/(1.0+exp((V+251.5 )/-51.5));} diff --git a/c++/conductances/bronk/EAGwt.hpp b/c++/conductances/bronk/EAGwt.hpp index d8a63100..7e783523 100644 --- a/c++/conductances/bronk/EAGwt.hpp +++ b/c++/conductances/bronk/EAGwt.hpp @@ -23,9 +23,10 @@ class EAGwt: public conductance { // defaults if (isnan(gbar)) { gbar = 0; } - if (isnan (E)) { E = -80; } + name = "EAGwt"; + p = 1; @@ -33,11 +34,10 @@ class EAGwt: public conductance { double m_inf(double V, double Ca); double tau_m(double, double); - string getClass(void); + }; -string EAGwt::getClass(){return "EAG";} double EAGwt::m_inf(double V, double Ca) { return (9.29e-2/(Ca+9.29e-2))/(1.0+exp((V+23.12)/-16.94)); } double EAGwt::tau_m(double V, double Ca) {return 5497 - 5500/(1.0+exp((V+251.5 )/-51.5));} diff --git a/c++/conductances/brookings/ACurrent.hpp b/c++/conductances/brookings/ACurrent.hpp index 3982677d..b6e0241a 100644 --- a/c++/conductances/brookings/ACurrent.hpp +++ b/c++/conductances/brookings/ACurrent.hpp @@ -28,6 +28,8 @@ class ACurrent: public conductance { p = 3; + name = "ACurrent"; + } @@ -35,14 +37,11 @@ class ACurrent: public conductance { double h_inf(double V, double Ca); double tau_m(double V, double Ca); double tau_h(double V, double Ca); - string getClass(void); }; -string ACurrent::getClass(){ - return "ACurrent"; -} + double ACurrent::m_inf(double V, double Ca) {return (1.0/(1.0+exp(((V)+12.3)/-11.8))); } diff --git a/c++/conductances/caplan/MICurrent.hpp b/c++/conductances/caplan/MICurrent.hpp index 07b4a4b7..806f8ad4 100644 --- a/c++/conductances/caplan/MICurrent.hpp +++ b/c++/conductances/caplan/MICurrent.hpp @@ -24,22 +24,21 @@ class MICurrent: public conductance { // defaults if (isnan(gbar)) { gbar = 0; } - if (isnan (E)) { E = 30; } p = 1; + + name = "MICurrent"; } double m_inf(double V, double Ca); double h_inf(double V, double Ca); double tau_m(double V, double Ca); double tau_h(double V, double Ca); - string getClass(void); + }; -string MICurrent::getClass(){return "MICurrent";} - double MICurrent::m_inf(double V, double Ca) {return 1.0/(1.0+exp((V+12.0)/-5));} diff --git a/c++/conductances/chow/Kd.hpp b/c++/conductances/chow/Kd.hpp index 4ea45888..69c3223b 100644 --- a/c++/conductances/chow/Kd.hpp +++ b/c++/conductances/chow/Kd.hpp @@ -22,28 +22,25 @@ class Kd: public conductance { // defaults if (isnan(gbar)) { gbar = 0; } - if (isnan (E)) { E = -77; } unitary_conductance = 20e-6; // uS + name = "Kd"; + p = 4; } double m_inf(double, double); double tau_m(double, double); - string getClass(void); + double Alpha(double); double Beta(double); }; -string Kd::getClass(){ - return "Kd"; -} - double Kd::Alpha(double V) { return 0.01 * (V+55) / (1-exp((V+55)/(-10))); diff --git a/c++/conductances/chow/NaV.hpp b/c++/conductances/chow/NaV.hpp index 6ab744ef..aef3c41f 100644 --- a/c++/conductances/chow/NaV.hpp +++ b/c++/conductances/chow/NaV.hpp @@ -23,8 +23,6 @@ class NaV: public conductance { // defaults if (isnan(gbar)) { gbar = 0; } - - if (isnan (E)) { E = 50; } unitary_conductance = 20e-6; // uS @@ -32,6 +30,8 @@ class NaV: public conductance { p = 3; q = 1; + name = "NaV"; + } double m_inf(double, double); @@ -45,10 +45,10 @@ class NaV: public conductance { double BetaM(double); double BetaH(double); - string getClass(void); + }; -string NaV::getClass(){return "NaV";} + double NaV::AlphaM(double V) { diff --git a/c++/conductances/clay00/Kd2.hpp b/c++/conductances/clay00/Kd2.hpp index 055f3848..3760b207 100644 --- a/c++/conductances/clay00/Kd2.hpp +++ b/c++/conductances/clay00/Kd2.hpp @@ -39,19 +39,17 @@ class Kd2: public conductance { // need to set E to zero to linearize. Don't worry, // this is not the reversal potential E = 0; + + name = "Kd2"; } - string getClass(void); + void integrate(double, double); }; -string Kd2::getClass(){ - return "Kd2"; -} - void Kd2::integrate(double V_, double Ca_){ diff --git a/c++/conductances/destexhe/CaN.hpp b/c++/conductances/destexhe/CaN.hpp index 2c56fb15..5b85213d 100644 --- a/c++/conductances/destexhe/CaN.hpp +++ b/c++/conductances/destexhe/CaN.hpp @@ -38,18 +38,16 @@ class CaN: public conductance { p = 2; + name = "CaN"; + } double m_inf(double, double); double tau_m(double, double); - string getClass(void); + }; -string CaN::getClass(){ - return "CaN"; -} - double CaN::m_inf(double V, double Ca) {return alpha * fast_pow(Ca, 2) / (alpha * fast_pow(Ca, 2) + beta);} double CaN::tau_m(double V, double Ca) {return 1 / (alpha * fast_pow(Ca, 2) + beta);} diff --git a/c++/conductances/destexhe/CaT.hpp b/c++/conductances/destexhe/CaT.hpp index 2f29c8f1..548dd84b 100644 --- a/c++/conductances/destexhe/CaT.hpp +++ b/c++/conductances/destexhe/CaT.hpp @@ -35,6 +35,7 @@ class CaT: public conductance { q = 1; is_calcium = true; + name = "CaT"; } @@ -43,14 +44,11 @@ class CaT: public conductance { double h_inf(double, double); double tau_m(double, double); double tau_h(double, double); - string getClass(void); + }; -string CaT::getClass(){ - return "CaT"; -} double CaT::m_inf(double V, double Ca) {return 1 / (1 + exp(-(V + 52)/7.4));} double CaT::h_inf(double V, double Ca) {return 1 / (1 + exp((V + 80)/5));} diff --git a/c++/conductances/destexhe/KCa.hpp b/c++/conductances/destexhe/KCa.hpp index 9f8e7617..acace7ae 100644 --- a/c++/conductances/destexhe/KCa.hpp +++ b/c++/conductances/destexhe/KCa.hpp @@ -41,17 +41,16 @@ class KCa: public conductance { // allow approximations AllowMInfApproximation = false; + name = "KCa"; + } double m_inf(double, double); double tau_m(double, double); - string getClass(void); + }; -string KCa::getClass(){ - return "KCa"; -} double KCa::m_inf(double V, double Ca) {return alpha * fast_pow(Ca, 2) / (alpha * fast_pow(Ca, 2) + beta);} double KCa::tau_m(double V, double Ca) {return 1 / (alpha * fast_pow(Ca, 2) + beta);} diff --git a/c++/conductances/destexhe98/CaT.hpp b/c++/conductances/destexhe98/CaT.hpp index 1b809e5c..0f0322bf 100644 --- a/c++/conductances/destexhe98/CaT.hpp +++ b/c++/conductances/destexhe98/CaT.hpp @@ -57,7 +57,7 @@ class CaT: public conductance { if (isnan(pbar)) {pbar = 0;} - + name = "CaT"; is_calcium = true; } @@ -70,7 +70,7 @@ class CaT: public conductance { void integrate(double, double); - string getClass(void); + void connect(compartment *); @@ -125,9 +125,6 @@ void CaT::integrate(double V, double Ca) { } -string CaT::getClass(){ - return "CaT"; -} double CaT::m_inf(double V, double Ca) { diff --git a/c++/conductances/dethier/CaT.hpp b/c++/conductances/dethier/CaT.hpp index 23833644..8ef3dbf7 100644 --- a/c++/conductances/dethier/CaT.hpp +++ b/c++/conductances/dethier/CaT.hpp @@ -34,33 +34,21 @@ class CaT: public conductance { q = 1; is_calcium = true; + name = "CaT"; } - void integrate(double, double); - void integrateMS(int, double, double); double m_inf(double, double); double tau_m(double, double); double h_inf(double, double); double tau_h(double, double); - string getClass(void); + }; -string CaT::getClass(){return "CaT";} -void CaT::integrate(double V, double Ca) { - E = container->E_Ca; - conductance::integrate(V,Ca); - container->i_Ca += getCurrent(V); -} -void CaT::integrateMS(int k, double V, double Ca) { - E = container->E_Ca; - conductance::integrateMS(k, V, Ca); - container->i_Ca += getCurrent(V); -} double CaT::m_inf(double V, double Ca) {return (1.0/(1.0+exp(((V)+57.1)/-7.2)));} double CaT::h_inf(double V, double Ca) {return (1.0/(1.0+exp(((V)+82.1)/5.5)));} diff --git a/c++/conductances/dethier/HCurrent.hpp b/c++/conductances/dethier/HCurrent.hpp index 73fa8a16..bcbbbe99 100644 --- a/c++/conductances/dethier/HCurrent.hpp +++ b/c++/conductances/dethier/HCurrent.hpp @@ -24,18 +24,18 @@ class HCurrent: public conductance { // defaults if (isnan(gbar)) { gbar = 0; } - if (isnan (E)) { E = 30; } - p = 1; + + name = "HCurrent"; } double m_inf(double, double); double tau_m(double, double); - string getClass(void); + }; -string HCurrent::getClass(){return "HCurrent";} + double HCurrent::m_inf(double V, double Ca) {return (1.0/(1.0+exp(((V)+80.0)/6.0)));} diff --git a/c++/conductances/dethier/Kd.hpp b/c++/conductances/dethier/Kd.hpp index f04e3313..95e3324e 100644 --- a/c++/conductances/dethier/Kd.hpp +++ b/c++/conductances/dethier/Kd.hpp @@ -23,22 +23,21 @@ class Kd: public conductance { m = m_; // defaults - if (isnan(gbar)) { gbar = 0; } - + if (isnan(gbar)) { gbar = 0; } if (isnan (E)) { E = 30; } - p = 4; + name = "Kd"; } double m_inf(double, double); double tau_m(double, double); - string getClass(void); + }; -string Kd::getClass(){return "Kd";} + double Kd::m_inf(double V, double Ca) {return (1.0/(1.0+exp(((V)+12.3)/-11.8)));} double Kd::tau_m(double V, double Ca) {return 7.2- (6.4/(1.0+exp(((V)+28.3)/-19.2)));} diff --git a/c++/conductances/dethier/NaV.hpp b/c++/conductances/dethier/NaV.hpp index 10ba7751..2c2d3e53 100644 --- a/c++/conductances/dethier/NaV.hpp +++ b/c++/conductances/dethier/NaV.hpp @@ -33,18 +33,18 @@ class NaV: public conductance { p = 3; q = 1; + name = "NaV"; + } double m_inf(double, double); double h_inf(double, double); double tau_m(double, double); double tau_h(double, double); - string getClass(void); }; -string NaV::getClass(){return "NaV";} double NaV::m_inf(double V, double Ca) {return (1.0/(1.0+exp(((V)+35.5)/-5.29)));} diff --git a/c++/conductances/generic/HCurrent.hpp b/c++/conductances/generic/HCurrent.hpp index 98d9e078..e892d5c5 100644 --- a/c++/conductances/generic/HCurrent.hpp +++ b/c++/conductances/generic/HCurrent.hpp @@ -31,15 +31,17 @@ class HCurrent: public conductance { if (isnan(tau)) { tau = 2e3; } if (isnan (E)) { E = -20; } + name = "HCurrent"; + } double m_inf(double, double); double tau_m(double, double); - string getClass(void); + }; -string HCurrent::getClass(){return "HCurrent";} + double HCurrent::m_inf(double V, double Ca) {return 1.0/(1.0+exp((V-Vhalf)/5.5));} diff --git a/c++/conductances/giovannini/CaN.hpp b/c++/conductances/giovannini/CaN.hpp index dcafa7b9..f10c87cd 100644 --- a/c++/conductances/giovannini/CaN.hpp +++ b/c++/conductances/giovannini/CaN.hpp @@ -46,6 +46,8 @@ class CaN: public conductance { AllowMInfApproximation = false; AllowHInfApproximation = false; + name = "CaN"; + } double m_inf(double, double); @@ -54,13 +56,10 @@ class CaN: public conductance { double b_m(double, double); double alpha(double); void init(void); - string getClass(void); + }; -string CaN::getClass(){ - return "CaN"; -} void CaN::init() { diff --git a/c++/conductances/giovannini/CaT.hpp b/c++/conductances/giovannini/CaT.hpp index 29c00ddb..07d44632 100644 --- a/c++/conductances/giovannini/CaT.hpp +++ b/c++/conductances/giovannini/CaT.hpp @@ -31,7 +31,7 @@ class CaT: public conductance { q = 1; - + name = "CaT"; is_calcium = true; } @@ -45,15 +45,11 @@ class CaT: public conductance { double b_m(double, double); double a_h(double, double); double b_h(double, double); - string getClass(void); + }; -string CaT::getClass(){ - return "CaT"; -} - double CaT::a_m(double V, double Ca) {return 0.055 * (-27 - V) / (exp((-27 - V)/3.8) - 1);} double CaT::a_h(double V, double Ca) {return 0.000457 * exp((-13 - V)/50);} double CaT::b_m(double V, double Ca) {return 0.94 * exp((-75 - V)/17);} diff --git a/c++/conductances/giovannini/Kd.hpp b/c++/conductances/giovannini/Kd.hpp index 7fcdb676..e01af33b 100644 --- a/c++/conductances/giovannini/Kd.hpp +++ b/c++/conductances/giovannini/Kd.hpp @@ -25,20 +25,17 @@ class Kd: public conductance { // defaults if (isnan(gbar)) { gbar = 0; } if (isnan(E)) { E = -80; } + name = "Kd"; } double m_inf(double, double); double tau_m(double, double); double a_m(double, double); double b_m(double, double); - string getClass(void); + }; -string Kd::getClass() -{ - return "Kd"; -} double Kd::a_m(double V, double Ca) {return 0.032 * (15 - V + 55) / (exp((15 - V + 55)/5) - 1);} double Kd::b_m(double V, double Ca) {return 0.5 * exp((10 - V + 55)/40);} diff --git a/c++/conductances/giovannini/MCurrent.hpp b/c++/conductances/giovannini/MCurrent.hpp index 31c43afa..c901fbcf 100644 --- a/c++/conductances/giovannini/MCurrent.hpp +++ b/c++/conductances/giovannini/MCurrent.hpp @@ -31,20 +31,18 @@ class MCurrent: public conductance { if (isnan(gbar)) { gbar = 0; } if (isnan(E)) { E = -80; } if (isnan(tau)) { tau = 1000; } + + name = "MCurrent"; } double m_inf(double, double); double tau_m(double, double); double a_m(double, double); double b_m(double, double); - string getClass(void); + }; -string MCurrent::getClass() -{ - return "MCurrent"; -} double MCurrent::a_m(double V, double Ca) {return (1 / tau) * (3.3 * exp((V + 35)/20) + exp(-(V + 35)/20)) / exp((-35 + V)/10) + 1;} double MCurrent::b_m(double V, double Ca) {return (1 / tau) * (3.3 * exp((V + 35)/20) + exp(-(V + 35)/20) * (1 - 1 / (exp((-35 + V)/10) + 1)));} diff --git a/c++/conductances/giovannini/NaV.hpp b/c++/conductances/giovannini/NaV.hpp index 54cbe77b..ca8f221f 100644 --- a/c++/conductances/giovannini/NaV.hpp +++ b/c++/conductances/giovannini/NaV.hpp @@ -27,6 +27,8 @@ class NaV: public conductance { // defaults if (isnan(gbar)) { gbar = 0; } if (isnan(E)) { E = 50; } + + name = "NaV"; } double m_inf(double, double); @@ -37,15 +39,10 @@ class NaV: public conductance { double b_m(double, double); double a_h(double, double); double b_h(double, double); - string getClass(void); + }; -string NaV::getClass() -{ - return "NaV"; -} - double NaV::a_m(double V, double Ca) {return 0.32 * (13 - V + 55) / (exp((13 - V + 55)/4) - 1);} double NaV::a_h(double V, double Ca) {return 0.128 * exp((17 - V + 55)/18);} double NaV::b_m(double V, double Ca) {return 0.28 * (V - 55 - 40) / (exp((V - 55 - 40)/5) - 1);} diff --git a/c++/conductances/goldman/Ap.hpp b/c++/conductances/goldman/Ap.hpp index ec94f4b9..370b1a30 100644 --- a/c++/conductances/goldman/Ap.hpp +++ b/c++/conductances/goldman/Ap.hpp @@ -24,9 +24,10 @@ class Ap: public conductance { // defaults if (isnan(gbar)) { gbar = 0; } - if (isnan (E)) { E = 0; } + name = "Ap"; + p = 1; } @@ -34,13 +35,10 @@ class Ap: public conductance { double m_inf(double, double); double tau_m(double, double); - string getClass(void); + }; -string Ap::getClass(){return "Ap";} - - double Ap::m_inf(double V, double Ca) {return (1.0/(1.0+exp(((V)-12.0)/-11.0)));} double Ap::tau_m(double V, double Ca) {return 6.0;} diff --git a/c++/conductances/goldman/At.hpp b/c++/conductances/goldman/At.hpp index fbca6a79..59f24400 100644 --- a/c++/conductances/goldman/At.hpp +++ b/c++/conductances/goldman/At.hpp @@ -32,6 +32,8 @@ class At: public conductance { p = 1; q = 1; + name = "At"; + } @@ -39,12 +41,10 @@ class At: public conductance { double h_inf(double, double); double tau_m(double, double); double tau_h(double, double); - string getClass(void); + }; -string At::getClass(){return "At";} - double At::m_inf(double V, double Ca) {return (1.0/(1.0+exp(((V)+23.0)/-13.0)));} double At::tau_m(double V, double Ca) {return 11.0+(8.0/(1.0+exp(((V)+70.0)/-15.0)));} diff --git a/c++/conductances/goldman/Cal.hpp b/c++/conductances/goldman/Cal.hpp index a2b852c1..b44215d7 100644 --- a/c++/conductances/goldman/Cal.hpp +++ b/c++/conductances/goldman/Cal.hpp @@ -25,42 +25,25 @@ class Cal: public conductance { // defaults if (isnan(gbar)) { gbar = 0; } - - if (isnan (E)) { E = 0; } p = 3; q = 1; is_calcium = true; + name = "Cal"; } - void integrate(double, double); - void integrateMS(int, double, double); double m_inf(double, double); double h_inf(double, double); double tau_m(double, double); double tau_h(double, double); - string getClass(void); + }; -string Cal::getClass(){return "Cal";} - -void Cal::integrate(double V, double Ca) { - E = container->E_Ca; - conductance::integrate(V,Ca); - container->i_Ca += getCurrent(V); -} - -void Cal::integrateMS(int k, double V, double Ca) { - E = container->E_Ca; - conductance::integrateMS(k, V, Ca); - container->i_Ca += getCurrent(V); -} - double Cal::m_inf(double V, double Ca) {return (1.0/(1.0+exp(((V)+35.0)/-12.0)));} double Cal::tau_m(double V, double Ca) {return 7.0+(0.4/(1.0+exp(((V)+70.0)/-15.0)));} diff --git a/c++/conductances/goldman/Proc.hpp b/c++/conductances/goldman/Proc.hpp index 8ea14d52..7ae0b5bd 100644 --- a/c++/conductances/goldman/Proc.hpp +++ b/c++/conductances/goldman/Proc.hpp @@ -24,20 +24,20 @@ class Proc: public conductance { // defaults if (isnan(gbar)) { gbar = 0; } - if (isnan (E)) { E = 0; } p = 1; + name = "Proc"; + } double m_inf(double, double); double tau_m(double, double); - string getClass(void); + }; -string Proc::getClass(){return "Proc";} diff --git a/c++/conductances/golowasch/HCurrent.hpp b/c++/conductances/golowasch/HCurrent.hpp index 0417ba32..f586ff1d 100644 --- a/c++/conductances/golowasch/HCurrent.hpp +++ b/c++/conductances/golowasch/HCurrent.hpp @@ -24,19 +24,18 @@ class HCurrent: public conductance { // defaults if (isnan(gbar)) { gbar = 0; } - if (isnan (E)) { E = -20; } + name = "HCurrent"; + } double m_inf(double, double); double tau_m(double, double); - string getClass(void); + }; -string HCurrent::getClass(){ - return "HCurrent"; -} + double HCurrent::m_inf(double V, double Ca) {return 1.0/(1.0+exp((V+95.16)/9.12));} double HCurrent::tau_m(double V, double Ca) {return (272.0 + 1499.0/(1.0+exp((V+42.2)/-8.73)));} diff --git a/c++/conductances/hardie-laughlin/Shaker.hpp b/c++/conductances/hardie-laughlin/Shaker.hpp index 4d653414..acd389be 100644 --- a/c++/conductances/hardie-laughlin/Shaker.hpp +++ b/c++/conductances/hardie-laughlin/Shaker.hpp @@ -25,27 +25,24 @@ class Shaker: public conductance { // defaults if (isnan(gbar)) { gbar = 0; } - - if (isnan (E)) { E = -80; } p = 1; q = 1; + name = "Shaker"; + } double m_inf(double, double); double h_inf(double, double); double tau_m(double, double); double tau_h(double, double); - string getClass(void); + }; -string Shaker::getClass(){return "Shaker";} - - double Shaker::m_inf(double V, double Ca) {return 1.0/(1.0+exp((V+62.8)/-8.2)); } double Shaker::h_inf(double V, double Ca) {return 1.0/(1.0+exp((V+80.0)/5.23)); } double Shaker::tau_m(double V, double Ca) {return 50.0 - 47.88/(1.0+exp((V+92.24)/-8.0));} diff --git a/c++/conductances/heras/Novel.hpp b/c++/conductances/heras/Novel.hpp index 09531e43..02f79f2d 100644 --- a/c++/conductances/heras/Novel.hpp +++ b/c++/conductances/heras/Novel.hpp @@ -26,22 +26,21 @@ class Novel: public conductance { // defaults if (isnan(gbar)) { gbar = 0; } - if (isnan (E)) { E = -80; } p = 1; + name = "Novel"; + } double m_inf(double, double); double tau_m(double, double); - string getClass(void); + }; -string Novel::getClass(){return "Novel";} - double Novel::m_inf(double V, double Ca) {return (1.0/(1.0+exp(sqrt((1.0+V)/-9.1))));} double Novel::tau_m(double V, double Ca) {return 13.0+165.0*exp(-2.0*((V+19.4)/30.0)*((V+19.4)/30.0));} diff --git a/c++/conductances/heras/Shab.hpp b/c++/conductances/heras/Shab.hpp index b6d7da14..a6fdc6c2 100644 --- a/c++/conductances/heras/Shab.hpp +++ b/c++/conductances/heras/Shab.hpp @@ -25,13 +25,13 @@ class Shab: public conductance { // defaults if (isnan(gbar)) { gbar = 0; } - - if (isnan (E)) { E = -80; } p = 2; q = 1; + name = "Shab"; + } @@ -39,12 +39,10 @@ class Shab: public conductance { double h_inf(double, double); double tau_m(double, double); double tau_h(double, double); - string getClass(void); + }; -string Shab::getClass(){return "Shab";} - double Shab::m_inf(double V, double Ca) {return (1.0/(1.0+exp(sqrt((-1.0-V)/9.1))));} double Shab::tau_m(double V, double Ca) {return 1.0/(0.116*exp((-V-25.7)/32.2)+0.00659*(-V-23.8)/(exp((-V-23.8)/1.35)-1.0));} diff --git a/c++/conductances/hodgkin-huxley/Kd.hpp b/c++/conductances/hodgkin-huxley/Kd.hpp index c064702b..130ebf6e 100644 --- a/c++/conductances/hodgkin-huxley/Kd.hpp +++ b/c++/conductances/hodgkin-huxley/Kd.hpp @@ -28,21 +28,19 @@ class Kd: public conductance { unitary_conductance = 20e-6; // uS p = 4; + + name = "Kd"; } double m_inf(double, double); double tau_m(double, double); - string getClass(void); + double Alpha(double); double Beta(double); }; -string Kd::getClass(){ - return "Kd"; -} - double Kd::Alpha(double V) { return 0.01 * (10-V) / (exp((10-V)/10)-1); diff --git a/c++/conductances/hodgkin-huxley/NaV.hpp b/c++/conductances/hodgkin-huxley/NaV.hpp index e4d8d433..b7639df7 100644 --- a/c++/conductances/hodgkin-huxley/NaV.hpp +++ b/c++/conductances/hodgkin-huxley/NaV.hpp @@ -23,8 +23,6 @@ class NaV: public conductance { // defaults if (isnan(gbar)) { gbar = 0; } - - if (isnan (E)) { E = 50; } unitary_conductance = 20e-6; // uS @@ -32,6 +30,8 @@ class NaV: public conductance { p = 3; q = 1; + name = "NaV"; + } double m_inf(double, double); @@ -45,10 +45,10 @@ class NaV: public conductance { double BetaM(double); double BetaH(double); - string getClass(void); + }; -string NaV::getClass(){return "NaV";} + double NaV::AlphaM(double V) { diff --git a/c++/conductances/jochems/CaN.hpp b/c++/conductances/jochems/CaN.hpp index f0999e3a..2fe91b21 100644 --- a/c++/conductances/jochems/CaN.hpp +++ b/c++/conductances/jochems/CaN.hpp @@ -44,16 +44,17 @@ class CaN: public conductance { AllowMInfApproximation = false; AllowHInfApproximation = false; + name = "CaN"; + } double m_inf(double, double); double tau_m(double, double); double alpha(double); - string getClass(void); + }; -string CaN::getClass(){return "CaN";} double CaN::alpha(double Ca) { return beta + fast_pow(Ca / Ca_c, 2); } diff --git a/c++/conductances/jochems/CaT.hpp b/c++/conductances/jochems/CaT.hpp index 97db5ed8..0cec2e2e 100644 --- a/c++/conductances/jochems/CaT.hpp +++ b/c++/conductances/jochems/CaT.hpp @@ -31,6 +31,7 @@ class CaT: public conductance { q = 1; is_calcium = true; + name = "CaT"; } @@ -43,14 +44,11 @@ class CaT: public conductance { double b_m(double, double); double a_h(double, double); double b_h(double, double); - string getClass(void); + }; -string CaT::getClass(){ - return "CaT"; -} double CaT::a_m(double V, double Ca) {return 0.055 * (-27 - V) / (exp((-27 - V)/3.8) - 1);} double CaT::a_h(double V, double Ca) {return 0.000457 * exp((-13 - V)/50);} diff --git a/c++/conductances/jochems/Kd.hpp b/c++/conductances/jochems/Kd.hpp index 9cc41dd6..94c934ad 100644 --- a/c++/conductances/jochems/Kd.hpp +++ b/c++/conductances/jochems/Kd.hpp @@ -26,19 +26,18 @@ class Kd: public conductance { // defaults if (isnan(gbar)) { gbar = 0; } if (isnan(E)) { E = -100; } + + name = "Kd"; } double m_inf(double, double); double tau_m(double, double); double a_m(double, double); double b_m(double, double); - string getClass(void); + }; -string Kd::getClass() { - return "Kd"; -} double Kd::a_m(double V, double Ca) {return 0.032 * (15 - V) / (exp((15 - V)/5) - 1);} double Kd::b_m(double V, double Ca) {return 0.5 * exp((10 - V)/40);} diff --git a/c++/conductances/jochems/MCurrent.hpp b/c++/conductances/jochems/MCurrent.hpp index 90e44b6f..0130b891 100644 --- a/c++/conductances/jochems/MCurrent.hpp +++ b/c++/conductances/jochems/MCurrent.hpp @@ -23,6 +23,8 @@ class MCurrent: public conductance { p = 1; + name = "MCurrent"; + // defaults if (isnan(gbar)) { gbar = 0; } @@ -31,14 +33,10 @@ class MCurrent: public conductance { double m_inf(double, double); double tau_m(double, double); - string getClass(void); + }; -string MCurrent::getClass() -{ - return "MCurrent"; -} double MCurrent::m_inf(double V, double Ca) {return 1 / (1 + exp((-(V + 35)/10)));} double MCurrent::tau_m(double V, double Ca) {return 4 / (3.3 * exp((V + 35)/20) + exp(-(V + 35)/20));} diff --git a/c++/conductances/jochems/NaV.hpp b/c++/conductances/jochems/NaV.hpp index 4744a61e..fabad44e 100644 --- a/c++/conductances/jochems/NaV.hpp +++ b/c++/conductances/jochems/NaV.hpp @@ -30,6 +30,8 @@ class NaV: public conductance { p = 3; h = 1; + name = "NaV"; + } double m_inf(double, double); @@ -40,11 +42,11 @@ class NaV: public conductance { double b_m(double, double); double a_h(double, double); double b_h(double, double); - string getClass(void); + }; -string NaV::getClass(){return "NaV";} + double NaV::a_m(double V, double Ca) {return 0.32 * (13 - V) / (exp((13 - V)/4) - 1);} diff --git a/c++/conductances/kispersky/ACurrent.hpp b/c++/conductances/kispersky/ACurrent.hpp index f9a57a38..0726afe2 100644 --- a/c++/conductances/kispersky/ACurrent.hpp +++ b/c++/conductances/kispersky/ACurrent.hpp @@ -32,6 +32,8 @@ class ACurrent: public conductance { p = 3; q = 1; + name = "ACurrent"; + } @@ -39,12 +41,9 @@ class ACurrent: public conductance { double h_inf(double, double); double tau_m(double, double); double tau_h(double, double); - string getClass(void); }; -string ACurrent::getClass(){return "ACurrent";} - double ACurrent::m_inf(double V, double Ca) {return (1.0/(1.0+exp(((V)+27.2)/-8.7)));} double ACurrent::tau_m(double V, double Ca) {return 11.6-(10.4/(exp(((V)+32.9)/-15.2)));} diff --git a/c++/conductances/kispersky/CaS.hpp b/c++/conductances/kispersky/CaS.hpp index 66b77fbb..7b10c5ed 100644 --- a/c++/conductances/kispersky/CaS.hpp +++ b/c++/conductances/kispersky/CaS.hpp @@ -25,41 +25,26 @@ class CaS: public conductance { // defaults if (isnan(gbar)) { gbar = 0; } - - if (isnan (E)) { E = 0; } p = 3; q = 1; is_calcium = true; + name = "CaS"; } - void integrate(double, double); - void integrateMS(int, double, double); double m_inf(double, double); double h_inf(double, double); double tau_m(double, double); double tau_h(double, double); - string getClass(void); + }; -string CaS::getClass(){return "CaS";} -void CaS::integrate(double V, double Ca) { - E = container->E_Ca; - conductance::integrate(V,Ca); - container->i_Ca += getCurrent(V); -} - -void CaS::integrateMS(int k, double V, double Ca) { - E = container->E_Ca; - conductance::integrateMS(k, V, Ca); - container->i_Ca += getCurrent(V); -} double CaS::m_inf(double V, double Ca) {return 1.0 / (1.0 + exp( (V + 33.0) / -8.1 ));} diff --git a/c++/conductances/kispersky/CaT.hpp b/c++/conductances/kispersky/CaT.hpp index ad575cde..53221f53 100644 --- a/c++/conductances/kispersky/CaT.hpp +++ b/c++/conductances/kispersky/CaT.hpp @@ -34,33 +34,19 @@ class CaT: public conductance { is_calcium = true; + name = "CaT"; + } - void integrate(double, double); - void integrateMS(int, double, double); double m_inf(double, double); double h_inf(double, double); double tau_m(double, double); double tau_h(double, double); - string getClass(void); + }; -string CaT::getClass(){return "CaT";} - -void CaT::integrate(double V, double Ca) { - E = container->E_Ca; - conductance::integrate(V,Ca); - container->i_Ca += getCurrent(V); -} - -void CaT::integrateMS(int k, double V, double Ca) { - E = container->E_Ca; - conductance::integrateMS(k, V, Ca); - container->i_Ca += getCurrent(V); -} - double CaT::m_inf(double V, double Ca) {return (1.0/(1.0+exp(((V)+27.1)/-7.2)));} diff --git a/c++/conductances/kispersky/HCurrent.hpp b/c++/conductances/kispersky/HCurrent.hpp index a3f47421..195c18bf 100644 --- a/c++/conductances/kispersky/HCurrent.hpp +++ b/c++/conductances/kispersky/HCurrent.hpp @@ -24,20 +24,21 @@ class HCurrent: public conductance { // defaults if (isnan(gbar)) { gbar = 0; } - if (isnan (E)) { E = 0; } + name = "HCurrent"; + p = 1; } double m_inf(double, double); double tau_m(double, double); - string getClass(void); + }; -string HCurrent::getClass(){return "HCurrent";} + double HCurrent::m_inf(double V, double Ca) {return (1.0/(1.0+exp(((V)+70.0)/-6.0)));} diff --git a/c++/conductances/kispersky/KCa.hpp b/c++/conductances/kispersky/KCa.hpp index f2c93d43..d289dc18 100644 --- a/c++/conductances/kispersky/KCa.hpp +++ b/c++/conductances/kispersky/KCa.hpp @@ -24,20 +24,21 @@ class KCa: public conductance { // defaults if (isnan(gbar)) { gbar = 0; } - if (isnan (E)) { E = 0; } p = 4; + name = "KCa"; + } double m_inf(double V, double Ca); double tau_m(double, double); - string getClass(void); + }; -string KCa::getClass(){return "KCa";} + double KCa::m_inf(double V, double Ca) {return (Ca/(Ca+3))*(1.0/(1.0+exp(((V)+27.2)/-7.2)));} diff --git a/c++/conductances/kispersky/Kd.hpp b/c++/conductances/kispersky/Kd.hpp index b52fdd08..518be501 100644 --- a/c++/conductances/kispersky/Kd.hpp +++ b/c++/conductances/kispersky/Kd.hpp @@ -23,21 +23,22 @@ class Kd: public conductance { m = m_; // defaults - if (isnan(gbar)) { gbar = 0; } - + if (isnan(gbar)) { gbar = 0; } if (isnan (E)) { E = 0; } p = 3; + name = "Kd"; + } double m_inf(double, double); double tau_m(double, double); - string getClass(void); + }; -string Kd::getClass(){return "Kd";} + double Kd::m_inf(double V, double Ca) {return (1.0/(1.0+exp(((V)+12.3)/-11.8)));} double Kd::tau_m(double V, double Ca) {return 7.2-(6.4/(1.0+exp(((V)+28.3)/-19.2)));} diff --git a/c++/conductances/kispersky/NaV.hpp b/c++/conductances/kispersky/NaV.hpp index 9c480bc1..1494ec9a 100644 --- a/c++/conductances/kispersky/NaV.hpp +++ b/c++/conductances/kispersky/NaV.hpp @@ -25,13 +25,13 @@ class NaV: public conductance { // defaults if (isnan(gbar)) { gbar = 0; } - - if (isnan (E)) { E = 0; } p = 3; h = 1; + name = "NaV"; + } @@ -39,11 +39,11 @@ class NaV: public conductance { double h_inf(double, double); double tau_m(double, double); double tau_h(double, double); - string getClass(void); + }; -string NaV::getClass(){return "NaV";} + double NaV::m_inf(double V, double Ca) {return (1.0/(1.0+exp(((V)+25.5)/-5.29)));} diff --git a/c++/conductances/lin/NaT.hpp b/c++/conductances/lin/NaT.hpp index e04440fa..44139dbb 100644 --- a/c++/conductances/lin/NaT.hpp +++ b/c++/conductances/lin/NaT.hpp @@ -30,19 +30,19 @@ class NaT: public conductance { p = 3; q = 1; + name = "NaT"; + } double m_inf(double, double); double h_inf(double, double); double tau_m(double, double); double tau_h(double, double); - string getClass(void); + }; -string NaT::getClass(){return "NaT";} - double NaT::m_inf(double V, double Ca) {return 1.0/(1.0+exp((V+29.13)/-8.92));} double NaT::h_inf(double V, double Ca) {return 1.0/(1.0+exp((V+40.0)/6.04));} diff --git a/c++/conductances/liu-temperature/ACurrent.hpp b/c++/conductances/liu-temperature/ACurrent.hpp index 795f942b..c2b753ae 100644 --- a/c++/conductances/liu-temperature/ACurrent.hpp +++ b/c++/conductances/liu-temperature/ACurrent.hpp @@ -49,6 +49,8 @@ class ACurrent: public conductance { p = 3; q = 1; + + name = "ACurrent"; } void integrate(double, double); @@ -60,10 +62,8 @@ class ACurrent: public conductance { double h_inf(double, double); double tau_m(double, double); double tau_h(double, double); - string getClass(void); }; -string ACurrent::getClass(){return "ACurrent";} void ACurrent::connect(compartment *pcomp_) { // call super class method diff --git a/c++/conductances/liu-temperature/CaS.hpp b/c++/conductances/liu-temperature/CaS.hpp index 118d5a56..dfd25fb2 100644 --- a/c++/conductances/liu-temperature/CaS.hpp +++ b/c++/conductances/liu-temperature/CaS.hpp @@ -50,6 +50,7 @@ class CaS: public conductance { is_calcium = true; p = 3; q = 1; + name = "CaS"; } void integrate(double, double); @@ -60,10 +61,10 @@ class CaS: public conductance { double h_inf(double, double); double tau_m(double, double); double tau_h(double, double); - string getClass(void); + }; -string CaS::getClass(){return "CaS";} + void CaS::connect(compartment *pcomp_) { // call super class method diff --git a/c++/conductances/liu-temperature/CaT.hpp b/c++/conductances/liu-temperature/CaT.hpp index 3bde92fc..b81bf321 100644 --- a/c++/conductances/liu-temperature/CaT.hpp +++ b/c++/conductances/liu-temperature/CaT.hpp @@ -46,6 +46,8 @@ class CaT: public conductance { is_calcium = true; + name = "CaT"; + p = 3; q = 1; } @@ -58,10 +60,10 @@ class CaT: public conductance { double h_inf(double, double); double tau_m(double, double); double tau_h(double, double); - string getClass(void); + }; -string CaT::getClass(){return "CaT";} + void CaT::connect(compartment *pcomp_) { // call super class method diff --git a/c++/conductances/liu-temperature/HCurrent.hpp b/c++/conductances/liu-temperature/HCurrent.hpp index 26db6648..c30ce4fd 100644 --- a/c++/conductances/liu-temperature/HCurrent.hpp +++ b/c++/conductances/liu-temperature/HCurrent.hpp @@ -41,6 +41,8 @@ class HCurrent: public conductance { if (isnan (Q_g)) { Q_g = 1; } if (isnan (Q_tau_m)) { Q_tau_m = 2; } if (isnan (E)) { E = -20; } + + name = "HCurrent"; } void integrate(double, double); @@ -50,13 +52,10 @@ class HCurrent: public conductance { double m_inf(double, double); double tau_m(double, double); - string getClass(void); + }; -string HCurrent::getClass(){ - return "HCurrent"; -} void HCurrent::connect(compartment *pcomp_) { // call super class method diff --git a/c++/conductances/liu-temperature/KCa.hpp b/c++/conductances/liu-temperature/KCa.hpp index adb2382f..e0c83c35 100644 --- a/c++/conductances/liu-temperature/KCa.hpp +++ b/c++/conductances/liu-temperature/KCa.hpp @@ -43,6 +43,8 @@ class KCa: public conductance { AllowHInfApproximation = false; p = 4; + + name = "KCa"; } void integrate(double, double); @@ -51,11 +53,11 @@ class KCa: public conductance { double m_inf(double V, double Ca); double tau_m(double, double); - string getClass(void); + }; -string KCa::getClass(){return "KCa";} + void KCa::connect(compartment *pcomp_) { // call super class method diff --git a/c++/conductances/liu-temperature/Kd.hpp b/c++/conductances/liu-temperature/Kd.hpp index b3c9df82..7b371578 100644 --- a/c++/conductances/liu-temperature/Kd.hpp +++ b/c++/conductances/liu-temperature/Kd.hpp @@ -43,6 +43,8 @@ class Kd: public conductance { p = 4; + name = "Kd"; + } void integrate(double, double); @@ -51,11 +53,11 @@ class Kd: public conductance { double m_inf(double, double); double tau_m(double, double); - string getClass(void); + }; -string Kd::getClass(){return "Kd";} + void Kd::connect(compartment *pcomp_) { // call super class method diff --git a/c++/conductances/liu-temperature/NaV.hpp b/c++/conductances/liu-temperature/NaV.hpp index af03fe9a..2c07fd98 100644 --- a/c++/conductances/liu-temperature/NaV.hpp +++ b/c++/conductances/liu-temperature/NaV.hpp @@ -47,6 +47,8 @@ class NaV: public conductance { p = 3; q = 1; + name = "NaV"; + } void integrate(double, double); @@ -57,10 +59,10 @@ class NaV: public conductance { double h_inf(double, double); double tau_m(double, double); double tau_h(double, double); - string getClass(void); + }; -string NaV::getClass(){return "NaV";} + void NaV::connect(compartment *pcomp_) { // call super class method diff --git a/c++/conductances/liu/ACurrent.hpp b/c++/conductances/liu/ACurrent.hpp index 2b8bd262..22bcb432 100644 --- a/c++/conductances/liu/ACurrent.hpp +++ b/c++/conductances/liu/ACurrent.hpp @@ -28,23 +28,19 @@ class ACurrent: public conductance { p = 3; q = 1; + + name = "ACurrent"; } - double m_inf(double, double); double h_inf(double, double); double tau_m(double, double); double tau_h(double, double); - string getClass(void); }; -string ACurrent::getClass(){ - return "ACurrent"; -} - double ACurrent::m_inf(double V, double Ca) {return 1.0/(1.0+exp((V+27.2)/-8.7)); } double ACurrent::h_inf(double V, double Ca) {return 1.0/(1.0+exp((V+56.9)/4.9)); } diff --git a/c++/conductances/liu/CaS.hpp b/c++/conductances/liu/CaS.hpp index c50e6fee..47bc5979 100644 --- a/c++/conductances/liu/CaS.hpp +++ b/c++/conductances/liu/CaS.hpp @@ -30,6 +30,8 @@ class CaS: public conductance { q = 1; is_calcium = true; + + name = "CaS"; } @@ -37,13 +39,9 @@ class CaS: public conductance { double h_inf(double, double); double tau_m(double, double); double tau_h(double, double); - string getClass(void); -}; -string CaS::getClass(){ - return "CaS"; -} +}; double CaS::m_inf(double V, double Ca) {return 1.0/(1.0+exp((V+33.0)/-8.1));} diff --git a/c++/conductances/liu/CaT.hpp b/c++/conductances/liu/CaT.hpp index 0ed76e7a..4dc73191 100644 --- a/c++/conductances/liu/CaT.hpp +++ b/c++/conductances/liu/CaT.hpp @@ -29,8 +29,8 @@ class CaT: public conductance { p = 3; q = 1; - is_calcium = true; + name = "CaT"; } @@ -39,15 +39,11 @@ class CaT: public conductance { double h_inf(double, double); double tau_m(double, double); double tau_h(double, double); - string getClass(void); + }; -string CaT::getClass(){ - return "CaT"; -} - double CaT::m_inf(double V, double Ca) {return 1.0/(1.0 + exp((V+27.1)/-7.2));} double CaT::h_inf(double V, double Ca) {return 1.0/(1.0 + exp((V+32.1)/5.5));} diff --git a/c++/conductances/liu/HCurrent.hpp b/c++/conductances/liu/HCurrent.hpp index 76d307c9..0e46fd15 100644 --- a/c++/conductances/liu/HCurrent.hpp +++ b/c++/conductances/liu/HCurrent.hpp @@ -27,18 +27,16 @@ class HCurrent: public conductance { p = 1; + name = "HCurrent"; + } double m_inf(double, double); double tau_m(double, double); - string getClass(void); }; -string HCurrent::getClass(){ - return "HCurrent"; -} double HCurrent::m_inf(double V, double Ca) {return 1.0/(1.0+exp((V+70.0)/6.0));} double HCurrent::tau_m(double V, double Ca) {return (272.0 + 1499.0/(1.0+exp((V+42.2)/-8.73)));} diff --git a/c++/conductances/liu/KCa.hpp b/c++/conductances/liu/KCa.hpp index 0a5cb7ee..b8185e27 100644 --- a/c++/conductances/liu/KCa.hpp +++ b/c++/conductances/liu/KCa.hpp @@ -30,18 +30,16 @@ class KCa: public conductance { AllowMInfApproximation = false; AllowHInfApproximation = false; + name = "KCa"; + } double m_inf(double V, double Ca); double tau_m(double, double); - string getClass(void); }; -string KCa::getClass(){ - return "KCa"; -} double KCa::m_inf(double V, double Ca) { return (Ca/(Ca+3.0))/(1.0+exp((V+28.3)/-12.6)); } double KCa::tau_m(double V, double Ca) {return 90.3 - 75.1/(1.0+exp((V+46.0)/-22.7));} diff --git a/c++/conductances/liu/Kd.hpp b/c++/conductances/liu/Kd.hpp index 4a7767d3..2acfef78 100644 --- a/c++/conductances/liu/Kd.hpp +++ b/c++/conductances/liu/Kd.hpp @@ -26,17 +26,15 @@ class Kd: public conductance { if (isnan (E)) { E = -80; } p = 4; + + name = "Kd"; } double m_inf(double, double); double tau_m(double, double); - string getClass(void); }; -string Kd::getClass(){ - return "Kd"; -} double Kd::m_inf(double V, double Ca) {return 1.0/(1.0+exp((V+12.3)/-11.8));} diff --git a/c++/conductances/liu/NaV.hpp b/c++/conductances/liu/NaV.hpp index 1dfeec7a..b3a4fbf4 100644 --- a/c++/conductances/liu/NaV.hpp +++ b/c++/conductances/liu/NaV.hpp @@ -28,16 +28,16 @@ class NaV: public conductance { p = 3; q = 1; + name = "NaV"; + } double m_inf(double, double); double h_inf(double, double); double tau_m(double, double); double tau_h(double, double); - string getClass(void); }; -string NaV::getClass(){return "NaV";} double NaV::m_inf(double V, double Ca) {return 1.0/(1.0+exp((V+25.5)/-5.29));} diff --git a/c++/conductances/morris-lecar/CaCurrent.hpp b/c++/conductances/morris-lecar/CaCurrent.hpp index a8229a4b..69f2cd7b 100644 --- a/c++/conductances/morris-lecar/CaCurrent.hpp +++ b/c++/conductances/morris-lecar/CaCurrent.hpp @@ -35,18 +35,17 @@ class CaCurrent: public conductance { p = 1; q = 0; + + name = "CaCurrent"; } void integrate(double, double); double m_inf(double V, double CaCurrent); - string getClass(void); }; -string CaCurrent::getClass(){return "CaCurrent";} - void CaCurrent::integrate(double V, double Ca) { if (isnan(E)) { diff --git a/c++/conductances/morris-lecar/Potassium.hpp b/c++/conductances/morris-lecar/Potassium.hpp index 4673bada..32558c70 100644 --- a/c++/conductances/morris-lecar/Potassium.hpp +++ b/c++/conductances/morris-lecar/Potassium.hpp @@ -39,17 +39,17 @@ class Potassium: public conductance { p = 1; q = 0; + + name = "Potassium"; } double m_inf(double V, double Ca); double tau_m(double V, double Ca); - string getClass(void); }; -string Potassium::getClass(){return "Potassium";} diff --git a/c++/conductances/nadim98/GenericChannel.hpp b/c++/conductances/nadim98/GenericChannel.hpp index 5fb1e7b9..50f5f742 100644 --- a/c++/conductances/nadim98/GenericChannel.hpp +++ b/c++/conductances/nadim98/GenericChannel.hpp @@ -71,16 +71,17 @@ class GenericChannel: public conductance { AllowMInfApproximation = true; AllowHInfApproximation = true; + name = "GenericChannel"; + } double m_inf(double, double); double h_inf(double, double); double tau_m(double, double); double tau_h(double, double); - string getClass(void); + }; -string GenericChannel::getClass(){return "GenericChannel";} double GenericChannel::m_inf(double V, double Ca) { diff --git a/c++/conductances/nadim98/int1/Kd.hpp b/c++/conductances/nadim98/int1/Kd.hpp index f89a32fb..d4eabcb4 100644 --- a/c++/conductances/nadim98/int1/Kd.hpp +++ b/c++/conductances/nadim98/int1/Kd.hpp @@ -24,20 +24,21 @@ class Kd: public conductance { // defaults if (isnan(gbar)) { gbar = 0; } - if (isnan (E)) { E = 0; } + name = "Kd"; + p = 4; } double m_inf(double, double); double tau_m(double, double); - string getClass(void); + }; -string Kd::getClass(){return "Kd";} + double Kd::m_inf(double V, double Ca) {return (1.0/(1.0+exp(-0.045*((V)+25.0))));} double Kd::tau_m(double V, double Ca) {return (154.0/(1.0+exp(0.065*((V)+30.0))));} diff --git a/c++/conductances/nadim98/int1/NaV.hpp b/c++/conductances/nadim98/int1/NaV.hpp index acf32dea..9300523e 100644 --- a/c++/conductances/nadim98/int1/NaV.hpp +++ b/c++/conductances/nadim98/int1/NaV.hpp @@ -22,10 +22,10 @@ class NaV: public conductance { m = m_; h = h_; + name = "NaV"; + // defaults if (isnan(gbar)) { gbar = 0; } - - if (isnan (E)) { E = 0; } p = 3; @@ -37,11 +37,11 @@ class NaV: public conductance { double h_inf(double, double); double tau_m(double, double); double tau_h(double, double); - string getClass(void); + }; -string NaV::getClass(){return "NaV";} + double NaV::m_inf(double V, double Ca) {return (1.0/(1.0+exp(-0.08*((V)+26.0))));} double NaV::tau_m(double V, double Ca) {return 0.0;} diff --git a/c++/conductances/nadim98/lg/Kd.hpp b/c++/conductances/nadim98/lg/Kd.hpp index 5951262f..566efff8 100644 --- a/c++/conductances/nadim98/lg/Kd.hpp +++ b/c++/conductances/nadim98/lg/Kd.hpp @@ -26,18 +26,19 @@ class Kd: public conductance { // defaults if (isnan(gbar)) { gbar = 0; } - if (isnan (E)) { E = 0; } + name = "Kd"; + } double m_inf(double, double); double tau_m(double, double); - string getClass(void); + }; -string Kd::getClass(){return "Kd";} + double Kd::m_inf(double V, double Ca) {return (1.0/(1.0+exp(-0.045*((V)+33.0))));} double Kd::tau_m(double V, double Ca) {return (104.0/(1.0+exp(0.065*((V)+5.0))));} diff --git a/c++/conductances/nadim98/lg/NaV.hpp b/c++/conductances/nadim98/lg/NaV.hpp index e2ebc940..000e69c2 100644 --- a/c++/conductances/nadim98/lg/NaV.hpp +++ b/c++/conductances/nadim98/lg/NaV.hpp @@ -25,10 +25,10 @@ class NaV: public conductance { p = 3; q = 1; + name = "NaV"; + // defaults - if (isnan(gbar)) { gbar = 0; } - - + if (isnan(gbar)) { gbar = 0; } if (isnan (E)) { E = 0; } } @@ -38,11 +38,11 @@ class NaV: public conductance { double h_inf(double, double); double tau_m(double, double); double tau_h(double, double); - string getClass(void); + }; -string NaV::getClass(){return "NaV";} + double NaV::m_inf(double V, double Ca) {return (1.0/(1.0+exp(-0.08*((V)+21.0))));} double NaV::tau_m(double V, double Ca) {return 0.0;} diff --git a/c++/conductances/nadim98/mcn1/Kd.hpp b/c++/conductances/nadim98/mcn1/Kd.hpp index a5dcaa02..e0a32b9d 100644 --- a/c++/conductances/nadim98/mcn1/Kd.hpp +++ b/c++/conductances/nadim98/mcn1/Kd.hpp @@ -27,18 +27,19 @@ class Kd: public conductance { // defaults if (isnan(gbar)) { gbar = 0; } - if (isnan (E)) { E = 0; } + name = "Kd"; + } double m_inf(double, double); double tau_m(double, double); - string getClass(void); + }; -string Kd::getClass(){return "Kd";} + double Kd::m_inf(double V, double Ca) {return (1.0/(1.0+exp(-0.045*((V)+33.0))));} double Kd::tau_m(double V, double Ca) {return (104.0/(1.0+exp(0.065*((V)+5.0))));} diff --git a/c++/conductances/nadim98/mcn1/NaV.hpp b/c++/conductances/nadim98/mcn1/NaV.hpp index f8c13411..4718872a 100644 --- a/c++/conductances/nadim98/mcn1/NaV.hpp +++ b/c++/conductances/nadim98/mcn1/NaV.hpp @@ -25,10 +25,10 @@ class NaV: public conductance { p = 3; q = 1; + name = "NaV"; + // defaults if (isnan(gbar)) { gbar = 0; } - - if (isnan (E)) { E = 0; } } @@ -38,11 +38,11 @@ class NaV: public conductance { double h_inf(double, double); double tau_m(double, double); double tau_h(double, double); - string getClass(void); + }; -string NaV::getClass(){return "NaV";} + double NaV::m_inf(double V, double Ca) {return (1.0/(1.0+exp(-0.08*((V)+21.0))));} double NaV::tau_m(double V, double Ca) {return 0.0;} diff --git a/c++/conductances/nadim99/Cal.hpp b/c++/conductances/nadim99/Cal.hpp index f421d27d..9b81b8f9 100644 --- a/c++/conductances/nadim99/Cal.hpp +++ b/c++/conductances/nadim99/Cal.hpp @@ -34,31 +34,18 @@ class Cal: public conductance { if (isnan (h)) { h = 0; } if (isnan (E)) { E = -80; } + + name = "Cal"; } - void integrate(double, double); - void integrateMS(int, double, double); double m_inf(double, double); double h_inf(double, double); double tau_h(double, double); - string getClass(void); + }; -string Cal::getClass(){return "Cal";} - -void Cal::integrate(double V, double Ca) { - E = container->E_Ca; - conductance::integrate(V,Ca); - container->i_Ca += getCurrent(V); -} - -void Cal::integrateMS(int k, double V, double Ca) { - E = container->E_Ca; - conductance::integrateMS(k, V, Ca); - container->i_Ca += getCurrent(V); -} double Cal::m_inf(double V, double Ca) {return (1.0/(1.0+exp(((V)+61.0)/-4.2)));} diff --git a/c++/conductances/odowd-aldrich/DmNaV.hpp b/c++/conductances/odowd-aldrich/DmNaV.hpp index 9afbaaee..f0dbca23 100644 --- a/c++/conductances/odowd-aldrich/DmNaV.hpp +++ b/c++/conductances/odowd-aldrich/DmNaV.hpp @@ -29,22 +29,21 @@ class DmNaV: public conductance { // defaults if (isnan(gbar)) { gbar = 0; } - - if (isnan (E)) { E = 47; } + name = "DmNaV"; + } double m_inf(double, double); double h_inf(double, double); double tau_m(double, double); double tau_h(double, double); - string getClass(void); + }; -string DmNaV::getClass(){return "DmNaV";} double DmNaV::m_inf(double V, double Ca) {return 1.0/(1.0+exp((V+34.3)/-8.79));} double DmNaV::h_inf(double V, double Ca) {return 1.0/(1.0+exp((V+48)/6));} diff --git a/c++/conductances/prinz-temperature/ACurrent.hpp b/c++/conductances/prinz-temperature/ACurrent.hpp index 3194a1cc..a69444ed 100644 --- a/c++/conductances/prinz-temperature/ACurrent.hpp +++ b/c++/conductances/prinz-temperature/ACurrent.hpp @@ -49,6 +49,8 @@ class ACurrent: public conductance { p = 3; q = 1; + name = "ACurrent"; + } @@ -61,10 +63,8 @@ class ACurrent: public conductance { double h_inf(double, double); double tau_m(double, double); double tau_h(double, double); - string getClass(void); }; -string ACurrent::getClass(){return "ACurrent";} void ACurrent::init(void) { conductance::init(); diff --git a/c++/conductances/prinz-temperature/CaS.hpp b/c++/conductances/prinz-temperature/CaS.hpp index 0af47fbc..47cd4b33 100644 --- a/c++/conductances/prinz-temperature/CaS.hpp +++ b/c++/conductances/prinz-temperature/CaS.hpp @@ -51,6 +51,8 @@ class CaS: public conductance { p = 3; q = 1; + name = "CaS"; + } void integrate(double, double); @@ -61,10 +63,10 @@ class CaS: public conductance { double h_inf(double, double); double tau_m(double, double); double tau_h(double, double); - string getClass(void); + }; -string CaS::getClass(){return "CaS";} + diff --git a/c++/conductances/prinz-temperature/CaT.hpp b/c++/conductances/prinz-temperature/CaT.hpp index 32b5ce7f..b536ee91 100644 --- a/c++/conductances/prinz-temperature/CaT.hpp +++ b/c++/conductances/prinz-temperature/CaT.hpp @@ -51,6 +51,8 @@ class CaT: public conductance { p = 3; q = 1; + name = "CaT"; + } void integrate(double, double); @@ -61,11 +63,9 @@ class CaT: public conductance { double h_inf(double, double); double tau_m(double, double); double tau_h(double, double); - string getClass(void); + }; -string CaT::getClass(){return "CaT";} - void CaT::init() { diff --git a/c++/conductances/prinz-temperature/HCurrent.hpp b/c++/conductances/prinz-temperature/HCurrent.hpp index 0dd42a8c..abe5e626 100644 --- a/c++/conductances/prinz-temperature/HCurrent.hpp +++ b/c++/conductances/prinz-temperature/HCurrent.hpp @@ -43,6 +43,8 @@ class HCurrent: public conductance { if (isnan (Q_tau_m)) { Q_tau_m = 2; } if (isnan (E)) { E = -20; } + name = "HCurrent"; + } void integrate(double, double); @@ -52,14 +54,10 @@ class HCurrent: public conductance { double m_inf(double, double); double tau_m(double, double); - string getClass(void); + }; -string HCurrent::getClass(){ - return "HCurrent"; -} - void HCurrent::init() { conductance::init(); diff --git a/c++/conductances/prinz-temperature/KCa.hpp b/c++/conductances/prinz-temperature/KCa.hpp index 2f8e1f17..8315f3e0 100644 --- a/c++/conductances/prinz-temperature/KCa.hpp +++ b/c++/conductances/prinz-temperature/KCa.hpp @@ -45,6 +45,8 @@ class KCa: public conductance { AllowHInfApproximation = false; p = 4; + + name = "KCa"; } void integrate(double, double); @@ -53,11 +55,11 @@ class KCa: public conductance { double m_inf(double V, double Ca); double tau_m(double, double); - string getClass(void); + }; -string KCa::getClass(){return "KCa";} + void KCa::init() { diff --git a/c++/conductances/prinz-temperature/Kd.hpp b/c++/conductances/prinz-temperature/Kd.hpp index 8b52ed06..0a67e2f5 100644 --- a/c++/conductances/prinz-temperature/Kd.hpp +++ b/c++/conductances/prinz-temperature/Kd.hpp @@ -43,6 +43,8 @@ class Kd: public conductance { p = 4; + name = "Kd"; + } void integrate(double, double); @@ -51,11 +53,11 @@ class Kd: public conductance { double m_inf(double, double); double tau_m(double, double); - string getClass(void); + }; -string Kd::getClass(){return "Kd";} + void Kd::init() { diff --git a/c++/conductances/prinz-temperature/NaV.hpp b/c++/conductances/prinz-temperature/NaV.hpp index 95b4225f..1c340926 100644 --- a/c++/conductances/prinz-temperature/NaV.hpp +++ b/c++/conductances/prinz-temperature/NaV.hpp @@ -48,6 +48,8 @@ class NaV: public conductance { p = 3; q = 1; + name = "NaV"; + } void integrate(double, double); @@ -58,10 +60,10 @@ class NaV: public conductance { double h_inf(double, double); double tau_m(double, double); double tau_h(double, double); - string getClass(void); + }; -string NaV::getClass(){return "NaV";} + void NaV::init() { diff --git a/c++/conductances/prinz/ACurrent.hpp b/c++/conductances/prinz/ACurrent.hpp index 56358c31..9f30c9f2 100644 --- a/c++/conductances/prinz/ACurrent.hpp +++ b/c++/conductances/prinz/ACurrent.hpp @@ -29,6 +29,8 @@ class ACurrent: public conductance { p = 3; q = 1; + name = "ACurrent"; + } @@ -36,12 +38,10 @@ class ACurrent: public conductance { double h_inf(double, double); double tau_m(double, double); double tau_h(double, double); - string getClass(void); }; -string ACurrent::getClass(){return "ACurrent";} double ACurrent::m_inf(double V, double Ca) {return 1.0/(1.0+exp((V+27.2)/-8.7)); } diff --git a/c++/conductances/prinz/CaS.hpp b/c++/conductances/prinz/CaS.hpp index b67b8cf4..9149cfcf 100644 --- a/c++/conductances/prinz/CaS.hpp +++ b/c++/conductances/prinz/CaS.hpp @@ -31,6 +31,7 @@ class CaS: public conductance { q = 1; is_calcium = true; + name = "CaS"; } @@ -38,12 +39,12 @@ class CaS: public conductance { double h_inf(double, double); double tau_m(double, double); double tau_h(double, double); - string getClass(void); + }; -string CaS::getClass(){return "CaS";} + double CaS::m_inf(double V, double Ca) {return 1.0/(1.0+exp((V+33.0)/-8.1));} diff --git a/c++/conductances/prinz/CaT.hpp b/c++/conductances/prinz/CaT.hpp index 1370504d..b80468c8 100644 --- a/c++/conductances/prinz/CaT.hpp +++ b/c++/conductances/prinz/CaT.hpp @@ -31,6 +31,7 @@ class CaT: public conductance { p = 3; q = 1; + name = "CaT"; is_calcium = true; } @@ -40,12 +41,12 @@ class CaT: public conductance { double h_inf(double, double); double tau_m(double, double); double tau_h(double, double); - string getClass(void); + }; -string CaT::getClass(){return "CaT";} + double CaT::m_inf(double V, double Ca) {return 1.0/(1.0 + exp((V+27.1)/-7.2));} diff --git a/c++/conductances/prinz/HCurrent.hpp b/c++/conductances/prinz/HCurrent.hpp index f7fee361..e06b4fe4 100644 --- a/c++/conductances/prinz/HCurrent.hpp +++ b/c++/conductances/prinz/HCurrent.hpp @@ -23,17 +23,18 @@ class HCurrent: public conductance { // defaults if (isnan(gbar)) { gbar = 0; } - if (isnan (E)) { E = -20; } + name = "HCurrent"; + } double m_inf(double, double); double tau_m(double, double); - string getClass(void); + }; -string HCurrent::getClass(){return "HCurrent";} + double HCurrent::m_inf(double V, double Ca) {return 1.0/(1.0+exp((V+75.0)/5.5));} diff --git a/c++/conductances/prinz/KCa.hpp b/c++/conductances/prinz/KCa.hpp index ef807495..fbd7026f 100644 --- a/c++/conductances/prinz/KCa.hpp +++ b/c++/conductances/prinz/KCa.hpp @@ -30,17 +30,19 @@ class KCa: public conductance { AllowHInfApproximation = false; p = 4; + + name = "KCa"; } double m_inf(double V, double Ca); double tau_m(double, double); - string getClass(void); + }; -string KCa::getClass(){return "KCa";} + double KCa::m_inf(double V, double Ca) {return (Ca/(Ca+3.0))/(1.0+exp((V+28.3)/-12.6)); } diff --git a/c++/conductances/prinz/Kd.hpp b/c++/conductances/prinz/Kd.hpp index a043242b..dbcb4da9 100644 --- a/c++/conductances/prinz/Kd.hpp +++ b/c++/conductances/prinz/Kd.hpp @@ -28,17 +28,19 @@ class Kd: public conductance { p = 4; + name = "Kd"; + } double m_inf(double, double); double tau_m(double, double); - string getClass(void); + }; -string Kd::getClass(){return "Kd";} + double Kd::m_inf(double V, double Ca) {return 1.0/(1.0+exp((V+12.3)/-11.8));} diff --git a/c++/conductances/prinz/NaV.hpp b/c++/conductances/prinz/NaV.hpp index 5cec253d..1cea2c0c 100644 --- a/c++/conductances/prinz/NaV.hpp +++ b/c++/conductances/prinz/NaV.hpp @@ -29,18 +29,20 @@ class NaV: public conductance { p = 3; q = 1; + name = "NaV"; + } double m_inf(double, double); double h_inf(double, double); double tau_m(double, double); double tau_h(double, double); - string getClass(void); + }; -string NaV::getClass(){return "NaV";} + double NaV::m_inf(double V, double Ca) {return 1.0/(1.0+exp((V+25.5)/-5.29));} diff --git a/c++/conductances/rodriguez/Int1/KCurrent.hpp b/c++/conductances/rodriguez/Int1/KCurrent.hpp index 675213b8..1d2d7071 100644 --- a/c++/conductances/rodriguez/Int1/KCurrent.hpp +++ b/c++/conductances/rodriguez/Int1/KCurrent.hpp @@ -29,19 +29,19 @@ class KCurrent: public conductance { // defaults if (isnan(gbar)) { gbar = 0; } if (isnan (E)) { E = -70; } + + name = "KCurrent"; } double m_inf(double, double); double h_inf(double, double); double tau_m(double, double); double tau_h(double, double); - string getClass(void); + }; -string KCurrent::getClass(){return "KCurrent";} - double KCurrent::m_inf(double V, double Ca) {return 1.0/(1.0+exp((V+26.0)/-9.0));} double KCurrent::h_inf(double V, double Ca) {return 1.0/(1.0+exp((V+16.0)/1.5));} double KCurrent::tau_m(double V, double Ca) {return 27.0;} diff --git a/c++/conductances/rodriguez/Int1/NaV.hpp b/c++/conductances/rodriguez/Int1/NaV.hpp index b4a93af0..f2b2eb90 100644 --- a/c++/conductances/rodriguez/Int1/NaV.hpp +++ b/c++/conductances/rodriguez/Int1/NaV.hpp @@ -29,18 +29,20 @@ class NaV: public conductance { // defaults if (isnan(gbar)) { gbar = 0; } if (isnan (E)) { E = 45; } + + name = "NaV"; } double m_inf(double, double); double h_inf(double, double); double tau_m(double, double); double tau_h(double, double); - string getClass(void); + }; -string NaV::getClass(){return "NaV";} + double NaV::m_inf(double V, double Ca) {return 1.0/(1.0+exp((V+42.0)/-5.0));} double NaV::h_inf(double V, double Ca) {return 1.0/(1.0+exp((V+52.0)/9.2));} diff --git a/c++/conductances/rodriguez/LG/MICurrent.hpp b/c++/conductances/rodriguez/LG/MICurrent.hpp index 488f098f..92102772 100644 --- a/c++/conductances/rodriguez/LG/MICurrent.hpp +++ b/c++/conductances/rodriguez/LG/MICurrent.hpp @@ -25,6 +25,8 @@ class MICurrent: public conductance { p = 1; + name = "MICurrent"; + // defaults if (isnan(gbar)) { gbar = 0; } @@ -35,11 +37,10 @@ class MICurrent: public conductance { double h_inf(double V, double Ca); double tau_m(double V, double Ca); double tau_h(double V, double Ca); - string getClass(void); + }; -string MICurrent::getClass(){return "MICurrent";} double MICurrent::m_inf(double V, double Ca) {return 1.0/(1.0+exp((V+60.0)/-5.0));} double MICurrent::tau_m(double V, double Ca) {return 5.0;} diff --git a/c++/conductances/rodriguez/LG/TransLTS.hpp b/c++/conductances/rodriguez/LG/TransLTS.hpp index 47472bde..acf08461 100644 --- a/c++/conductances/rodriguez/LG/TransLTS.hpp +++ b/c++/conductances/rodriguez/LG/TransLTS.hpp @@ -26,6 +26,8 @@ class TransLTS: public conductance { p = 1; q = 1; + name = "TransLTS"; + // defaults if (isnan(gbar)) { gbar = 0; } if (isnan (E)) { E = 0; } @@ -35,12 +37,11 @@ class TransLTS: public conductance { double h_inf(double, double); double tau_m(double, double); double tau_h(double, double); - string getClass(void); + }; -string TransLTS::getClass(){return "TransLTS";} double TransLTS::m_inf(double V, double Ca) {return 1.0/(1.0+exp((V+55.0)/-3.0));} double TransLTS::h_inf(double V, double Ca) {return 1.0/(1.0+exp((V+63.0)/0.8));} diff --git a/c++/conductances/sharp/MICurrent.hpp b/c++/conductances/sharp/MICurrent.hpp index 230e007e..05be9e52 100644 --- a/c++/conductances/sharp/MICurrent.hpp +++ b/c++/conductances/sharp/MICurrent.hpp @@ -24,21 +24,21 @@ class MICurrent: public conductance { p = 1; - // defaults if (isnan(gbar)) { gbar = 0; } if (isnan (E)) { E = -20; } + + name = "MICurrent"; } double m_inf(double V, double Ca); double h_inf(double V, double Ca); double tau_m(double V, double Ca); double tau_h(double V, double Ca); - string getClass(void); + }; -string MICurrent::getClass(){return "MICurrent";} double MICurrent::m_inf(double V, double Ca) {return 1.0/(1.0+exp((V+55.0)/-5));} double MICurrent::tau_m(double V, double Ca) {return 6.0;} diff --git a/c++/conductances/sharp96/HCurrent.hpp b/c++/conductances/sharp96/HCurrent.hpp index d0bdebd5..afbf4623 100644 --- a/c++/conductances/sharp96/HCurrent.hpp +++ b/c++/conductances/sharp96/HCurrent.hpp @@ -28,16 +28,18 @@ class HCurrent: public conductance { if (isnan (E)) { E = -10; } if (isnan (Vhalf)) { Vhalf = -50; } + name = "HCurrent"; + } double m_inf(double, double); double tau_m(double, double); - string getClass(void); + }; -string HCurrent::getClass(){return "HCurrent";} + double HCurrent::m_inf(double V, double Ca) {return 1.0/(1.0+exp((V-Vhalf)/7));} diff --git a/c++/conductances/soplata/CaN.hpp b/c++/conductances/soplata/CaN.hpp index 33af7480..81fd3c7b 100644 --- a/c++/conductances/soplata/CaN.hpp +++ b/c++/conductances/soplata/CaN.hpp @@ -34,16 +34,16 @@ class CaN: public conductance { // allow this channel to be approximated AllowMInfApproximation = false; + name = "CaN"; } double m_inf(double, double); double tau_m(double, double); - string getClass(void); + }; -string CaN::getClass(){return "CaN";} double CaN::m_inf(double V, double Ca) { return alpha * Ca / (alpha * Ca + beta); } double CaN::tau_m(double V, double Ca) { return 1.0 / (alpha * Ca + beta); } diff --git a/c++/conductances/soplata/CaT.hpp b/c++/conductances/soplata/CaT.hpp index fd737b28..82fddf10 100644 --- a/c++/conductances/soplata/CaT.hpp +++ b/c++/conductances/soplata/CaT.hpp @@ -46,6 +46,7 @@ class CaT: public conductance { q = 1; is_calcium = true; + name = "CaT"; } @@ -53,14 +54,11 @@ class CaT: public conductance { double h_inf(double, double); double tau_m(double, double); double tau_h(double, double); - string getClass(void); + }; -string CaT::getClass(){ - return "CaT"; -} double CaT::m_inf(double V, double Ca) {return 1 / (1 + exp((-(V + 2) + 57)/6.2));} diff --git a/c++/conductances/soplata/Kd.hpp b/c++/conductances/soplata/Kd.hpp index 2067ebd3..1339d60b 100644 --- a/c++/conductances/soplata/Kd.hpp +++ b/c++/conductances/soplata/Kd.hpp @@ -43,6 +43,8 @@ class Kd: public conductance { p = 4; + name = "Kd"; + } double m_alpha(double, double); @@ -51,11 +53,10 @@ class Kd: public conductance { double m_inf(double, double); double tau_m(double, double); - string getClass(void); }; -string Kd::getClass(){return "Kd";} + double Kd::m_alpha(double V, double Ca) {return 0.032 * (15 - (V + 25)) / (exp((15 - (V + 25))/5) -1);} double Kd::m_beta(double V, double Ca) {return 0.5 * exp((10 - (V + 25))/40);} diff --git a/c++/conductances/soplata/MCurrent.hpp b/c++/conductances/soplata/MCurrent.hpp index 464d7306..b2e482fb 100644 --- a/c++/conductances/soplata/MCurrent.hpp +++ b/c++/conductances/soplata/MCurrent.hpp @@ -33,19 +33,20 @@ class MCurrent: public conductance { p = 1; + name = "MCurrent"; + } double m_inf(double, double); double tau_m(double, double); - string getClass(void); + double alpha(double, double); double beta(double, double); }; -string MCurrent::getClass(){return "MCurrent";} double MCurrent::alpha(double V, double Ca) { return .02/(1+exp((-20-V)/5)); } double MCurrent::beta(double V, double Ca) { return .01*exp((-43-V)/18); } diff --git a/c++/conductances/soplata/NaV.hpp b/c++/conductances/soplata/NaV.hpp index a6eec12a..876e3d64 100644 --- a/c++/conductances/soplata/NaV.hpp +++ b/c++/conductances/soplata/NaV.hpp @@ -45,6 +45,8 @@ class NaV: public conductance { p = 3; q = 1; + name = "NaV"; + } @@ -58,10 +60,9 @@ class NaV: public conductance { double tau_m(double, double); double tau_h(double, double); - string getClass(void); }; -string NaV::getClass(){return "NaV";} + double NaV::m_alpha(double V, double Ca) {return 0.32 * (13 - (V + 35)) / (exp((13 - (V + 35))/4) -1);} double NaV::m_beta(double V, double Ca) {return 0.28 * ((V + 35) - 40) / (exp(((V + 35) - 40)/5) - 1);} diff --git a/c++/conductances/soplata/legacy/MCurrent.hpp b/c++/conductances/soplata/legacy/MCurrent.hpp index 8a3da00d..6d76bc57 100644 --- a/c++/conductances/soplata/legacy/MCurrent.hpp +++ b/c++/conductances/soplata/legacy/MCurrent.hpp @@ -25,16 +25,16 @@ class MCurrent: public conductance { // defaults if (isnan(gbar)) { gbar = 0; } - if (isnan (E)) { E = -80; } p = 4; + name = "MCurrent"; } double m_inf(double, double); double tau_m(double, double); - string getClass(void); + // auxiliary functions double a_m(double, double); @@ -42,9 +42,6 @@ class MCurrent: public conductance { }; -string MCurrent::getClass(){ - return "MCurrent"; -} double MCurrent::a_m(double V, double Ca) {return 0.0001 * 3.209 * (V + 30) / (1 - exp(-(V+30)/9)); } double MCurrent::b_m(double V, double Ca) {return -0.0001 * 3.209 * (V + 30) / (1 - exp((V+30)/9)); } diff --git a/c++/conductances/soplata/legacy/reticular/CaT.hpp b/c++/conductances/soplata/legacy/reticular/CaT.hpp index 2d7040a0..c7016224 100644 --- a/c++/conductances/soplata/legacy/reticular/CaT.hpp +++ b/c++/conductances/soplata/legacy/reticular/CaT.hpp @@ -26,75 +26,25 @@ class CaT: public conductance { // defaults if (isnan(gbar)) { gbar = 0; } - - if (isnan (E)) { E = 30; } p = 2; q = 1; + name = "CaT"; is_calcium = true; } - void integrate(double, double); - void integrateMS(int, double, double); - double m_inf(double, double); double h_inf(double, double); double tau_m(double, double); double tau_h(double, double); - string getClass(void); + }; -string CaT::getClass(){ - return "CaT"; -} - -void CaT::integrate(double V, double Ca) { - E = container->E_Ca; - m = m_inf(V, Ca); - h = h_inf(V, Ca) + (h - h_inf(V, Ca))*exp(-dt/tau_h(V, Ca)); - g = gbar * m * m * h; - container->i_Ca += getCurrent(V); -} - -void CaT::integrateMS(int k, double V, double Ca) { - E = container->E_Ca; - - switch (k) - { - case 0: - k_m[0] = dt*m_inf(V, Ca); - k_h[0] = dt*(hdot(V, Ca, h)); - g = gbar*fast_pow(m,p)*fast_pow(h,q); - break; - case 1: - k_m[1] = dt*m_inf(V, Ca); - k_h[1] = dt*(hdot(V, Ca, h + k_h[0]/2)); - g = gbar*fast_pow(m + k_m[0]/2,p)*fast_pow(h + k_h[0]/2,q); - break; - case 2: - k_m[2] = dt*m_inf(V, Ca); - k_h[2] = dt*(hdot(V, Ca, h + k_h[1]/2)); - g = gbar*fast_pow(m + k_m[1]/2,p)*fast_pow(h + k_h[1]/2,q); - break; - case 3: - k_m[3] = dt*m_inf(V, Ca); - k_h[3] = dt*(hdot(V, Ca, h + k_h[2])); - g = gbar*fast_pow(m + k_m[2],p)*fast_pow(h + k_h[2],q); - break; - case 4: - m = m_inf(V, Ca); - h = h + (k_h[0] + 2*k_h[1] + 2*k_h[2] + k_h[3])/6; - break; - } - - - container->i_Ca += getCurrent(V); -} double CaT::m_inf(double V, double Ca) {return 1.0/(1.0+exp((-((V+4.0)+57.0))/6.2)); } double CaT::h_inf(double V, double Ca) {return 1.0/(1.0+exp(((V+4.0)+81.0)/4.0)); } diff --git a/c++/conductances/soplata/legacy/reticular/Kd.hpp b/c++/conductances/soplata/legacy/reticular/Kd.hpp index 532490ed..4b041e5c 100644 --- a/c++/conductances/soplata/legacy/reticular/Kd.hpp +++ b/c++/conductances/soplata/legacy/reticular/Kd.hpp @@ -25,16 +25,17 @@ class Kd: public conductance { // defaults if (isnan(gbar)) { gbar = 0; } - if (isnan (E)) { E = -80; } p = 4; + name = "Kd"; + } double m_inf(double, double); double tau_m(double, double); - string getClass(void); + // auxiliary functions double a_m(double, double); @@ -42,9 +43,6 @@ class Kd: public conductance { }; -string Kd::getClass(){ - return "Kd"; -} double Kd::a_m(double V, double Ca) {return 0.032*(15.0-(V+55.0))/(exp((15.0-(V+55.0))/5.0)-1.0); } double Kd::b_m(double V, double Ca) {return 0.5*exp((10-(V+55.0))/40.0); } diff --git a/c++/conductances/soplata/legacy/reticular/NaV.hpp b/c++/conductances/soplata/legacy/reticular/NaV.hpp index bd0b92c3..d7b011c7 100644 --- a/c++/conductances/soplata/legacy/reticular/NaV.hpp +++ b/c++/conductances/soplata/legacy/reticular/NaV.hpp @@ -26,19 +26,19 @@ class NaV: public conductance { // defaults if (isnan(gbar)) { gbar = 0; } - - if (isnan (E)) { E = 30; } p = 3; q = 1; + + name = "NaV"; } double m_inf(double, double); double h_inf(double, double); double tau_m(double, double); double tau_h(double, double); - string getClass(void); + // auxiliary functions double a_m(double, double); @@ -48,7 +48,6 @@ class NaV: public conductance { }; -string NaV::getClass() {return "NaV";} double NaV::a_m(double V, double Ca) {return 0.32*(13.0-(V+55.0))/(exp((13.0-(V+55.0))/4.0)-1.0); } double NaV::b_m(double V, double Ca) {return 0.28*((V+55.0)-40)/(exp(((V+55.0)-40.0)/5.0)-1.0); } diff --git a/c++/conductances/soplata/legacy/thalamocortical/CaT.hpp b/c++/conductances/soplata/legacy/thalamocortical/CaT.hpp index 79fc6e05..525ba022 100644 --- a/c++/conductances/soplata/legacy/thalamocortical/CaT.hpp +++ b/c++/conductances/soplata/legacy/thalamocortical/CaT.hpp @@ -26,73 +26,24 @@ class CaT: public conductance { // defaults if (isnan(gbar)) { gbar = 0; } - - if (isnan (E)) { E = 30; } p = 2; q = 1; is_calcium = true; + name = "CaT"; } - void integrate(double, double); - void integrateMS(int, double, double); - double m_inf(double, double); double h_inf(double, double); double tau_m(double, double); double tau_h(double, double); - string getClass(void); + }; -string CaT::getClass(){ - return "CaT"; -} - -void CaT::integrate(double V, double Ca) { - E = container->E_Ca; - m = m_inf(V, Ca); - h = h_inf(V, Ca) + (h - h_inf(V, Ca))*exp(-dt/tau_h(V, Ca)); - g = gbar * m * m * h; - container->i_Ca += getCurrent(V); -} - -void CaT::integrateMS(int k, double V, double Ca) { - E = container->E_Ca; - - switch (k) - { - case 0: - k_m[0] = dt*m_inf(V, Ca); - k_h[0] = dt*(hdot(V, Ca, h)); - g = gbar*fast_pow(m,p)*fast_pow(h,q); - break; - case 1: - k_m[1] = dt*m_inf(V, Ca); - k_h[1] = dt*(hdot(V, Ca, h + k_h[0]/2)); - g = gbar*fast_pow(m + k_m[0]/2,p)*fast_pow(h + k_h[0]/2,q); - break; - case 2: - k_m[2] = dt*m_inf(V, Ca); - k_h[2] = dt*(hdot(V, Ca, h + k_h[1]/2)); - g = gbar*fast_pow(m + k_m[1]/2,p)*fast_pow(h + k_h[1]/2,q); - break; - case 3: - k_m[3] = dt*m_inf(V, Ca); - k_h[3] = dt*(hdot(V, Ca, h + k_h[2])); - g = gbar*fast_pow(m + k_m[2],p)*fast_pow(h + k_h[2],q); - break; - case 4: - m = m_inf(V, Ca); - h = h + (k_h[0] + 2*k_h[1] + 2*k_h[2] + k_h[3])/6; - break; - } - - container->i_Ca += getCurrent(V); -} double CaT::m_inf(double V, double Ca) {return 1.0/(1.0+exp((-((V+2.0)+57.0))/6.2)); } double CaT::h_inf(double V, double Ca) {return 1.0/(1.0+exp(((V+2.0)+81.0)/4.0)); } diff --git a/c++/conductances/soplata/legacy/thalamocortical/HCurrent.hpp b/c++/conductances/soplata/legacy/thalamocortical/HCurrent.hpp index 17a13687..707dfa5a 100644 --- a/c++/conductances/soplata/legacy/thalamocortical/HCurrent.hpp +++ b/c++/conductances/soplata/legacy/thalamocortical/HCurrent.hpp @@ -47,12 +47,14 @@ class HCurrent: public conductance { p = 1; + name = "HCurrent"; + } double m_inf(double, double); double tau_m(double, double); - string getClass(void); + // equations of state double C1dot(double, double, double, double, double); @@ -69,10 +71,6 @@ class HCurrent: public conductance { }; -string HCurrent::getClass(){ - return "HCurrent"; -} - double HCurrent::aH(double V, double Ca) { return (1.0 - m_inf(V, Ca)) / tau_m(V, Ca); } diff --git a/c++/conductances/soplata/legacy/thalamocortical/NaV.hpp b/c++/conductances/soplata/legacy/thalamocortical/NaV.hpp index 222c8ced..37454109 100644 --- a/c++/conductances/soplata/legacy/thalamocortical/NaV.hpp +++ b/c++/conductances/soplata/legacy/thalamocortical/NaV.hpp @@ -33,13 +33,14 @@ class NaV: public conductance { p = 3; q = 1; + name = "NaV"; + } double m_inf(double, double); double h_inf(double, double); double tau_m(double, double); double tau_h(double, double); - string getClass(void); // auxiliary functions double a_m(double, double); @@ -49,7 +50,7 @@ class NaV: public conductance { }; -string NaV::getClass(){return "NaV";} + double NaV::a_m(double V, double Ca) {return 0.32*(13.0-(V+35.0))/(exp((13.0-(V+35.0))/4.0)-1.0); } double NaV::b_m(double V, double Ca) {return 0.28*((V+35.0)-40)/(exp(((V+35.0)-40.0)/5.0)-1.0); } diff --git a/c++/conductances/soto-trevino01/ABPD/Cal.hpp b/c++/conductances/soto-trevino01/ABPD/Cal.hpp index 90cc4f0b..d1c5cce5 100644 --- a/c++/conductances/soto-trevino01/ABPD/Cal.hpp +++ b/c++/conductances/soto-trevino01/ABPD/Cal.hpp @@ -27,32 +27,18 @@ class Cal: public conductance { is_calcium = true; + name = "Cal"; + // defaults if (isnan(gbar)) { gbar = 0; } if (isnan (E)) { E = -80; } } - void integrate(double, double); - void integrateMS(int,double, double); - double m_inf(double, double); - string getClass(void); + }; -string Cal::getClass(){return "Cal";} - -void Cal::integrate(double V, double Ca) { - E = container->E_Ca; - conductance::integrate(V,Ca); - container->i_Ca += getCurrent(V); -} - -void Cal::integrateMS(int k, double V, double Ca) { - E = container->E_Ca; - conductance::integrateMS(k, V, Ca); - container->i_Ca += getCurrent(V); -} double Cal::m_inf(double V, double Ca) {return (0.5)*(1.0+tanh((V)+20.0)/8.0);} diff --git a/c++/conductances/soto-trevino01/ABPD/Kd.hpp b/c++/conductances/soto-trevino01/ABPD/Kd.hpp index 7278376e..13fe5628 100644 --- a/c++/conductances/soto-trevino01/ABPD/Kd.hpp +++ b/c++/conductances/soto-trevino01/ABPD/Kd.hpp @@ -29,16 +29,18 @@ class Kd: public conductance { // defaults if (isnan(gbar)) { gbar = 0; } if (isnan (E)) { E = -80; } + + name = "Kd"; } double m_inf(double, double); double tau_m(double, double); - string getClass(void); + }; -string Kd::getClass(){return "Kd";} + double Kd::m_inf(double V, double Ca) {return (0.5)*(1.0+tanh((V)+20.0)/8.0);} double Kd::tau_m(double V, double Ca) {return 1.0 / ( 0.0008*cosh((V + 5.0)/40.0) );} diff --git a/c++/conductances/soto-trevino01/LP/Cal.hpp b/c++/conductances/soto-trevino01/LP/Cal.hpp index 61288adc..e5cb0790 100644 --- a/c++/conductances/soto-trevino01/LP/Cal.hpp +++ b/c++/conductances/soto-trevino01/LP/Cal.hpp @@ -30,29 +30,14 @@ class Cal: public conductance { if (isnan (E)) { E = -80; } is_calcium = true; + name = "Cal"; } - void integrate(double, double); - void integrateMS(int,double, double); - double m_inf(double, double); - string getClass(void); + }; -string Cal::getClass(){return "Cal";} - -void Cal::integrate(double V, double Ca) { - E = container->E_Ca; - conductance::integrate(V,Ca); - container->i_Ca += getCurrent(V); -} - -void Cal::integrateMS(int k, double V, double Ca) { - E = container->E_Ca; - conductance::integrateMS(k, V, Ca); - container->i_Ca += getCurrent(V); -} double Cal::m_inf(double V, double Ca) {return (0.5)*(1.0+tanh((V)+10.0)/5.0);} diff --git a/c++/conductances/soto-trevino01/LP/Kd.hpp b/c++/conductances/soto-trevino01/LP/Kd.hpp index 7d8cabf0..681c634e 100644 --- a/c++/conductances/soto-trevino01/LP/Kd.hpp +++ b/c++/conductances/soto-trevino01/LP/Kd.hpp @@ -27,15 +27,17 @@ class Kd: public conductance { // defaults if (isnan(gbar)) { gbar = 0; } if (isnan (E)) { E = -80; } + + name = "Kd"; } double m_inf(double, double); double tau_m(double, double); - string getClass(void); + }; -string Kd::getClass(){return "Kd";} + double Kd::m_inf(double V, double Ca) {return (0.5)*(1.0+tanh((V)+10.0)/20.0);} double Kd::tau_m(double V, double Ca) {return 1.0 / ( 0.008*cosh((V)/30.0) );} diff --git a/c++/conductances/soto-trevino01/PY/Cal.hpp b/c++/conductances/soto-trevino01/PY/Cal.hpp index 6fe361a1..97d87a56 100644 --- a/c++/conductances/soto-trevino01/PY/Cal.hpp +++ b/c++/conductances/soto-trevino01/PY/Cal.hpp @@ -26,32 +26,20 @@ class Cal: public conductance { p = 1; + is_calcium = true; + name = "Cal"; + // defaults if (isnan(gbar)) { gbar = 0; } if (isnan (E)) { E = -80; } } - void integrate(double, double); - void integrateMS(int,double, double); - double m_inf(double, double); - string getClass(void); + }; -string Cal::getClass(){return "Cal";} - -void Cal::integrate(double V, double Ca) { - E = container->E_Ca; - conductance::integrate(V,Ca); - container->i_Ca += getCurrent(V); -} -void Cal::integrateMS(int k, double V, double Ca) { - E = container->E_Ca; - conductance::integrateMS(k, V, Ca); - container->i_Ca += getCurrent(V); -} double Cal::m_inf(double V, double Ca) {return (0.5)*(1.0+tanh((V))/15.0);} diff --git a/c++/conductances/soto-trevino01/PY/Kd.hpp b/c++/conductances/soto-trevino01/PY/Kd.hpp index d91b1326..d294c4ab 100644 --- a/c++/conductances/soto-trevino01/PY/Kd.hpp +++ b/c++/conductances/soto-trevino01/PY/Kd.hpp @@ -28,16 +28,18 @@ class Kd: public conductance { // defaults if (isnan(gbar)) { gbar = 0; } if (isnan (E)) { E = -80; } + + name = "Kd"; } double m_inf(double, double); double tau_m(double, double); - string getClass(void); + }; -string Kd::getClass(){return "Kd";} + double Kd::m_inf(double V, double Ca) {return (0.5)*(1.0+tanh((V)+4.0)/25.0);} double Kd::tau_m(double V, double Ca) {return 1.0 / ( 0.0025*cosh((V)/30.0) );} diff --git a/c++/conductances/soto-trevino05/AB/ACurrentAB.hpp b/c++/conductances/soto-trevino05/AB/ACurrentAB.hpp index 2455a966..628569ae 100644 --- a/c++/conductances/soto-trevino05/AB/ACurrentAB.hpp +++ b/c++/conductances/soto-trevino05/AB/ACurrentAB.hpp @@ -29,16 +29,17 @@ class ACurrentAB: public conductance { if (isnan(gbar)) { gbar = 0; } if (isnan (E)) { E = -80; } + name = "ACurrentAB"; + } double m_inf(double, double); double h_inf(double, double); double tau_m(double, double); double tau_h(double, double); - string getClass(void); + }; -string ACurrentAB::getClass(){return "ACurrentAB";} double ACurrentAB::m_inf(double V, double Ca) {return 1.0/(1.0+exp(-(V+27)/8.7)); } double ACurrentAB::h_inf(double V, double Ca) {return 1.0/(1.0+exp((V+56.9)/4.9)); } diff --git a/c++/conductances/soto-trevino05/AB/CaTAB.hpp b/c++/conductances/soto-trevino05/AB/CaTAB.hpp index 4149281c..c0d68407 100644 --- a/c++/conductances/soto-trevino05/AB/CaTAB.hpp +++ b/c++/conductances/soto-trevino05/AB/CaTAB.hpp @@ -29,31 +29,20 @@ class CaTAB: public conductance { if (isnan(gbar)) { gbar = 0; } if (isnan (E)) { E = 50; } + name = "CaTAB"; + is_calicum = true; + } - void integrate(double, double); - void integrateMS(int,double, double); double m_inf(double, double); double h_inf(double, double); double tau_m(double, double); double tau_h(double, double); - string getClass(void); + }; -string CaTAB::getClass(){return "CaTAB";} - -void CaTAB::integrate(double V, double Ca) { - E = container->E_Ca; - conductance::integrate(V,Ca); - container->i_Ca += getCurrent(V); -} -void CaTAB::integrateMS(int k, double V, double Ca) { - E = container->E_Ca; - conductance::integrateMS(k, V, Ca); - container->i_Ca += getCurrent(V); -} double CaTAB::m_inf(double V, double Ca) {return 1.0/(1.0 + exp((V+25)/-7.2));} double CaTAB::h_inf(double V, double Ca) {return 1.0/(1.0 + exp((V+36)/7));} diff --git a/c++/conductances/soto-trevino05/AB/KCaAB.hpp b/c++/conductances/soto-trevino05/AB/KCaAB.hpp index 4c6039ac..7dd7cca6 100644 --- a/c++/conductances/soto-trevino05/AB/KCaAB.hpp +++ b/c++/conductances/soto-trevino05/AB/KCaAB.hpp @@ -29,14 +29,15 @@ class KCaAB: public conductance { // defaults if (isnan(gbar)) { gbar = 0; } if (isnan (E)) { E = -80; } + + name = "KCaAB"; } double m_inf(double V, double Ca); double tau_m(double, double); - string getClass(void); + }; -string KCaAB::getClass(){return "KCaAB";} double KCaAB::m_inf(double V, double Ca) { return (Ca/(Ca+30))/(1.0+exp(-(V+51.0)/4)); } double KCaAB::tau_m(double V, double Ca) {return 90.3 - 75.09/(1.0+exp(-(V+46.0)/22.7));} diff --git a/c++/conductances/soto-trevino05/CaS.hpp b/c++/conductances/soto-trevino05/CaS.hpp index d9b8c320..b169d53a 100644 --- a/c++/conductances/soto-trevino05/CaS.hpp +++ b/c++/conductances/soto-trevino05/CaS.hpp @@ -28,30 +28,20 @@ class CaS: public conductance { if (isnan(gbar)) { gbar = 0; } if (isnan (E)) { E = 50; } + is_calcium = true; + + name = "CaS"; + } - void integrate(double, double); - void integrateMS(int,double, double); double m_inf(double, double); double tau_m(double, double); - string getClass(void); + }; -string CaS::getClass(){return "CaS";} - -void CaS::integrate(double V, double Ca) { - E = container->E_Ca; - conductance::integrate(V,Ca); - container->i_Ca += getCurrent(V); -} -void CaS::integrateMS(int k, double V, double Ca) { - E = container->E_Ca; - conductance::integrateMS(k, V, Ca); - container->i_Ca += getCurrent(V); -} double CaS::m_inf(double V, double Ca) {return 1.0/(1.0+exp(-(V+22.0)/8.5));} double CaS::tau_m(double V, double Ca) {return 16 - 13.1/(1 + exp(-(V+25.1)/-26.4));} diff --git a/c++/conductances/soto-trevino05/HCurrent.hpp b/c++/conductances/soto-trevino05/HCurrent.hpp index d9f8d1c5..8c188042 100644 --- a/c++/conductances/soto-trevino05/HCurrent.hpp +++ b/c++/conductances/soto-trevino05/HCurrent.hpp @@ -26,15 +26,16 @@ class HCurrent: public conductance { // defaults if (isnan(gbar)) { gbar = 0; } if (isnan (E)) { E = -20; } + + name = "HCurrent"; } double m_inf(double, double); double tau_m(double, double); - string getClass(void); }; -string HCurrent::getClass(){return "HCurrent";} + double HCurrent::m_inf(double V, double Ca) {return 1.0/(1.0+exp((V+70.0)/6.0));} double HCurrent::tau_m(double V, double Ca) {return (272.0 + 1499.0/(1.0+exp((V+42.2)/-8.73)));} diff --git a/c++/conductances/soto-trevino05/Kd.hpp b/c++/conductances/soto-trevino05/Kd.hpp index 6a126031..ad742f56 100644 --- a/c++/conductances/soto-trevino05/Kd.hpp +++ b/c++/conductances/soto-trevino05/Kd.hpp @@ -27,15 +27,17 @@ class Kd: public conductance { if (isnan(gbar)) { gbar = 0; } if (isnan (E)) { E = -80; } + name = "Kd"; + } double m_inf(double, double); double tau_m(double, double); - string getClass(void); + }; -string Kd::getClass(){return "Kd";} + double Kd::m_inf(double V, double Ca) {return 1.0/(1.0+exp(-(V+14.2)/11.8));} double Kd::tau_m(double V, double Ca) {return 7.2 - 6.4/(1.0+exp(-(V+28.3)/19.2));} diff --git a/c++/conductances/soto-trevino05/NaP.hpp b/c++/conductances/soto-trevino05/NaP.hpp index cdbbb757..1b8f0fd8 100644 --- a/c++/conductances/soto-trevino05/NaP.hpp +++ b/c++/conductances/soto-trevino05/NaP.hpp @@ -24,6 +24,7 @@ class NaP: public conductance { p = 3; q = 1; + name = "NaP"; // defaults if (isnan(gbar)) { gbar = 0; } @@ -34,10 +35,9 @@ class NaP: public conductance { double h_inf(double, double); double tau_m(double, double); double tau_h(double, double); - string getClass(void); + }; -string NaP::getClass(){return "NaP";} double NaP::m_inf(double V, double Ca) {return 1.0/(1.0+exp(-(V+26.8)/8.2));} double NaP::h_inf(double V, double Ca) {return 1.0/(1.0+exp((V+48.5)/4.8));} diff --git a/c++/conductances/soto-trevino05/NaV.hpp b/c++/conductances/soto-trevino05/NaV.hpp index 02e06d8a..e4486c77 100644 --- a/c++/conductances/soto-trevino05/NaV.hpp +++ b/c++/conductances/soto-trevino05/NaV.hpp @@ -25,7 +25,9 @@ class NaV: public conductance { q = 1; - // defaults + name = "NaV"; + + // defaults if (isnan(gbar)) { gbar = 0; } if (isnan (E)) { E = 50; } @@ -35,10 +37,10 @@ class NaV: public conductance { double h_inf(double, double); double tau_m(double, double); double tau_h(double, double); - string getClass(void); + }; -string NaV::getClass(){return "NaV";} + double NaV::m_inf(double V, double Ca) {return 1.0/(1.0+exp(-(V+24.7)/5.29));} double NaV::h_inf(double V, double Ca) {return 1.0/(1.0+exp((V+48.9)/5.18));} diff --git a/c++/conductances/soto-trevino05/PD/ACurrentPD.hpp b/c++/conductances/soto-trevino05/PD/ACurrentPD.hpp index 25f35fb5..f38579f4 100644 --- a/c++/conductances/soto-trevino05/PD/ACurrentPD.hpp +++ b/c++/conductances/soto-trevino05/PD/ACurrentPD.hpp @@ -29,16 +29,17 @@ class ACurrentPD: public conductance { if (isnan(gbar)) { gbar = 0; } if (isnan (E)) { E = -80; } + name = "ACurrentPD"; + } double m_inf(double, double); double h_inf(double, double); double tau_m(double, double); double tau_h(double, double); - string getClass(void); + }; -string ACurrentPD::getClass(){return "ACurrentPD";} double ACurrentPD::m_inf(double V, double Ca) {return 1.0/(1.0+exp(-(V+27)/8.7)); } double ACurrentPD::h_inf(double V, double Ca) {return 1.0/(1.0+exp((V+56.9)/4.9)); } diff --git a/c++/conductances/soto-trevino05/PD/CaTPD.hpp b/c++/conductances/soto-trevino05/PD/CaTPD.hpp index 59d3d964..c2b888d0 100644 --- a/c++/conductances/soto-trevino05/PD/CaTPD.hpp +++ b/c++/conductances/soto-trevino05/PD/CaTPD.hpp @@ -26,17 +26,17 @@ class CaTPD: public conductance { if (isnan(gbar)) { gbar = 0; } if (isnan (E)) { E = 50; } + name = "CaTPD"; + } double m_inf(double, double); double h_inf(double, double); double tau_m(double, double); double tau_h(double, double); - string getClass(void); + }; -string CaTPD::getClass(){return "CaTPD";} - double CaTPD::m_inf(double V, double Ca) {return 1.0/(1.0 + exp((V+25)/-7.2));} double CaTPD::h_inf(double V, double Ca) {return 1.0/(1.0 + exp((V+36)/7));} diff --git a/c++/conductances/soto-trevino05/PD/KCaPD.hpp b/c++/conductances/soto-trevino05/PD/KCaPD.hpp index 9c7ead41..fc86cb06 100644 --- a/c++/conductances/soto-trevino05/PD/KCaPD.hpp +++ b/c++/conductances/soto-trevino05/PD/KCaPD.hpp @@ -22,19 +22,19 @@ class KCaPD: public conductance { p = 4; + name = "KCaPD"; + // defaults if (isnan(gbar)) { gbar = 0; } - if (isnan (E)) { E = -80; } } double m_inf(double V, double Ca); double tau_m(double, double); - string getClass(void); + }; -string KCaPD::getClass(){return "KCaPD";} double KCaPD::m_inf(double V, double Ca) { return (Ca/(Ca+30))/(1.0+exp(-(V+51.0)/8.0)); } double KCaPD::tau_m(double V, double Ca) {return 90.3 - 75.09/(1.0+exp(-(V+46.0)/22.7));} diff --git a/c++/conductances/soto-trevino05/Proc.hpp b/c++/conductances/soto-trevino05/Proc.hpp index 09515874..2d628491 100644 --- a/c++/conductances/soto-trevino05/Proc.hpp +++ b/c++/conductances/soto-trevino05/Proc.hpp @@ -27,15 +27,16 @@ class Proc: public conductance { // defaults if (isnan(gbar)) { gbar = 0; } if (isnan (E)) { E = 0; } + + name = "Proc"; } double m_inf(double, double); - string getClass(void); + }; -string Proc::getClass(){return "Proc";} double Proc::m_inf(double V, double Ca) {return 1.0/(1.0+exp(-(V+12.0)/3.05));} diff --git a/c++/conductances/swensen/MICurrent.hpp b/c++/conductances/swensen/MICurrent.hpp index 14a11953..95b5f2d9 100644 --- a/c++/conductances/swensen/MICurrent.hpp +++ b/c++/conductances/swensen/MICurrent.hpp @@ -25,6 +25,7 @@ class MICurrent: public conductance { p = 1; + name = "MICurrent"; // defaults if (isnan(gbar)) { gbar = 0; } @@ -36,11 +37,10 @@ class MICurrent: public conductance { double h_inf(double V, double Ca); double tau_m(double V, double Ca); double tau_h(double V, double Ca); - string getClass(void); + }; -string MICurrent::getClass(){return "MICurrent";} double MICurrent::m_inf(double V, double Ca) {return 1.0/(1.0+exp((V+21.0)/-8));} double MICurrent::tau_m(double V, double Ca) {return 6.0;} diff --git a/c++/conductances/templates/Ca_exact.hpp b/c++/conductances/templates/Ca_exact.hpp index 9e9b3f53..1fe11864 100644 --- a/c++/conductances/templates/Ca_exact.hpp +++ b/c++/conductances/templates/Ca_exact.hpp @@ -41,12 +41,11 @@ class CondName: public conductance { double h_inf(double V, double Ca); double tau_m(double V, double Ca); double tau_h(double V, double Ca); - string getClass(void); + }; -string CondName::getClass(){return "CondName";} void CondName::integrate(double V, double Ca) { E = container->E_Ca; diff --git a/c++/conductances/templates/generic_exact.hpp b/c++/conductances/templates/generic_exact.hpp index 8f2fb8d1..8045d33d 100644 --- a/c++/conductances/templates/generic_exact.hpp +++ b/c++/conductances/templates/generic_exact.hpp @@ -37,12 +37,11 @@ class CondName: public conductance { double h_inf(double V, double Ca); double tau_m(double V, double Ca); double tau_h(double V, double Ca); - string getClass(void); + }; -string CondName::getClass(){return "CondName";} double CondName::m_inf(double V, double Ca) {return $m_inf;} double CondName::h_inf(double V, double Ca) {return $h_inf;} diff --git a/c++/conductances/traub/ACurrent.hpp b/c++/conductances/traub/ACurrent.hpp index 6c1b627c..2d9e8eec 100644 --- a/c++/conductances/traub/ACurrent.hpp +++ b/c++/conductances/traub/ACurrent.hpp @@ -26,6 +26,8 @@ class ACurrent: public conductance { p = 1; q = 1; + name = "ACurrent"; + // defaults if (isnan(gbar)) { gbar = 0; } @@ -36,15 +38,10 @@ class ACurrent: public conductance { double h_inf(double, double); double tau_m(double, double); double tau_h(double, double); - string getClass(void); }; -string ACurrent::getClass(){ - return "ACurrent"; -} - double ACurrent::m_inf(double V, double Ca) {return (0.02*(13.1-V)/(exp((13.1-V)/10.0)-1.0))/((0.02*(13.1-V)/(exp((13.1-V)/10.0)-1.0))+(0.0175*(V-40.1)/(exp((V-40.1)/10.0)-1.0))); } double ACurrent::h_inf(double V, double Ca) {return (0.128*exp((17.0-V)/18.0))/((0.128*exp((17.0-V)/18.0))+(4.0/(1.0+exp((40.0-V)/5.0)))); } double ACurrent::tau_m(double V, double Ca) {return (0.0016*exp((-13.0-V)/18.0))/((0.0016*exp((-13.0-V)/18.0))+(0.05/(1.0+exp((10.1-V)/5.0))));} diff --git a/c++/conductances/traub/Cal.hpp b/c++/conductances/traub/Cal.hpp index fd589200..989d58b7 100644 --- a/c++/conductances/traub/Cal.hpp +++ b/c++/conductances/traub/Cal.hpp @@ -32,13 +32,11 @@ class Cal: public conductance { q = 1; is_calcium = true; + name = "Cal"; } - void integrate(double, double); - void integrateMS(int, double, double); - double m_inf(double, double); double h_inf(double, double); double tau_m(double, double); @@ -49,30 +47,16 @@ class Cal: public conductance { double h_alpha(double, double); double h_beta(double, double); - string getClass(void); + }; -string Cal::getClass(){return "Cal";} - -void Cal::integrate(double V, double Ca) { - E = container->E_Ca; - conductance::integrate(V,Ca); - container->i_Ca += getCurrent(V); -} - -void Cal::integrateMS(int k, double V, double Ca) { - E = container->E_Ca; - conductance::integrateMS(k, V, Ca); - container->i_Ca += getCurrent(V); -} double Cal::m_alpha(double V, double Ca) {return 1.6 / (1.0 + exp(-0.072 * (V - 65.0)));} double Cal::m_beta(double V, double Ca) {return 0.02 * (V - 51.1) / (exp((V-51.1)/5.0) - 1.0);} -double Cal::h_alpha(double V, double Ca) -{ +double Cal::h_alpha(double V, double Ca) { if (V > 0) { return exp(-V/20.0)/200.0; @@ -81,8 +65,7 @@ double Cal::h_alpha(double V, double Ca) } } -double Cal::h_beta(double V, double Ca) -{ +double Cal::h_beta(double V, double Ca) { if (V > 0) { return 0.005 - h_alpha(V, Ca); diff --git a/c++/conductances/traub/KCa.hpp b/c++/conductances/traub/KCa.hpp index 6a8f57f8..10e0b083 100644 --- a/c++/conductances/traub/KCa.hpp +++ b/c++/conductances/traub/KCa.hpp @@ -31,25 +31,21 @@ class KCa: public conductance { // defaults if (isnan(gbar)) { gbar = 0; } - if (isnan (E)) { E = -80; } + + name = "KCa"; } void integrate(double, double); double m_inf(double, double); double tau_m(double, double); - string getClass(void); + }; -string KCa::getClass(){ - return "KCa"; -} - -void KCa::integrate(double V, double Ca) -{ +void KCa::integrate(double V, double Ca) { m = m_inf(V,Ca) + (m - m_inf(V,Ca))*exp(-dt/tau_m(V,Ca)); g = gbar * m * min(1.0, Ca / 250.0); } diff --git a/c++/conductances/traub/Kahp.hpp b/c++/conductances/traub/Kahp.hpp index 399c1c3d..4b884333 100644 --- a/c++/conductances/traub/Kahp.hpp +++ b/c++/conductances/traub/Kahp.hpp @@ -26,21 +26,18 @@ class Kahp: public conductance { // defaults if (isnan(gbar)) { gbar = 0; } - if (isnan (E)) { E = -80; } + + name = "Kahp"; } double m_inf(double V, double Ca); double tau_m(double, double); - string getClass(void); + }; -string Kahp::getClass(){ - return "Kahp"; -} - double Kahp::m_inf(double V, double Ca) { double var = 0.2 / 10000 * Ca; if (var < 0.01) { return var / (var + 0.001); } diff --git a/c++/conductances/traub/Kd.hpp b/c++/conductances/traub/Kd.hpp index d24c043a..c5b01200 100644 --- a/c++/conductances/traub/Kd.hpp +++ b/c++/conductances/traub/Kd.hpp @@ -28,19 +28,17 @@ class Kd: public conductance { // defaults if (isnan(gbar)) { gbar = 0; } if (isnan (E)) { E = -80; } + + name = "Kd"; } double m_inf(double, double); double tau_m(double, double); - string getClass(void); + }; -string Kd::getClass(){ - return "Kd"; -} - double Kd::m_inf(double V, double Ca) {return (0.016*(35.1-V)/(exp((35.1-V)/5.0)-1.0))/((0.016*(35.1-V)/(exp((35.1-V)/5.0)-1.0))+(0.25*exp((20.0-V)/40.0))); } double Kd::tau_m(double V, double Ca) {return 1.0/((0.016*(35.1-V)/(exp((35.1-V)/5.0)-1.0))+(0.25*exp((20.0-V)/40.0)));} diff --git a/c++/conductances/traub/NaV.hpp b/c++/conductances/traub/NaV.hpp index ba554b02..e45fb596 100644 --- a/c++/conductances/traub/NaV.hpp +++ b/c++/conductances/traub/NaV.hpp @@ -30,21 +30,19 @@ class NaV: public conductance { // defaults if (isnan(gbar)) { gbar = 0; } if (isnan (E)) { E = 50; } + + name = "NaV"; } double m_inf(double, double); double h_inf(double, double); double tau_m(double, double); double tau_h(double, double); - string getClass(void); + }; -string NaV::getClass(){ - return "NaV"; -} - double NaV::m_inf(double V, double Ca) {return (0.32*(13.1-V)/(exp((13.1-V)/4.0)-1.0))/((0.32*(13.1-V)/(exp((13.1-V)/4.0)-1.0))+(0.28*(V-40.1)/(exp((V-40.1)/5)-1.0))); } double NaV::h_inf(double V, double Ca) {return (0.128*exp((17.0-V)/18.0))/((0.128*exp((17.0-V)/18.0))+(4.0/(1.0+exp((40.0-V)/5.0)))); } double NaV::tau_m(double V, double Ca) {return (1.0)/((0.32*(13.1-V)/(exp((13.1-V)/4.0)-1.0))+(0.28*(V-40.1)/(exp((V-40.1)/5)-1.0)));} diff --git a/c++/conductances/turrigiano/ACurrent.hpp b/c++/conductances/turrigiano/ACurrent.hpp index 86d77f31..e2f0732d 100644 --- a/c++/conductances/turrigiano/ACurrent.hpp +++ b/c++/conductances/turrigiano/ACurrent.hpp @@ -30,19 +30,17 @@ class ACurrent: public conductance { // defaults if (isnan(gbar)) { gbar = 0; } if (isnan (E)) { E = -80; } + + name = "ACurrent"; } double m_inf(double, double); double h_inf(double, double); double tau_m(double, double); double tau_h(double, double); - string getClass(void); }; -string ACurrent::getClass(){ - return "ACurrent"; -} double ACurrent::m_inf(double V, double Ca) {return 1.0/(1.0+exp((V+27.2)/-8.7)); } double ACurrent::h_inf(double V, double Ca) {return 1.0/(1.0+exp((V+56.9)/4.9)); } diff --git a/c++/conductances/turrigiano/ASlow.hpp b/c++/conductances/turrigiano/ASlow.hpp index 88e10ea9..62bd688a 100644 --- a/c++/conductances/turrigiano/ASlow.hpp +++ b/c++/conductances/turrigiano/ASlow.hpp @@ -31,20 +31,18 @@ class ASlow: public conductance { // defaults if (isnan(gbar)) { gbar = 0; } if (isnan (E)) { E = -20; } + + name = "ASlow"; } double m_inf(double, double); double h_inf(double, double); double tau_m(double, double); double tau_h(double, double); - string getClass(void); + }; -string ASlow::getClass(){ - return "ASlow"; -} - double ASlow::m_inf(double V, double Ca) {return 1.0/(1.0+exp((V+24.3)/-9.4)); } double ASlow::h_inf(double V, double Ca) {return 1.0/(1.0+exp((V+61.3)/6.6)); } double ASlow::tau_m(double V, double Ca) {return 13.3 - 9/(1.0+exp((V+50.3)/-11.8));} diff --git a/c++/conductances/turrigiano/Ca1.hpp b/c++/conductances/turrigiano/Ca1.hpp index 7a3c00d7..06192c6c 100644 --- a/c++/conductances/turrigiano/Ca1.hpp +++ b/c++/conductances/turrigiano/Ca1.hpp @@ -30,33 +30,18 @@ class Ca1: public conductance { if (isnan(gbar)) { gbar = 0; } if (isnan (E)) { E = 120; } - } - - void integrate(double, double); - void integrateMS(int,double, double); + name = "Ca1"; + is_calcium = true; + } double m_inf(double, double); double h_inf(double, double); double tau_m(double, double); double tau_h(double, double); - string getClass(void); + }; -string Ca1::getClass(){ - return "Ca1"; -} - -void Ca1::integrate(double V, double Ca) { - E = container->E_Ca; - conductance::integrate(V,Ca); - container->i_Ca += getCurrent(V); -} -void Ca1::integrateMS(int k, double V, double Ca) { - E = container->E_Ca; - conductance::integrateMS(k, V, Ca); - container->i_Ca += getCurrent(V); -} double Ca1::m_inf(double V, double Ca) {return 1.0/(1.0+exp((V+27.1)/-7.18));} double Ca1::h_inf(double V, double Ca) {return 1.0/(1.0+exp((V+30.1)/5.5));} diff --git a/c++/conductances/turrigiano/Ca2.hpp b/c++/conductances/turrigiano/Ca2.hpp index 673aa8e0..c661727d 100644 --- a/c++/conductances/turrigiano/Ca2.hpp +++ b/c++/conductances/turrigiano/Ca2.hpp @@ -25,35 +25,21 @@ class Ca2: public conductance { p = 1; + name = "Ca2"; + is_calcium = true; + // defaults if (isnan(gbar)) { gbar = 0; } if (isnan (E)) { E = 120; } } - void integrate(double, double); - void integrateMS(int,double, double); double m_inf(double, double); double tau_m(double, double); - string getClass(void); + }; -string Ca2::getClass(){ - return "Ca2"; -} - -void Ca2::integrate(double V, double Ca) { - E = container->E_Ca; - conductance::integrate(V,Ca); - container->i_Ca += getCurrent(V); -} - -void Ca2::integrateMS(int k, double V, double Ca) { - E = container->E_Ca; - conductance::integrateMS(k, V, Ca); - container->i_Ca += getCurrent(V); -} double Ca2::m_inf(double V, double Ca) {return 1.0/(1.0+exp((V+21.6)/-8.5));} double Ca2::tau_m(double V, double Ca) {return 16 - 13.1/(exp((V+25.1)/-26.4));} diff --git a/c++/conductances/turrigiano/HCurrent.hpp b/c++/conductances/turrigiano/HCurrent.hpp index d1a6384f..40183f91 100644 --- a/c++/conductances/turrigiano/HCurrent.hpp +++ b/c++/conductances/turrigiano/HCurrent.hpp @@ -23,7 +23,7 @@ class HCurrent: public conductance { p = 1; - + name = "HCurrent"; // defaults if (isnan(gbar)) { gbar = 0; } @@ -33,12 +33,9 @@ class HCurrent: public conductance { double m_inf(double, double); double tau_m(double, double); - string getClass(void); + }; -string HCurrent::getClass(){ - return "HCurrent"; -} double HCurrent::m_inf(double V, double Ca) {return 1.0/(1.0+exp((V+78.3)/6.5));} double HCurrent::tau_m(double V, double Ca) {return (272.0 + 1499.0/(1.0+exp((V+42.2)/-8.73)));} diff --git a/c++/conductances/turrigiano/KCa.hpp b/c++/conductances/turrigiano/KCa.hpp index 8781f8db..57f25576 100644 --- a/c++/conductances/turrigiano/KCa.hpp +++ b/c++/conductances/turrigiano/KCa.hpp @@ -22,20 +22,19 @@ class KCa: public conductance { p = 4; + name = "KCa"; + // defaults if (isnan(gbar)) { gbar = 0; } - if (isnan (E)) { E = -80; } } double m_inf(double V, double Ca); double tau_m(double, double); - string getClass(void); + }; -string KCa::getClass(){ - return "KCa"; -} + double KCa::m_inf(double V, double Ca) { return (Ca/(Ca+3.0))/(1.0+exp((V+28.3)/-12.6)); } double KCa::tau_m(double V, double Ca) {return 90.3 - 75.1/(1.0+exp((V+46.0)/-22.7));} diff --git a/c++/conductances/turrigiano/Kd.hpp b/c++/conductances/turrigiano/Kd.hpp index b1571f65..637ff000 100644 --- a/c++/conductances/turrigiano/Kd.hpp +++ b/c++/conductances/turrigiano/Kd.hpp @@ -22,6 +22,7 @@ class Kd: public conductance { p = 4; + name = "Kd"; // defaults if (isnan(gbar)) { gbar = 0; } @@ -31,12 +32,9 @@ class Kd: public conductance { double m_inf(double, double); double tau_m(double, double); - string getClass(void); + }; -string Kd::getClass(){ - return "Kd"; -} double Kd::m_inf(double V, double Ca) {return 1.0/(1.0+exp((V+12.3)/-11.8));} double Kd::tau_m(double V, double Ca) {return 7.2 - 6.4/(1.0+exp((V+28.3)/-19.2));} diff --git a/c++/conductances/turrigiano/NaP.hpp b/c++/conductances/turrigiano/NaP.hpp index 69499279..75daac48 100644 --- a/c++/conductances/turrigiano/NaP.hpp +++ b/c++/conductances/turrigiano/NaP.hpp @@ -25,6 +25,7 @@ class NaP: public conductance { p = 3; q = 1; + name = "NaP"; // defaults if (isnan(gbar)) { gbar = 0; } @@ -35,10 +36,9 @@ class NaP: public conductance { double h_inf(double, double); double tau_m(double, double); double tau_h(double, double); - string getClass(void); + }; -string NaP::getClass(){return "NaP";} double NaP::m_inf(double V, double Ca) {return 1.0/(1.0+exp((V+26.8)/-8.2));} double NaP::h_inf(double V, double Ca) {return 1.0/(1.0+exp((V+48.5)/4.8));} diff --git a/c++/conductances/turrigiano/NaV.hpp b/c++/conductances/turrigiano/NaV.hpp index 0ee7fc60..b217485f 100644 --- a/c++/conductances/turrigiano/NaV.hpp +++ b/c++/conductances/turrigiano/NaV.hpp @@ -29,16 +29,18 @@ class NaV: public conductance { // defaults if (isnan(gbar)) { gbar = 0; } if (isnan (E)) { E = 50; } + + name = "NaV"; } double m_inf(double, double); double h_inf(double, double); double tau_m(double, double); double tau_h(double, double); - string getClass(void); + }; -string NaV::getClass(){return "NaV";} + double NaV::m_inf(double V, double Ca) {return 1.0/(1.0+exp((V+25.5)/-5.29));} double NaV::h_inf(double V, double Ca) {return 1.0/(1.0+exp((V+48.9)/5.18));} diff --git a/c++/conductances/wicher/DmNaV.hpp b/c++/conductances/wicher/DmNaV.hpp index 590c8dd0..ca451390 100644 --- a/c++/conductances/wicher/DmNaV.hpp +++ b/c++/conductances/wicher/DmNaV.hpp @@ -24,6 +24,8 @@ class DmNaV: public conductance { p = 3; q = 1; + name = "DmNaV"; + // defaults if (isnan(gbar)) { gbar = 0; } if (isnan (E)) { E = 50; } @@ -34,10 +36,9 @@ class DmNaV: public conductance { double h_inf(double, double); double tau_m(double, double); double tau_h(double, double); - string getClass(void); + }; -string DmNaV::getClass(){return "DmNaV";} double DmNaV::m_inf(double V, double Ca) {return 1.0/(1.0+exp((V+25.5)/-5.29));} double DmNaV::h_inf(double V, double Ca) {return 1.0/(1.0+exp((V+48.9)/5.18));} diff --git a/c++/mechanism.hpp b/c++/mechanism.hpp index bc2f8d85..f3e434e7 100644 --- a/c++/mechanism.hpp +++ b/c++/mechanism.hpp @@ -37,7 +37,8 @@ class mechanism { // store the type of the thing being controlled // as a string - string controlling_class; + string controlling_class = "unset"; + string name = "unset"; int mechanism_idx; @@ -70,7 +71,6 @@ class mechanism { virtual int getFullState(double*, int); virtual double getState(int); - virtual string getClass(void) = 0; virtual void checkSolvers(int); @@ -105,7 +105,7 @@ method, which will be used instead of this. */ void mechanism::connectCompartment(compartment* comp_) { string txt = "Error using "; - txt += getClass(); + txt += name; txt += ". This mechanism cannot connect to a compartment object"; mexErrMsgTxt(txt.c_str()); } @@ -119,7 +119,7 @@ method, which will be used instead of this. */ void mechanism::connectConductance(conductance* cond_) { string txt = "Error using "; - txt += getClass(); + txt += name; txt += ". This mechanism cannot connect to a conductance object"; mexErrMsgTxt(txt.c_str()); } @@ -133,7 +133,7 @@ method, which will be used instead of this. */ void mechanism::connectSynapse(synapse* syn_) { string txt = "Error using "; - txt += getClass(); + txt += name; txt += ". This mechanism cannot connect to a synapse object"; mexErrMsgTxt(txt.c_str()); } @@ -193,7 +193,7 @@ void mechanism::checkSolvers(int k) { if (k == 0) {return;} else { string txt = "Error using "; - txt += getClass(); + txt += name; txt += ". This mechanism does not support this solver order. Try using x.solver_order = 0;"; mexErrMsgTxt(txt.c_str()); } diff --git a/c++/mechanisms/CalciumTarget.hpp b/c++/mechanisms/CalciumTarget.hpp index 0a75da51..299cbbc9 100644 --- a/c++/mechanisms/CalciumTarget.hpp +++ b/c++/mechanisms/CalciumTarget.hpp @@ -24,6 +24,7 @@ class CalciumTarget: public mechanism { // specify parameters + initial conditions CalciumTarget(double Target_) { Target = Target_; + name = "CalciumTarget"; } void checkSolvers(int); @@ -31,14 +32,10 @@ class CalciumTarget: public mechanism { void connectCompartment(compartment*); double getState(int); - string getClass(void); + }; -string CalciumTarget::getClass() { - return "CalciumTarget"; -} - // we are abusing getState to read out value of the target // from other mechanisms diff --git a/c++/mechanisms/ChannelProbe.hpp b/c++/mechanisms/ChannelProbe.hpp index f4372a0f..7423dad6 100644 --- a/c++/mechanisms/ChannelProbe.hpp +++ b/c++/mechanisms/ChannelProbe.hpp @@ -22,24 +22,16 @@ class ChannelProbe: public mechanism { ChannelProbe(double dummy_) { dummy = dummy_; fullStateSize = 2; + name = "ChannelProbe"; } void connectConductance(conductance *); - int getFullState(double * cont_state, int idx); - string getClass(void); + }; - - -string ChannelProbe::getClass() { - return "ChannelProbe"; -} - - - int ChannelProbe::getFullState(double *cont_state, int idx) { // read out m and h cont_state[idx] = channel->m; @@ -51,7 +43,6 @@ int ChannelProbe::getFullState(double *cont_state, int idx) { void ChannelProbe::connectConductance(conductance * channel_) { - // connect to a channel channel = channel_; diff --git a/c++/mechanisms/buchholtz-temperature/CalciumMech.hpp b/c++/mechanisms/buchholtz-temperature/CalciumMech.hpp index d70f2d66..2ea680fb 100644 --- a/c++/mechanisms/buchholtz-temperature/CalciumMech.hpp +++ b/c++/mechanisms/buchholtz-temperature/CalciumMech.hpp @@ -43,19 +43,16 @@ class CalciumMech: public mechanism { Ca_in = Ca_in_; Q_tau = Q_tau_; + name = "CalciumMech"; + controlling_class = "unset"; } void integrate(void); - void checkSolvers(int); - void connectCompartment(compartment*); - - string getClass(void); - void init(void); @@ -63,17 +60,10 @@ class CalciumMech: public mechanism { - -string CalciumMech::getClass() { - return "CalciumMech"; -} - // connection methods void CalciumMech::connectCompartment(compartment* comp_) { - comp = comp_; comp->addMechanism(this); - } diff --git a/c++/mechanisms/buchholtz/CalciumMech.hpp b/c++/mechanisms/buchholtz/CalciumMech.hpp index 748a1802..8287d04d 100644 --- a/c++/mechanisms/buchholtz/CalciumMech.hpp +++ b/c++/mechanisms/buchholtz/CalciumMech.hpp @@ -38,32 +38,21 @@ class CalciumMech: public mechanism { Ca_in = Ca_in_; controlling_class = "unset"; + name = "CalciumMech"; } void integrate(void); void integrateMS(int, double, double); - void checkSolvers(int); - void connectCompartment(compartment*); - - - string getClass(void); - double Cadot(double); - void init(void); }; - -string CalciumMech::getClass() { - return "CalciumMech"; -} - // connection methods void CalciumMech::connectCompartment(compartment* comp_) { comp = comp_; diff --git a/c++/mechanisms/destexhe/CalciumMech.hpp b/c++/mechanisms/destexhe/CalciumMech.hpp index 965aab81..17e51874 100644 --- a/c++/mechanisms/destexhe/CalciumMech.hpp +++ b/c++/mechanisms/destexhe/CalciumMech.hpp @@ -49,6 +49,7 @@ class CalciumMech: public mechanism { Ca_in = Ca_in_; controlling_class = "unset"; + name = "CalciumMech"; } @@ -60,7 +61,7 @@ class CalciumMech: public mechanism { void connectCompartment(compartment*); - string getClass(void); + double Cadot(double); double Cainf(void); @@ -71,11 +72,6 @@ class CalciumMech: public mechanism { - -string CalciumMech::getClass() { - return "CalciumMech"; -} - // connection methods void CalciumMech::connectCompartment(compartment* comp_) { comp = comp_; diff --git a/c++/mechanisms/goldwyn/CurrentNoise.hpp b/c++/mechanisms/goldwyn/CurrentNoise.hpp index 0c9fb957..9944652d 100644 --- a/c++/mechanisms/goldwyn/CurrentNoise.hpp +++ b/c++/mechanisms/goldwyn/CurrentNoise.hpp @@ -35,6 +35,7 @@ class CurrentNoise: public mechanism { { noise_amplitude = noise_amplitude_; controlling_class = "unset"; + name = "CurrentNoise"; } @@ -43,14 +44,10 @@ class CurrentNoise: public mechanism { void connectCompartment(compartment*); - string getClass(void); + }; -string CurrentNoise::getClass() { - return "CurrentNoise"; -} - void CurrentNoise::connectCompartment(compartment* comp_) { comp = comp_; diff --git a/c++/mechanisms/goldwyn/CurrentNoise2.hpp b/c++/mechanisms/goldwyn/CurrentNoise2.hpp index 32709caf..6e67e346 100644 --- a/c++/mechanisms/goldwyn/CurrentNoise2.hpp +++ b/c++/mechanisms/goldwyn/CurrentNoise2.hpp @@ -32,7 +32,7 @@ class CurrentNoise2: public mechanism { { noise_amplitude = noise_amplitude_; controlling_class = "unset"; - + name = "CurrentNoise2"; } @@ -43,14 +43,10 @@ class CurrentNoise2: public mechanism { void connect(compartment*); - string getClass(void); + }; -string CurrentNoise2::getClass() { - return "CurrentNoise2"; -} - void CurrentNoise2::connect(compartment* comp_) { diff --git a/c++/mechanisms/goldwyn/SubunitNoise.hpp b/c++/mechanisms/goldwyn/SubunitNoise.hpp index 4a3c1340..98373681 100644 --- a/c++/mechanisms/goldwyn/SubunitNoise.hpp +++ b/c++/mechanisms/goldwyn/SubunitNoise.hpp @@ -33,6 +33,8 @@ class SubunitNoise: public mechanism { noise_amplitude = noise_amplitude_; controlling_class = "unset"; + name = "SubunitNoise"; + } @@ -44,13 +46,10 @@ class SubunitNoise: public mechanism { void connect(synapse*); - string getClass(void); + }; -string SubunitNoise::getClass() { - return "SubunitNoise"; -} void SubunitNoise::connect(conductance * channel_) { @@ -58,7 +57,7 @@ void SubunitNoise::connect(conductance * channel_) { // connect to a channel channel = channel_; (channel->container)->addMechanism(this); - controlling_class = (channel_->getClass()).c_str(); + controlling_class = (channel_->name).c_str(); } diff --git a/c++/mechanisms/gorur-shandilya/CalciumSensor.hpp b/c++/mechanisms/gorur-shandilya/CalciumSensor.hpp index 4c07fa44..3c6d9bf8 100644 --- a/c++/mechanisms/gorur-shandilya/CalciumSensor.hpp +++ b/c++/mechanisms/gorur-shandilya/CalciumSensor.hpp @@ -31,6 +31,8 @@ class CalciumSensor: public mechanism { Ca_average = Ca_average_; fullStateSize = 1; + + name = "CalciumSensor"; } @@ -41,13 +43,10 @@ class CalciumSensor: public mechanism { int getFullState(double * cont_state, int idx); - string getClass(void); + }; -string CalciumSensor::getClass() { - return "CalciumSensor"; -} diff --git a/c++/mechanisms/liu/DCSensor.hpp b/c++/mechanisms/liu/DCSensor.hpp index 11431693..3377f042 100644 --- a/c++/mechanisms/liu/DCSensor.hpp +++ b/c++/mechanisms/liu/DCSensor.hpp @@ -52,6 +52,8 @@ class DCSensor: public mechanism { if (isnan(X)) {X = 0;} if (isnan(m)) {m = 0;} + name = "DCSensor"; + } @@ -65,13 +67,10 @@ class DCSensor: public mechanism { int getFullState(double * cont_state, int idx); double getState(int); - string getClass(void); + }; -string DCSensor::getClass() { - return "DCSensor"; -} double DCSensor::getState(int idx){return X;} diff --git a/c++/mechanisms/liu/FSDTarget.hpp b/c++/mechanisms/liu/FSDTarget.hpp index 352c0d10..0b61e332 100644 --- a/c++/mechanisms/liu/FSDTarget.hpp +++ b/c++/mechanisms/liu/FSDTarget.hpp @@ -33,6 +33,8 @@ class FSDTarget: public mechanism { FTarget = FTarget_; STarget = STarget_; DCTarget = DCTarget_; + + name = "FSDTarget"; } void checkSolvers(int); @@ -43,14 +45,10 @@ class FSDTarget: public mechanism { double getState(int); - string getClass(void); + }; -string FSDTarget::getClass() { - return "FSDTarget"; -} - // we are abusing getState to read out value of the target // from other mechanisms diff --git a/c++/mechanisms/liu/FastSensor.hpp b/c++/mechanisms/liu/FastSensor.hpp index cf87d855..fe0b99de 100644 --- a/c++/mechanisms/liu/FastSensor.hpp +++ b/c++/mechanisms/liu/FastSensor.hpp @@ -60,6 +60,8 @@ class FastSensor: public mechanism { if (isnan(m)) {m = 0;} if (isnan(h)) {h = 1;} + name = "FastSensor"; + } @@ -74,15 +76,10 @@ class FastSensor: public mechanism { int getFullStateSize(void); int getFullState(double * cont_state, int idx); double getState(int); - string getClass(void); + }; -string FastSensor::getClass() { - return "FastSensor"; -} - - double FastSensor::getState(int idx){return X;} diff --git a/c++/mechanisms/liu/IntegralController.hpp b/c++/mechanisms/liu/IntegralController.hpp index b66cfd89..6c674390 100644 --- a/c++/mechanisms/liu/IntegralController.hpp +++ b/c++/mechanisms/liu/IntegralController.hpp @@ -49,13 +49,15 @@ class IntegralController: public mechanism { // defaults if (isnan(tau)) {tau = 5000; } // ms + name = "IntegralController"; + } void integrate(void); void connectConductance(conductance*); - string getClass(void); + void connectToLiuSensor(void); @@ -69,7 +71,7 @@ void IntegralController::connectToLiuSensor() { for (int i = 0; i < n_mech; i++) { - string this_mech = (channel->container)->getMechanismPointer(i)->getClass().c_str(); + string this_mech = (channel->container)->getMechanismPointer(i)->name.c_str(); if (this_mech == "FastSensor") { Fast = (channel->container)->getMechanismPointer(i); @@ -95,10 +97,6 @@ void IntegralController::connectToLiuSensor() { } -string IntegralController::getClass() { - return "IntegralController"; -} - // connection methods @@ -109,7 +107,7 @@ void IntegralController::connect(conductance* cond_) { // make sure the compartment that we are in knows about us (channel->container)->addMechanism(this); - controlling_class = (channel->getClass()).c_str(); + controlling_class = (channel->name).c_str(); // attempt to read the area of the container that this // controller should be in. diff --git a/c++/mechanisms/liu/LiuController.hpp b/c++/mechanisms/liu/LiuController.hpp index 98f4f3a7..5f117503 100644 --- a/c++/mechanisms/liu/LiuController.hpp +++ b/c++/mechanisms/liu/LiuController.hpp @@ -49,6 +49,8 @@ class LiuController: public mechanism { fullStateSize = 1; + + name = "LiuController"; } @@ -62,7 +64,7 @@ class LiuController: public mechanism { int getFullState(double * cont_state, int idx); - string getClass(void); + void init(void); @@ -76,7 +78,7 @@ void LiuController::init() { for (int i = 0; i < n_mech; i++) { - string this_mech = (channel->container)->getMechanismPointer(i)->getClass().c_str(); + string this_mech = (channel->container)->getMechanismPointer(i)->name.c_str(); if (this_mech == "FastSensor") { Fast = (channel->container)->getMechanismPointer(i); @@ -114,9 +116,6 @@ void LiuController::init() { } -string LiuController::getClass() { - return "LiuController"; -} @@ -135,7 +134,7 @@ void LiuController::connectConductance(conductance* cond_) { // make sure the compartment that we are in knows about us (channel->container)->addMechanism(this); - controlling_class = (channel->getClass()).c_str(); + controlling_class = (channel->name).c_str(); // attempt to read the area of the container that this // controller should be in. diff --git a/c++/mechanisms/liu/SlowSensor.hpp b/c++/mechanisms/liu/SlowSensor.hpp index 4b055547..cf163a14 100644 --- a/c++/mechanisms/liu/SlowSensor.hpp +++ b/c++/mechanisms/liu/SlowSensor.hpp @@ -58,6 +58,7 @@ class SlowSensor: public mechanism { if (isnan(m)) {m = 0;} if (isnan(h)) {h = 1;} + name = "SlowSensor"; } @@ -71,13 +72,10 @@ class SlowSensor: public mechanism { int getFullState(double * cont_state, int idx); double getState(int); - string getClass(void); + }; -string SlowSensor::getClass() { - return "SlowSensor"; -} double SlowSensor::getState(int idx){return X;} diff --git a/c++/mechanisms/oleary/IntegralController.hpp b/c++/mechanisms/oleary/IntegralController.hpp index 0d86b72c..f4db7639 100644 --- a/c++/mechanisms/oleary/IntegralController.hpp +++ b/c++/mechanisms/oleary/IntegralController.hpp @@ -46,6 +46,8 @@ class IntegralController: public mechanism { // if (tau_m<=0) {mexErrMsgTxt("[IntegralController] tau_m must be > 0. Perhaps you meant to set it to Inf?\n");} if (tau_g<=0) {mexErrMsgTxt("[IntegralController] tau_g must be > 0. Perhaps you meant to set it to Inf?\n");} + + name = "IntegralController"; } @@ -59,7 +61,7 @@ class IntegralController: public mechanism { int getFullState(double * cont_state, int idx); double getState(int); - string getClass(void); + }; @@ -86,7 +88,7 @@ void IntegralController::init() { // in the compartment that the controlled object is in for (int i = 0; i < n_mech; i++) { - string this_mech = temp_comp->getMechanismPointer(i)->getClass().c_str(); + string this_mech = temp_comp->getMechanismPointer(i)->name.c_str(); if (this_mech == "CalciumTarget") { if (verbosity==0) { @@ -104,10 +106,6 @@ void IntegralController::init() { } } -string IntegralController::getClass() { - return "IntegralController"; -} - double IntegralController::getState(int idx) { if (idx == 1) {return m;} @@ -148,7 +146,7 @@ void IntegralController::connectConductance(conductance * channel_) { - controlling_class = (channel_->getClass()).c_str(); + controlling_class = (channel_->name).c_str(); // attempt to read the area of the container that this // controller should be in. diff --git a/c++/mechanisms/prinz-temperature/CalciumMech.hpp b/c++/mechanisms/prinz-temperature/CalciumMech.hpp index 2f1c76ba..b08c1c36 100644 --- a/c++/mechanisms/prinz-temperature/CalciumMech.hpp +++ b/c++/mechanisms/prinz-temperature/CalciumMech.hpp @@ -40,6 +40,7 @@ class CalciumMech: public mechanism { Q_tau = Q_tau_; controlling_class = "unset"; + name = "CalciumMech"; } @@ -48,15 +49,10 @@ class CalciumMech: public mechanism { void connectCompartment(compartment*); - string getClass(void); + }; -string CalciumMech::getClass() { - return "CalciumMech"; -} - - // connection methods diff --git a/c++/mechanisms/prinz/CalciumMech.hpp b/c++/mechanisms/prinz/CalciumMech.hpp index 0d2cf1cb..9ca8e229 100644 --- a/c++/mechanisms/prinz/CalciumMech.hpp +++ b/c++/mechanisms/prinz/CalciumMech.hpp @@ -37,6 +37,7 @@ class CalciumMech: public mechanism { Ca_in = Ca_in_; controlling_class = "unset"; + name = "CalciumMech"; } @@ -49,16 +50,12 @@ class CalciumMech: public mechanism { void connectCompartment(compartment*); - string getClass(void); + void init(void); }; -string CalciumMech::getClass() { - return "CalciumMech"; -} - diff --git a/c++/mechanisms/soto-trevino/ProportionalController.hpp b/c++/mechanisms/soto-trevino/ProportionalController.hpp index 69d9d1bb..e9b82be5 100644 --- a/c++/mechanisms/soto-trevino/ProportionalController.hpp +++ b/c++/mechanisms/soto-trevino/ProportionalController.hpp @@ -47,6 +47,8 @@ class ProportionalController: public mechanism { if (isnan(tau_m)) {tau_m = 10e3;}; fullStateSize = 1; + + name = "ProportionalController"; } @@ -58,13 +60,11 @@ class ProportionalController: public mechanism { int getFullState(double * cont_state, int idx); double getState(int); - string getClass(void); + }; -string ProportionalController() { - return "ProportionalController"; -} + double ProportionalController::getState(int idx) { @@ -102,7 +102,7 @@ void ProportionalController::connect(conductance * channel_) { // make sure the compartment that we are in knows about us (channel->container)->addMechanism(this); - controlling_class = (channel_->getClass()).c_str(); + controlling_class = (channel_->name).c_str(); // attempt to read the area of the container that this // controller should be in. diff --git a/c++/mechanisms/traub/CalciumMech.hpp b/c++/mechanisms/traub/CalciumMech.hpp index 34a9bcf8..7182baf4 100644 --- a/c++/mechanisms/traub/CalciumMech.hpp +++ b/c++/mechanisms/traub/CalciumMech.hpp @@ -33,6 +33,7 @@ class CalciumMech: public mechanism { tau_Ca = tau_Ca_; controlling_class = "unset"; + name = "CalciumMech"; } @@ -45,14 +46,11 @@ class CalciumMech: public mechanism { void connectCompartment(compartment*); - string getClass(void); + }; -string CalciumMech::getClass() { - return "CalciumMech"; -} diff --git a/c++/mexTemplate.cpp b/c++/mexTemplate.cpp index bab27259..e130c755 100644 --- a/c++/mexTemplate.cpp +++ b/c++/mexTemplate.cpp @@ -223,7 +223,7 @@ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) idx = 0; for(int j = 0; j < n_comp; j++) { for (int k = 0; k < xolotl_network.comp[j]->n_syn; k++) { - int syn_size = (xolotl_network.comp[j]->getSynapsePointer(k))->getFullStateSize(); + int syn_size = (xolotl_network.comp[j]->getSynapsePointer(k))->fullStateSize; syn_sizes_out[idx] = syn_size; idx++; } diff --git a/c++/synapse.hpp b/c++/synapse.hpp index 1605087b..bb15c50c 100644 --- a/c++/synapse.hpp +++ b/c++/synapse.hpp @@ -40,6 +40,8 @@ class synapse { double temperature_ref = 11; double temperature = 11; + int fullStateSize = 0; + string name = "unset"; synapse() { @@ -54,8 +56,7 @@ class synapse { virtual void checkSolvers(int); virtual void connect(compartment*, compartment*) = 0;// tells compiler they will be overridden by derived class - virtual int getFullStateSize(void) = 0; - virtual int getFullState(double*, int) = 0; + virtual int getFullState(double*, int); virtual void init(void); @@ -91,12 +92,19 @@ This method checks whether the synapse can use the requested solver order to integrate its equations. If it can't, it should throw an error. */ -void synapse::checkSolvers(int k){ - mexErrMsgTxt("[synapse] Unsupported solver order\n"); +void synapse::checkSolvers(int k) { + if (k == 0) {return;} + else { + string txt = "Error using "; + txt += name; + txt += ". This synapse does not support this solver order. Try using x.solver_order = 0;"; + mexErrMsgTxt(txt.c_str()); + } } + /* This virtual method is a placeholder initialization method. Initialization methods are called after the model has been constructed, and all components @@ -106,4 +114,16 @@ good place to put code that you need to run once before the simulation. void synapse::init() {} +/* +This virtual method can be overridden to return the full state +of this synapse. +*/ +int synapse::getFullState(double* syn_state, int i) { + return i; +} + + + + + #endif diff --git a/c++/synapses/Axial.hpp b/c++/synapses/Axial.hpp index ed2e8f52..c7c2fd5e 100644 --- a/c++/synapses/Axial.hpp +++ b/c++/synapses/Axial.hpp @@ -26,10 +26,7 @@ class Axial: public synapse { void integrate(void); void connect(compartment *pcomp1_, compartment *pcomp2_); - int getFullState(double*, int); - int getFullStateSize(void); - void checkSolvers(int k); }; void Axial::integrate(void) { @@ -38,18 +35,7 @@ void Axial::integrate(void) { } -int Axial::getFullStateSize() {return 0; } -int Axial::getFullState(double *syn_state, int idx){ - return idx; -} - -void Axial::checkSolvers(int k){ - if (k == 0) { - return; - } - mexErrMsgTxt("[Axial] Unsupported solver order\n"); -} diff --git a/c++/synapses/Electrical.hpp b/c++/synapses/Electrical.hpp index c69b7e32..5c6936ff 100644 --- a/c++/synapses/Electrical.hpp +++ b/c++/synapses/Electrical.hpp @@ -19,9 +19,7 @@ class Electrical: public synapse { void integrate(void); void connect(compartment *pcomp1_, compartment *pcomp2_); - - int getFullState(double*, int); - int getFullStateSize(void); + void checkSolvers(int); }; void Electrical::integrate() { @@ -30,12 +28,10 @@ void Electrical::integrate() { g = gmax; } -int Electrical::getFullStateSize() { - return 0; -} -int Electrical::getFullState(double *syn_state, int idx) { - return idx; +// always works +void mechanism::checkSolvers(int k) { + return; } diff --git a/c++/synapses/borgers/AMPAergic.hpp b/c++/synapses/borgers/AMPAergic.hpp index a591ab87..4d973a50 100644 --- a/c++/synapses/borgers/AMPAergic.hpp +++ b/c++/synapses/borgers/AMPAergic.hpp @@ -28,6 +28,8 @@ class AMPAergic: public synapse { if (isnan (tau_r)) { tau_r = 1; } if (isnan (tau_d)) { tau_d = 1; } is_electrical = false; + + fullStateSize = 2; } // dynamics functions @@ -42,14 +44,11 @@ class AMPAergic: public synapse { void integrateMS(int, double, double); // output/connection functions - int getFullStateSize(void); void connect(compartment *pcomp1_, compartment *pcomp2_); - double getCurrent(double V_post); int getFullState(double*, int); }; -int AMPAergic::getFullStateSize() {return 2;} double AMPAergic::ss_core(double V_pre) { return (1.0 + tanh(V_pre/10.0))/2.0; diff --git a/c++/synapses/borgers/NMDAergic.hpp b/c++/synapses/borgers/NMDAergic.hpp index 0e72c7c3..15634e98 100644 --- a/c++/synapses/borgers/NMDAergic.hpp +++ b/c++/synapses/borgers/NMDAergic.hpp @@ -40,6 +40,8 @@ class NMDAergic: public synapse { if (isnan (tau_r)) { tau_r = 2; } if (isnan (tau_d)) { tau_d = 100; } is_electrical = false; + + fullStateSize = 3; } // dynamics functions @@ -54,16 +56,11 @@ class NMDAergic: public synapse { void integrateMS(int, double, double); // output/connection functions - int getFullStateSize(void); void connect(compartment *pcomp1_, compartment *pcomp2_); - double getCurrent(double V_post); int getFullState(double*, int); }; -int NMDAergic::getFullStateSize() { - return 3; -} // // // double NMDAergic::ss_core(double V_pre) { diff --git a/c++/synapses/cymbalyuk/Inhibitory.hpp b/c++/synapses/cymbalyuk/Inhibitory.hpp index 2c3d7a28..ceb331f3 100644 --- a/c++/synapses/cymbalyuk/Inhibitory.hpp +++ b/c++/synapses/cymbalyuk/Inhibitory.hpp @@ -37,12 +37,13 @@ class Inhibitory: public synapse { if (isnan (E)) { E = 0; } if (isnan (gmax)) { gmax = 0; } is_electrical = false; + + fullStateSize = 2; } void integrate(void); void checkSolvers(int); - int getFullStateSize(void); void connect(compartment *pcomp1_, compartment *pcomp2_); double getCurrent(double V_post); int getFullState(double*, int); @@ -51,9 +52,7 @@ class Inhibitory: public synapse { double m_inf(double); }; -int Inhibitory::getFullStateSize() { - return 2; -} + void Inhibitory::integrate(void) { // figure out the voltage of the pre-synaptic neuron diff --git a/c++/synapses/dayan-abbott/AlphaSynapse.hpp b/c++/synapses/dayan-abbott/AlphaSynapse.hpp index b447545c..5d2a2251 100644 --- a/c++/synapses/dayan-abbott/AlphaSynapse.hpp +++ b/c++/synapses/dayan-abbott/AlphaSynapse.hpp @@ -38,6 +38,8 @@ class AlphaSynapse: public synapse { if (isnan (E)) { E = 0; } if (isnan (gmax)) { gmax = 0; } is_electrical = false; + + fullStateSize = 2; } void integrate(void); @@ -49,9 +51,6 @@ class AlphaSynapse: public synapse { int getFullState(double*, int); }; -int AlphaSynapse::getFullStateSize() { - return 2; -} diff --git a/c++/synapses/generic/Graded.hpp b/c++/synapses/generic/Graded.hpp index 20d253f8..f2a845d8 100644 --- a/c++/synapses/generic/Graded.hpp +++ b/c++/synapses/generic/Graded.hpp @@ -32,6 +32,8 @@ class Graded: public synapse { if (isnan (Vth)) { Vth = -35.0; } if (isnan (tau)) { tau = 100; } is_electrical = false; + + fullStateSize = 2; } void integrate(void); @@ -48,9 +50,6 @@ class Graded: public synapse { int getFullState(double*, int); }; -int Graded::getFullStateSize() { - return 2; -} double Graded::s_inf(double V_pre) {return 1.0/(1.0+exp((Vth - V_pre)/Delta));} diff --git a/c++/synapses/nadim/A2ASynapse.hpp b/c++/synapses/nadim/A2ASynapse.hpp index 64928273..fdcd962e 100644 --- a/c++/synapses/nadim/A2ASynapse.hpp +++ b/c++/synapses/nadim/A2ASynapse.hpp @@ -26,13 +26,14 @@ class A2ASynapse: public synapse { if (isnan (gmax)) { gmax = 0; } is_electrical = false; + fullStateSize = 2; + } void integrate(void); void connect(compartment *pcomp1_, compartment *pcomp2_); int getFullState(double*, int); - int getFullStateSize(void); }; void A2ASynapse::integrate() { @@ -66,7 +67,6 @@ int A2ASynapse::getFullState(double *syn_state, int idx) { } -int A2ASynapse::getFullStateSize(){return 2;} void A2ASynapse::connect(compartment *pcomp1_, compartment *pcomp2_) { diff --git a/c++/synapses/nadim/NeuriteSyn.hpp b/c++/synapses/nadim/NeuriteSyn.hpp index 51b59b6c..b907bc2c 100644 --- a/c++/synapses/nadim/NeuriteSyn.hpp +++ b/c++/synapses/nadim/NeuriteSyn.hpp @@ -26,13 +26,15 @@ class NeuriteSyn: public synapse { if (isnan (gmax)) { gmax = 0; } is_electrical = false; + fullStateSize = 2; + } void integrate(void); void connect(compartment *pcomp1_, compartment *pcomp2_); int getFullState(double*, int); - int getFullStateSize(void); + }; void NeuriteSyn::integrate(void) { @@ -65,9 +67,6 @@ int NeuriteSyn::getFullState(double *syn_state, int idx) { } -int NeuriteSyn::getFullStateSize() { - return 2; -} void NeuriteSyn::connect(compartment *pcomp1_, compartment *pcomp2_) { diff --git a/c++/synapses/nadim/Soma.hpp b/c++/synapses/nadim/Soma.hpp index 3b1a4232..0da67767 100644 --- a/c++/synapses/nadim/Soma.hpp +++ b/c++/synapses/nadim/Soma.hpp @@ -26,13 +26,15 @@ class Soma: public synapse { if (isnan (gmax)) { gmax = 0; } is_electrical = false; + fullStateSize = 2; + } void integrate(void); void connect(compartment *pcomp1_, compartment *pcomp2_); int getFullState(double*, int); - int getFullStateSize(void); + }; void Soma::integrate(void) { @@ -65,9 +67,6 @@ int Soma::getFullState(double *syn_state, int idx) { } -int Soma::getFullStateSize() { - return 2; -} void Soma::connect(compartment *pcomp1_, compartment *pcomp2_) { diff --git a/c++/synapses/nadim98/GenericSynapse.hpp b/c++/synapses/nadim98/GenericSynapse.hpp index a5c4d277..cad3296c 100644 --- a/c++/synapses/nadim98/GenericSynapse.hpp +++ b/c++/synapses/nadim98/GenericSynapse.hpp @@ -34,6 +34,8 @@ class GenericSynapse: public synapse { if (isnan (gmax)) { gmax = -80; } is_electrical = false; + fullStateSize = 2; + } void integrate(void); @@ -46,12 +48,10 @@ class GenericSynapse: public synapse { void connect(compartment *pcomp1_, compartment *pcomp2_); int getFullState(double*, int); - int getFullStateSize(void); + }; -int GenericSynapse::getFullStateSize() { - return 2; -} + double GenericSynapse::s_inf(double V_pre) { diff --git a/c++/synapses/prinz-temperature/Cholinergic.hpp b/c++/synapses/prinz-temperature/Cholinergic.hpp index 44d61ce6..4cf0ea20 100644 --- a/c++/synapses/prinz-temperature/Cholinergic.hpp +++ b/c++/synapses/prinz-temperature/Cholinergic.hpp @@ -39,6 +39,8 @@ class Cholinergic: public synapse { if (isnan (gmax)) { gmax = 0; } is_electrical = false; + + fullStateSize = 2; } void integrate(void); @@ -49,36 +51,29 @@ class Cholinergic: public synapse { double tau_s(double); double sdot(double, double); - int getFullStateSize(void); + void connect(compartment *pcomp1_, compartment *pcomp2_); double getCurrent(double V_post); int getFullState(double*, int); }; -int Cholinergic::getFullStateSize() -{ - return 2; -} -double Cholinergic::s_inf(double V_pre) -{ + +double Cholinergic::s_inf(double V_pre) { return 1.0/(1.0+exp((Vth - V_pre)/Delta)); } -double Cholinergic::tau_s(double sinf_) -{ +double Cholinergic::tau_s(double sinf_) { return (1 - sinf_)/k_; } -double Cholinergic::sdot(double V_pre, double s_) -{ +double Cholinergic::sdot(double V_pre, double s_) { double sinf = s_inf(V_pre); return (sinf - s_)/tau_s(sinf); } -void Cholinergic::integrate(void) -{ +void Cholinergic::integrate(void) { // figure out the voltage of the pre-synaptic neuron double V_pre = pre_syn->V; double sinf = s_inf(V_pre); @@ -90,8 +85,7 @@ void Cholinergic::integrate(void) } -void Cholinergic::integrateMS(int k, double V, double Ca) -{ +void Cholinergic::integrateMS(int k, double V, double Ca) { double V_pre; @@ -140,7 +134,6 @@ void Cholinergic::checkSolvers(int k){ int Cholinergic::getFullState(double *syn_state, int idx) { // give it the current synapse variable syn_state[idx] = s; - idx++; // also return the current from this synapse diff --git a/c++/synapses/prinz-temperature/Glutamatergic.hpp b/c++/synapses/prinz-temperature/Glutamatergic.hpp index 43870acc..88467bb1 100644 --- a/c++/synapses/prinz-temperature/Glutamatergic.hpp +++ b/c++/synapses/prinz-temperature/Glutamatergic.hpp @@ -38,6 +38,8 @@ class Glutamatergic: public synapse { if (isnan (gmax)) { gmax = 0; } is_electrical = false; + fullStateSize = 2; + } void integrate(void); @@ -50,33 +52,25 @@ class Glutamatergic: public synapse { void connect(compartment *pcomp1_, compartment *pcomp2_); int getFullState(double*, int); - int getFullStateSize(void); }; -int Glutamatergic::getFullStateSize() -{ - return 2; -} -double Glutamatergic::s_inf(double V_pre) -{ + +double Glutamatergic::s_inf(double V_pre) { return 1.0/(1.0+exp((Vth - V_pre)/Delta)); } -double Glutamatergic::tau_s(double sinf_) -{ +double Glutamatergic::tau_s(double sinf_) { return (1 - sinf_)/k_; } -double Glutamatergic::sdot(double V_pre, double s_) -{ +double Glutamatergic::sdot(double V_pre, double s_) { double sinf = s_inf(V_pre); return (sinf - s_)/tau_s(sinf); } -void Glutamatergic::integrate(void) -{ +void Glutamatergic::integrate(void) { // figure out the voltage of the pre-synaptic neuron double V_pre = pre_syn->V; double sinf = s_inf(V_pre); @@ -88,8 +82,7 @@ void Glutamatergic::integrate(void) } -void Glutamatergic::integrateMS(int k, double V, double Ca) -{ +void Glutamatergic::integrateMS(int k, double V, double Ca) { double V_pre; diff --git a/c++/synapses/prinz/Cholinergic.hpp b/c++/synapses/prinz/Cholinergic.hpp index cf0aca19..a5596cfb 100644 --- a/c++/synapses/prinz/Cholinergic.hpp +++ b/c++/synapses/prinz/Cholinergic.hpp @@ -34,6 +34,9 @@ class Cholinergic: public synapse { if (isnan (gmax)) { gmax = 0; } if (isnan (Vth)) { Vth = -35.0; } + + fullStateSize = 2; + } void integrate(void); @@ -46,15 +49,11 @@ class Cholinergic: public synapse { void init(void); - int getFullStateSize(void); void connect(compartment *pcomp1_, compartment *pcomp2_); double getCurrent(double V_post); int getFullState(double*, int); }; -int Cholinergic::getFullStateSize() { - return 2; -} void Cholinergic::init() { // build a LUT @@ -69,9 +68,6 @@ void Cholinergic::init() { } - - - double Cholinergic::s_inf(double V_pre) {return 1.0/(1.0+exp((Vth - V_pre)/Delta));} double Cholinergic::tau_s(double sinf_) {return (1 - sinf_)/k_;} diff --git a/c++/synapses/prinz/Glutamatergic.hpp b/c++/synapses/prinz/Glutamatergic.hpp index b6356f52..7bdd7b1e 100644 --- a/c++/synapses/prinz/Glutamatergic.hpp +++ b/c++/synapses/prinz/Glutamatergic.hpp @@ -31,6 +31,8 @@ class Glutamatergic: public synapse { if (isnan (s)) { s = 0; } if (isnan (gmax)) { gmax = 0; } + fullStateSize = 2; + } void integrate(void); @@ -44,12 +46,9 @@ class Glutamatergic: public synapse { void connect(compartment *pcomp1_, compartment *pcomp2_); int getFullState(double*, int); - int getFullStateSize(void); + }; -int Glutamatergic::getFullStateSize() { - return 2; -} double Glutamatergic::s_inf(double V_pre) { diff --git a/docs/how-to/make-own-models.md b/docs/how-to/make-own-models.md index 45c49a7f..53159b5f 100644 --- a/docs/how-to/make-own-models.md +++ b/docs/how-to/make-own-models.md @@ -118,17 +118,17 @@ public: // allow this channel to be approximated? AllowMInfApproximation = true; // or false if not AllowHInfApproximation = true; + + name = "NewCond"; } double m_inf(double, double); double h_inf(double, double); double tau_m(double, double); double tau_h(double, double); - string getClass(void); + }; -string NewCond::getClass(){return "NewCond";} - double NewCond::m_inf(double V, double Ca) {return ...;} double NewCond::h_inf(double V, double Ca) {return ...;} @@ -192,6 +192,7 @@ public: A = A_; B = B_; controlling_class = "unset"; + name = "NewMech"; } void integrate(void); @@ -285,6 +286,8 @@ public: if (isnan (s)) { s = 0; } if (isnan (gmax)) { gmax = 0; } is_electrical = false; + + name = "NewSynapse"; } // all of these functions are needed for all synapses @@ -374,7 +377,7 @@ void NewSynapse::connect(compartment *pcomp1_, compartment *pcomp2_) { All conductances (and any other network component) are defined by an `.hpp` header file. **You can save your -new conductance anywhere within your MATLAB path.** +new conductance anywhere on your MATLAB path.** `cpplab` will find them, link them, and use them automatically. If `cpplab` can't find them, then running `xolotl.rebuildCache` should fix it. diff --git a/docs/reference/c++/compartment.md b/docs/reference/c++/compartment.md index cce49d79..38010135 100644 --- a/docs/reference/c++/compartment.md +++ b/docs/reference/c++/compartment.md @@ -166,7 +166,7 @@ It does the following things: 1. Adds a pointer to the conductance to a vector of pointers called `mech` 2. Updates various attributes of the conductance like verbosity, etc. 3. Tells the mechanism what its ordering in `mech` is by updating `mechanism_idx` in that mechanism object -4. Determines the data frame size of this object by calling `getFullStateSize` and storing this in `mechanism_sizes` +4. Determines the data frame size of this object by reading out `fullStateSize` and storing this in `mechanism_sizes` **See Also** diff --git a/docs/reference/c++/conductance.md b/docs/reference/c++/conductance.md index d969caea..4868e234 100644 --- a/docs/reference/c++/conductance.md +++ b/docs/reference/c++/conductance.md @@ -113,7 +113,7 @@ a little more memory, but can be much faster. **Code** -[Click here to view this method's code](https://github.com/sg-s/xolotl/blob/master/c%2B%2B/conductance.hpp#L210) +[Click here to view this method's code](https://github.com/sg-s/xolotl/blob/master/c%2B%2B/conductance.hpp#L211) ------- @@ -140,7 +140,7 @@ number is raised to be an integer (0-8) **Code** -[Click here to view this method's code](https://github.com/sg-s/xolotl/blob/master/c%2B%2B/conductance.hpp#L278) +[Click here to view this method's code](https://github.com/sg-s/xolotl/blob/master/c%2B%2B/conductance.hpp#L279) ------- @@ -165,7 +165,7 @@ but is less precise **Code** -[Click here to view this method's code](https://github.com/sg-s/xolotl/blob/master/c%2B%2B/conductance.hpp#L318) +[Click here to view this method's code](https://github.com/sg-s/xolotl/blob/master/c%2B%2B/conductance.hpp#L319) ------- @@ -191,7 +191,7 @@ this channel at this moment. **Code** -[Click here to view this method's code](https://github.com/sg-s/xolotl/blob/master/c%2B%2B/conductance.hpp#L333) +[Click here to view this method's code](https://github.com/sg-s/xolotl/blob/master/c%2B%2B/conductance.hpp#L334) ------- @@ -213,7 +213,7 @@ void checkSolvers(int solver_order) **Code** -[Click here to view this method's code](https://github.com/sg-s/xolotl/blob/master/c%2B%2B/conductance.hpp#L339) +[Click here to view this method's code](https://github.com/sg-s/xolotl/blob/master/c%2B%2B/conductance.hpp#L340) ------- @@ -237,7 +237,7 @@ of this conductance. This definition is used when `integrateMS` is used. **Code** -[Click here to view this method's code](https://github.com/sg-s/xolotl/blob/master/c%2B%2B/conductance.hpp#L354) +[Click here to view this method's code](https://github.com/sg-s/xolotl/blob/master/c%2B%2B/conductance.hpp#L355) ------- @@ -261,7 +261,7 @@ of this conductance. This definition is used when `integrateMS` is used. **Code** -[Click here to view this method's code](https://github.com/sg-s/xolotl/blob/master/c%2B%2B/conductance.hpp#L362) +[Click here to view this method's code](https://github.com/sg-s/xolotl/blob/master/c%2B%2B/conductance.hpp#L363) ------- @@ -286,7 +286,7 @@ the channel object. **Code** -[Click here to view this method's code](https://github.com/sg-s/xolotl/blob/master/c%2B%2B/conductance.hpp#L371) +[Click here to view this method's code](https://github.com/sg-s/xolotl/blob/master/c%2B%2B/conductance.hpp#L372) ------- @@ -311,7 +311,7 @@ the channel object. **Code** -[Click here to view this method's code](https://github.com/sg-s/xolotl/blob/master/c%2B%2B/conductance.hpp#L378) +[Click here to view this method's code](https://github.com/sg-s/xolotl/blob/master/c%2B%2B/conductance.hpp#L379) ------- @@ -337,7 +337,7 @@ the channel object. **Code** -[Click here to view this method's code](https://github.com/sg-s/xolotl/blob/master/c%2B%2B/conductance.hpp#L386) +[Click here to view this method's code](https://github.com/sg-s/xolotl/blob/master/c%2B%2B/conductance.hpp#L387) ------- @@ -363,7 +363,7 @@ the channel object. **Code** -[Click here to view this method's code](https://github.com/sg-s/xolotl/blob/master/c%2B%2B/conductance.hpp#L394) +[Click here to view this method's code](https://github.com/sg-s/xolotl/blob/master/c%2B%2B/conductance.hpp#L395) ------- @@ -393,7 +393,7 @@ SIAM Rev., 6(3), 260–264. **Code** -[Click here to view this method's code](https://github.com/sg-s/xolotl/blob/master/c%2B%2B/conductance.hpp#L410) +[Click here to view this method's code](https://github.com/sg-s/xolotl/blob/master/c%2B%2B/conductance.hpp#L411) ------- @@ -448,7 +448,7 @@ double conductance::gaussrand() { **Code** -[Click here to view this method's code](https://github.com/sg-s/xolotl/blob/master/c%2B%2B/conductance.hpp#L435) +[Click here to view this method's code](https://github.com/sg-s/xolotl/blob/master/c%2B%2B/conductance.hpp#L436) ------- @@ -473,7 +473,7 @@ so the channel knows which compartment contains it. **Code** -[Click here to view this method's code](https://github.com/sg-s/xolotl/blob/master/c%2B%2B/conductance.hpp#L447) +[Click here to view this method's code](https://github.com/sg-s/xolotl/blob/master/c%2B%2B/conductance.hpp#L448) ------- @@ -499,7 +499,7 @@ good place to put code that you need to run once before the simulation. **Code** -[Click here to view this method's code](https://github.com/sg-s/xolotl/blob/master/c%2B%2B/conductance.hpp#L459) +[Click here to view this method's code](https://github.com/sg-s/xolotl/blob/master/c%2B%2B/conductance.hpp#L460) ------- @@ -539,7 +539,7 @@ conductance. **Code** -[Click here to view this method's code](https://github.com/sg-s/xolotl/blob/master/c%2B%2B/conductance.hpp#L505) +[Click here to view this method's code](https://github.com/sg-s/xolotl/blob/master/c%2B%2B/conductance.hpp#L506) ------- @@ -577,7 +577,7 @@ and the area of the compartment. **Code** -[Click here to view this method's code](https://github.com/sg-s/xolotl/blob/master/c%2B%2B/conductance.hpp#L607) +[Click here to view this method's code](https://github.com/sg-s/xolotl/blob/master/c%2B%2B/conductance.hpp#L608) ------- @@ -615,7 +615,7 @@ are calculated and stored. At each step, the derivative functions **Code** -[Click here to view this method's code](https://github.com/sg-s/xolotl/blob/master/c%2B%2B/conductance.hpp#L708) +[Click here to view this method's code](https://github.com/sg-s/xolotl/blob/master/c%2B%2B/conductance.hpp#L709) ------- diff --git a/docs/reference/c++/synapse.md b/docs/reference/c++/synapse.md index 0a07cf11..ff5f1a39 100644 --- a/docs/reference/c++/synapse.md +++ b/docs/reference/c++/synapse.md @@ -36,7 +36,7 @@ synapse type. **Code** -[Click here to view this method's code](https://github.com/sg-s/xolotl/blob/master/c%2B%2B/synapse.hpp#L72) +[Click here to view this method's code](https://github.com/sg-s/xolotl/blob/master/c%2B%2B/synapse.hpp#L73) ------- @@ -64,7 +64,7 @@ synapse type. **Code** -[Click here to view this method's code](https://github.com/sg-s/xolotl/blob/master/c%2B%2B/synapse.hpp#L84) +[Click here to view this method's code](https://github.com/sg-s/xolotl/blob/master/c%2B%2B/synapse.hpp#L85) ------- @@ -75,7 +75,7 @@ synapse type. **Function Signature** ```C++ -void checkSolvers(int k) +void checkSolvers(int k) ``` **Description** @@ -89,7 +89,7 @@ should throw an error. **Code** -[Click here to view this method's code](https://github.com/sg-s/xolotl/blob/master/c%2B%2B/synapse.hpp#L94) +[Click here to view this method's code](https://github.com/sg-s/xolotl/blob/master/c%2B%2B/synapse.hpp#L95) ------- @@ -115,7 +115,31 @@ good place to put code that you need to run once before the simulation. **Code** -[Click here to view this method's code](https://github.com/sg-s/xolotl/blob/master/c%2B%2B/synapse.hpp#L106) +[Click here to view this method's code](https://github.com/sg-s/xolotl/blob/master/c%2B%2B/synapse.hpp#L114) + +------- + + + +### getFullState + +**Function Signature** + +```C++ +int getFullState(double* syn_state, int i) +``` + +**Description** + + +This virtual method can be overridden to return the full state +of this synapse. + + + + **Code** + +[Click here to view this method's code](https://github.com/sg-s/xolotl/blob/master/c%2B%2B/synapse.hpp#L121) ------- From dd5fc0b0a4f62a17c8b920df16da0436f2ef11c2 Mon Sep 17 00:00:00 2001 From: Srinivas Gorur-Shandilya Date: Sat, 12 Dec 2020 13:04:34 -0500 Subject: [PATCH 3/4] fixed a bug in one of the channels --- c++/conductances/soto-trevino05/AB/CaTAB.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/c++/conductances/soto-trevino05/AB/CaTAB.hpp b/c++/conductances/soto-trevino05/AB/CaTAB.hpp index c0d68407..5a0dc215 100644 --- a/c++/conductances/soto-trevino05/AB/CaTAB.hpp +++ b/c++/conductances/soto-trevino05/AB/CaTAB.hpp @@ -30,7 +30,7 @@ class CaTAB: public conductance { if (isnan (E)) { E = 50; } name = "CaTAB"; - is_calicum = true; + is_calcium = true; } From 80ae5c0426d5b6fa55f4663a9c82db9423268a19 Mon Sep 17 00:00:00 2001 From: Srinivas Gorur-Shandilya Date: Sat, 12 Dec 2020 13:22:19 -0500 Subject: [PATCH 4/4] fixed some minor bugs --- @xtest/xtest.m | 4 ++-- c++/conductances/liu/Kd.hpp | 2 +- examples/demo_clamp.m | 2 +- examples/demo_controlling_integration.m | 13 ++++++++----- examples/demo_multi_compartment_clamp.m | 6 ++++-- 5 files changed, 16 insertions(+), 11 deletions(-) diff --git a/@xtest/xtest.m b/@xtest/xtest.m index c41260c5..4118ea7c 100644 --- a/@xtest/xtest.m +++ b/@xtest/xtest.m @@ -4,9 +4,9 @@ properties % xolotl objects - single_comp@xolotl + single_comp (1,1) xolotl - stg_network@xolotl + stg_network (1,1) xolotl diff --git a/c++/conductances/liu/Kd.hpp b/c++/conductances/liu/Kd.hpp index 2acfef78..8aca34f9 100644 --- a/c++/conductances/liu/Kd.hpp +++ b/c++/conductances/liu/Kd.hpp @@ -14,7 +14,7 @@ class Kd: public conductance { public: - //specify both gbar and erev and initial conditions + //specify both gbar and E_rev and initial conditions Kd(double gbar_, double E_, double m_) { gbar = gbar_; diff --git a/examples/demo_clamp.m b/examples/demo_clamp.m index 07540ca4..dd481cc9 100644 --- a/examples/demo_clamp.m +++ b/examples/demo_clamp.m @@ -23,7 +23,7 @@ % make a note of what the actual activation curve is -f = x.AB.Kd.cpp_child_functions(3).fun_handle; +f = x.AB.Kd.cpp_child_functions(1).fun_handle; all_V_step = linspace(-80,50,30); actual_m_inf = NaN*all_V_step; for i = 1:length(all_V_step) diff --git a/examples/demo_controlling_integration.m b/examples/demo_controlling_integration.m index 798606fc..8c45e21a 100644 --- a/examples/demo_controlling_integration.m +++ b/examples/demo_controlling_integration.m @@ -21,11 +21,6 @@ x.AB.Kd.add('oleary/IntegralController','tau_m',2000); x.AB.HCurrent.add('oleary/IntegralController','tau_m',125000); -x.closed_loop = false; -x.t_end = 1e6; -x.dt = .1; -x.sim_dt = .1; - % try to download a binary % so that people without compilers can use this too @@ -38,6 +33,14 @@ end +x.closed_loop = false; +x.t_end = 1e6; +x.dt = .1; +x.sim_dt = .1; + + + + % normal output type, variables separated x.output_type = 0; [V,Ca] = x.integrate; diff --git a/examples/demo_multi_compartment_clamp.m b/examples/demo_multi_compartment_clamp.m index 634e0a33..da473872 100644 --- a/examples/demo_multi_compartment_clamp.m +++ b/examples/demo_multi_compartment_clamp.m @@ -9,8 +9,6 @@ x.dt = .01; x.sim_dt = .01; -x.closed_loop = false; - % try to download a binary % so that people without compilers can use this too try @@ -23,6 +21,10 @@ +x.closed_loop = false; + + + V = x.integrate; time = (1:length(V))*x.dt*1e-3;