Timeline for Use Do to evaluate an expression over two indices $i \ne j$ (over a list of tuples)?
Current License: CC BY-SA 3.0
3 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
May 23, 2015 at 11:42 | comment | added | kglr |
@kirma, you are right; I just wanted to avoid Tuples for cases where i and j range over a large set.
|
|
May 23, 2015 at 5:57 | comment | added | kirma |
You could also use pairs = Cases[Tuples[Range[4], 2], Except[{i_, i_}]] (or equivalent Select or DeleteCases ) instead of maybe slightly more unintuitive reversing trick.
|
|
May 22, 2015 at 22:11 | history | answered | kglr | CC BY-SA 3.0 |