COIN-OR::LEMON - Graph Library

Changeset 1352:bdbb9144a49e in lemon-0.x


Ignore:
Timestamp:
04/14/05 14:30:18 (15 years ago)
Author:
Alpar Juttner
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@1796
Message:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/lemon/xy.h

    r1317 r1352  
    340340    XMap(M &map) : _map(map) {}
    341341    Value operator[](Key k) const {return _map[k].x;}
    342     Value set(Key k,Value v) {_map.set(k,typename M::Value(v,_map[k].y));}
     342    void set(Key k,Value v) {_map.set(k,typename M::Value(v,_map[k].y));}
    343343  };
    344344   
     
    397397    YMap(M &map) : _map(map) {}
    398398    Value operator[](Key k) const {return _map[k].y;}
    399     Value set(Key k,Value v) {_map.set(k,typename M::Value(_map[k].x,v));}
     399    void set(Key k,Value v) {_map.set(k,typename M::Value(_map[k].x,v));}
    400400  };
    401401
     
    441441
    442442
     443  ///Map of the \ref xy::normSquare() "normSquare()" of an \ref xy "xy"-map
     444
     445  ///Map of the \ref xy::normSquare() "normSquare()" of an \ref xy "xy"-map
     446  ///\ingroup maps
     447  ///
     448  template<class M>
     449  class NormSquareMap
     450  {
     451    const M &_map;
     452  public:
     453    typedef typename M::Value::Value Value;
     454    typedef typename M::Key Key;
     455    ///\e
     456    NormSquareMap(const M &map) : _map(map) {}
     457    Value operator[](Key k) const {return _map[k].normSquare();}
     458  };
     459   
     460  ///Returns a \ref NormSquareMap class
     461
     462  ///This function just returns an \ref NormSquareMap class.
     463  ///
     464  ///\ingroup maps
     465  ///\relates NormSquareMap
     466  template<class M>
     467  inline NormSquareMap<M> normSquareMap(const M &m)
     468  {
     469    return NormSquareMap<M>(m);
     470  }
     471
    443472  /// @}
    444473
Note: See TracChangeset for help on using the changeset viewer.