| |
comp.soft-sys.math.maple |
On Feb 27, 12:53 pm, Axel Vogt <&nore...@axelvogt.de> wrote: > Be aware that if you are working with sets, there Y:=[seq(i,i in X)]; <----------- Note the '[ ]' {a = 2, b = -4}, {b = 2, a = 0}, {a = 2, b = 0}] [seq( eval(f(a,b),xi), xi in Y)]; <---------Note the '[ ]' Here, the ordering in Y is whatever ordering Maple decided to use for {seq( eval(f(a,b),xi), xi in Y)}; <----- Note the '{ }' So, here you don't know which element of Y gives the entry f(a,b) = Note: sets do not have repeated elements, so if you wanted to have two R.G. Vickson.
> > Thanks!!!
> is no guarantee on ordering. So do not assume that
> positions match in the result and X (sets do not
> have an ordering, lists do).
initially); then that ordering remains in force throughout the rest of
the session:
Y := [{a = 3, b = -3}, {a = 2, b = 2}, {a = 0, b = 3},
1/2 1/2 1/2 1/2 1/2
[3 - 3 2 , 2 + 2 2 , 3 2 , 2 - 4 2 , 2 2 , 2]
X when the call was made. You can't control it, but you can at least
be guaranteed the order remains unchanged from now on (in Y, that is,
not in X). If you don't use [ ] in this evaluation, Maple may again
write the results in some random order:
1/2 1/2 1/2 1/2 1/2
{2, 3 - 3 2 , 2 + 2 2 , 2 - 4 2 , 2 2 , 3 2 }
2!
or more identical entries in X you could not do it: they would appear
only once. Lists and sequences can, however, have repetitions.