#1231 diag_matrix() with block matrices gets off-diag boxes wrong

closed
None
4
2007-08-03
2007-07-11
No

Hello,

I couldn't find this bug among the reports, sorry if I didn't search hard enough.

The problem is related to "linearalgebra," concretely to function diag_matrix, which is said in the documentation to create appropriate off-diagonal zero blocks when its arguments are matrices. This is not so, as in the following example:

(%i2) b1 : matrix( [ 1 ] );
(%o2) [ 1 ]
(%i3) b2 : matrix( [ 0, 1 ], [ 7, 9 ] );
[ 0 1 ]
(%o3) [ ]
[ 7 9 ]
(%i4) dma : diag_matrix( b1, b2 );
[ 0 1 ]
(%o4) diag_matrix([ 1 ], [ ])
[ 7 9 ]
(%i5) load("linearalgebra");
(%o5) /usr/share/maxima/5.10.0/share/linearalgebra/linearalgebra.mac
(%i6) dma : diag_matrix( b1, b2 );
[ [ 1 ] [ 0 ] ]
[ ]
(%o6) [ [ 0 0 ] [ 0 1 ] ]
[ [ ] [ ] ]
[ [ 0 0 ] [ 7 9 ] ]

Obviously, mat_unblocker fails to handle this output.

Thanks in advance,
Miguel

-------------------------------------------------------------

\;

Maxima version: 5.10.0

Maxima build date: 14:57 10/18/2006

host type: i686-pc-linux-gnu

lisp-implementation-type: GNU Common Lisp (GCL)

lisp-implementation-version: GCL 2.6.7

\;

-------------------------------------------------------------

Discussion

  • Barton Willis

    Barton Willis - 2007-07-14

    Logged In: YES
    user_id=895922
    Originator: NO

    Oh, I think that you are suggesting that size of the zero matrices in
    the off-diagonal entries be adjusted so that mat_unblocker will work.
    OK. I'll try to do that.

    Thanks for the bug report.

     
  • Barton Willis

    Barton Willis - 2007-07-14
    • priority: 5 --> 4
    • assigned_to: nobody --> willisbl
     
  • Barton Willis

    Barton Willis - 2007-07-19

    Logged In: YES
    user_id=895922
    Originator: NO

    Fixed by linearalgebra.mac CVS revison 1.6.

    (%i12) b1 : matrix( [ 1 ] );
    (%o12) matrix([1])
    (%i13) b2 : matrix( [ 0, 1 ], [ 7, 9 ] );
    (%o13) matrix([0,1],[7,9])
    (%i14) dma : diag_matrix( b1, b2 );
    (%o14) matrix([matrix([1]),matrix([0,0])],[matrix([0],[0]),matrix([0,1],[7,9])])
    (%i15) mat_unblocker(%);
    (%o15) matrix([1,0,0],[0,0,1],[0,7,9])

     
  • Barton Willis

    Barton Willis - 2007-07-19
    • status: open --> pending
     
  • SourceForge Robot

    Logged In: YES
    user_id=1312539
    Originator: NO

    This Tracker item was closed automatically by the system. It was
    previously set to a Pending status, and the original submitter
    did not respond within 14 days (the time period specified by
    the administrator of this Tracker).

     
  • SourceForge Robot

    • status: pending --> closed
     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks