summaryrefslogtreecommitdiff
path: root/src/generic/problemresolver/choice_indexed_map.h
AgeCommit message (Collapse)AuthorFilesLines
2009-06-25Make choice_indexed_map::try_get a const method.Daniel Burrows1-1/+1
2009-06-18Fix how the size of a choice_indexed_set is counted.Daniel Burrows1-4/+10
2009-06-16Compute the size of choice indexed maps.Daniel Burrows1-5/+25
2009-06-09Add 3-way comparisons to the resolver layer instead of using operator<.Daniel Burrows1-1/+2
A 3-way comparison is the traditional "return <0, =0, or >0" protocol. The implementation supports compile-time polymorphism to select the most appropriate comparison, defaulting to operator<. This yields a huge improvement in the program run-time, probably because the program compares lots of complex objects, especially things like imm::set objects that build their comparison from sub-comparisons. It would still be good to overload compare3<> on the types used in the aptitude resolver universe -- although the core types are simple enough that the compiler will probably be able to optimize the extra comparisons away (I hope, anyway).
2009-06-06Add a convenience routine in choice_indexed_map that checks whether a map ↵Daniel Burrows1-0/+21
contains a key.
2009-06-04Add support for writing a choice_indexed_map to a std::ostream.Daniel Burrows1-1/+43
2009-06-02Fix enough compile errors that the problem resolver subdirectory compiles.Daniel Burrows1-5/+5
The rest of the code still needs to be overhauled to take the changes into account, and it looks like there are bugs in code that's only instantiated from the client (e.g., reject_version()).
2009-06-01More compile fixes.Daniel Burrows1-1/+1
2009-06-01Fix some type errors in the choice indexed map.Daniel Burrows1-5/+5
2009-06-01Add a for_each method on choice-indexed maps that lets client code iterate ↵Daniel Burrows1-1/+63
over *all* entries, not just some of them.
2009-06-01More compile fixes.Daniel Burrows1-1/+1
2009-05-29Various compilation fixes for the problem resolver.Daniel Burrows1-5/+7
2009-05-25Kill off dep-scoped choices.Daniel Burrows1-128/+37
These were always a little weird, they turn out not to be necessary for the purpose they were originally introduced to serve, and they play havoc with some of the optimizations I'm working on. They aren't necessary to generate promotions for approvals, because only the deferred choice itself would get this special tag. Just by the usual way promotions are generalized, the dep-scoped choice is always eliminated before it does anything useful. The specific problem motivating this change is that dep-scoped choices make it much trickier to have a mapping from choices to lists of solved dependencies using the generic choice_indexed_map object. This isn't an insurmountable problem, but considering the other issues with dep-scoped choices, I thought it was a good idea to get rid of them. For instance, look at how much simpler choice_indexed_map is when it doesn't have to support dep-scoping.
2009-05-25Rework the choice-indexed-set stuff in terms of a choice-indexed-map instead.Daniel Burrows1-0/+487
A map is a more natural fit for the semantics of the core data structure than a set, and the set behavior can easily be layered on top. This will be very slightly less efficient (a few extra traversals of the set for some operations), but most of that can be recovered if it matters.