MathGroup Archive 2012

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

Search the Archive

Re: Default sort of vector is by "complexity" of expression!!?????

  • To: mathgroup at smc.vnet.net
  • Subject: [mg124054] Re: Default sort of vector is by "complexity" of expression!!?????
  • From: "Sjoerd C. de Vries" <sjoerd.c.devries at gmail.com>
  • Date: Sat, 7 Jan 2012 05:21:12 -0500 (EST)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com
  • References: <je6e4i$q73$1@smc.vnet.net>

I don't see a sort on complexity. I see a list of lists being sorted
based on the first element of each list and ties being broken, by
using the next list element.

Cheers -- Sjoerd


----
Check out Stackoverflow's Mathematica tag: http://stackoverflow.com/questions/tagged/mathematica
or better, help out with the new dedicated Mathematica Q&A site on
StackExchange.
It's almost in private beta, but needs just a few extra people to kick
off and participate. Go to:
http://area51.stackexchange.com/proposals/37304/mathematica?referrer=EJOMFcZOBpAIDM_
9uBjtlA2

On Jan 6, 10:16 am, Chris Young <c... at comcast.net> wrote:
> Why on earth is that the default?? How is that possibly of any use?
>
> In[1114]:= hexN = hex // N
>
> Out[1114]= {{0., 0.}, {1., 0.}, {0.5, 0.866025}, {-0.5,
>   0.866025}, {-1., 0.}, {-0.5, -0.866025}, {0.5, -0.866025}}
>
> In[1115]:= {Part[#, 2], Part[#, 1], #} & /@ hexN
>
> Out[1115]= {{0., 0., {0., 0.}}, {0., 1., {1., 0.}}, {0.866025,
>   0.5, {0.5, 0.866025}}, {0.866025, -0.5, {-0.5,
>    0.866025}}, {0., -1., {-1.,
>    0.}}, {-0.866025, -0.5, {-0.5, -0.866025}}, {-0.866025,
>   0.5, {0.5, -0.866025}}}
>
> In[1116]:= Sort[%1115]
>
> Out[1116]= {{-0.866025, -0.5, {-0.5, -0.866025}}, {-0.866025,
>   0.5, {0.5, -0.866025}}, {0., -1., {-1., 0.}}, {0.,
>   0., {0., 0.}}, {0.,
>   1., {1., 0.}}, {0.866025, -0.5, {-0.5, 0.866025}}, {0.866025,
>   0.5, {0.5, 0.866025}}}




  • Prev by Date: ListPolarPlot questions
  • Next by Date: How to create a Dynamic monitoring palette that will keep working after a kernel restart?
  • Previous by thread: Re: Default sort of vector is by "complexity" of expression!!?????
  • Next by thread: SortBy for multiple key sorts