COIN-OR::LEMON - Graph Library

Changeset 891:74589d20dbc3 in lemon-0.x for src/hugo/graph_wrapper.h


Ignore:
Timestamp:
09/21/04 00:57:48 (17 years ago)
Author:
Balazs Dezso
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@1199
Message:

template<typename CMap> Map(const CMap&) like constructors and
assigns are removed.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/hugo/graph_wrapper.h

    r888 r891  
    287287      return GraphWrapper<Graph>::tail(e); }
    288288
    289     KEEP_MAPS(Parent, RevGraphWrapper);
     289    //    KEEP_MAPS(Parent, RevGraphWrapper);
    290290
    291291  };
     
    494494    }
    495495
    496     KEEP_MAPS(Parent, SubGraphWrapper);
     496    //    KEEP_MAPS(Parent, SubGraphWrapper);
    497497  };
    498498
     
    559559        return this->graph->tail(e); }
    560560
    561     KEEP_MAPS(Parent, UndirGraphWrapper);
     561    //    KEEP_MAPS(Parent, UndirGraphWrapper);
    562562
    563563  };
     
    566566  ///
    567567  ///\warning Graph wrappers are in even more experimental state than the other
    568   ///parts of the lib. Use them at you own risk.
     568  ///parts of the lib. Use them at your own risk.
    569569  ///
    570570  /// An undirected graph template.
     
    582582    }
    583583
    584     KEEP_MAPS(Parent, UndirGraph);
     584    //    KEEP_MAPS(Parent, UndirGraph);
    585585  };
    586586
     
    895895    /// one for the backward edges.
    896896    class EdgeMap {
     897      template <typename TT> friend class EdgeMap;
    897898      typename Graph::template EdgeMap<T> forward_map, backward_map;
    898899    public:
    899900      typedef T ValueType;
    900901      typedef Edge KeyType;
     902
    901903      EdgeMap(const SubBidirGraphWrapper<Graph,
    902904              ForwardFilterMap, BackwardFilterMap>& g) :
    903905        forward_map(*(g.graph)), backward_map(*(g.graph)) { }
     906
    904907      EdgeMap(const SubBidirGraphWrapper<Graph,
    905908              ForwardFilterMap, BackwardFilterMap>& g, T a) :
    906909        forward_map(*(g.graph), a), backward_map(*(g.graph), a) { }
     910
     911      template <typename TT>
     912      EdgeMap(const EdgeMap<TT>& copy)
     913        : forward_map(copy.forward_map), backward_map(copy.backward_map) {}
     914
     915      template <typename TT>
     916      EdgeMap& operator=(const EdgeMap<TT>& copy) {
     917        forward_map = copy.forward_map;
     918        backward_map = copy.backward_map;
     919        return *this;
     920      }
     921     
    907922      void set(Edge e, T a) {
    908923        if (!e.backward)
     
    911926          backward_map.set(e, a);
    912927      }
    913       T operator[](Edge e) const {
     928
     929      typename Graph::template EdgeMap<T>::ConstReferenceType
     930      operator[](Edge e) const {
    914931        if (!e.backward)
    915932          return forward_map[e];
     
    917934          return backward_map[e];
    918935      }
     936
     937      typename Graph::template EdgeMap<T>::ReferenceType
     938      operator[](Edge e) {
     939        if (!e.backward)
     940          return forward_map[e];
     941        else
     942          return backward_map[e];
     943      }
     944
    919945      void update() {
    920946        forward_map.update();
     
    924950
    925951
    926     KEEP_NODE_MAP(Parent, SubBidirGraphWrapper);
     952    //    KEEP_NODE_MAP(Parent, SubBidirGraphWrapper);
    927953
    928954  };
     
    966992      return 2*this->graph->edgeNum();
    967993    }
    968     KEEP_MAPS(Parent, BidirGraphWrapper);
     994    //    KEEP_MAPS(Parent, BidirGraphWrapper);
    969995  };
    970996
     
    9921018      Parent::setGraph(gr);
    9931019    }
    994     KEEP_MAPS(Parent, BidirGraph);
     1020    //    KEEP_MAPS(Parent, BidirGraph);
    9951021  };
    9961022
     
    11071133    };
    11081134
    1109     KEEP_MAPS(Parent, ResGraphWrapper);
     1135    //    KEEP_MAPS(Parent, ResGraphWrapper);
    11101136  };
    11111137
     
    11691195    }
    11701196
    1171     KEEP_MAPS(Parent, ErasingFirstGraphWrapper);
     1197    //    KEEP_MAPS(Parent, ErasingFirstGraphWrapper);
    11721198  };
    11731199
Note: See TracChangeset for help on using the changeset viewer.