Van Snyder asked
> I think P1 should be
> 11 12 13 14 21 22 23 24 31 32 33 34 41 42 43 44
> and P2 should be
> 1 5 9 13
> 2 6 10 14
> 3 7 11 15
> 4 8 12 16
>
> 1. What do you think the "right" answers are for P1 and P2?
> 2. Do you have a compiler that does what you (or I) expect?
I am extremely hesitant to question Van's thoughts but is there any
reason why the output of P1 => res(reshape(t2,(/16/))) should not be
the same as the output of reshape(t2,(/16/)) ?
(Similarly P2 => res(reshape(t1,(/4,4/))) should look the same as
reshape(t1,(/4,4/)) ).
Consequently I think P1 should be
11 21 31 41 12 22 32 42 13 23 33 43 14 24 34 44
and (p2(i,:),i=1,4)
1 5 9 13
2 6 10 14
3 7 11 15
4 8 12 16
which is exactly what I get from DEC compliers on VMS and Tru64.
(I compared print *, p1 with print *, t2 and print *, p2 with print *,t1
as a sanity check)
However, with Fujitsu on Linux my output from Van's code is as follows.
This is obviously a problem area. Has somebody already reported this
to Fujitsu ?
T1 =
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
T2 =
11 12 13 14
21 22 23 24
31 32 33 34
41 42 43 44
P1 => res(reshape(t2,(/16/))) =
0*************** 0 0 0 0 0 0 0 0 0 1
P2 => res(reshape(t1,(/4,4/))) =
0*** 0 0
****** 0 0
*** 0 0 0
*** 0 0 1
SHAPE(P1) = 16
SHAPE(P2) = 4 4
Bob ([log in to unmask])
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|