Re: Dimension of sequences
- Posted by Al Getz <Xaxo at aol?c?m> Sep 16, 2007
- 672 views
Hello again, The game of chess if often referred to as having move sequences that exist on the edge of a multi-dimensional object, so i suppose you could say the same thing about a sequence. My question would be say you defined the 'dimension' of a sequence as the product of the max of all the inner sequences written out such as 1x2x3 as is sometimes customary with arrays. What would you use this information for in a program? When i did my jpeg decoder program in Euphoria i used sequences like arrays where every level had the same length: s=repeat(0,10) s=repeat(s,4) s=repeat(s,9) s=repeat(s,5) and this builds up a structure similar to a C style array where every level has the same length. The above code creates 5 three dimensional 'arrays' that can be accessed by index. I would have no problem calling this a 10x4x9x5 or a 5x9x4x10 'sequence', but the actual common useage seems to be to use every element, but then again i could easily see an app that although includes a given element, does not in fact use that element in the program, ever, and of course the implication of this is that an element missing altogether (only possible with a sequence) does not necessarily decrease the length because the other sequences at the same level contain more elements: s={ {1,2,3,4}, {5,6,7} } is still a 2x4 sequence. If you want to get more detailed, you might have to start enumerating every element and returning a sequence that corresponds to that sequence. As with the above, this would be: m={4,3} I guess this would simply be a sequence with the lengths of all first level sequences arranged in the same structure as the original sequence, which would still have to be perused. Again i would have to wonder about how useful this would be unless the sequence isnt that big. For example, "When do i need to know the actual structure of the sequence in full?" Some applications would be interesting to hear about at this point. Take care, Al E boa sorte com sua programacao Euphoria! My bumper sticker: "I brake for LED's" From "Black Knight": "I can live with losing the good fight, but i can not live without fighting it". "Well on second thought, maybe not."