Page 1 of 1

Cannot use continuous play with Dt?

Posted: Thu Jun 27, 2013 11:49 am
by patoorio
Hi,

The following simple code is giving me a Segmentation fault at init():

Code: Select all

load_file("nrngui.hoc")

create soma
access soma
insert hh

objref celsiusvec,timevec
celsiusvec=new Vector(10)
celsiusvec.fill(20)
for (i=0;i<=8;i=i+2) {celsiusvec.x[i]=18}

tstop = celsiusvec.size()*1000
celsiusvec.play(&celsius, 1000,1)
init()
However if I add/replace the following lines, there is no problem:

Code: Select all

timevec=new Vector(10)
timevec.indgen(1000)

celsiusvec.play(&celsius, timevec,1)
Why can't I do continuous play with a Dt? Oh, and the code gives no problem using celsiusvec.play(&celsius, 1000,0)
I'm using Neuron 7.3 on Ubuntu 13.04

Regards.

Re: Cannot use continuous play with Dt?

Posted: Sat Jun 29, 2013 9:00 am
by hines
That's correct. One must use a time vector as the second arg in continuous mode. There is a great deal of shared logic involved due to the possibility of a discontinuity vector which does require a tvec and it seems not too onerous to do as you show in your second fragment.
Use of Dt as the second arg of Vector.play in continuous mode now generates the explicit error message:
Second argument of Vector.play in continuous mode must be a time vector
http://www.neuron.yale.edu/hg/neuron/nr ... 36db45853d
And I've updated the documentation line
vsrc.play(&var or stmt, Dt or Tvec, continuous)
to read
vsrc.play(&var or stmt, Tvec, continuous)

Re: Cannot use continuous play with Dt?

Posted: Sun Jun 30, 2013 3:26 pm
by patoorio
Thanks for the answer!
Yes, it's easy to make a vector; I just wanted to know if the behavior was 'bug or feature'.

Regards