Hi,
for i in 1:N loop
for j in 1:i-1,i+1:N loop
// do stuff
end for;
end for;
yesterday I was trying to exclude (i,i) pairs
today I came up with this
for i in 1:N loop
for j in vector([1:i-1;i+1:N]) loop
// do stuff
end for;
end for;
but I am not sure that non-constants (like i) are allowed in the low:high construct at all.
Is it disallowed?
Are there possibilities for manipulating the "compile-time" index space of nested loops?
I would think that equations are produced at "compile-time" and there would be no interference problems
with the rest of solving engine.
modelica for-loop in this regard is not a software for-loop which runs again and again when a function
containing it happens to be called, but more of generate-loop of VHDL, which is evaluated once.
In this way it would be nicer (straigth forward) when
for i in 1:N loop
for j in 1:N loop
if i == j then continue;
// do stuff
end for;
end for;
could be used.
Regards, Daniel