Ralf Hemmecke
unread,Apr 23, 2021, 4:28:50 PM4/23/21Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to fricas...@googlegroups.com
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