Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #13277

sorting

From Francisco Gutierrez <fgutiers2002@yahoo.com>
Newsgroups comp.soft-sys.math.mathematica
Subject sorting
Date 2013-01-26 06:38 +0000
Message-ID <kdvtkq$fp9$1@smc.vnet.net> (permalink)
Organization Time-Warner Telecom

Show all headers | View raw


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

Back to comp.soft-sys.math.mathematica | Previous | Next | Find similar | Unroll thread


Thread

sorting Francisco Gutierrez <fgutiers2002@yahoo.com> - 2013-01-26 06:38 +0000

csiph-web