invert_by_lu does not work as expected



On 01/10/2012 07:56 AM, Robert Dodier wrote:
> On 1/8/12, andre maute<andre.maute at gmx.de>  wrote:
>
>> M:matrix([1,0,0],[v[[1,0],[0,0]],1,0],[v[[0,1],[0,0]],v[[0,1],[1,0]],1])
>> (%i7) Minvinv:invert_by_lu(invert_by_lu(M))
>> Maxima encountered a Lisp error:
>>
>>    The value NIL is not of type CHARACTER.
> > From what I can tell, the error is not in invert_by_lu
> but somewhere downstream from GENSYM-READABLE,
> which calls AFORMAT and eventually OUTPUT-TEXT*,
> where it barfs. Unfortunately I can't tell what's going on
> in the source code (src/mformt.lisp); too much macrology
> for my tiny brain to comprehend. Oh well.
>
> I find that
> :lisp (defun gensym-readable (x) (gensym))
> makes the error go away. Does that work for you?

Yes, thanks for the workaround.
Here two slightly smaller test cases, which give the error too.
---------------------------------
display2d : false;
Minv : matrix([1,0,0],[-v[[1,0],[0,0]],1,0],
         [v[[0,1],[1,0]]*v[[1,0],[0,0]]-v[[0,1],[0,0]],-v[[0,1],[1,0]],1]);
invert_by_lu(Minv);
---------------------------------
display2d : false;
Minv : matrix([1,0,0],[-v[1,0,0,0],1,0],
         [v[0,1,1,0]*v[1,0,0,0]-v[0,1,0,0],-v[0,1,1,0],1]);
invert_by_lu(Minv);
---------------------------------

whereas the following works
---------------------------------
display2d : false;
Minv : matrix([1,0,0],[-v_1_0_0_0,1,0],
         [v_0_1_1_0*v_1_0_0_0-v_0_1_0_0,-v_0_1_1_0,1]);
invert_by_lu(Minv);
---------------------------------

Regards
Andre