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:
co-authored by
Claude Sonnet 5.5
parent
26ece9cc9b
commit
35ef0872de
@@ -0,0 +1,24 @@
|
||||
Transpose
|
||||
=========
|
||||
|
||||
2x3 matrix
|
||||
[1 2 3]
|
||||
[4 5 6]
|
||||
transpose() gives a 3x2 matrix
|
||||
[1 4]
|
||||
[2 5]
|
||||
[3 6]
|
||||
|
||||
3x3 matrix, transposeInPlace()
|
||||
[1 2 3]
|
||||
[4 5 6]
|
||||
[7 8 9]
|
||||
becomes
|
||||
[1 4 7]
|
||||
[2 5 8]
|
||||
[3 6 9]
|
||||
|
||||
isSymmetric([[1,7,3],[7,4,-5],[3,-5,6]]) = true
|
||||
isSymmetric([[1,2],[3,4]]) = false
|
||||
|
||||
transposeInPlace on a 2x3 matrix -> IllegalArgumentException: in-place transpose needs a square matrix but got 2x3
|
||||
Reference in New Issue
Block a user