COIN-OR::LEMON - Graph Library

Changeset 365:9ca84022df34 in lemon-0.x


Ignore:
Timestamp:
04/21/04 20:56:26 (16 years ago)
Author:
Mihaly Barasz
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@493
Message:

Masikfele iteralas, Node-hoz alkalmazkodva...

Location:
src/work/klao
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/work/klao/iter_map.h

    r362 r365  
    1111#include <cstring>
    1212
     13#include <invalid.h>
    1314
    1415namespace hugo {
     
    113114    }
    114115
     116
     117    /// For use as an iterator...
     118    KeyType& first(KeyType &k, Val n) {
     119      size_t i = (n ? bounds[n-1] : 0);
     120      if( i < bounds[n] ) {
     121        k = data[i];
     122      }
     123      else {
     124        k = INVALID;
     125      }
     126      return k;
     127    }
     128
     129    /// For use as an iterator...
     130    KeyType& next(KeyType &k) {
     131      size_t i = base[k];
     132      uint8_t n = find(i);
     133      ++i;
     134      if( i < bounds[n] ) {
     135        k = data[i];
     136      }
     137      else {
     138        k = INVALID;
     139      }
     140      return k;
     141    }
     142
    115143  };
    116144
  • src/work/klao/iter_map_test.cc

    r362 r365  
    2626  }
    2727}
    28 
    29 
    3028
    3129int main() {
Note: See TracChangeset for help on using the changeset viewer.