Question: If not working within a for cycle

January 31 2014 manueleleonelli 35
Maple
0

Hi all,
I've got this code but the second if statement does not seem to work within the for cycle... If I write it outside the cycle it works... Can you help me with this??? 
 
Dec := {1, 4}; Var := {2, 3, 5, 6}; n[1] := 4; n[2] := 3; n[3] := 2; n[4] := 3; n[5] := 4; n[6] := 2; Ut := {1, 2, 3}; pa[2] := {1}; pa[3] := {1, 2}; pau[1] := {3}; pa[5] := {4}; pau[2] := {5}; pa[6] := {4, 5}; pau[3] := {4, 6}; J := {3, 5, 6};
m := numelems(Ut); n := numelems(`union`(Dec, Var)); j := numelems(J);

if member(n, J) then A[n] := {`union`(pa[n], `intersect`(pau[3], {n}))}; jcur := j-1 end if

for i from n-1 to 1 do if member(i, J) then A[i] := `union`(`union`(A[i+1], pa[i]), `intersect`(pau[jcur], {i})); jcur := j-1 else A[i] := `union`(A[i+1], `intersect`(pa[i], {i})) end if end do

Thanks in advance
manuele

Please Wait...