mirror of
https://github.com/boostorg/graph.git
synced 2026-07-21 13:23:42 +00:00
Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 892bc47bd6 | |||
| d347855d50 | |||
| d3db10adba | |||
| adea277486 | |||
| 8669942153 |
@@ -56,6 +56,7 @@ namespace boost {
|
||||
struct property_traits<default_color_type*> {
|
||||
typedef default_color_type value_type;
|
||||
typedef std::ptrdiff_t key_type;
|
||||
typedef default_color_type& reference;
|
||||
typedef lvalue_property_map_tag category;
|
||||
};
|
||||
// get/put already defined for T*
|
||||
|
||||
@@ -58,9 +58,9 @@ namespace boost {
|
||||
class PredecessorMap, class DistanceMap,
|
||||
class BinaryFunction, class BinaryPredicate>
|
||||
bool relax(typename graph_traits<Graph>::edge_descriptor e,
|
||||
const Graph& g, WeightMap w,
|
||||
PredecessorMap p, DistanceMap d,
|
||||
BinaryFunction combine, BinaryPredicate compare)
|
||||
const Graph& g, const WeightMap& w,
|
||||
PredecessorMap& p, DistanceMap& d,
|
||||
const BinaryFunction& combine, const BinaryPredicate& compare)
|
||||
{
|
||||
typedef typename graph_traits<Graph>::directed_category DirCat;
|
||||
bool is_undirected = is_same<DirCat, undirected_tag>::value;
|
||||
|
||||
@@ -49,14 +49,14 @@
|
||||
namespace boost {
|
||||
|
||||
template <class TreeNode, class Compare, class ExternalData>
|
||||
inline TreeNode up_heap(TreeNode x, Compare comp, ExternalData& edata) {
|
||||
inline TreeNode up_heap(TreeNode x, const Compare& comp, ExternalData& edata) {
|
||||
while (x.has_parent() && comp(x, x.parent()))
|
||||
x.swap(x.parent(), edata);
|
||||
return x;
|
||||
}
|
||||
|
||||
template <class TreeNode, class Compare, class ExternalData>
|
||||
inline TreeNode down_heap(TreeNode x, Compare comp, ExternalData& edata) {
|
||||
inline TreeNode down_heap(TreeNode x, const Compare& comp, ExternalData& edata) {
|
||||
while (x.children().size() > 0) {
|
||||
typename TreeNode::children_type::iterator
|
||||
child_iter = std::min_element(x.children().begin(),
|
||||
@@ -71,7 +71,7 @@ namespace boost {
|
||||
}
|
||||
|
||||
template <class TreeNode, class Compare, class ExternalData>
|
||||
inline void update_heap(TreeNode x, Compare comp, ExternalData& edata) {
|
||||
inline void update_heap(TreeNode x, const Compare& comp, ExternalData& edata) {
|
||||
x = down_heap(x, comp, edata);
|
||||
(void)up_heap(x, comp, edata);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user