Skip to content

Commit 9893f6e

Browse files
authored
Update for '1uc/nonspecific_current'. (#4)
1 parent b277a26 commit 9893f6e

File tree

9 files changed

+695
-0
lines changed

9 files changed

+695
-0
lines changed

cnexp_array/neuron/leonhard.cpp

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,14 @@ namespace neuron {
100100
};
101101

102102

103+
struct leonhard_NodeData {
104+
int const * nodeindices;
105+
double const * node_voltages;
106+
double * node_rhs;
107+
int nodecount;
108+
};
109+
110+
103111
static leonhard_Instance make_instance_leonhard(_nrn_mechanism_cache_range& _ml) {
104112
return leonhard_Instance {
105113
_ml.template data_array_ptr<0, 3>(),
@@ -113,6 +121,16 @@ namespace neuron {
113121
}
114122

115123

124+
static leonhard_NodeData make_node_data_leonhard(NrnThread& _nt, Memb_list& _ml_arg) {
125+
return leonhard_NodeData {
126+
_ml_arg.nodeindices,
127+
_nt.node_voltage_storage(),
128+
_nt.node_rhs_storage(),
129+
_ml_arg.nodecount
130+
};
131+
}
132+
133+
116134
static void nrn_alloc_leonhard(Prop* _prop) {
117135
Prop *prop_ion{};
118136
Datum *_ppvar{};
@@ -165,6 +183,7 @@ namespace neuron {
165183
void nrn_init_leonhard(_nrn_model_sorted_token const& _sorted_token, NrnThread* _nt, Memb_list* _ml_arg, int _type) {
166184
_nrn_mechanism_cache_range _lmr{_sorted_token, *_nt, *_ml_arg, _type};
167185
auto inst = make_instance_leonhard(_lmr);
186+
auto node_data = make_node_data_leonhard(*_nt, *_ml_arg);
168187
auto nodecount = _ml_arg->nodecount;
169188
for (int id = 0; id < nodecount; id++) {
170189
inst.x[id] = 42.0;
@@ -180,6 +199,7 @@ namespace neuron {
180199
void nrn_state_leonhard(_nrn_model_sorted_token const& _sorted_token, NrnThread* _nt, Memb_list* _ml_arg, int _type) {
181200
_nrn_mechanism_cache_range _lmr{_sorted_token, *_nt, *_ml_arg, _type};
182201
auto inst = make_instance_leonhard(_lmr);
202+
auto node_data = make_node_data_leonhard(*_nt, *_ml_arg);
183203
auto nodecount = _ml_arg->nodecount;
184204
for (int id = 0; id < nodecount; id++) {
185205
inst.x[id] = inst.x[id] + (1.0 - exp(_nt->_dt * ((((inst.s+id*2)[static_cast<int>(0)] + (inst.s+id*2)[static_cast<int>(1)]) * ((inst.z+id*3)[static_cast<int>(0)] * (inst.z+id*3)[static_cast<int>(1)] * (inst.z+id*3)[static_cast<int>(2)])) * (1.0)))) * ( -(0.0) / (((((inst.s+id*2)[static_cast<int>(0)] + (inst.s+id*2)[static_cast<int>(1)])) * (((((inst.z+id*3)[static_cast<int>(0)]) * ((inst.z+id*3)[static_cast<int>(1)])) * ((inst.z+id*3)[static_cast<int>(2)])))) * (1.0)) - inst.x[id]);

cnexp_scalar/neuron/leonhard.cpp

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,14 @@ namespace neuron {
9494
};
9595

9696

97+
struct leonhard_NodeData {
98+
int const * nodeindices;
99+
double const * node_voltages;
100+
double * node_rhs;
101+
int nodecount;
102+
};
103+
104+
97105
static leonhard_Instance make_instance_leonhard(_nrn_mechanism_cache_range& _ml) {
98106
return leonhard_Instance {
99107
_ml.template fpfield_ptr<0>(),
@@ -104,6 +112,16 @@ namespace neuron {
104112
}
105113

106114

115+
static leonhard_NodeData make_node_data_leonhard(NrnThread& _nt, Memb_list& _ml_arg) {
116+
return leonhard_NodeData {
117+
_ml_arg.nodeindices,
118+
_nt.node_voltage_storage(),
119+
_nt.node_rhs_storage(),
120+
_ml_arg.nodecount
121+
};
122+
}
123+
124+
107125
static void nrn_alloc_leonhard(Prop* _prop) {
108126
Prop *prop_ion{};
109127
Datum *_ppvar{};
@@ -156,6 +174,7 @@ namespace neuron {
156174
void nrn_init_leonhard(_nrn_model_sorted_token const& _sorted_token, NrnThread* _nt, Memb_list* _ml_arg, int _type) {
157175
_nrn_mechanism_cache_range _lmr{_sorted_token, *_nt, *_ml_arg, _type};
158176
auto inst = make_instance_leonhard(_lmr);
177+
auto node_data = make_node_data_leonhard(*_nt, *_ml_arg);
159178
auto nodecount = _ml_arg->nodecount;
160179
for (int id = 0; id < nodecount; id++) {
161180
inst.x[id] = 42.0;
@@ -166,6 +185,7 @@ namespace neuron {
166185
void nrn_state_leonhard(_nrn_model_sorted_token const& _sorted_token, NrnThread* _nt, Memb_list* _ml_arg, int _type) {
167186
_nrn_mechanism_cache_range _lmr{_sorted_token, *_nt, *_ml_arg, _type};
168187
auto inst = make_instance_leonhard(_lmr);
188+
auto node_data = make_node_data_leonhard(*_nt, *_ml_arg);
169189
auto nodecount = _ml_arg->nodecount;
170190
for (int id = 0; id < nodecount; id++) {
171191
inst.x[id] = inst.x[id] + (1.0 - exp(_nt->_dt * ( -1.0))) * ( -(0.0) / ( -1.0) - inst.x[id]);

func_proc/neuron/func_proc.cpp

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,14 @@ namespace neuron {
9090
};
9191

9292

93+
struct test_func_proc_NodeData {
94+
int const * nodeindices;
95+
double const * node_voltages;
96+
double * node_rhs;
97+
int nodecount;
98+
};
99+
100+
93101
static test_func_proc_Instance make_instance_test_func_proc(_nrn_mechanism_cache_range& _ml) {
94102
return test_func_proc_Instance {
95103
_ml.template fpfield_ptr<0>(),
@@ -98,6 +106,16 @@ namespace neuron {
98106
}
99107

100108

109+
static test_func_proc_NodeData make_node_data_test_func_proc(NrnThread& _nt, Memb_list& _ml_arg) {
110+
return test_func_proc_NodeData {
111+
_ml_arg.nodeindices,
112+
_nt.node_voltage_storage(),
113+
_nt.node_rhs_storage(),
114+
_ml_arg.nodecount
115+
};
116+
}
117+
118+
101119
static void nrn_alloc_test_func_proc(Prop* _prop) {
102120
Prop *prop_ion{};
103121
Datum *_ppvar{};
@@ -341,6 +359,7 @@ namespace neuron {
341359
void nrn_init_test_func_proc(_nrn_model_sorted_token const& _sorted_token, NrnThread* _nt, Memb_list* _ml_arg, int _type) {
342360
_nrn_mechanism_cache_range _lmr{_sorted_token, *_nt, *_ml_arg, _type};
343361
auto inst = make_instance_test_func_proc(_lmr);
362+
auto node_data = make_node_data_test_func_proc(*_nt, *_ml_arg);
344363
auto nodecount = _ml_arg->nodecount;
345364
for (int id = 0; id < nodecount; id++) {
346365
}

func_proc_pnt/neuron/func_proc_pnt.cpp

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,14 @@ namespace neuron {
8989
};
9090

9191

92+
struct test_func_proc_pnt_NodeData {
93+
int const * nodeindices;
94+
double const * node_voltages;
95+
double * node_rhs;
96+
int nodecount;
97+
};
98+
99+
92100
static test_func_proc_pnt_Instance make_instance_test_func_proc_pnt(_nrn_mechanism_cache_range& _ml) {
93101
return test_func_proc_pnt_Instance {
94102
_ml.template fpfield_ptr<0>(),
@@ -98,6 +106,16 @@ namespace neuron {
98106
}
99107

100108

109+
static test_func_proc_pnt_NodeData make_node_data_test_func_proc_pnt(NrnThread& _nt, Memb_list& _ml_arg) {
110+
return test_func_proc_pnt_NodeData {
111+
_ml_arg.nodeindices,
112+
_nt.node_voltage_storage(),
113+
_nt.node_rhs_storage(),
114+
_ml_arg.nodecount
115+
};
116+
}
117+
118+
101119
static void nrn_alloc_test_func_proc_pnt(Prop* _prop) {
102120
Prop *prop_ion{};
103121
Datum *_ppvar{};
@@ -267,6 +285,7 @@ namespace neuron {
267285
void nrn_init_test_func_proc_pnt(_nrn_model_sorted_token const& _sorted_token, NrnThread* _nt, Memb_list* _ml_arg, int _type) {
268286
_nrn_mechanism_cache_range _lmr{_sorted_token, *_nt, *_ml_arg, _type};
269287
auto inst = make_instance_test_func_proc_pnt(_lmr);
288+
auto node_data = make_node_data_test_func_proc_pnt(*_nt, *_ml_arg);
270289
auto nodecount = _ml_arg->nodecount;
271290
for (int id = 0; id < nodecount; id++) {
272291
}

global_breakpoint/neuron/leonhard.cpp

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,14 @@ namespace neuron {
9494
};
9595

9696

97+
struct leonhard_NodeData {
98+
int const * nodeindices;
99+
double const * node_voltages;
100+
double * node_rhs;
101+
int nodecount;
102+
};
103+
104+
97105
static leonhard_Instance make_instance_leonhard(_nrn_mechanism_cache_range& _ml) {
98106
return leonhard_Instance {
99107
_ml.template fpfield_ptr<0>(),
@@ -104,6 +112,16 @@ namespace neuron {
104112
}
105113

106114

115+
static leonhard_NodeData make_node_data_leonhard(NrnThread& _nt, Memb_list& _ml_arg) {
116+
return leonhard_NodeData {
117+
_ml_arg.nodeindices,
118+
_nt.node_voltage_storage(),
119+
_nt.node_rhs_storage(),
120+
_ml_arg.nodecount
121+
};
122+
}
123+
124+
107125
static void nrn_alloc_leonhard(Prop* _prop) {
108126
Prop *prop_ion{};
109127
Datum *_ppvar{};
@@ -157,6 +175,7 @@ namespace neuron {
157175
void nrn_init_leonhard(_nrn_model_sorted_token const& _sorted_token, NrnThread* _nt, Memb_list* _ml_arg, int _type) {
158176
_nrn_mechanism_cache_range _lmr{_sorted_token, *_nt, *_ml_arg, _type};
159177
auto inst = make_instance_leonhard(_lmr);
178+
auto node_data = make_node_data_leonhard(*_nt, *_ml_arg);
160179
auto nodecount = _ml_arg->nodecount;
161180
for (int id = 0; id < nodecount; id++) {
162181
inst.x[id] = 42.0;
@@ -167,6 +186,7 @@ namespace neuron {
167186
void nrn_state_leonhard(_nrn_model_sorted_token const& _sorted_token, NrnThread* _nt, Memb_list* _ml_arg, int _type) {
168187
_nrn_mechanism_cache_range _lmr{_sorted_token, *_nt, *_ml_arg, _type};
169188
auto inst = make_instance_leonhard(_lmr);
189+
auto node_data = make_node_data_leonhard(*_nt, *_ml_arg);
170190
auto nodecount = _ml_arg->nodecount;
171191
for (int id = 0; id < nodecount; id++) {
172192
inst.x[id] = inst.global->c;

0 commit comments

Comments
 (0)