Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision |
dev:program_ulam [2015/07/07 14:18] – [Node Elements] xychen | dev:program_ulam [2016/01/14 07:13] (current) – ackley |
---|
==== EventWindow Indices ==== | ==== EventWindow Indices ==== |
| |
The following graph shows the index numbers within an ''EventWindow''. The ''EventWindow'' has two functions to describe those indices. The ''getCoord(siteNum)'' converts an 1-d index(which is an ''Unsigned(6)'' ) to a 2-d coordinate(which is a quark ''C2D''). The ''getSiteNumber(coord)'' convert ''C2D'' back to 1-d ''Unsigned(6)''. The quark ''C2D'' has ''getX()'' and ''getY()'' to interpret the //(x,y)// better. | {{ :dev:event-window-10.png?300|}} The image at right (click to enlarge) shows the indexing scheme used for sites within an ''EventWindow''. Both 2D 'coord' numbering and a 1D 'site number' approach are offered. |
| |
{{:dev:ew_indx2d.png?280|}} | The ''getCoord(siteNum)'' function converts an 1D index (which is an ''Unsigned(6)'' ) to a 2D coordinate (which is a quark ''C2D''). The ''getSiteNumber(coord)'' convert ''C2D'' back to 1-d ''Unsigned(6)''. The quark ''C2D'' has ''getX()'' and ''getY()'' methods to access the //x// and //y// coordinate values individually. |
| |
| In general, when code is referring to individual fixed sites within the event window, the 1D coordinate system is used (see the 'First' element below for an example). Two-dimensional C2D indexing is more commonly used when there is some flexibility depending on geometry or relative positions. |
| |
| |
EventWindow ew; | EventWindow ew; |
Void behave(){ | Void behave(){ |
ew[1]=ew[0]; | ew[1]=ew[0]; // Copy self one site west |
} | } |
} | } |