COIN-OR::LEMON - Graph Library

Changeset 987:87f7c54892df in lemon-0.x for src/work


Ignore:
Timestamp:
11/13/04 18:07:10 (19 years ago)
Author:
Alpar Juttner
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@1377
Message:

Naming changes:

Location:
src/work
Files:
18 edited

Legend:

Unmodified
Added
Removed
  • src/work/alpar/boolmap_iter.cc

    r986 r987  
    1414  typedef typename GG::Edge Edge;
    1515 
    16   typedef Edge KeyType;
    17   typedef bool ValueType;
     16  typedef Edge Key;
     17  typedef bool Value;
    1818 
    1919  friend class RefType;
     
    6868    RefType(BoolIterEdgeMap &_M,Edge _e) : M(_M), e(_e) { }
    6969   
    70     operator ValueType() const
     70    operator Value() const
    7171    {
    7272      return M.isTrue(e);
    7373     
    7474    }
    75     ValueType operator = (ValueType v) const
     75    Value operator = (Value v) const
    7676    {
    7777      if(v) M.setTrue(e);
  • src/work/alpar/dijkstra.h

    r986 r987  
    4747    typedef LM LengthMap;
    4848    //The type of the length of the edges.
    49     typedef typename LM::ValueType ValueType;
     49    typedef typename LM::Value Value;
    5050    ///The heap type used by Dijkstra algorithm.
    5151
     
    5555    ///\sa Dijkstra
    5656    typedef BinHeap<typename Graph::Node,
    57                     typename LM::ValueType,
     57                    typename LM::Value,
    5858                    typename GR::template NodeMap<int>,
    59                     std::less<ValueType> > Heap;
     59                    std::less<Value> > Heap;
    6060
    6161    ///\brief The type of the map that stores the last
     
    9191    ///It must meet the \ref concept::WriteMap "WriteMap" concept.
    9292    ///
    93     typedef typename Graph::template NodeMap<typename LM::ValueType> DistMap;
     93    typedef typename Graph::template NodeMap<typename LM::Value> DistMap;
    9494    ///Instantiates a DistMap.
    9595 
     
    110110  ///
    111111  ///The type of the length is determined by the
    112   ///\ref concept::ReadMap::ValueType "ValueType" of the length map.
     112  ///\ref concept::ReadMap::Value "Value" of the length map.
    113113  ///
    114114  ///It is also possible to change the underlying priority heap.
     
    159159   
    160160    ///The type of the length of the edges.
    161     typedef typename TR::LengthMap::ValueType ValueType;
     161    typedef typename TR::LengthMap::Value Value;
    162162    ///The type of the map that stores the edge lengths.
    163163    typedef typename TR::LengthMap LengthMap;
     
    388388       
    389389        Node v=heap.top();
    390         ValueType oldvalue=heap[v];
     390        Value oldvalue=heap[v];
    391391        heap.pop();
    392392        distance->set(v, oldvalue);
     
    421421    ///\warning If node \c v in unreachable from the root the return value
    422422    ///of this funcion is undefined.
    423     ValueType dist(Node v) const { return (*distance)[v]; }
     423    Value dist(Node v) const { return (*distance)[v]; }
    424424
    425425    ///Returns the 'previous edge' of the shortest path tree.
     
    498498    typedef typename TR::LengthMap LengthMap;
    499499    ///The type of the length of the edges.
    500     typedef typename LengthMap::ValueType ValueType;
     500    typedef typename LengthMap::Value Value;
    501501    ///\brief The type of the map that stores the last
    502502    ///edges of the shortest paths.
  • src/work/alpar/f_ed_ka.h

    r986 r987  
    1414namespace lemon {
    1515  template <typename Graph, typename FlowMap, typename CapacityMap>
    16   typename FlowMap::ValueType maxFlow(Graph &G,
     16  typename FlowMap::Value maxFlow(Graph &G,
    1717                                      FlowMap &f,
    1818                                      CapacityMap &c,
     
    2626    typedef typename Graph::OutEdgeIt OutEdgeIt;
    2727    typedef typename Graph::InEdgeIt InEdgeIt;
    28     typedef typename FlowMap::ValueType T;
     28    typedef typename FlowMap::Value T;
    2929   
    3030    T flow_val = 0;
  • src/work/alpar/rw_nonref_map.cc

    r986 r987  
    1111  typedef typename GG::Edge Edge;
    1212 
    13   typedef Edge KeyType;
    14   typedef TT ValueType;
     13  typedef Edge Key;
     14  typedef TT Value;
    1515 
    1616  class RefType
     
    2121    RefType(Graph &_G,Edge _e) : G(_G), e(_e) { }
    2222   
    23     operator ValueType() const
     23    operator Value() const
    2424    {
    25       ValueType tmp;
     25      Value tmp;
    2626      std::cout << G.id(G.source(e)) << "->"
    2727                << G.id(G.target(e)) << ": ";
     
    2929      return tmp;
    3030    }
    31     ValueType operator = (ValueType v) const
     31    Value operator = (Value v) const
    3232    {
    3333      std::cout << G.id(G.source(e)) << "->"
     
    4848{
    4949public:
    50   typedef K KeyType;
    51   typedef T ValueType;
     50  typedef K Key;
     51  typedef T Value;
    5252 
    5353  class RefType
    5454  {
    55     ValueType val;
     55    Value val;
    5656  public:
    57     RefType(ValueType v) : val(v) { }   
    58     operator ValueType() const { return val; }
    59     ValueType operator = (ValueType v) const { return val; }
     57    RefType(Value v) : val(v) { }   
     58    operator Value() const { return val; }
     59    Value operator = (Value v) const { return val; }
    6060  };
    6161 
    6262private:
    63   ValueType val;
     63  Value val;
    6464public:
    65   NullMap(ValueType v) : val(v) { }
    66   RefType operator[] (KeyType e) const { return RefType(v);} 
     65  NullMap(Value v) : val(v) { }
     66  RefType operator[] (Key e) const { return RefType(v);} 
    6767};
    6868
  • src/work/athos/mincostflow.h

    r986 r987  
    4444  class MinCostFlow {
    4545
    46     typedef typename CostMap::ValueType Cost;
    47 
    48 
    49     typedef typename SupplyDemandMap::ValueType SupplyDemand;
     46    typedef typename CostMap::Value Cost;
     47
     48
     49    typedef typename SupplyDemandMap::Value SupplyDemand;
    5050   
    5151    typedef typename Graph::Node Node;
     
    6969      const NodeMap &pot;
    7070    public :
    71       typedef typename CostMap::KeyType KeyType;
    72       typedef typename CostMap::ValueType ValueType;
     71      typedef typename CostMap::Key Key;
     72      typedef typename CostMap::Value Value;
    7373       
    74       ValueType operator[](typename ResGraph::Edge e) const {     
     74      Value operator[](typename ResGraph::Edge e) const {     
    7575        if (res_graph.forward(e))
    7676          return  ol[e]-(pot[res_graph.target(e)]-pot[res_graph.source(e)]);   
  • src/work/athos/old/minlengthpaths.h

    r986 r987  
    3131  class MinLengthPaths {
    3232
    33     typedef typename LengthMap::ValueType Length;
     33    typedef typename LengthMap::Value Length;
    3434   
    3535    typedef typename Graph::Node Node;
     
    5050      const NodeMap &pot;
    5151    public :
    52       typedef typename LengthMap::KeyType KeyType;
    53       typedef typename LengthMap::ValueType ValueType;
    54        
    55       ValueType operator[](typename ResGraphType::Edge e) const {     
     52      typedef typename LengthMap::Key Key;
     53      typedef typename LengthMap::Value Value;
     54       
     55      Value operator[](typename ResGraphType::Edge e) const {     
    5656        //if ( (1-2*rev[e])*ol[e]-(pot[G.target(e)]-pot[G.source(e)] ) <0 ){
    5757        //  std::cout<<"Negative length!!"<<std::endl;
  • src/work/athos/union_find.h

    r921 r987  
    1616namespace lemon {
    1717 
    18   template <typename KeyType, typename KeyIntMap>
     18  template <typename Key, typename KeyIntMap>
    1919    class UnionFind {
    2020    KeyIntMap& pointmap;
     
    3535   
    3636    //Give a component of one point to the structure
    37     int addPoint(KeyType u){
     37    int addPoint(Key u){
    3838      int _index = container.size();
    3939      VectorElementType buf(_index,1);
     
    4444   
    4545    //Finds the big boss of u
    46     int find(KeyType u){
     46    int find(Key u){
    4747      if (pointmap.get(u)==-1){
    4848        int whoami = addPoint(u);
     
    6262
    6363    //Finds u and v in the structures and merges the comopnents, if not equal
    64     bool findAndMerge(KeyType u,KeyType v){
     64    bool findAndMerge(Key u,Key v){
    6565      int bu = find(u);
    6666      int bv = find(v);
  • src/work/deba/dijkstra.h

    r921 r987  
    2222  ///so it is easy to change it to any kind of length.
    2323  ///
    24   ///The type of the length is determined by the \c ValueType of the length map.
     24  ///The type of the length is determined by the \c Value of the length map.
    2525  ///
    2626  ///It is also possible to change the underlying priority heap.
     
    6060   
    6161    ///The type of the length of the edges.
    62     typedef typename LM::ValueType ValueType;
     62    typedef typename LM::Value Value;
    6363    ///The type of the map that stores the edge lengths.
    6464    typedef LM LengthMap;
     
    7070    typedef typename Graph::template NodeMap<Node> PredNodeMap;
    7171    ///The type of the map that stores the dists of the nodes.
    72     typedef typename Graph::template NodeMap<ValueType> DistMap;
     72    typedef typename Graph::template NodeMap<Value> DistMap;
    7373
    7474  private:
     
    217217      typename GR::template NodeMap<int> heap_map(*G,-1);
    218218     
    219       typedef Heap<Node, ValueType, typename GR::template NodeMap<int>,
    220       std::less<ValueType> >
     219      typedef Heap<Node, Value, typename GR::template NodeMap<int>,
     220      std::less<Value> >
    221221      HeapType;
    222222     
     
    228228       
    229229        Node v=heap.top();
    230         ValueType oldvalue=heap[v];
     230        Value oldvalue=heap[v];
    231231        heap.pop();
    232232        distance->set(v, oldvalue);
     
    262262    ///\warning If node \c v in unreachable from the root the return value
    263263    ///of this funcion is undefined.
    264     ValueType dist(Node v) const { return (*distance)[v]; }
     264    Value dist(Node v) const { return (*distance)[v]; }
    265265
    266266    ///Returns the 'previous edge' of the shortest path tree.
  • src/work/klao/iter_map.h

    r921 r987  
    2626  public:
    2727
    28     typedef typename KeyIntMap::KeyType KeyType;
    29     typedef Val ValueType;
     28    typedef typename KeyIntMap::Key Key;
     29    typedef Val Value;
    3030
    31     typedef typename std::vector<KeyType>::const_iterator iterator;
     31    typedef typename std::vector<Key>::const_iterator iterator;
    3232
    3333  protected:
    3434    KeyIntMap &base;
    35     std::vector<KeyType> data;
     35    std::vector<Key> data;
    3636    size_t bounds[N];
    3737    Val def_val;
     
    5656      if(m != n) {
    5757        size_t orig_a = a;
    58         KeyType orig_key = data[a];
     58        Key orig_key = data[a];
    5959        while(m > n) {
    6060          --m;
     
    8181    }
    8282
    83     Val operator[](const KeyType& k) const {
     83    Val operator[](const Key& k) const {
    8484      return find(base[k]);
    8585    }
    8686
    87     void set(const KeyType& k, Val n) {
     87    void set(const Key& k, Val n) {
    8888      // FIXME: range check?
    8989      size_t a = base[k];
     
    9696    }
    9797
    98     void insert(const KeyType& k, Val n) {
     98    void insert(const Key& k, Val n) {
    9999      data.push_back(k);
    100100      base.set(k, move(bounds[N-1]++, N-1, n));
     
    103103    /// This func is not very usable, but necessary to implement
    104104    /// dynamic map behaviour.
    105     void remove(const KeyType& k) {
     105    void remove(const Key& k) {
    106106      size_t a = base[k];
    107107      if(a < bounds[N-1]) {
     
    131131
    132132    /// For use as an iterator...
    133     KeyType& first(KeyType &k, Val n) {
     133    Key& first(Key &k, Val n) {
    134134      size_t i = (n ? bounds[n-1] : 0);
    135135      if( i < bounds[n] ) {
     
    143143
    144144    /// For use as an iterator...
    145     KeyType& next(KeyType &k) {
     145    Key& next(Key &k) {
    146146      size_t i = base[k];
    147147      uint8_t n = find(i);
  • src/work/marci/augmenting_flow.h

    r986 r987  
    113113      int* number_of_augmentations;
    114114    public:
    115       typedef Node KeyType;
    116       typedef bool ValueType;
     115      typedef Node Key;
     116      typedef bool Value;
    117117      TrickyReachedMap(IntMap& _map, int& _number_of_augmentations) :
    118118        map(&_map), number_of_augmentations(&_number_of_augmentations) { }
  • src/work/marci/bfs_mm.h

    r986 r987  
    141141    /// Guess what?
    142142    /// \deprecated
    143     typename ReachedMap::ValueType reached(const Node& n) const {
     143    typename ReachedMap::Value reached(const Node& n) const {
    144144      return (*reached_map)[n];
    145145    }
     
    243243    /// Guess what?
    244244    /// \deprecated
    245     typename PredMap::ValueType pred(const Node& n) const {
     245    typename PredMap::Value pred(const Node& n) const {
    246246      return (*pred_map)[n];
    247247    }
     
    251251    /// Guess what?
    252252    /// \deprecated
    253     typename PredNodeMap::ValueType predNode(const Node& n) const {
     253    typename PredNodeMap::Value predNode(const Node& n) const {
    254254      return (*pred_node_map)[n];
    255255    }
     
    259259    /// Guess what?
    260260    /// \deprecated
    261     typename DistMap::ValueType dist(const Node& n) const {
     261    typename DistMap::Value dist(const Node& n) const {
    262262      return (*dist_map)[n];
    263263    }
  • src/work/marci/bipartite_graph_wrapper.h

    r986 r987  
    795795    template<typename NM> class NodeMapWrapper {
    796796    public:
    797       typedef Node KeyType;
    798       typedef typename NM::ValueType ValueType;
     797      typedef Node Key;
     798      typedef typename NM::Value Value;
    799799    protected:
    800800      NM* nm;
    801       ValueType* s_value, t_value;
    802     public:
    803       NodeMapWrapper(NM& _nm, ValueType& _s_value, ValueType& _t_value) :
     801      Value* s_value, t_value;
     802    public:
     803      NodeMapWrapper(NM& _nm, Value& _s_value, Value& _t_value) :
    804804        nm(&_nm), s_value(&_s_value), t_value(&_t_value) { }
    805       ValueType operator[](const Node& n) const {
     805      Value operator[](const Node& n) const {
    806806        switch (n.getSpec()) {
    807807        case 0:
     
    814814        }
    815815      }
    816       void set(const Node& n, ValueType t) {
     816      void set(const Node& n, Value t) {
    817817        switch (n.getSpec()) {
    818818        case 0:
     
    874874    class EdgeMapWrapper {
    875875    public:
    876       typedef Edge KeyType;
    877       typedef typename EM::ValueType ValueType;
     876      typedef Edge Key;
     877      typedef typename EM::Value Value;
    878878    protected:
    879879      EM* em;
     
    881881    public:
    882882      EdgeMapWrapper(EM& _em, NM& _nm) : em(&_em), nm(&_nm) { }
    883       ValueType operator[](const Edge& e) const {
     883      Value operator[](const Edge& e) const {
    884884        switch (e.getSpec()) {
    885885        case 0:
     
    892892        }
    893893      }
    894       void set(const Edge& e, ValueType t) {
     894      void set(const Edge& e, Value t) {
    895895        switch (e.getSpec()) {
    896896        case 0:
  • src/work/marci/experiment/list_graph.h

    r986 r987  
    3939      std::vector<T> container;
    4040    public:
    41       typedef T ValueType;
    42       typedef Node KeyType;
     41      typedef T Value;
     42      typedef Node Key;
    4343      NodeMap(const ListGraph& _G) : G(_G), container(G.node_id) { }
    4444      NodeMap(const ListGraph& _G, T a) :
     
    6060      std::vector<T> container;
    6161    public:
    62       typedef T ValueType;
    63       typedef Edge KeyType;
     62      typedef T Value;
     63      typedef Edge Key;
    6464      EdgeMap(const ListGraph& _G) : G(_G), container(G.edge_id) { }
    6565      EdgeMap(const ListGraph& _G, T a) :
  • src/work/marci/graph_concept.h

    r986 r987  
    168168    {
    169169    public:
    170       typedef T ValueType;
    171       typedef Node KeyType;
     170      typedef T Value;
     171      typedef Node Key;
    172172
    173173      NodeMap(const GraphConcept& g) { }
     
    206206    {
    207207    public:
    208       typedef T ValueType;
    209       typedef Edge KeyType;
     208      typedef T Value;
     209      typedef Edge Key;
    210210
    211211      EdgeMap(const GraphConcept& g) {}
  • src/work/marci/leda/leda_graph_wrapper.h

    r986 r987  
    262262      leda_node_map<T> leda_stuff;
    263263    public:
    264       typedef T ValueType;
    265       typedef Node KeyType;
     264      typedef T Value;
     265      typedef Node Key;
    266266
    267267      NodeMap(const LedaGraphWrapper &G) : leda_stuff(*(G.l_graph)) {}
     
    282282      leda_edge_map<T> leda_stuff;
    283283    public:
    284       typedef T ValueType;
    285       typedef Edge KeyType;
     284      typedef T Value;
     285      typedef Edge Key;
    286286
    287287      EdgeMap(const LedaGraphWrapper &G) : leda_stuff(*(G.l_graph)) {}
     
    304304      leda_node_array<T>* leda_stuff;
    305305    public:
    306       typedef T ValueType;
    307       typedef Node KeyType;
     306      typedef T Value;
     307      typedef Node Key;
    308308
    309309      NodeMapWrapper(leda_node_array<T>& _leda_stuff) :
     
    326326      leda_edge_array<T>* leda_stuff;
    327327    public:
    328       typedef T ValueType;
    329       typedef Edge KeyType;
     328      typedef T Value;
     329      typedef Edge Key;
    330330
    331331      EdgeMapWrapper(leda_edge_array<T>& _leda_stuff) :
  • src/work/peter/edgepathgraph.h

    r986 r987  
    307307    {
    308308    public:
    309       typedef T ValueType;
    310       typedef Node KeyType;
     309      typedef T Value;
     310      typedef Node Key;
    311311
    312312      NodeMap(const EdgePathGraph &) {}
     
    345345    {
    346346    public:
    347       typedef T ValueType;
    348       typedef Edge KeyType;
     347      typedef T Value;
     348      typedef Edge Key;
    349349
    350350      EdgeMap(const EdgePathGraph &) {}
  • src/work/peter/hierarchygraph.h

    r986 r987  
    434434    {
    435435    public:
    436       typedef T ValueType;
    437       typedef Node KeyType;
     436      typedef T Value;
     437      typedef Node Key;
    438438
    439439      NodeMap (const HierarchyGraph &)
     
    490490    {
    491491    public:
    492       typedef T ValueType;
    493       typedef Edge KeyType;
     492      typedef T Value;
     493      typedef Edge Key;
    494494
    495495      EdgeMap (const HierarchyGraph &)
  • src/work/sage_graph.h

    r986 r987  
    3939      std::vector<T> container;
    4040    public:
    41       typedef T ValueType;
    42       typedef Node KeyType;
     41      typedef T Value;
     42      typedef Node Key;
    4343      NodeMap(const SageGraph& _G) : G(_G), container(G.node_id) { }
    4444      NodeMap(const SageGraph& _G, T a) :
     
    6060      std::vector<T> container;
    6161    public:
    62       typedef T ValueType;
    63       typedef Edge KeyType;
     62      typedef T Value;
     63      typedef Edge Key;
    6464      EdgeMap(const SageGraph& _G) : G(_G), container(G.edge_id) { }
    6565      EdgeMap(const SageGraph& _G, T a) :
Note: See TracChangeset for help on using the changeset viewer.