Hi Tobias,

I cannot help you with the Library domain, but perhaps the new Format1D
domain can help you. (See current github repo, you would have to compile
from the HEAD there.)

Format1D is not perfect, but I have created it in order to cut&paste
output from FriCAS back to the input line. I would be happy if someone
tries it out and sends feedback.

Switching it on is a bit cumbersome, but not too hard.

)set output formatted on
F ==> Formatter
l := [F Format1D];
setFormats!(l pretend List(OutputFormatterCategory))$FormattedOutput

If you do not like algebra output together with Format1D, then switch it
off.

)set output algebra off


(1) -> )set output formatted on
(1) -> F ==> Formatter
                                        Type: Void
(2) -> l := [F Format1D];
                                        Type: List(Type)
(3) -> setFormats!(l pretend List(OutputFormatterCategory))$FormattedOutput
                                         Type: Void
(4) -> matx1 := matrix([[0,x1],[0,0]]) :: Matrix(Expression(Integer))

        +0  x1+
   (4)  |     |
        +0  0 +
matrix[[0, x1], [0, 0]]

                      Type: Matrix(Expression(Integer))
(5) -> matx2 := matrix([[0,sqrt(x1)],[0,0]]) :: Matrix(Expression(Integer))

        +    +--++
   (5)  |0  \|x1 |
        |        |
        +0    0  +
matrix[[0, sqrt(x1)], [0, 0]]

                     Type: Matrix(Expression(Integer))
(6) -> matrix[[0, sqrt(x1)], [0, 0]]

        +    +--++
   (6)  |0  \|x1 |
        |        |
        +0    0  +
matrix[[0, sqrt(x1)], [0, 0]]

                     Type: Matrix(Expression(Integer))



You could also do a few tricks with it as is done in JFriCASSupport

(9) -> setFormat!(Format1D)$JFriCASSupport
                             Type: Void
(12) -> )set output algebra off
(12) -> matx1 := matrix([[0,x1],[0,0]]) :: Matrix(Expression(Integer))

--FORMAT:BEG:Format1D
matrix[[0, x1], [0, 0]]
--FORMAT:END:Format1D

                             Type: Matrix(Expression(Integer))
(13) -> matx2 := matrix([[0,sqrt(x1)],[0,0]]) :: Matrix(Expression(Integer))

--FORMAT:BEG:Format1D
matrix[[0, sqrt(x1)], [0, 0]]
--FORMAT:END:Format1D
                             Type: Matrix(Expression(Integer))

So you could parse the output easily by a script.
The strings between the --FORMAT:BEG ... --FORMAT:END should be readable
as if they come from a .input file.


Ralf

-- 
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/1bd76831-6afb-60b7-4df6-a59419d4516d%40hemmecke.org.

Reply via email to