MathGroup Archive 2011

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

Search the Archive

Re: list equation

  • To: mathgroup at
  • Subject: [mg121973] Re: list equation
  • From: Simon <simonjtyler at>
  • Date: Fri, 7 Oct 2011 04:50:51 -0400 (EDT)
  • Delivered-to:
  • References: <j6jpek$me8$>
  • Reply-to: comp.soft-sys.math.mathematica at

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