       Re: Problems with high-dimensional lists

• Subject: [mg2532] Re: [mg2494] Problems with high-dimensional lists
• From: hay at haystack.demon.co.uk (Allan Hayes)
• Date: Thu, 16 Nov 1995 06:46:49 GMT
• Approved: usenet@wri.com
• Distribution: local
• Newsgroups: wri.mathgroup
• Organization: Wolfram Research, Inc.
• Sender: daemon at wri.com ( )

```

Begin forwarded message:

Sascha
Unzicker<Sascha at sunmail.lrz-muenchen.de,Unzicker at lrz.uni-muenchen.de>
Problems with high-dimensional lists

Reports the following

a=Table[0,{3},{4},{5},{6}];
Dimensions[a]
{3, 4, 5, 6},

a[[1,1]]=Table[x,{6},{5}];  (*1*)
Dimensions[a]
{3, 4}

Transpose[a,{4,1,2,3}];
Transpose::tperm:
Permutation {4, 1, 2, 3} is longer than the dimensions {3,
4} of the array.

Sascha:

After (*1*), a is no longer a cuboidal array. Dimensions only goes
as deep as the cuboidal structure. This is also shown by
TensorRank[original a] being 4 and TensorRank[a after (*1*)] being
2.

A simpler example of the effect is

a=Table[0,{2},{1}]
{{0}, {0}}
TensorRank[a]
2
Dimensions[a]
{2, 1}
a[] = {1,2}
{1, 2}
a
{{1, 2}, {0}}
TensorRank[a]
1
Dimensions[a]
{2}
Transpose[a]
Transpose::nmtx:
The first two levels of the one dimensional list {{1, 2},
{0}}cannot be transposed.

Transpose[{{1, 2}, {0}}]

Allan Hayes
hay at haystack.demon.co.uk

```

• Prev by Date: Re: Recombining CoefficientList
• Next by Date: Re: (fix) bizarre mathematica replacement rule error
• Previous by thread: Re: Problems with high-dimensional lists
• Next by thread: Re: Problems with high-dimensional lists