Skip to content

Commit

Permalink
Add == methods for Matrix/Vector
Browse files Browse the repository at this point in the history
  • Loading branch information
d-torrance committed Dec 5, 2024
1 parent cb5bc16 commit 638ae7b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions M2/Macaulay2/m2/matrix.m2
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,8 @@ Matrix == Matrix := (f,g) -> (
target f == target g and
raw(super f * inducedMap(source f, source g)) === raw super g
)
Vector == Matrix := (v,m) -> matrix v == m
Matrix == Vector := (m,v) -> m == matrix v

Matrix == Number :=
Matrix == RingElement :=
Expand Down
2 changes: 2 additions & 0 deletions M2/Macaulay2/tests/normal/vector.m2
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ N = image vars R
v = vector(N, {1, 2, 3})
w = vector(N, {4, 5, 6})
assert Equation(v, vector map(N,, {{1}, {2}, {3}}))
assert Equation(v, matrix v)
assert Equation(matrix v, v)

assert zero vector {0, 0, 0}

Expand Down

0 comments on commit 638ae7b

Please sign in to comment.