Add matrix module: addition, multiplication, transpose, spiral and rotation programs, dry-run traces, operation counts, seeded law checks, six pitfalls (10 tests)

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017ic4b4pD5LRLNWAecBNsj9
This commit is contained in:
asmhatre
2026-11-16 10:48:48 +05:30
co-authored by Claude Sonnet 5.5
parent 26ece9cc9b
commit 35ef0872de
27 changed files with 1435 additions and 0 deletions
+12
View File
@@ -0,0 +1,12 @@
Seeded random checks (seed 2026, 2000 trials each)
==================================================
rotateClockwise == transpose-then-reverse == layer swaps (n x n, n = 1..8): 2000 agree, 0 disagree
four clockwise turns return the original: 2000 agree, 0 disagree
clockwise then counter-clockwise returns the original: 2000 agree, 0 disagree
transpose twice returns the original (random m x n): 2000 agree, 0 disagree
(A * B) transposed == B transposed * A transposed: 2000 agree, 0 disagree
A * I == A and I * A == A: 2000 agree, 0 disagree
i-j-k product == i-k-j product: 2000 agree, 0 disagree
A * (B + C) == A * B + A * C: 2000 agree, 0 disagree
spiral order is a permutation of all m * n elements: 2000 agree, 0 disagree