COIN-OR::LEMON - Graph Library

Changeset 1027:8b2b9e61d8ce in lemon-main


Ignore:
Timestamp:
01/11/12 22:43:50 (13 years ago)
Author:
Balazs Dezso <deba@…>
Branch:
default
Phase:
public
Message:

Remove asRedBludeNode() function (#69)

Files:
5 edited

Legend:

Unmodified
Added
Removed
  • lemon/bits/graph_extender.h

    r1026 r1027  
    841841    }
    842842
    843     std::pair<RedNode, BlueNode> asRedBlueNode(const Node& node) const {
    844       if (node == INVALID) {
    845         return std::make_pair(RedNode(INVALID), BlueNode(INVALID));
    846       } else if (Parent::red(node)) {
    847         return std::make_pair(Parent::asRedNodeUnsafe(node), BlueNode(INVALID));
    848       } else {
    849         return std::make_pair(RedNode(INVALID), Parent::asBlueNodeUnsafe(node));
    850       }
    851     }
    852 
    853843    // Alterable extension
    854844
  • lemon/concepts/bpgraph.h

    r1026 r1027  
    801801      BlueNode asBlueNode(const Node&) const { return BlueNode(); }
    802802
    803       /// \brief Convert the node to either red or blue node.
    804       ///
    805       /// If the node is from the red partition then it is returned in
    806       /// first and second is INVALID. If the node is from the blue
    807       /// partition then it is returned in second and first is
    808       /// INVALID. If the node INVALID then both first and second are
    809       /// INVALID in the return value.
    810       std::pair<RedNode, BlueNode> asRedBlueNode(const Node&) const {
    811         return std::make_pair(RedNode(), BlueNode());
    812       }
    813 
    814803      /// \brief Gives back the red end node of the edge.
    815804      ///
  • lemon/concepts/graph_components.h

    r1026 r1027  
    428428      /// returns INVALID.
    429429      BlueNode asBlueNode(const Node&) const { return BlueNode(); }
    430 
    431       /// \brief Convert the node to either red or blue node.
    432       ///
    433       /// If the node is from the red partition then it is returned in
    434       /// first and second is INVALID. If the node is from the blue
    435       /// partition then it is returned in second and first is
    436       /// INVALID. If the node INVALID then both first and second are
    437       /// INVALID in the return value.
    438       std::pair<RedNode, BlueNode> asRedBlueNode(const Node&) const {
    439         return std::make_pair(RedNode(), BlueNode());
    440       }
    441430
    442431      template <typename _BpGraph>
     
    468457            rn = bpgraph.asRedNode(rnan);
    469458            bn = bpgraph.asBlueNode(bnan);
    470             std::pair<RedNode, BlueNode> p = bpgraph.asRedBlueNode(rnan);
    471             ignore_unused_variable_warning(b,p);
     459            ignore_unused_variable_warning(b);
    472460          }
    473461        }
  • lemon/core.h

    r1026 r1027  
    12101210
    12111211      Value operator[](const Key& key) const {
    1212         std::pair<RedNode, BlueNode> red_blue_pair = _from.asRedBlueNode(key);
    1213         if (red_blue_pair.first != INVALID) {
    1214           return _red_node_ref[red_blue_pair.first];
     1212        if (_from.red(key)) {
     1213          return _red_node_ref[_from.asRedNodeUnsafe(key)];
    12151214        } else {
    1216           return _blue_node_ref[red_blue_pair.second];
     1215          return _blue_node_ref[_from.asBlueNodeUnsafe(key)];
    12171216        }
    12181217      }
  • test/graph_test.h

    r1026 r1027  
    5353      check(G.asRedNode(nn) == n,"Wrong node conversion.");
    5454      check(G.asBlueNode(nn) == INVALID,"Wrong node conversion.");
    55       std::pair<typename Graph::RedNode, typename Graph::BlueNode> rbn =
    56         G.asRedBlueNode(nn);
    57       check(rbn.first == n,"Wrong node conversion.");
    58       check(rbn.second == INVALID,"Wrong node conversion.");
    5955      ++n;
    6056    }
     
    7571      check(G.asBlueNode(nn) == n,"Wrong node conversion.");
    7672      check(G.asRedNode(nn) == INVALID,"Wrong node conversion.");
    77       std::pair<typename Graph::RedNode, typename Graph::BlueNode> rbn =
    78         G.asRedBlueNode(nn);
    79       check(rbn.first == INVALID,"Wrong node conversion.");
    80       check(rbn.second == n,"Wrong node conversion.");
    8173      ++n;
    8274    }
Note: See TracChangeset for help on using the changeset viewer.