MathGroup Archive 2011

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: list equation

Using SameTest is a lot slower than sticking to the default, so you could try
lst = Tuples[Range[50], 2];
lstnew = Union[Sort /@ lst]
which is about 6000 times faster than your 
Union[lst, SameTest -> (#1 == Reverse[#2] &)]

Easier still would just be to construct
Flatten[Table[{i, j}, {i, 1, 100}, {j, i, 100}], 1]
which is about twice as fast again.

  • Prev by Date: Re: A variable defaulting to a previous variable?
  • Next by Date: Re: importing data into a CDF
  • Previous by thread: Re: list equation
  • Next by thread: Re: list equation