options Transpose[] ?
- To: mathgroup at smc.vnet.net
- Subject: [mg48977] options Transpose[] ?
- From: Petr Kujan <kujanp at fel.cvut.cz>
- Date: Fri, 25 Jun 2004 17:52:19 -0400 (EDT)
- Organization: Czech Technical University
- Sender: owner-wri-mathgroup at wolfram.com
Hello Mathematica User Group.
If I have an multidimensional array A:
In[1] :=
A = Array[Random[]&, dims = {3,2,4}]
Than I expect that dimension of transposed A with options per = {3,1,2}
is equal {4,3,2} === dims[[per]] , but it is not equal!
Dimensions of transposed A with options per = {3,1,2} is:
{2,4,3}.
In[2] :=
Dimensions[Transpose[A, per = {3, 1, 2}]]
dims[[per]]
It' s correct or it's bug?
How can I get the same dimensions?
(*-----------------------------------------------------------------------*)
This is a code for other possible options per in Transpose[A,per] and
tests if it's equal dims[[per]]:
In[3] :=
d = Length[dims];
Dimensions[Transpose[A, #]] == dims[[#]]& /@ Permutations[Range[d]]
I require all elements in True!
(*-----------------------------------------------------------------------*)
Thanks a lot,
Petr