Skip to main content
10 events
when toggle format what by license comment
Jul 4, 2014 at 17:21 vote accept Zerowalker
Jul 4, 2014 at 17:21 comment added Zerowalker @Edward Ah, don't know much about classes, but i do like the approach. Don't understand how left and right works though, have no idea how it can tall that left is 1 less than right.
Jul 4, 2014 at 11:20 comment added Edward @Zerowalker: I've updated my answer to try to better explain how that part works and also to show an alternative that doesn't have the flaw that JerryCoffin noted in his comment.
Jul 4, 2014 at 11:18 history edited Edward CC BY-SA 3.0
explained and expanded left/right structure mechanism
Jul 4, 2014 at 6:22 comment added Zerowalker @Edward, i tried the left/right, it works, but i don't get why. There is nothing showing why ever even is stored in left, and odd in right.
Jul 4, 2014 at 5:20 comment added Zerowalker Quite interested in that Left Right thing, but i see no way for it to know what left and right means?, left will need to be 1 index behind right (and vice versa).
Jul 3, 2014 at 15:32 comment added Edward @JerryCoffin: That's good point. An alternative might be to define the struct as an array of 2 floats and provide left and right as aliases.
Jul 3, 2014 at 15:22 comment added Jerry Coffin ...but note that the last might not work. The compiler is free to treat the struct as having padding between the items, so left and right might not refer to consecutive items in the input.
Jul 3, 2014 at 13:37 history edited Edward CC BY-SA 3.0
fixed example
Jul 3, 2014 at 13:23 history answered Edward CC BY-SA 3.0