# Thread: Help with tuple/set construction

1. ## Help with tuple/set construction

I'm trying to develop a structure that will create a 1d index that refers to the contents of a 2d index, to try to flatten a table structure. For example, f:i --> (j,k). The table is:

You can see from this that Phi is a linear index that accesses the Alpha x Delta cell according to the Cartesian product. The set notation that I've put together follows:

I still feel that this is wrong; any ideas about how this can be done?

Because order is important, I wanted to create the C_Phi and C_Alpha,Delta as tuples.

2. Originally Posted by RandomThinker
I'm trying to develop a structure that will create a 1d index that refers to the contents of a 2d index, to try to flatten a table structure. For example, f:i --> (j,k). The table is:

You can see from this that Phi is a linear index that accesses the Alpha x Delta cell according to the Cartesian product. The set notation that I've put together follows:

I still feel that this is wrong; any ideas about how this can be done?

Because order is important, I wanted to create the C_Phi and C_Alpha,Delta as tuples.
LinearIndex=ColumnIndex + NumbColumns*(RowIndex-1)

CB

3. Thanks Capn...here is my latest incantation:

Now here's the conundrum. Since the set C_Phi is correct in i and C_Alpha,Delta is correct in (j,k), then I can't help but think that the two can be combined to produce the set {(i,j,k),...,(m,n,p)} that would contain all the information that is needed to access the data linearly, according to the table above.