On Thursday, April 23, 2015 at 6:51:05 AM UTC-5, Michela Di Lullo wrote:
>
> I'm trying to make it but it's not working because of the indexes. I don't 
> know how to declare the parameter branch_x indexed by (n,b_from,b_to).
>

I'm not sure what this indexing expression is supposed to do; branch_x is 
defined as a vector so providing three arguments doesn't make sense; each 
indexing argument indexes along a dimension of the array, and branch_x is 
one dimensional.

We might be missing better documentation of indexing expressions; all I can 
find right now is 
http://julia.readthedocs.org/en/release-0.3/stdlib/arrays/#indexing-assignment-and-concatenation;
 
getindex(X, ...) is the desugared form of X[...].

It looks like you might be trying to extract a range, in which case you can 
construct it with colon:

branch_x[b_from:b_to]

but that throws n away...if n is supposed to be a stride, then

branch_x[b_from:n:b_to]

...but without understanding the AMPL expression, I'm just stabbing 
possible answers at you.

(If someone who understands AMPL comes along, they might be able to help 
better/faster.) 

Reply via email to