Hi,
I was wondering whether it is possible to declare a matrix in NMODL, without having to use VERBATIM blocks. I tried to use the same syntax as for arrays, but the compilation failed.
Thank you for your help,
Daniele
Declare a matrix in NMODL
Re: Declare a matrix in NMODL
I'm afraid nmodl does not support multidimensional arrays. You have to map it into a fixed size 1-d array.
That is often unacceptable and so many mod files use VERBATIM to wrap hoc Vector using
extern int vector_capacity(Vect*);
extern void vector_resize(Vect*, int);
extern double* vector_vec(Vect*);
extern Vect* vector_arg(int);
extern bool is_vector_arg(int);
See nrn/src/nrnoc/pattern.mod or (simpler) nrn/share/examples/nrniv/netcon/vecevent.mod for examples.
That is often unacceptable and so many mod files use VERBATIM to wrap hoc Vector using
extern int vector_capacity(Vect*);
extern void vector_resize(Vect*, int);
extern double* vector_vec(Vect*);
extern Vect* vector_arg(int);
extern bool is_vector_arg(int);
See nrn/src/nrnoc/pattern.mod or (simpler) nrn/share/examples/nrniv/netcon/vecevent.mod for examples.