lemon/concepts/graph_components.h
changeset 1148 0900cfe4a84d
parent 1087 dd1443e4a34c
equal deleted inserted replaced
38:a98e8832d758 39:40012b11d42d
     1 /* -*- mode: C++; indent-tabs-mode: nil; -*-
     1 /* -*- mode: C++; indent-tabs-mode: nil; -*-
     2  *
     2  *
     3  * This file is a part of LEMON, a generic C++ optimization library.
     3  * This file is a part of LEMON, a generic C++ optimization library.
     4  *
     4  *
     5  * Copyright (C) 2003-2010
     5  * Copyright (C) 2003-2013
     6  * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
     6  * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
     7  * (Egervary Research Group on Combinatorial Optimization, EGRES).
     7  * (Egervary Research Group on Combinatorial Optimization, EGRES).
     8  *
     8  *
     9  * Permission to use, modify and distribute this software is granted
     9  * Permission to use, modify and distribute this software is granted
    10  * provided that this copyright notice appears in all copies. For
    10  * provided that this copyright notice appears in all copies. For
   389       ///
   389       ///
   390       /// Gives back %true for blue nodes.
   390       /// Gives back %true for blue nodes.
   391       bool blue(const Node&) const { return true; }
   391       bool blue(const Node&) const { return true; }
   392 
   392 
   393       /// \brief Gives back the red end node of the edge.
   393       /// \brief Gives back the red end node of the edge.
   394       /// 
   394       ///
   395       /// Gives back the red end node of the edge.
   395       /// Gives back the red end node of the edge.
   396       RedNode redNode(const Edge&) const { return RedNode(); }
   396       RedNode redNode(const Edge&) const { return RedNode(); }
   397 
   397 
   398       /// \brief Gives back the blue end node of the edge.
   398       /// \brief Gives back the blue end node of the edge.
   399       /// 
   399       ///
   400       /// Gives back the blue end node of the edge.
   400       /// Gives back the blue end node of the edge.
   401       BlueNode blueNode(const Edge&) const { return BlueNode(); }
   401       BlueNode blueNode(const Edge&) const { return BlueNode(); }
   402 
   402 
   403       /// \brief Converts the node to red node object.
   403       /// \brief Converts the node to red node object.
   404       ///
   404       ///
  1148       typedef typename Base::Node Node;
  1148       typedef typename Base::Node Node;
  1149       typedef typename Base::RedNode RedNode;
  1149       typedef typename Base::RedNode RedNode;
  1150       typedef typename Base::BlueNode BlueNode;
  1150       typedef typename Base::BlueNode BlueNode;
  1151       typedef typename Base::Arc Arc;
  1151       typedef typename Base::Arc Arc;
  1152       typedef typename Base::Edge Edge;
  1152       typedef typename Base::Edge Edge;
  1153       
  1153 
  1154       typedef IterableBpGraphComponent BpGraph;
  1154       typedef IterableBpGraphComponent BpGraph;
  1155 
  1155 
  1156       using IterableGraphComponent<BAS>::first;
  1156       using IterableGraphComponent<BAS>::first;
  1157       using IterableGraphComponent<BAS>::next;
  1157       using IterableGraphComponent<BAS>::next;
  1158 
  1158 
  1208         void constraints() {
  1208         void constraints() {
  1209           checkConcept<IterableGraphComponent<Base>, _BpGraph>();
  1209           checkConcept<IterableGraphComponent<Base>, _BpGraph>();
  1210 
  1210 
  1211           typename _BpGraph::RedNode rn(INVALID);
  1211           typename _BpGraph::RedNode rn(INVALID);
  1212           bpgraph.first(rn);
  1212           bpgraph.first(rn);
  1213           bpgraph.next(rn); 
  1213           bpgraph.next(rn);
  1214           typename _BpGraph::BlueNode bn(INVALID);
  1214           typename _BpGraph::BlueNode bn(INVALID);
  1215           bpgraph.first(bn);
  1215           bpgraph.first(bn);
  1216           bpgraph.next(bn);
  1216           bpgraph.next(bn);
  1217 
  1217 
  1218           checkConcept<GraphItemIt<_BpGraph, typename _BpGraph::RedNode>,
  1218           checkConcept<GraphItemIt<_BpGraph, typename _BpGraph::RedNode>,