Skip to content

Commit

Permalink
Matrix-update has auxiliary functions in it too
Browse files Browse the repository at this point in the history
  • Loading branch information
JosephBond committed Oct 5, 2023
1 parent 2900713 commit 8ab6811
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
7 changes: 6 additions & 1 deletion fluid/example/dtw/matrix-update.fld
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
let mat = [| (n+m) | (n,m) in (3, 3)|];
let localMinUpdate seq1 seq2 matrix (i, j) =
let fmin Infty Infty = EQ;
fmin Infty (FNum y) = GT;
fmin (FNum x) Infty = LT;
fmin (FNum x) (FNum y) = compare x y;
let fminimal = foldr1 fmin;
let localMinUpdate seq1 seq2 matrix (i, j) =
let iEntr = nth (i - 1) seq1;
jEntr = nth (j - 1) seq2;
dist = iEntr - jEntr;
Expand Down
8 changes: 3 additions & 5 deletions test/Main.purs
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,9 @@ test_scratchpad :: Array (String × Aff Unit)
test_scratchpad = second void <$> many
[ { file: "dtw/matrix-update"
, fwd_expect:
"FNum 0, Infty, Infty, Infty, Infty, Infty, Infty,\n\
\Infty, FNum 0, FNum 0, Infty, Infty, Infty, Infty,\n\
\Infty, FNum 0, FNum 0, FNum 0, Infty, Infty, Infty,\n\
\Infty, Infty, FNum 0, FNum 0, FNum 0, Infty, Infty,\n\
\Infty, Infty, Infty, FNum 0, FNum 0, FNum 0, Infty"
"2, 3, 4,\n\
\3, 52, 5,\n\
\4, 5, -45"
}
]
1
Expand Down
2 changes: 1 addition & 1 deletion test/Util.purs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ test ∷ Int -> File -> ProgCxt Unit -> TestConfig -> Aff BenchRow
test n file progCxt tconfig = do
gconfig <- initialConfig progCxt
s <- open file
testPretty s
-- testPretty s
rows <- replicateM n $ do
trRow <- testTrace s gconfig.γ tconfig
grRow <- testGraph s gconfig tconfig
Expand Down

0 comments on commit 8ab6811

Please sign in to comment.