(j3.2006) If SIZE(B) > SIZE(A), what part of B does RESHAPE(B, SHAPE(A)) contain, if both A, B are rank N arrays ?

Toon Moene toon
Mon Dec 12 13:34:48 EST 2011


On 12/12/2011 01:01 AM, Robert Corbett wrote:

> On 12/10/2011 6:31 AM, John Reid wrote:

>> Haven't you got the signs wrong here? Don't you mean
>>
>> A = B( : LBOUND(B, 1) + SIZE(A, 1) - 1, &
>> : LBOUND(B, 2) + SIZE(A, 2) - 1, &
>> : LBOUND(B, 3) + SIZE(A, 3) - 1, &
>> : LBOUND(B, 4) + SIZE(A, 4) - 1)
>
> You are correct. My simplified code is equivalent to the
> code that was originally presented. I should have checked
> that the original code was correct.

Thanks, John.  Of course, it didn't help that in my case, all LBOUNDS 
were 1 ;-)

-- 
Toon Moene - e-mail: toon at moene.org - phone: +31 346 214290
Saturnushof 14, 3738 XG  Maartensdijk, The Netherlands
At home: http://moene.org/~toon/; weather: http://moene.org/~hirlam/
Progress of GNU Fortran: http://gcc.gnu.org/wiki/GFortran#news



More information about the J3 mailing list