I took a free minute to convert Ralf's example to something simpler.

Personally, I currently think (as Bill pointed out) that

 ?*? : (DirectProduct(ndim,R),%) -> DirectProduct(ndim,R)
 ?*? : (%,DirectProduct(ndim,R)) -> DirectProduct(ndim,R)

are "wrong".  Or, rather: once we think of DIRPROD as a vector, once as
a diagonal matrix.  Right?

Martin

(1) -> m:SQMATRIX(2, POLY INT) := squareMatrix matrix [[a, b], [c, d]]

        +a  b+
   (1)  |    |
        +c  d+
                                    Type: SquareMatrix(2,Polynomial(Integer))
(2) -> im := inverse m

        +     d             b    +
        | ---------   - ---------|
        | a d - b c     a d - b c|
   (2)  |                        |
        |      c           a     |
        |- ---------   --------- |
        +  a d - b c   a d - b c +
               Type: Union(SquareMatrix(2,Fraction(Polynomial(Integer))),...)
(3) -> (r::FRAC POLY INT)*inverse m

        +    d r           b r   +
        | ---------   - ---------|
        | a d - b c     a d - b c|
   (3)  |                        |
        |     c r         a r    |
        |- ---------   --------- |
        +  a d - b c   a d - b c +
                          Type: SquareMatrix(2,Fraction(Polynomial(Integer)))
(4) -> (r::POLY INT)*inverse m

          (d - c)r (- b + a)r
   (4)  [---------,----------]
         a d - b c  a d - b c
                         Type: DirectProduct(2,Fraction(Polynomial(Integer)))
(5) -> )tr SQMATRIX )ma
 
   Packages traced: 
      SquareMatrix(2,Fraction(Polynomial(Integer))), SquareMatrix
            (2,Polynomial(Integer))
   Parameterized constructors traced:
      SQMATRIX
(5) -> )tr DIRPROD )ma
 
   Packages traced: 
      SquareMatrix(2,Fraction(Polynomial(Integer))), SquareMatrix
            (2,Polynomial(Integer)), DirectProduct(2,Fraction(
            Polynomial(Integer))), DirectProduct(2,Polynomial(
            Integer))
   Parameterized constructors traced:
      SQMATRIX, DIRPROD
(5) -> r*inverse m
 1<enter SquareMatrix.inverse,67 
: 
       +a  b+
 arg1= |    |
       +c  d+
 1>exit  SquareMatrix.inverse,67 
: 
 +     d             b    +
 | ---------   - ---------|
 | a d - b c     a d - b c|
 |                        |
 |      c           a     |
 |- ---------   --------- |
 +  a d - b c   a d - b c +
 1<enter DirectProduct.coerce,11 
: 
 arg1= r
 1>exit  DirectProduct.coerce,11 
: 
 [r,r]
 1<enter SquareMatrix.*,46 
: 
 arg1= [r,r]
       +     d             b    +
       | ---------   - ---------|
       | a d - b c     a d - b c|
 arg2= |                        |
       |      c           a     |
       |- ---------   --------- |
       +  a d - b c   a d - b c +
  1<enter DirectProduct.coerce,10 
: 
  arg1= [r,r]
  1>exit  DirectProduct.coerce,10 
: 
  [r,r]
  1<enter DirectProduct.directProduct,17 
: 
          (d - c)r (- b + a)r
  arg1= [---------,----------]
         a d - b c  a d - b c
   1<enter DirectProduct.size?,16 
: 
           (d - c)r (- b + a)r
   arg1= [---------,----------]
          a d - b c  a d - b c
   arg2= 2
   1>exit  DirectProduct.size?,16 
: 
   true
  1>exit  DirectProduct.directProduct,17 
: 
    (d - c)r (- b + a)r
  [---------,----------]
   a d - b c  a d - b c
 1>exit  SquareMatrix.*,46 
: 
   (d - c)r (- b + a)r
 [---------,----------]
  a d - b c  a d - b c

 1<enter DirectProduct.parts,13 
: 
         (d - c)r (- b + a)r
 arg1= [---------,----------]
        a d - b c  a d - b c
 1>exit  DirectProduct.parts,13 
: 
   (d - c)r (- b + a)r
 [---------,----------]
  a d - b c  a d - b c
          (d - c)r (- b + a)r
   (5)  [---------,----------]
         a d - b c  a d - b c
                         Type: DirectProduct(2,Fraction(Polynomial(Integer)))

-- 
You received this message because you are subscribed to the Google Groups 
"FriCAS - computer algebra system" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/fricas-devel?hl=en.

Reply via email to