diff --git a/M2/Macaulay2/m2/matrix.m2 b/M2/Macaulay2/m2/matrix.m2 index 5d73a6ca02..7b27f72664 100644 --- a/M2/Macaulay2/m2/matrix.m2 +++ b/M2/Macaulay2/m2/matrix.m2 @@ -129,20 +129,20 @@ Matrix == ZZ := (m,i) -> if i === 0 then rawIsZero m.RawMatrix else m - i == 0 Matrix + Matrix := Matrix => ( (f,g) -> map(target f, source f, reduce(target f, raw f + raw g)) ) @@ toSameRing -Matrix + RingElement := (f,r) -> if r == 0 then f else f + r*id_(target f) -RingElement + Matrix := (r,f) -> if r == 0 then f else r*id_(target f) + f -Number + Matrix := (i,f) -> if i === 0 then f else i*id_(target f) + f -Matrix + Number := (f,i) -> if i === 0 then f else f + i*id_(target f) +Matrix + RingElement := +Matrix + Number := (f,r) -> if r == 0 then f else f + r*id_(target f) +RingElement + Matrix := +Number + Matrix := (r,f) -> f + r Vector + Number := Vector + RingElement := (v,r) -> vector(matrix v + r) Number + Vector := RingElement + Vector := (r,v) -> vector(r + matrix v) Matrix - Matrix := Matrix => ( (f,g) -> map(target f, source f, reduce(target f, raw f - raw g)) ) @@ toSameRing -Matrix - RingElement := (f,r) -> if r == 0 then f else f - r*id_(target f) -RingElement - Matrix := (r,f) -> if r == 0 then -f else r*id_(target f) - f -Number - Matrix := (i,f) -> if i === 0 then -f else i*id_(target f) - f -Matrix - Number := (f,i) -> if i === 0 then f else f - i*id_(target f) +Matrix - RingElement := +Matrix - Number := (f,r) -> if r == 0 then f else f - r*id_(target f) +RingElement - Matrix := +Number - Matrix := (r,f) -> -f + r Vector - Number := Vector - RingElement := (v,r) -> vector(matrix v - r) Number - Vector := RingElement - Vector := (r,v) -> vector(r - matrix v)