From 01d9be9999622400347af560b28c9a2284950449 Mon Sep 17 00:00:00 2001 From: dos-reis Date: Sun, 18 May 2008 19:07:55 +0000 Subject: Fix AW/117 * algebra/vector.spad.pamphlet (DirectProductCategory): Also a Monoid is base type belongs to Monoid. (DirectProduct): Implement multiplication is base type belongs to Monoid. --- src/ChangeLog | 8 ++++++++ src/algebra/vector.spad.pamphlet | 2 ++ 2 files changed, 10 insertions(+) diff --git a/src/ChangeLog b/src/ChangeLog index 5162aa12..37c65fcd 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,11 @@ +2008-05-18 Bill Page + + Fix AW/117 + * algebra/vector.spad.pamphlet (DirectProductCategory): Also a + Monoid is base type belongs to Monoid. + (DirectProduct): Implement multiplication is base type belongs to + Monoid. + 2008-05-18 Gabriel Dos Reis Fix AW/221 diff --git a/src/algebra/vector.spad.pamphlet b/src/algebra/vector.spad.pamphlet index 481ea5cc..d580afe1 100644 --- a/src/algebra/vector.spad.pamphlet +++ b/src/algebra/vector.spad.pamphlet @@ -400,6 +400,7 @@ DirectProductCategory(dim:NonNegativeInteger, R:Type): Category == if R has AbelianSemiGroup then AbelianSemiGroup if R has CancellationAbelianMonoid then CancellationAbelianMonoid if R has Monoid then + Monoid _* : (R, %) -> % ++ r * y multiplies the element r times each component of the ++ vector y. @@ -511,6 +512,7 @@ DirectProduct(dim:NonNegativeInteger, R:Type): 1 == new(dim, 1)$Vector(R) pretend % u:% * r:R == map(#1 * r, u) r:R * u:% == map(r * #1, u) + x:% * y:% == [x.i * y.i for i in 1..dim]$Vector(R) pretend % if R has CancellationAbelianMonoid then -- cgit v1.2.3