On 9/23/24 09:57, Prof. Dr. Johannes Grabmeier wrote:
hence, it is really the matrix function of OutputForm, which uses an
 appropriate Lisp-function labelled by symbol 'MATRIX.

It is actually still not completely clear what you want to achieve.

As one of the early AXIOM users, you certainly know about the OutputForm
mechanism.

What I wanted to say is that the transformation of a tableau into
OutputForm is IMHO already wrong independent of what the output routine
will be. This pile of lines in which each line is a concatenated (by
spaces) list of the row items has no information of a grid structure as
the MATRIX operator would have.

https://github.com/fricas/fricas/blob/master/src/algebra/tableau.spad#L31

A matrix is represented by a special OutputForm that is represented via
'MATRIX in the first position.

https://github.com/fricas/fricas/blob/master/src/algebra/tableau.spad#L31

Any formatter can then decide what to do with this special form.
If a formatter gets the 'SC (the OutputForm for pile), it is already to
late, since a pile means: put lines on top of each other.

So, my question is really to the Lisp experts, are there other
functions in Lisp which provice a pile without a new line. Or: how is
MATRIX output implemented and how can it be modified for this purpose
to have a proper output for tableaus.

Honestly, I would be much more happy if the tableau itself would
be output like

   +---+------+---+
   | 0 |    3 | 5 |
   +---+------+---+
   | 1 | 4444 | 6 |
   +---+ -----+---+
   | 2 |
   +---+

instead of showing a frame around each element.

Whether it breaks after each comma when several tableaux are put into a list, is another problem, that can probably be solved by splitting the code that handles 'MATRIX into something that handles the grid structure and then puts it into paren to add the parentheses around that grid.
I guess, that would not be a very big change.

I think you can find/modify/adapt the matrix code in src/interp/i-output.boot around the function "appmat".

Ralf




On 9/23/24 09:57, Prof. Dr. Johannes Grabmeier wrote:
> thanks Ralf for the quick answer! I had solved the other other aspect
> already by using the width of an output form.
>
> The algebra code for matrices traces back to  (category:
> TwoDimensionalArrayCategory)
>
>      if R has CoercibleTo(OutputForm) then
>
>        coerce(m : %) ==
>          l : List List OutputForm
>          l := [[qelt(m, i, j) :: OutputForm _
>                    for j in minColIndex(m)..maxColIndex(m)] _
>                    for i in minRowIndex(m)..maxRowIndex(m)]
>          matrix l
>
> hence, it is really the matrix function of OutputForm, which uses an
> appropriate Lisp-function labelled by symbol 'MATRIX. So, my question is
> really to the Lisp experts, are there other functions in Lisp which
> provice a pile without a new line. Or: how is MATRIX output implemented
> and how can it be modified for this purpose to have a proper output for
> tableaus.
>
> Johannes

--
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/fricas-devel/c8a83a20-85de-48d5-8e6c-a433699c7ac1%40hemmecke.de.

Reply via email to