aboutsummaryrefslogtreecommitdiff
path: root/src/heap.cpp (unfollow)
AgeCommit message (Collapse)Author
2008-03-24Removed the backtrace stuff, it had some bugs, and shouldn't be here all theMike Buland
time anyway. Recompile everything.
2008-03-20This is a preliminary test of my new server simplification subclass, don't useMike Buland
it yet, the name will change. I really, really, really want the name to change.
2008-03-07Minor updates to MiniMacroMike Buland
2008-03-04Added backtrace support to the Exception system. It's pretty simple, if it'sMike Buland
enabled, and the compiler/libc support it, then you just get backtraces, if not you get a message about it not being supported. It probably shouldn't be enabled in most production environments, since it does happen for every exception, and could be memory and time consuming.
2008-02-26Some simple getters that are const safe weren't labeled as such. Oops.Mike Buland
2008-02-26Thought this may be handy. It should have more functions and things later, butMike Buland
it's basically an uber-simple counter class that's thread-safe!
2008-02-20Applied an update from Hash to Set (they're basically the same logic/code, inMike Buland
fact, I need to get in there and change all the comments and exceptions in Set to refer to Set and not Hash). Util has the functors in it that are shared now, and List actually uses those functors for it's insertSorted function, that thing has come in so handy.
2008-02-19Oops. I made the Bu::Heap API look like a stack, not a queue, that's beenMike Buland
fixed, and the Bu::ItoHeap is working and tested. Note that when multiple items have the same sort order, they will come out in random order.
2008-02-19I believe this will do the trick. The Bu::Heap class now uses the appropriateMike Buland
allocators for all work, every data type used in a Bu::Heap must support the equals operator and <= or >=, or you need to write your own comparison functor. The heap works as both a min-heap and max-heap, just change out the functor used for camparison, kinda' cool. The print function I'll leave in for a little while, but not in the long run, it just prints a dot graph to stdout. Next up, the Ito version.
2008-02-19Bu::Heap is a real class, it works great, except it doesn't grow right now.Mike Buland
I'm thinking the heap should add one layer to the binary tree each time it grows, which means double+1 each time. The Bu::ItoHeap will be implemented as soon as the rest of Bu::Heap is done. Also, I finally added bu/util.h which is mainly handy template functions like Bu::swap, Bu::min, Bu::max, and Bu::mid. A few more may be added.