Re: basic program


[Prev][Next][Index][Thread]

Re: basic program



sierrawyoming wrote:

> Greetings,
>         I'm new to this list-serve, so this question may have been discussed
> before, but I would appreciate someone's expertise.  Basically I am writing
> a program for my TI-89 which will require a 10 (or greater) dimensional
> matrix.  That is to say M(1,2,3,4,5,6,7,8,9,10...) would point to one
> element.  I realize this would take up a lot of memory, but my main concern
> is that this may not be possible.  I could not find any reference to a
> n-dimension matrix in the manual, only 2-dimensional matrices. Thanks in
> advance to anyone who can help me,
>
> Jp
>

You could always _simulate_ a higher-order array by indexing into a long
vector.
For example, to index an array that has five dimensions, each of length 10, the
element
m(3,0,8,6,1) would be in position 30861 in your list. Notice that we are
counting the first position as 0 here, not 1.  If the dimensions are not of
length 10, you would have to work in a different base, or in a mixed base.

    Given the programming environmkent of the TI-89, you could create little
"pipeline" functions to do this translating for you, so that the actual
accessing (and writing back) calls would be more transparent. The main
disadvantage (aside from the complexity of the arithmetic) would be that this
would be slow. If you are only making occasional calls and updates perhaps you
could stand it.  But 10 dimensions gives you a _lot_ of data! How are you even
going to _initialize_ your array?

RWW Taylor
National Technical Institute for the Deaf
Rochester Institute of Technology
Rochester NY 14623

>>>> The plural of mongoose begins with p. <<<<

P.S. Of course this issue has nothing to do with the Basic language, per se!

******************************************************************
* To UNSUBSCRIBE, send an email TO: listserv@lists.ppp.ti.com
* with a message (not the subject) that reads SIGNOFF CALC-TI
*
* Archives at http://peach.ease.lsoft.com/archives/calc-ti.html
******************************************************************