Macro to decide the best search directon on dual-way ring based pointer chains. More...
This graph shows which files directly or indirectly include this file:Go to the source code of this file.
Defines | |
| #define | DIR_R 'R' |
| #define | DIR_L 'L' |
| #define | DIRECTION(s, d, l) (s>d ? ((((l-s)+d) > (s-d)) ? DIR_L : DIR_R) : (((d-s) > ((l-d)+s)) ? DIR_L : DIR_R)) |
Macro to decide the best search directon on dual-way ring based pointer chains.
Definition in file eurephia_directions.h.
| #define DIR_L 'L' |
"Left" direction, where the ID number decreases (previous element)
Definition at line 36 of file eurephia_directions.h.
| #define DIR_R 'R' |
"Right" direction, where the ID number increases (next element)
Definition at line 35 of file eurephia_directions.h.
| #define DIRECTION | ( | s, | ||
| d, | ||||
| l | ||||
| ) | (s>d ? ((((l-s)+d) > (s-d)) ? DIR_L : DIR_R) : (((d-s) > ((l-d)+s)) ? DIR_L : DIR_R)) |
This macro finds the quickest way to go from one element to another one in a circular dual-way pointer chain, based on a numeric id of the elements.
| s | starting point on the chain | |
| d | destination point on the chain | |
| l | number of elements in the chain |
Definition at line 48 of file eurephia_directions.h.
1.7.1