As my professional career continues, I slowly drift further and further from these sorts of problems. But if you need to know about the day-to-day practicalities of implementing bit-bang protocols, radio controls, frequency hopping, clock synchronization, or anything in that direction, I can certainly help you.
I'm not worried that I couldn't move back in the algorithms direction, just commenting that I am doing that very little anymore.
I happen to like oscilloscopes and logic analyzers and embedded systems a lot, though. For Christmas I got a pretty cool beginner RC helicopter, which was a cool gift in itself. But some part of the fun for me was in realizing that they had implemented a 2.4GHz DSSS radio with diversity receive (a very difficult feat) in a consumer level product (even more difficult!), and opening it up to see what transceiver chipset they were using. (Cypress WirelessUSB series stuff, if you care, but they had to put two receiver chips in for diversity functionality...)
It is true that Gnuplot's default colors are basically the worst choices possible. Fixing this is not easy, and I didn't want to waste more time than I already had.
Let D be the input matrix (with annoying 1-based indexing -- which actually turns out to be useful when coding a solution with python). "D" for "Data".
Let C(i,j) = sum_{p=1 to i} sum_{q=1 to j} D(p,q). Note that C is the same size as D. For convenience, also define C(i,0)=C(0,j)=0 (yay zero-based!). "C" for "Corner". Obviously C can be computed in O(N^2).
The sum over the sub-rectangle CartesianProduct((u,v], (x,y]) is C(v,y)-C(u,y)-C(v,x)+C(u,x). This makes more sense when standing on a grid-tiled floor, preferably while sipping tea. Enumerating all rectangles is easy (4 nested for-loops) in O(N^4).
I can has fortran? takes ~30sec in python. I don't yet quite grok the algorithms you posted.
Comments 14
Reply
Reply
Reply
(The comment has been removed)
I happen to like oscilloscopes and logic analyzers and embedded systems a lot, though. For Christmas I got a pretty cool beginner RC helicopter, which was a cool gift in itself. But some part of the fun for me was in realizing that they had implemented a 2.4GHz DSSS radio with diversity receive (a very difficult feat) in a consumer level product (even more difficult!), and opening it up to see what transceiver chipset they were using. (Cypress WirelessUSB series stuff, if you care, but they had to put two receiver chips in for diversity functionality...)
Reply
(The comment has been removed)
Reply
Reply
Reply
Also what kirinn said.
Reply
the chart was truncated on the right side on my view of your entry, with no scrollbar.
Reply
Let C(i,j) = sum_{p=1 to i} sum_{q=1 to j} D(p,q). Note that C is the same size as D. For convenience, also define C(i,0)=C(0,j)=0 (yay zero-based!). "C" for "Corner". Obviously C can be computed in O(N^2).
The sum over the sub-rectangle CartesianProduct((u,v], (x,y]) is C(v,y)-C(u,y)-C(v,x)+C(u,x). This makes more sense when standing on a grid-tiled floor, preferably while sipping tea. Enumerating all rectangles is easy (4 nested for-loops) in O(N^4).
I can has fortran? takes ~30sec in python. I don't yet quite grok the algorithms you posted.
Reply
Leave a comment