Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.math.mathematica

Topic: sorting
Replies: 0  

Advanced Search

Back to Topic List Back to Topic List  
Francisco Gutierrez

Posts: 102
Registered: 5/31/05
sorting
Posted: Jan 26, 2013 1:38 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply


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




Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.