blackh Fri Jan 4 21:35:28 2002 EDT
Modified files:
/grapevine/raisen/grapevine vector.xml
Log:
Index: grapevine/raisen/grapevine/vector.xml
diff -u grapevine/raisen/grapevine/vector.xml:1.2 grapevine/raisen/grapevine/vector.xml:1.3
--- grapevine/raisen/grapevine/vector.xml:1.2 Fri Jan 4 12:58:17 2002
+++ grapevine/raisen/grapevine/vector.xml Fri Jan 4 21:35:28 2002
@@ -11,7 +11,7 @@
...
-->
<grapevine>
- <grapevine.vector author1="Stephen Blackheath" rev="$Id: vector.xml,v 1.2 2002/01/04 20:58:17 blackh Exp $">
+ <grapevine.vector author1="Stephen Blackheath" rev="$Id: vector.xml,v 1.3 2002/01/05 05:35:28 blackh Exp $">
<rules>
<!-- Format of various facts
@@ -47,18 +47,25 @@
endBit = ((no+1) * 160) / dims,
bits = endBit - startBit,
value = ((vector >> startBit) & ((1 << bits)-1)) << (160-bits),
- fire new <co-ord vector="[vector]" no="[no]" value="[value]"/>,
+ <!-- Can't use fire here, because we need to have the results
+ of two splits in memory at the same time.
+ \todo: Better to use 'assert' here, but we need to extend the
+ language to allow detaching the <dimensions/> fact as an
+ assert parent -->
+ remember new <co-ord vector="[vector]" no="[no]" value="[value]"/>,
s#no = s#no + 1; <!-- Causes this rule to re-fire -->
sum_squares:
d=<distance a="[a]" b="[b]"/>,
!bound(d#dist),
- <co-ord vector="[a]" no="[no]" value="[v1]"/>,
- <co-ord vector="[b]" no="[no]" value="[v2]"/>,
+ c1=<co-ord vector="[a]" no="[no]" value="[v1]"/>,
+ c2=<co-ord vector="[b]" no="[no]" value="[v2]"/>,
+ retract c1,
+ retract c2,
diff = v1 - v2,
square = diff * diff,
d#sum\-of\-squares = d#sum\-of\-squares + square;
-
+
square_root:
d=<distance a="[a]" b="[b]"/>,
!bound(d#dist),
|