[Lemon-devel] bug: direction of the coordinates in a grid

Barasz Mihaly klao at cs.elte.hu
Tue Jan 29 05:13:12 CET 2008


Hi,

I've fixed my previous issue with grid_ugraph.h. (In a most trivial way,
by making the functions inline. :))

Today, I want to discuss another issue with it. :)
The GridUGraph is coordinated in (x, y) manner. (When you create it, you
supply (width, height), and when you access a node, you supply two
coordinates: first is 0<=...<width, second: 0<=...<height).

And there are functions to access edges: up(), down(), left(), right().
For example the node (0,0) has two edges incident to it: right() and
down(). Meaning, the origin is in the top-left corner!

I think that's wrong. The origin can be in the top-left corner in a
mathematical library. But then, it's a matrix and the coordinates are
(row, column) and not (column, row).

But to access the points like pixels on a monitor??? That's nonsense! :)))

No seriously, I think this is really a bug, and have to be fixed. And
the documentation for this file have to be improved too. It's imposible
to figure out the order of the coordinates from the documentation
itself, only from the little example at the top. And the position of the
origin (that is, the behaviour of the up/down left/right functions) you
can only deduce from the code!

						Misi



More information about the Lemon-devel mailing list