From 38e141d37ec9664e0924bcd301ffa2245a360f1c Mon Sep 17 00:00:00 2001 From: timv Date: Wed, 12 Dec 2012 14:51:46 -0500 Subject: [PATCH] added matrixops examples; demonstrates the "edge template overcounting problem" - a template which shouldnt fire more than once results in overcounting. --- examples/matrixops.dyna | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 examples/matrixops.dyna diff --git a/examples/matrixops.dyna b/examples/matrixops.dyna new file mode 100644 index 0000000..8acd48f --- /dev/null +++ b/examples/matrixops.dyna @@ -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. -- 2.50.1