]> hydra-www.ietfng.org Git - dyna2/commitdiff
added matrixops examples; demonstrates the "edge template overcounting problem" ...
authortimv <tim.f.vieira@gmail.com>
Wed, 12 Dec 2012 19:51:46 +0000 (14:51 -0500)
committertimv <tim.f.vieira@gmail.com>
Wed, 12 Dec 2012 19:51:46 +0000 (14:51 -0500)
examples/matrixops.dyna [new file with mode: 0644]

diff --git a/examples/matrixops.dyna b/examples/matrixops.dyna
new file mode 100644 (file)
index 0000000..8acd48f
--- /dev/null
@@ -0,0 +1,20 @@
+
+% A and B are names of matricies
+times(A, B, I, J) += m(A, I, K) * m(B, K, J).
+
+% matrix "c" is the product of matricies "a" and "b"
+m(c, I, J) += times(a, b, I, J).
+
+% matrix "a" = [ 1 0 ;
+%                0 1 ]
+m(a, 1, 1) += 1.
+m(a, 1, 2) += 0 .
+m(a, 2, 1) += 0 .
+m(a, 2, 2) += 1.
+
+% matrix "b" = [ 3 0 ;
+%                0 2 ]
+m(b, 1, 1) += 3.
+m(b, 1, 2) += 0 .
+m(b, 2, 1) += 0 .
+m(b, 2, 2) += 2.