Col Type

Next: , Previous: Row, Index: Index

The col[] type, found in the allocation information, will allocate an array and acces it in a column major format, which results in a more efficient memory map for some applications. If you assign an array typed col to one typed row, then transposition will take place (to maintain identical index to value mappings.) If the array is partitioned over a number of processes, then this transposition will be distributed and involve communication.

Examples

var a:array[Int,10,10] :: allocated[col[] :: multiple[]];
((a#2)#4):=88;


In the example a is an array allocated in a column major fashion. The indices in the second line (the assignment) will access location 42.

var a:array[Int,10,10] :: allocated[col[] :: multiple[]];
var e:array[Int,10,10] :: allocated[row[] :: multiple[] :: share[a]];
((a#2)#4):=22;
((e#2)#4):=22;


In this example there are two arrays, a and e both share the same data, but are diffferent major allocations. This is a good example of how using share we can take a different view of the same data - in the allocations, the index for a is 42 and the index for e is 24.

Last Modified: August 2008