Skip to content

Commit

Permalink
fixed #488
Browse files Browse the repository at this point in the history
they now compile

diff --git a/c++/synapses/nadim/A2ASynapse.hpp b/c++/synapses/nadim/A2ASynapse.hpp
index 93586f1..35449ef 100644
--- a/c++/synapses/nadim/A2ASynapse.hpp
+++ b/c++/synapses/nadim/A2ASynapse.hpp
@@ -7,6 +7,10 @@ class A2ASynapse: public synapse {

 public:

+    double Delta;
+    double Vth;
+    double k_;
+
     // specify parameters + initial conditions
     A2ASynapse(double g_, double s_)
     {
@@ -24,14 +28,14 @@ public:

     }

-    void integrate(double dt);
+    void integrate(void);

     void connect(compartment *pcomp1_, compartment *pcomp2_);
     int getFullState(double*, int);
     int getFullStateSize(void);
 };

-void A2ASynapse::integrate(double dt) {
+void A2ASynapse::integrate() {

     // figure out the voltage of the pre-synaptic neuron
     double V_pre = pre_syn->V;
@@ -40,11 +44,12 @@ void A2ASynapse::integrate(double dt) {
     double s_inf = 1.0/(1.0+exp((Vth - V_pre)/Delta));

     // integrate using exponential Euler
-    double tau_s = 100.0/(1.0+exp((Vth - V_pre)/k_);
+    double tau_s = 100.0/(1.0+exp((Vth - V_pre)/k_));

     s = s_inf + (s - s_inf)*exp(-dt/tau_s);

+    g = gmax*s;

 }

diff --git a/c++/synapses/nadim/NeuriteSyn.hpp b/c++/synapses/nadim/NeuriteSyn.hpp
index e570fcf..3fbd8c0 100644
--- a/c++/synapses/nadim/NeuriteSyn.hpp
+++ b/c++/synapses/nadim/NeuriteSyn.hpp
@@ -7,6 +7,10 @@ class NeuriteSyn: public synapse {

 public:

+    double Delta;
+    double Vth;
+    double k_;
+
     // specify parameters + initial conditions
     NeuriteSyn(double g_, double s_)
     {
@@ -24,15 +28,14 @@ public:

     }

-    void integrate(double dt);
+    void integrate(void);

     void connect(compartment *pcomp1_, compartment *pcomp2_);
     int getFullState(double*, int);
     int getFullStateSize(void);
 };

-void NeuriteSyn::integrate(double dt)
-{
+void NeuriteSyn::integrate(void) {

     // figure out the voltage of the pre-synaptic neuron
     double V_pre = pre_syn->V;
@@ -45,13 +48,12 @@ void NeuriteSyn::integrate(double dt)

     s = s_inf + (s - s_inf)*exp(-dt/tau_s);

-
+    g = gmax*s;

 }

-int NeuriteSyn::getFullState(double *syn_state, int idx)
-{
+int NeuriteSyn::getFullState(double *syn_state, int idx) {
     // give it the current synapse variable
     syn_state[idx] = s;
     idx++;
@@ -63,14 +65,12 @@ int NeuriteSyn::getFullState(double *syn_state, int idx)
 }

-int NeuriteSyn::getFullStateSize()
-{
+int NeuriteSyn::getFullStateSize() {
     return 2;
 }

-void NeuriteSyn::connect(compartment *pcomp1_, compartment *pcomp2_)
-{
+void NeuriteSyn::connect(compartment *pcomp1_, compartment *pcomp2_) {
     pre_syn = pcomp1_;
     post_syn = pcomp2_;

diff --git a/c++/synapses/nadim/Soma.hpp b/c++/synapses/nadim/Soma.hpp
index c4ff9ba..831f474 100644
--- a/c++/synapses/nadim/Soma.hpp
+++ b/c++/synapses/nadim/Soma.hpp
@@ -7,6 +7,10 @@ class Soma: public synapse {

 public:

+    double Delta;
+    double Vth;
+    double k_;
+
     // specify parameters + initial conditions
     Soma(double g_, double s_)
     {
@@ -24,15 +28,14 @@ public:

     }

-    void integrate(double dt);
+    void integrate(void);

     void connect(compartment *pcomp1_, compartment *pcomp2_);
     int getFullState(double*, int);
     int getFullStateSize(void);
 };

-void Soma::integrate(double dt)
-{
+void Soma::integrate(void) {

     // figure out the voltage of the pre-synaptic neuron
     double V_pre = pre_syn->V;
@@ -41,17 +44,16 @@ void Soma::integrate(double dt)
     double s_inf = 1.0/(1.0+exp((Vth - V_pre)/Delta));

     // integrate using exponential Euler
-    double tau_s = 100.0/(1.0+exp((Vth - V_pre)/k_);
+    double tau_s = 100.0/(1.0+exp((Vth - V_pre)/k_));

     s = s_inf + (s - s_inf)*exp(-dt/tau_s);

-
+    g = gmax*s;

 }

-int Soma::getFullState(double *syn_state, int idx)
-{
+int Soma::getFullState(double *syn_state, int idx) {
     // give it the current synapse variable
     syn_state[idx] = s;
     idx++;
@@ -63,14 +65,12 @@ int Soma::getFullState(double *syn_state, int idx)
 }

-int Soma::getFullStateSize()
-{
+int Soma::getFullStateSize() {
     return 2;
 }

-void Soma::connect(compartment *pcomp1_, compartment *pcomp2_)
-{
+void Soma::connect(compartment *pcomp1_, compartment *pcomp2_) {
     pre_syn = pcomp1_;
     post_syn = pcomp2_;
  • Loading branch information
sg-s committed Mar 5, 2020
1 parent 231f14c commit c422d27
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 24 deletions.
11 changes: 8 additions & 3 deletions c++/synapses/nadim/A2ASynapse.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ class A2ASynapse: public synapse {

public:

double Delta;
double Vth;
double k_;

// specify parameters + initial conditions
A2ASynapse(double g_, double s_)
{
Expand All @@ -24,14 +28,14 @@ class A2ASynapse: public synapse {

}

void integrate(double dt);
void integrate(void);

void connect(compartment *pcomp1_, compartment *pcomp2_);
int getFullState(double*, int);
int getFullStateSize(void);
};

void A2ASynapse::integrate(double dt) {
void A2ASynapse::integrate() {

// figure out the voltage of the pre-synaptic neuron
double V_pre = pre_syn->V;
Expand All @@ -40,11 +44,12 @@ void A2ASynapse::integrate(double dt) {
double s_inf = 1.0/(1.0+exp((Vth - V_pre)/Delta));

// integrate using exponential Euler
double tau_s = 100.0/(1.0+exp((Vth - V_pre)/k_);
double tau_s = 100.0/(1.0+exp((Vth - V_pre)/k_));

s = s_inf + (s - s_inf)*exp(-dt/tau_s);


g = gmax*s;

}

Expand Down
20 changes: 10 additions & 10 deletions c++/synapses/nadim/NeuriteSyn.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ class NeuriteSyn: public synapse {

public:

double Delta;
double Vth;
double k_;

// specify parameters + initial conditions
NeuriteSyn(double g_, double s_)
{
Expand All @@ -24,15 +28,14 @@ class NeuriteSyn: public synapse {

}

void integrate(double dt);
void integrate(void);

void connect(compartment *pcomp1_, compartment *pcomp2_);
int getFullState(double*, int);
int getFullStateSize(void);
};

void NeuriteSyn::integrate(double dt)
{
void NeuriteSyn::integrate(void) {

// figure out the voltage of the pre-synaptic neuron
double V_pre = pre_syn->V;
Expand All @@ -45,13 +48,12 @@ void NeuriteSyn::integrate(double dt)

s = s_inf + (s - s_inf)*exp(-dt/tau_s);


g = gmax*s;

}


int NeuriteSyn::getFullState(double *syn_state, int idx)
{
int NeuriteSyn::getFullState(double *syn_state, int idx) {
// give it the current synapse variable
syn_state[idx] = s;
idx++;
Expand All @@ -63,14 +65,12 @@ int NeuriteSyn::getFullState(double *syn_state, int idx)
}


int NeuriteSyn::getFullStateSize()
{
int NeuriteSyn::getFullStateSize() {
return 2;
}


void NeuriteSyn::connect(compartment *pcomp1_, compartment *pcomp2_)
{
void NeuriteSyn::connect(compartment *pcomp1_, compartment *pcomp2_) {
pre_syn = pcomp1_;
post_syn = pcomp2_;

Expand Down
22 changes: 11 additions & 11 deletions c++/synapses/nadim/Soma.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ class Soma: public synapse {

public:

double Delta;
double Vth;
double k_;

// specify parameters + initial conditions
Soma(double g_, double s_)
{
Expand All @@ -24,15 +28,14 @@ class Soma: public synapse {

}

void integrate(double dt);
void integrate(void);

void connect(compartment *pcomp1_, compartment *pcomp2_);
int getFullState(double*, int);
int getFullStateSize(void);
};

void Soma::integrate(double dt)
{
void Soma::integrate(void) {

// figure out the voltage of the pre-synaptic neuron
double V_pre = pre_syn->V;
Expand All @@ -41,17 +44,16 @@ void Soma::integrate(double dt)
double s_inf = 1.0/(1.0+exp((Vth - V_pre)/Delta));

// integrate using exponential Euler
double tau_s = 100.0/(1.0+exp((Vth - V_pre)/k_);
double tau_s = 100.0/(1.0+exp((Vth - V_pre)/k_));

s = s_inf + (s - s_inf)*exp(-dt/tau_s);


g = gmax*s;

}


int Soma::getFullState(double *syn_state, int idx)
{
int Soma::getFullState(double *syn_state, int idx) {
// give it the current synapse variable
syn_state[idx] = s;
idx++;
Expand All @@ -63,14 +65,12 @@ int Soma::getFullState(double *syn_state, int idx)
}


int Soma::getFullStateSize()
{
int Soma::getFullStateSize() {
return 2;
}


void Soma::connect(compartment *pcomp1_, compartment *pcomp2_)
{
void Soma::connect(compartment *pcomp1_, compartment *pcomp2_) {
pre_syn = pcomp1_;
post_syn = pcomp2_;

Expand Down

0 comments on commit c422d27

Please sign in to comment.