@@ -142,9 +142,14 @@ namespace neuron {
142
142
}
143
143
/* Mechanism procedures and functions */
144
144
inline double x_plus_a_test_func_proc (_nrn_mechanism_cache_range* _ml, test_func_proc_Instance& inst, size_t id, Datum* _ppvar, Datum* _thread, NrnThread* _nt, double a);
145
+ inline double v_plus_a_test_func_proc (_nrn_mechanism_cache_range* _ml, test_func_proc_Instance& inst, size_t id, Datum* _ppvar, Datum* _thread, NrnThread* _nt, double a);
146
+ inline double just_v_test_func_proc (_nrn_mechanism_cache_range* _ml, test_func_proc_Instance& inst, size_t id, Datum* _ppvar, Datum* _thread, NrnThread* _nt, double v);
145
147
inline int set_x_42_test_func_proc (_nrn_mechanism_cache_range* _ml, test_func_proc_Instance& inst, size_t id, Datum* _ppvar, Datum* _thread, NrnThread* _nt);
146
148
inline int set_x_a_test_func_proc (_nrn_mechanism_cache_range* _ml, test_func_proc_Instance& inst, size_t id, Datum* _ppvar, Datum* _thread, NrnThread* _nt, double a);
147
149
inline int set_a_x_test_func_proc (_nrn_mechanism_cache_range* _ml, test_func_proc_Instance& inst, size_t id, Datum* _ppvar, Datum* _thread, NrnThread* _nt);
150
+ inline int set_x_v_test_func_proc (_nrn_mechanism_cache_range* _ml, test_func_proc_Instance& inst, size_t id, Datum* _ppvar, Datum* _thread, NrnThread* _nt);
151
+ inline int set_x_just_v_test_func_proc (_nrn_mechanism_cache_range* _ml, test_func_proc_Instance& inst, size_t id, Datum* _ppvar, Datum* _thread, NrnThread* _nt);
152
+ inline int set_x_just_vv_test_func_proc (_nrn_mechanism_cache_range* _ml, test_func_proc_Instance& inst, size_t id, Datum* _ppvar, Datum* _thread, NrnThread* _nt, double v);
148
153
149
154
150
155
/* * connect global (scalar) variables to hoc -- */
@@ -163,11 +168,21 @@ namespace neuron {
163
168
static void _hoc_set_x_42 (void );
164
169
static void _hoc_set_x_a (void );
165
170
static void _hoc_set_a_x (void );
171
+ static void _hoc_set_x_v (void );
172
+ static void _hoc_set_x_just_v (void );
173
+ static void _hoc_set_x_just_vv (void );
166
174
static void _hoc_x_plus_a (void );
175
+ static void _hoc_v_plus_a (void );
176
+ static void _hoc_just_v (void );
167
177
static double _npy_set_x_42 (Prop*);
168
178
static double _npy_set_x_a (Prop*);
169
179
static double _npy_set_a_x (Prop*);
180
+ static double _npy_set_x_v (Prop*);
181
+ static double _npy_set_x_just_v (Prop*);
182
+ static double _npy_set_x_just_vv (Prop*);
170
183
static double _npy_x_plus_a (Prop*);
184
+ static double _npy_v_plus_a (Prop*);
185
+ static double _npy_just_v (Prop*);
171
186
172
187
173
188
/* connect user functions to hoc names */
@@ -176,14 +191,24 @@ namespace neuron {
176
191
{" set_x_42_test_func_proc" , _hoc_set_x_42},
177
192
{" set_x_a_test_func_proc" , _hoc_set_x_a},
178
193
{" set_a_x_test_func_proc" , _hoc_set_a_x},
194
+ {" set_x_v_test_func_proc" , _hoc_set_x_v},
195
+ {" set_x_just_v_test_func_proc" , _hoc_set_x_just_v},
196
+ {" set_x_just_vv_test_func_proc" , _hoc_set_x_just_vv},
179
197
{" x_plus_a_test_func_proc" , _hoc_x_plus_a},
198
+ {" v_plus_a_test_func_proc" , _hoc_v_plus_a},
199
+ {" just_v_test_func_proc" , _hoc_just_v},
180
200
{0 , 0 }
181
201
};
182
202
static NPyDirectMechFunc npy_direct_func_proc[] = {
183
203
{" set_x_42" , _npy_set_x_42},
184
204
{" set_x_a" , _npy_set_x_a},
185
205
{" set_a_x" , _npy_set_a_x},
206
+ {" set_x_v" , _npy_set_x_v},
207
+ {" set_x_just_v" , _npy_set_x_just_v},
208
+ {" set_x_just_vv" , _npy_set_x_just_vv},
186
209
{" x_plus_a" , _npy_x_plus_a},
210
+ {" v_plus_a" , _npy_v_plus_a},
211
+ {" just_v" , _npy_just_v},
187
212
};
188
213
static void _hoc_set_x_42 (void ) {
189
214
double _r{};
@@ -293,6 +318,114 @@ namespace neuron {
293
318
set_a_x_test_func_proc (_ml, inst, id, _ppvar, _thread, _nt);
294
319
return (_r);
295
320
}
321
+ static void _hoc_set_x_v (void ) {
322
+ double _r{};
323
+ Datum* _ppvar;
324
+ Datum* _thread;
325
+ NrnThread* _nt;
326
+ if (!_prop_id) {
327
+ hoc_execerror (" No data for set_x_v_test_func_proc. Requires prior call to setdata_test_func_proc and that the specified mechanism instance still be in existence." , NULL );
328
+ }
329
+ Prop* _local_prop = _extcall_prop;
330
+ _nrn_mechanism_cache_instance _ml_real{_local_prop};
331
+ auto * const _ml = &_ml_real;
332
+ size_t const id{};
333
+ _ppvar = _local_prop ? _nrn_mechanism_access_dparam (_local_prop) : nullptr ;
334
+ _thread = _extcall_thread.data ();
335
+ _nt = nrn_threads;
336
+ auto inst = make_instance_test_func_proc (_ml_real);
337
+ _r = 1 .;
338
+ set_x_v_test_func_proc (_ml, inst, id, _ppvar, _thread, _nt);
339
+ hoc_retpushx (_r);
340
+ }
341
+ static double _npy_set_x_v (Prop* _prop) {
342
+ double _r{};
343
+ Datum* _ppvar;
344
+ Datum* _thread;
345
+ NrnThread* _nt;
346
+ _nrn_mechanism_cache_instance _ml_real{_prop};
347
+ auto * const _ml = &_ml_real;
348
+ size_t const id{};
349
+ _ppvar = _nrn_mechanism_access_dparam (_prop);
350
+ _thread = _extcall_thread.data ();
351
+ _nt = nrn_threads;
352
+ auto inst = make_instance_test_func_proc (_ml_real);
353
+ _r = 1 .;
354
+ set_x_v_test_func_proc (_ml, inst, id, _ppvar, _thread, _nt);
355
+ return (_r);
356
+ }
357
+ static void _hoc_set_x_just_v (void ) {
358
+ double _r{};
359
+ Datum* _ppvar;
360
+ Datum* _thread;
361
+ NrnThread* _nt;
362
+ if (!_prop_id) {
363
+ hoc_execerror (" No data for set_x_just_v_test_func_proc. Requires prior call to setdata_test_func_proc and that the specified mechanism instance still be in existence." , NULL );
364
+ }
365
+ Prop* _local_prop = _extcall_prop;
366
+ _nrn_mechanism_cache_instance _ml_real{_local_prop};
367
+ auto * const _ml = &_ml_real;
368
+ size_t const id{};
369
+ _ppvar = _local_prop ? _nrn_mechanism_access_dparam (_local_prop) : nullptr ;
370
+ _thread = _extcall_thread.data ();
371
+ _nt = nrn_threads;
372
+ auto inst = make_instance_test_func_proc (_ml_real);
373
+ _r = 1 .;
374
+ set_x_just_v_test_func_proc (_ml, inst, id, _ppvar, _thread, _nt);
375
+ hoc_retpushx (_r);
376
+ }
377
+ static double _npy_set_x_just_v (Prop* _prop) {
378
+ double _r{};
379
+ Datum* _ppvar;
380
+ Datum* _thread;
381
+ NrnThread* _nt;
382
+ _nrn_mechanism_cache_instance _ml_real{_prop};
383
+ auto * const _ml = &_ml_real;
384
+ size_t const id{};
385
+ _ppvar = _nrn_mechanism_access_dparam (_prop);
386
+ _thread = _extcall_thread.data ();
387
+ _nt = nrn_threads;
388
+ auto inst = make_instance_test_func_proc (_ml_real);
389
+ _r = 1 .;
390
+ set_x_just_v_test_func_proc (_ml, inst, id, _ppvar, _thread, _nt);
391
+ return (_r);
392
+ }
393
+ static void _hoc_set_x_just_vv (void ) {
394
+ double _r{};
395
+ Datum* _ppvar;
396
+ Datum* _thread;
397
+ NrnThread* _nt;
398
+ if (!_prop_id) {
399
+ hoc_execerror (" No data for set_x_just_vv_test_func_proc. Requires prior call to setdata_test_func_proc and that the specified mechanism instance still be in existence." , NULL );
400
+ }
401
+ Prop* _local_prop = _extcall_prop;
402
+ _nrn_mechanism_cache_instance _ml_real{_local_prop};
403
+ auto * const _ml = &_ml_real;
404
+ size_t const id{};
405
+ _ppvar = _local_prop ? _nrn_mechanism_access_dparam (_local_prop) : nullptr ;
406
+ _thread = _extcall_thread.data ();
407
+ _nt = nrn_threads;
408
+ auto inst = make_instance_test_func_proc (_ml_real);
409
+ _r = 1 .;
410
+ set_x_just_vv_test_func_proc (_ml, inst, id, _ppvar, _thread, _nt, *getarg (1 ));
411
+ hoc_retpushx (_r);
412
+ }
413
+ static double _npy_set_x_just_vv (Prop* _prop) {
414
+ double _r{};
415
+ Datum* _ppvar;
416
+ Datum* _thread;
417
+ NrnThread* _nt;
418
+ _nrn_mechanism_cache_instance _ml_real{_prop};
419
+ auto * const _ml = &_ml_real;
420
+ size_t const id{};
421
+ _ppvar = _nrn_mechanism_access_dparam (_prop);
422
+ _thread = _extcall_thread.data ();
423
+ _nt = nrn_threads;
424
+ auto inst = make_instance_test_func_proc (_ml_real);
425
+ _r = 1 .;
426
+ set_x_just_vv_test_func_proc (_ml, inst, id, _ppvar, _thread, _nt, *getarg (1 ));
427
+ return (_r);
428
+ }
296
429
static void _hoc_x_plus_a (void ) {
297
430
double _r{};
298
431
Datum* _ppvar;
@@ -327,6 +460,68 @@ namespace neuron {
327
460
_r = x_plus_a_test_func_proc (_ml, inst, id, _ppvar, _thread, _nt, *getarg (1 ));
328
461
return (_r);
329
462
}
463
+ static void _hoc_v_plus_a (void ) {
464
+ double _r{};
465
+ Datum* _ppvar;
466
+ Datum* _thread;
467
+ NrnThread* _nt;
468
+ Prop* _local_prop = _prop_id ? _extcall_prop : nullptr ;
469
+ _nrn_mechanism_cache_instance _ml_real{_local_prop};
470
+ auto * const _ml = &_ml_real;
471
+ size_t const id{};
472
+ _ppvar = _local_prop ? _nrn_mechanism_access_dparam (_local_prop) : nullptr ;
473
+ _thread = _extcall_thread.data ();
474
+ _nt = nrn_threads;
475
+ auto inst = make_instance_test_func_proc (_ml_real);
476
+ _r = v_plus_a_test_func_proc (_ml, inst, id, _ppvar, _thread, _nt, *getarg (1 ));
477
+ hoc_retpushx (_r);
478
+ }
479
+ static double _npy_v_plus_a (Prop* _prop) {
480
+ double _r{};
481
+ Datum* _ppvar;
482
+ Datum* _thread;
483
+ NrnThread* _nt;
484
+ _nrn_mechanism_cache_instance _ml_real{_prop};
485
+ auto * const _ml = &_ml_real;
486
+ size_t const id{};
487
+ _ppvar = _nrn_mechanism_access_dparam (_prop);
488
+ _thread = _extcall_thread.data ();
489
+ _nt = nrn_threads;
490
+ auto inst = make_instance_test_func_proc (_ml_real);
491
+ _r = v_plus_a_test_func_proc (_ml, inst, id, _ppvar, _thread, _nt, *getarg (1 ));
492
+ return (_r);
493
+ }
494
+ static void _hoc_just_v (void ) {
495
+ double _r{};
496
+ Datum* _ppvar;
497
+ Datum* _thread;
498
+ NrnThread* _nt;
499
+ Prop* _local_prop = _prop_id ? _extcall_prop : nullptr ;
500
+ _nrn_mechanism_cache_instance _ml_real{_local_prop};
501
+ auto * const _ml = &_ml_real;
502
+ size_t const id{};
503
+ _ppvar = _local_prop ? _nrn_mechanism_access_dparam (_local_prop) : nullptr ;
504
+ _thread = _extcall_thread.data ();
505
+ _nt = nrn_threads;
506
+ auto inst = make_instance_test_func_proc (_ml_real);
507
+ _r = just_v_test_func_proc (_ml, inst, id, _ppvar, _thread, _nt, *getarg (1 ));
508
+ hoc_retpushx (_r);
509
+ }
510
+ static double _npy_just_v (Prop* _prop) {
511
+ double _r{};
512
+ Datum* _ppvar;
513
+ Datum* _thread;
514
+ NrnThread* _nt;
515
+ _nrn_mechanism_cache_instance _ml_real{_prop};
516
+ auto * const _ml = &_ml_real;
517
+ size_t const id{};
518
+ _ppvar = _nrn_mechanism_access_dparam (_prop);
519
+ _thread = _extcall_thread.data ();
520
+ _nt = nrn_threads;
521
+ auto inst = make_instance_test_func_proc (_ml_real);
522
+ _r = just_v_test_func_proc (_ml, inst, id, _ppvar, _thread, _nt, *getarg (1 ));
523
+ return (_r);
524
+ }
330
525
331
526
332
527
inline int set_x_42_test_func_proc (_nrn_mechanism_cache_range* _ml, test_func_proc_Instance& inst, size_t id, Datum* _ppvar, Datum* _thread, NrnThread* _nt) {
@@ -354,6 +549,29 @@ namespace neuron {
354
549
}
355
550
356
551
552
+ inline int set_x_v_test_func_proc (_nrn_mechanism_cache_range* _ml, test_func_proc_Instance& inst, size_t id, Datum* _ppvar, Datum* _thread, NrnThread* _nt) {
553
+ int ret_set_x_v = 0 ;
554
+ auto v = inst.v_unused [id];
555
+ inst.x [id] = v;
556
+ return ret_set_x_v;
557
+ }
558
+
559
+
560
+ inline int set_x_just_v_test_func_proc (_nrn_mechanism_cache_range* _ml, test_func_proc_Instance& inst, size_t id, Datum* _ppvar, Datum* _thread, NrnThread* _nt) {
561
+ int ret_set_x_just_v = 0 ;
562
+ auto v = inst.v_unused [id];
563
+ inst.x [id] = just_v_test_func_proc (_ml, inst, id, _ppvar, _thread, _nt, v);
564
+ return ret_set_x_just_v;
565
+ }
566
+
567
+
568
+ inline int set_x_just_vv_test_func_proc (_nrn_mechanism_cache_range* _ml, test_func_proc_Instance& inst, size_t id, Datum* _ppvar, Datum* _thread, NrnThread* _nt, double v) {
569
+ int ret_set_x_just_vv = 0 ;
570
+ inst.x [id] = just_v_test_func_proc (_ml, inst, id, _ppvar, _thread, _nt, v);
571
+ return ret_set_x_just_vv;
572
+ }
573
+
574
+
357
575
inline double x_plus_a_test_func_proc (_nrn_mechanism_cache_range* _ml, test_func_proc_Instance& inst, size_t id, Datum* _ppvar, Datum* _thread, NrnThread* _nt, double a) {
358
576
double ret_x_plus_a = 0.0 ;
359
577
auto v = inst.v_unused [id];
@@ -362,6 +580,21 @@ namespace neuron {
362
580
}
363
581
364
582
583
+ inline double v_plus_a_test_func_proc (_nrn_mechanism_cache_range* _ml, test_func_proc_Instance& inst, size_t id, Datum* _ppvar, Datum* _thread, NrnThread* _nt, double a) {
584
+ double ret_v_plus_a = 0.0 ;
585
+ auto v = inst.v_unused [id];
586
+ ret_v_plus_a = v + a;
587
+ return ret_v_plus_a;
588
+ }
589
+
590
+
591
+ inline double just_v_test_func_proc (_nrn_mechanism_cache_range* _ml, test_func_proc_Instance& inst, size_t id, Datum* _ppvar, Datum* _thread, NrnThread* _nt, double v) {
592
+ double ret_just_v = 0.0 ;
593
+ ret_just_v = v;
594
+ return ret_just_v;
595
+ }
596
+
597
+
365
598
void nrn_init_test_func_proc (_nrn_model_sorted_token const & _sorted_token, NrnThread* _nt, Memb_list* _ml_arg, int _type) {
366
599
_nrn_mechanism_cache_range _lmr{_sorted_token, *_nt, *_ml_arg, _type};
367
600
auto inst = make_instance_test_func_proc (_lmr);
0 commit comments