MathGroup Archive 2013

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

Search the Archive

sorting

  • To: mathgroup at smc.vnet.net
  • Subject: [mg129583] sorting
  • From: Francisco Gutierrez <fgutiers2002 at yahoo.com>
  • Date: Sat, 26 Jan 2013 01:40:16 -0500 (EST)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com
  • Delivered-to: l-mathgroup@wolfram.com
  • Delivered-to: mathgroup-newout@smc.vnet.net
  • Delivered-to: mathgroup-newsend@smc.vnet.net
  • Reply-to: Francisco Gutierrez <fgutiers2002 at yahoo.com>

Dear Group:
I managed to solve the problem, but with a rather involved strategy.
Remember: the ratio between the first and the second part is the first sorting criterion, and the size of the second part is the second criterion.
First, use Gather to create clusters of sublists according to the first criterion.
Second, use Sort to order clusters within the big list according to the fist criterion
Then, with Map (or Table) order each cluster of lists according to the second criterion
Finally, Flatten the result at level 1.


It works ok, but i wonder if its efficient, and if there is not a much simpler way to do it

F



  • Prev by Date: sorting?
  • Next by Date: Re: NDSolve differences between mathematica 8 and 9
  • Previous by thread: Re: sorting?
  • Next by thread: Re: Setting parameters via Manipulate?