ocaml: phase 5.1 mat_mul.ml baseline (3x3 row-major matrix multiply, sum = 621)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 26s
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 26s
Triple-nested for loop with row-major indexing:
for i = 0 to n - 1 do
for j = 0 to n - 1 do
for k = 0 to n - 1 do
c.(i * n + j) <- c.(i * n + j) + a.(i * n + k) * b.(k * n + j)
done
done
done
For 3x3 matrices A=[[1..9]] and B=[[9..1]], the resulting C has sum
621. Tests deeply nested for loops on Array, Array.make + arr.(i) +
arr.(i) <- v + Array.fold_left.
50 baseline programs total — milestone.
This commit is contained in:
@@ -407,6 +407,13 @@ _Newest first._
|
||||
binary search tree (`type 'a tree = Leaf | Node of 'a * 'a tree *
|
||||
'a tree`) with insert + in-order traversal. Tests parametric ADT,
|
||||
recursive match, List.append, List.fold_left.
|
||||
- 2026-05-09 Phase 5.1 — mat_mul.ml baseline (3x3 row-major matrix
|
||||
multiply, sum of result = 621). Triple-nested for loop over
|
||||
i / j / k with row-major indexing `c.(i * n + j) <- c.(i * n + j) +
|
||||
a.(i * n + k) * b.(k * n + j)`. Tests deeply nested for loops on
|
||||
Array, Array.make + arr.(i) + arr.(i) <- v + Array.fold_left, and
|
||||
multi-arg let chains with intermediate Array bindings. 50 baseline
|
||||
programs total — milestone.
|
||||
- 2026-05-09 Phase 5.1 — bsearch.ml baseline (binary search,
|
||||
position-sum 6 + 2 + (-1) = 7). Iterative bsearch on a sorted int
|
||||
array using two index refs `lo`/`hi` and a sentinel `found = -1`.
|
||||
|
||||
Reference in New Issue
Block a user