Index: lemon/static_graph.h
===================================================================
--- lemon/static_graph.h	(revision 820)
+++ lemon/static_graph.h	(revision 821)
@@ -33,5 +33,5 @@
 
     StaticDigraphBase() 
-      : node_num(-1), arc_num(0), 
+      : built(false), node_num(0), arc_num(0), 
         node_first_out(NULL), node_first_in(NULL),
         arc_source(NULL), arc_target(NULL), 
@@ -39,5 +39,5 @@
     
     ~StaticDigraphBase() {
-      if (node_num != -1) {
+      if (built) {
         delete[] node_first_out;
         delete[] node_first_in;
@@ -129,8 +129,6 @@
     typedef True BuildTag;
     
-    template <typename Digraph, typename NodeRefMap, typename ArcRefMap>
-    void build(const Digraph& digraph, NodeRefMap& nodeRef, ArcRefMap& arcRef) {
-
-      if (node_num != -1) {
+    void clear() {
+      if (built) {
         delete[] node_first_out;
         delete[] node_first_in;
@@ -140,7 +138,15 @@
         delete[] arc_next_in;
       }
-
+      built = false;
+      node_num = 0;
+      arc_num = 0;
+    }
+    
+    template <typename Digraph, typename NodeRefMap, typename ArcRefMap>
+    void build(const Digraph& digraph, NodeRefMap& nodeRef, ArcRefMap& arcRef) {
       typedef typename Digraph::Node GNode;
       typedef typename Digraph::Arc GArc;
+
+      built = true;
 
       node_num = countNodes(digraph);
@@ -206,5 +212,6 @@
     }
 
-  private:
+  protected:
+    bool built;
     int node_num;
     int arc_num;
@@ -224,4 +231,13 @@
 
     typedef ExtendedStaticDigraphBase Parent;
+  
+  public:
+  
+    template <typename Digraph, typename NodeRefMap, typename ArcRefMap>
+    void build(const Digraph& digraph, NodeRefMap& nodeRef, ArcRefMap& arcRef) {
+      if (built) Parent::clear();
+      Parent::build(digraph, nodeRef, arcRef);
+    }
+  
 
   protected:
@@ -262,4 +278,20 @@
     };
 
+    Node baseNode(const OutArcIt &arc) const {
+      return Parent::source(static_cast<const Arc&>(arc));
+    }
+
+    Node runningNode(const OutArcIt &arc) const {
+      return Parent::target(static_cast<const Arc&>(arc));
+    }
+
+    Node baseNode(const InArcIt &arc) const {
+      return Parent::target(static_cast<const Arc&>(arc));
+    }
+
+    Node runningNode(const InArcIt &arc) const {
+      return Parent::source(static_cast<const Arc&>(arc));
+    }
+
   };
 
Index: test/digraph_test.cc
===================================================================
--- test/digraph_test.cc	(revision 463)
+++ test/digraph_test.cc	(revision 821)
@@ -20,4 +20,5 @@
 #include <lemon/list_graph.h>
 #include <lemon/smart_graph.h>
+#include <lemon/static_graph.h>
 #include <lemon/full_graph.h>
 
@@ -318,4 +319,8 @@
     checkConcept<ClearableDigraphComponent<>, SmartDigraph>();
   }
+  { // Checking StaticDigraph
+    checkConcept<Digraph, StaticDigraph>();
+    checkConcept<ClearableDigraphComponent<>, StaticDigraph>();
+  }
   { // Checking FullDigraph
     checkConcept<Digraph, FullDigraph>();
@@ -371,4 +376,74 @@
   check(!g.valid(g.nodeFromId(-1)), "Wrong validity check");
   check(!g.valid(g.arcFromId(-1)), "Wrong validity check");
+}
+
+void checkStaticDigraph() {
+  SmartDigraph g;
+  SmartDigraph::NodeMap<StaticDigraph::Node> nref(g);
+  SmartDigraph::ArcMap<StaticDigraph::Arc> aref(g);
+  
+  StaticDigraph G;
+  
+  checkGraphNodeList(G, 0);
+  checkGraphArcList(G, 0);
+
+  G.build(g, nref, aref);
+
+  checkGraphNodeList(G, 0);
+  checkGraphArcList(G, 0);
+
+  SmartDigraph::Node
+    n1 = g.addNode(),
+    n2 = g.addNode(),
+    n3 = g.addNode();
+
+  G.build(g, nref, aref);
+
+  checkGraphNodeList(G, 3);
+  checkGraphArcList(G, 0);
+
+  SmartDigraph::Arc a1 = g.addArc(n1, n2);
+
+  G.build(g, nref, aref);
+
+  check(G.source(aref[a1]) == nref[n1] && G.target(aref[a1]) == nref[n2],
+        "Wrong arc or wrong references");
+  checkGraphNodeList(G, 3);
+  checkGraphArcList(G, 1);
+
+  checkGraphOutArcList(G, nref[n1], 1);
+  checkGraphOutArcList(G, nref[n2], 0);
+  checkGraphOutArcList(G, nref[n3], 0);
+
+  checkGraphInArcList(G, nref[n1], 0);
+  checkGraphInArcList(G, nref[n2], 1);
+  checkGraphInArcList(G, nref[n3], 0);
+
+  checkGraphConArcList(G, 1);
+
+  SmartDigraph::Arc
+    a2 = g.addArc(n2, n1),
+    a3 = g.addArc(n2, n3),
+    a4 = g.addArc(n2, n3);
+
+  digraphCopy(g, G).nodeRef(nref).run();
+
+  checkGraphNodeList(G, 3);
+  checkGraphArcList(G, 4);
+
+  checkGraphOutArcList(G, nref[n1], 1);
+  checkGraphOutArcList(G, nref[n2], 3);
+  checkGraphOutArcList(G, nref[n3], 0);
+
+  checkGraphInArcList(G, nref[n1], 1);
+  checkGraphInArcList(G, nref[n2], 1);
+  checkGraphInArcList(G, nref[n3], 2);
+
+  checkGraphConArcList(G, 4);
+
+  checkNodeIds(G);
+  checkArcIds(G);
+  checkGraphNodeMap(G);
+  checkGraphArcMap(G);
 }
 
@@ -420,4 +495,7 @@
     checkDigraphValidity<SmartDigraph>();
   }
+  { // Checking StaticDigraph
+    checkStaticDigraph();
+  }
   { // Checking FullDigraph
     checkFullDigraph(8);
