MathGroup Archive 2007

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

Search the Archive

Re: Re: Question

  • To: mathgroup at smc.vnet.net
  • Subject: [mg74922] Re: [mg74892] Re: Question
  • From: Andrzej Kozlowski <akoz at mimuw.edu.pl>
  • Date: Wed, 11 Apr 2007 02:00:09 -0400 (EDT)
  • References: <ev51pb$ai7$1@smc.vnet.net> <200704100917.FAA07351@smc.vnet.net>

This does to seem to be so strange to me. Note that:


expr[[1,1]][[{1,2}]]


c11[d111,d112]

which is, of course, documented. On the other hand: expr[[1,1,{1,2}]]  
means the same thing as expr[[1,1]][[{1,2}]], which, I think, is  
consistent, with the general way of working of Part (although I don't  
know of any explicit documentation for this).

Andrzej Kozlowski



On 10 Apr 2007, at 18:17, dh wrote:

>
>
> Hi Peter,
>
> you are right , there is something very surprising concerning  
> "Part". I
>
> beg you to mention this to Wolfram, e.g. to Daniel Lichtblau.
>
> Consider the following expression that has one level less than yours,
>
> but will do to make the point:
>
> expr = a[
>
> b1[c11[d111, d112, d113], c12[d121, d122, d123], c13[d131, d132,  
> d133]],
>
> b2[c21[d211, d212, d213], c22[d221, d222, d223], c23[d231, d232,  
> d233]],
>
> b3[c31[d311, d312, d313], c32[d321, d322, d323], c33[d331, d332,  
> d333]]
>
> ]
>
> Now expr[[1,1,1]] gives d111 what is expected. expr[[1,1,{1,2}]] does
>
> not give {d111,d112}, but c11[d111,d112]. Therefore, as soon as we use
>
> more than one index on the same level, the head of the level above is
>
> applied.  I wonder if this is a bug or intention, I just can't imagine
>
> an application for this. Further, expr[[2,1,{1,2}]] gives:
>
> c21[d111,d112] and expr[[{1,2},1,{1,2}]] does the apply "trick" once
>
> again: a[c11[d111,d112],c21[d111,d112]]
>
> Hope this will help, Daniel
>
>
>
>
>
>> Hello Daniel,
>
>> thanks. It is quite a decision to apply the head to a list when  
>> talking about parts.
>
>> I would expect just a list of parts.
>
>> Still I am not able to predict what happens to:
>
>> Lambda0[[{1, 2, 3}, 1, {1, 2, 3}, 1]]
>
>> which gives: Lambda0[Lambda2[1, 1, 1], Lambda2[2, 2, 2], Lambda2 
>> [3, 3, 3]]
>
>> What confuses me is:
>
>> Lambda0[[{1, 2, 3}, 1, {1, 2, 3}]]
>
>> which gives: Lambda0[Lambda2[Lambda3[1, 1, 1], Lambda3[1, 1, 2],  
>> Lambda3[1, 1, 3]], Lambda2[Lambda3[2, 1, 1],
>
>>     Lambda3[2, 1, 2], Lambda3[2, 1, 3]], Lambda2[Lambda3[3, 1, 1],  
>> Lambda3[3, 1, 2], Lambda3[3, 1, 3]]]
>
>> So, I do not understand anything about these manipulations.
>
>> Can anyone explain these results? In one way or another I am  
>> wrongly focussed.
>
>> with frienldy greetings,
>
>> Peter van Summeren
>
>>
>
>
>



  • Prev by Date: convergence conditions correction
  • Next by Date: Re: ColorFunction help?
  • Previous by thread: Re: Question
  • Next by thread: Re: question