I was working with the 7x7 Hilbert on my HP-28S and decided that I wanted to work with the 5x5. I placed the 7x7 in level 2, placed {5,5} in level 1, and hit RDM. I didn't get a 5x5 Hilbert. Instead I got the following
1 1/2 1/3 1/4 1/51/6 1/7 1/2 1/3 1/4
1/5 1/6 1/7 1/8 1/3
1/4 1/5 1/6 1/7 1/8
1/9 1/4 1/5 1/6 1/7
Wow! I decided to follow the advice I have often given to others "When all else fails, try reading the instructions." I found that my strange result was due to the way the 28 (and the 49) does a Redimension. Quoting from HP28S Reference Manual:
"... Elements taken from array1 preserve the same row order in array2. If array2 is dimensioned to contain fewer elements than array1, excess elements from array1 at the end of the row order are discarded. ..."
Once I understood what RDM did I could get from the 7x7 to the 5x5 with the following sequence:
7x7 matrix in level 1
{ 5,7} in the display
Press RDM - Discards the bottom two rows of the 7x7
Press TRN - Moves the 6th and 7th columns to the 6th and 7th rows
{5,5} in the display
Press RDM - Discards the 6th and 7th rows, which were the 6th and 7th columns
Press TRN
I now have a 5x5 matrix using the 5x5 elements from the 7x7 matrix. Of course, when working with symmetric matrices like the Hilberts I do not have to do the final TRN.
I have two questions:
Is there an easier way to accomplish the desired task?
What is an application for the RDM function as mechanized?