[Lemon-commits] [lemon_svn] alpar: r150 - hugo/trunk/src/work/alpar
Lemon SVN
svn at lemon.cs.elte.hu
Mon Nov 6 20:37:49 CET 2006
Author: alpar
Date: Sun Feb 22 13:51:34 2004
New Revision: 150
Modified:
hugo/trunk/src/work/alpar/smart_graph.h
Log:
.
Modified: hugo/trunk/src/work/alpar/smart_graph.h
==============================================================================
--- hugo/trunk/src/work/alpar/smart_graph.h (original)
+++ hugo/trunk/src/work/alpar/smart_graph.h Sun Feb 22 13:51:34 2004
@@ -282,6 +282,7 @@
DynMapBase<NodeIt>(_G), container(_G.maxNodeId())
{
//FIXME: What if there are empty Id's?
+ //FIXME: Can I use 'this' in a constructor?
G->dyn_node_maps.push_back(this);
}
~DynNodeMap()
@@ -290,7 +291,12 @@
std::vector<DynMapBase<NodeIt>* >::iterator i;
for(i=G->dyn_node_maps.begin();
i!=G->dyn_node_maps.end() && *i!=this; ++i) ;
- if(*i==this) G->dyn_node_maps.erase(i); //FIXME: Way too slow...
+ //if(*i==this) G->dyn_node_maps.erase(i); //FIXME: Way too slow...
+ //A better way to do that: (Is this really important?)
+ if(*i==this) {
+ G->dyn_node_maps[i]=G->dyn_node_maps.back;
+ G->dyn_node_maps.pop_back();
+ }
}
}
@@ -324,7 +330,7 @@
DynMapBase<EdgeIt>(_G), container(_G.maxEdgeId())
{
//FIXME: What if there are empty Id's?
- //FIXME: Can I do that? :
+ //FIXME: Can I use 'this' in a constructor?
G->dyn_edge_maps.push_back(this);
}
~DynEdgeMap()
@@ -333,10 +339,15 @@
std::vector<DynMapBase<EdgeIt>* >::iterator i;
for(i=G->dyn_edge_maps.begin();
i!=G->dyn_edge_maps.end() && *i!=this; ++i) ;
- if(*i==this) G->dyn_edge_maps.erase(i); //FIXME: Way too slow...
+ //if(*i==this) G->dyn_edge_maps.erase(i); //Way too slow...
+ //A better way to do that: (Is this really important?)
+ if(*i==this) {
+ G->dyn_edge_maps[i]=G->dyn_edge_maps.back;
+ G->dyn_edge_maps.pop_back();
+ }
}
}
-
+
void add(const EdgeIt k)
{
if(k.n>=int(container.size())) container.resize(k.n+1);
More information about the Lemon-commits
mailing list