oldk1331 wtote:
> 
> If you use ')set output character default', you'll get:
> (14) -> new(3,0,0)$Matrix INT

Well, you get escape sequences that will give you box
charecters if you have IBM style terminal.

> BTW, from wikipedia, new(0,0,0) should have determinant
> of 1, should that implemented in FriCAS?

Probably.  Note however that we can compute determinants
in positive dimension even if the ring has no unit,
but in dimension 1 we need 1 in the ring.

> FYI, in sympy:
> 
> In [3]: zeros(2,0)
> Out[3]: []
> 
> In [4]: zeros(0,2)
> Out[4]: []
> 
> maxima:
> (%i3) zeromatrix(0,3);
> (%o3)                              matrix()
> (%i4) zeromatrix(3,0);
> (%o4)                         matrix([], [], [])
> 
> 
> >From 
> >https://de.mathworks.com/help/matlab/math/empty-matrices-scalars-and-vectors.html
> Matlab gives
>    Empty matrix: 0-by-3
> 
> Wolfram:
> In[3]:= Array[a,{0,3}]
> {}
> In[4]:= Array[a,{3,0}]
> {{}, {}, {}}

The following patch gives:

(1) -> new(2, 0, 0)$Matrix(Integer)

       ++
   (1) ||
       ++
                                                        Type: Matrix(Integer)
(2) -> new(0, 2, 0)$Matrix(Integer)

   (2)  []
                                                        Type: Matrix(Integer)

which is comparable to other systems.

--- src/algebra/outform.spad    (revision 1988)
+++ src/algebra/outform.spad    (working copy)
@@ -492,6 +492,7 @@
           vconcat(hspace n, rspace(n, m - 1))
 
         matrix ll ==
+            empty?(ll) => bracket([]$List(%))
             lv : List % := [cons(eform 'ROW, l) for l in ll]
             cons(eform 'MATRIX, cons(eform 'NIL, lv))
 

-- 
                              Waldek Hebisch

-- 
You received this message because you are subscribed to the Google Groups 
"FriCAS - computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to