equal
deleted
inserted
replaced
51 public : |
51 public : |
52 typedef typename LengthMap::KeyType KeyType; |
52 typedef typename LengthMap::KeyType KeyType; |
53 typedef typename LengthMap::ValueType ValueType; |
53 typedef typename LengthMap::ValueType ValueType; |
54 |
54 |
55 ValueType operator[](typename ResGraphType::Edge e) const { |
55 ValueType operator[](typename ResGraphType::Edge e) const { |
56 //if ( (1-2*rev[e])*ol[e]-(pot[G.head(e)]-pot[G.tail(e)] ) <0 ){ |
56 //if ( (1-2*rev[e])*ol[e]-(pot[G.target(e)]-pot[G.source(e)] ) <0 ){ |
57 // std::cout<<"Negative length!!"<<std::endl; |
57 // std::cout<<"Negative length!!"<<std::endl; |
58 //} |
58 //} |
59 return (1-2*rev[e])*ol[e]-(pot[G.head(e)]-pot[G.tail(e)]); |
59 return (1-2*rev[e])*ol[e]-(pot[G.target(e)]-pot[G.source(e)]); |
60 } |
60 } |
61 |
61 |
62 ModLengthMap(const ResGraphType& _G, const EdgeIntMap& _rev, |
62 ModLengthMap(const ResGraphType& _G, const EdgeIntMap& _rev, |
63 const LengthMap &o, const NodeMap &p) : |
63 const LengthMap &o, const NodeMap &p) : |
64 G(_G), rev(_rev), ol(o), pot(p){}; |
64 G(_G), rev(_rev), ol(o), pot(p){}; |
159 G.first(e,n); |
159 G.first(e,n); |
160 |
160 |
161 while (!reversed[e]){ |
161 while (!reversed[e]){ |
162 G.next(e); |
162 G.next(e); |
163 } |
163 } |
164 n = G.head(e); |
164 n = G.target(e); |
165 paths[j].push_back(e); |
165 paths[j].push_back(e); |
166 total_length += length[e]; |
166 total_length += length[e]; |
167 reversed[e] = 1-reversed[e]; |
167 reversed[e] = 1-reversed[e]; |
168 } |
168 } |
169 |
169 |