Difference between revisions of "Col"

From Mesham
Jump to navigationJump to search
m
m
Line 8: Line 8:
  
 
== Example ==
 
== Example ==
 
  
 
  var a:array[Int,10,20] :: allocated[col[] :: multiple[]];
 
  var a:array[Int,10,20] :: allocated[col[] :: multiple[]];
Line 16: Line 15:
 
Where the array is column major allocation, but the programmer has overridden this (just for the assignment) in line 3. If one array of allocation copies to another array of different allocation then transposition will be performed automatically in order to preserve indexes.  
 
Where the array is column major allocation, but the programmer has overridden this (just for the assignment) in line 3. If one array of allocation copies to another array of different allocation then transposition will be performed automatically in order to preserve indexes.  
  
 +
''Since: Version 0.41b''
  
 
[[Category:Type Library]]
 
[[Category:Type Library]]
 
[[Category:Compound Types]]
 
[[Category:Compound Types]]
 
[[Category:Collection Types]]
 
[[Category:Collection Types]]

Revision as of 18:18, 13 January 2013

Syntax

col[ ]

Semantics

In combination with the array, the programmer can specify whether allocation is row or column major. This allocation information is provided in the allocation type. In column major allocation the first dimension is the least major and last dimension most major

Example

var a:array[Int,10,20] :: allocated[col[] :: multiple[]];
a[1][2]:=23;
(a :: row)[1][2]:=23;

Where the array is column major allocation, but the programmer has overridden this (just for the assignment) in line 3. If one array of allocation copies to another array of different allocation then transposition will be performed automatically in order to preserve indexes.

Since: Version 0.41b