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


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

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

From "Sjoerd C. de Vries" <sjoerd.c.devries@gmail.com>
Newsgroups comp.soft-sys.math.mathematica
Subject Re: Default sort of vector is by "complexity" of expression!!?????
Date 2012-01-07 10:24 +0000
Organization Steven M. Christensen and Associates, Inc and MathTensor, Inc.
Message-ID <je96ge$j3g$1@smc.vnet.net> (permalink)
References <je6e4i$q73$1@smc.vnet.net>

Show all headers | View raw


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...@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}}}

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


Thread

Default sort of vector is by "complexity" of expression!!????? Chris Young <cy56@comcast.net> - 2012-01-06 09:16 +0000
  Re: Default sort of vector is by "complexity" of expression!!????? danl@wolfram.com - 2012-01-07 10:18 +0000
  Re: Default sort of vector is by "complexity" of expression!!????? "Sjoerd C. de Vries" <sjoerd.c.devries@gmail.com> - 2012-01-07 10:24 +0000

csiph-web