       Transpose[ InterpolatingFunction, { n1, n2, ...} ]

• To: mathgroup at smc.vnet.net
• Subject: [mg81195] Transpose[ InterpolatingFunction, { n1, n2, ...} ]
• From: pdickof at scf.sk.ca
• Date: Sat, 15 Sep 2007 04:11:18 -0400 (EDT)

```Suppose I have a table, grid lines, InterpolatingFunction, and order
list as follows ...

lens = {6, 5, 4}
t = Table[i + j + k,
{i,1, lens[], 1},
{j, 10, 10lens[], 10},
{k, 100, 100lens[], 100}]
g = {Range[lens[]], 10Range[lens[]], 100Range[lens[]]}
f = ListInterpolation[t, g]

Evaluate that and everything makes sense. Note that

Dimensions[t]==Map[Length,g]

Now let me transpose as follows ...

axisPosit = {3, 2, 1};
t2 = Transpose[t, axisPosit]
g2 = Part[g, axisPosit]
o2 = Part[o, axisPosit]
f2 = ListInterpolation[t2, g2, InterpolationOrder -> o2]

Again, no problems on evaluation. and

Dimensions[t2]==Map[Length,g2]

Trying all permutations of {1,2,3},... we see that the Dimensions and
Lengths do not always agree (and the corresponding ListInterpolation
must fail)

Map[{#,
Dimensions[t2 = Transpose[t, #]] == Map[Length, g2 = Part[g,
#]],
Permutations[Range]] // MatrixForm

I think all of these cases should always be True. Is there a bug in
Transpose or am I confused?

I am trying to generalize Transpose to work on InterpolatingFunctions
including those where an N1-D InterpolatingFunction has data for only
N2-D dimensional hyperplanes where (0<=N2<=N1) (ie. where elements in
the list lens above can be =1). The function would be

myTranspose[ InterpolatingFunction, {n1, n2,  ...} ]

I intend to check that Sort[{n1, n2, ...}]==Range[N1]

Does anyone have any advice on how to accomplish this?