COIN-OR::LEMON - Graph Library

Changeset 2212:0ad3835449f8 in lemon-0.x for lemon/dim2.h


Ignore:
Timestamp:
09/08/06 10:55:07 (18 years ago)
Author:
Balazs Dezso
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@2940
Message:

Some small improvments

size() and subscription operators
compatibility with higher dimensions

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lemon/dim2.h

    r2207 r2212  
    7474      Point(T a, T b) : x(a), y(b) { }
    7575
     76      ///Size of vector
     77      int size() const { return 2; }
     78
     79      ///Subscripting operator
     80      T& operator[](int idx) { return idx == 0 ? x : y; }
     81
     82      ///Const subscripting operator
     83      const T& operator[](int idx) const { return idx == 0 ? x : y; }
    7684
    7785      ///Conversion constructor
     
    164172  ///\relates Point
    165173  template <typename T>
    166   inline Point<T> make_Point(const T& x, const T& y) {
     174  inline Point<T> makePoint(const T& x, const T& y) {
    167175    return Point<T>(x, y);
    168176  }
Note: See TracChangeset for help on using the changeset viewer.