Oh okay. In that case, shouldn't an error be generated at compile time ? ᐧ
Regards, Kapil Agarwal On Tue, Oct 28, 2014 at 10:02 PM, Andreas Noack < [email protected]> wrote: > times[1] is the first element of the matrix times. Hence, then writing > times[1][1] you are trying to setindex a scalar. If you want to select the > 1,1 element of times then you should write times[1,1]. > > Med venlig hilsen > > Andreas Noack > > 2014-10-28 21:58 GMT-04:00 Kapil Agarwal <[email protected]>: > > Hi >> >> I have the following piece of code and I am getting a setindex! error >> which I am unable to figure out- >> >> times = Array(Float64,(4,10)); # 4 X 10 matrix >> a=fill(1.0,10); >> c=fill(0.0,10); >> times[1][1] = @elapsed @parallel for j=1:10 >> c[j] = a[j]; >> end >> >> ERROR: `setindex!` has no method matching setindex!(::Float64, ::Float64, >> ::Int64) >> >> What could be the problem ? >> >> Kapil >> > >
