chiark / gitweb /
before new shortest path graph layout cost function
[moebius2.git] / mgraph.h
index 9f02e88c418438c682321d6d30ea916c0ac0ca9e..ae341fae532786f45a2b53c779802eeb47ab0f25 100644 (file)
--- a/mgraph.h
+++ b/mgraph.h
 extern int edge_end2(unsigned v1, int e);
 #define EDGE_END2 edge_end2
 
+#define FOR_VEDGE_X(v1,e,init,otherwise)       \
+  FOR_VPEDGE((v1),(e))                         \
+    if (((v2)= EDGE_END2((v1),(e)),            \
+        (init),                                \
+        (v2)) < 0) { otherwise } else
+
+#define NOTHING ((void)0)
+
 #define FOR_VEDGE(v1,e) \
-  FOR_VPEDGE((v1),(e))
-    if (((v2)= EDGE_END2((v1),(e))) < 0) ; else
+  FOR_VEDGE_X(v1,e,NOTHING,NOTHING)
 
 #define FOR_EDGE(v1,e,v2) \
   FOR_VERTEX((v1)) \
@@ -97,4 +104,7 @@ typedef struct {
   double v[N][D3];
 } Layout;
 
+double hypotD(const double p[D3], const double q[D3]);
+double hypotD2(const double p[D3], const double q[D3]);
+
 #endif /*MGRAPH_H*/