login  home  contents  what's new  discussion  bug reports     help  links  subscribe  changes  refresh  edit

Edit detail for SandBox 1D output Form revision 1 of 1

1
Editor: r
Time: 2018/02/16 19:22:40 GMT+0
Note: Comments. OPEN QUESTION.

changed:
-
**How to have an output similar to a 1D input form?**

\begin{axiom}
)set output tex off
---disable tex display (if needed)

)set output algebra on
---enable 2D display


res:=expand((1+x)^10)            --- large  result
matrix( [[res,res],[res,res]])   --- even larger


--- 1D output soon...

res::InputForm               --- force input form ?Is this lisp?
unparse(res::InputForm)      --- what we want


--- this is a one character one parameter macro that implements the idea:
% r ==> unparse(r::InputForm)

% res

--- this is a 2 characters one parameter macro that implements alternative way but equivalent result:
%%  r ==> unparse convert r

%% res

% matrix( [[res,res],[res,res]])
\end{axiom}

** OPEN QUESTIONS **

- is there a way not to break numbers?

- is there a way to )set 1D output once for all without macros?


How to have an output similar to a 1D input form?

fricas
)set output tex off
---disable tex display (if needed)
fricas
)set output algebra on
---enable 2D display
res:=expand((1+x)^10) --- large result
(1) 10 9 8 7 6 5 4 3 2 x + 10 x + 45 x + 120 x + 210 x + 252 x + 210 x + 120 x + 45 x + 10 x + 1
Type: Polynomial(Integer)
fricas
matrix( [[res,res],[res,res]])   --- even larger
(2) [ [ 10 9 8 7 6 5 4 3 x + 10 x + 45 x + 120 x + 210 x + 252 x + 210 x + 120 x + 2 45 x + 10 x + 1 ,
10 9 8 7 6 5 4 3 x + 10 x + 45 x + 120 x + 210 x + 252 x + 210 x + 120 x + 2 45 x + 10 x + 1 ] ,
[ 10 9 8 7 6 5 4 3 x + 10 x + 45 x + 120 x + 210 x + 252 x + 210 x + 120 x + 2 45 x + 10 x + 1 ,
10 9 8 7 6 5 4 3 x + 10 x + 45 x + 120 x + 210 x + 252 x + 210 x + 120 x + 2 45 x + 10 x + 1 ] ]
Type: Matrix(Polynomial(Integer))
fricas
--- 1D output soon...
res::InputForm --- force input form ?Is this lisp?
(3) (+
(+
(+
(+
(+
(+
(+
(+ (+ (+ (^ x 10) (* 10 (^ x 9))) (* 45 (^ x 8))) (* 120 (^ x 7)))
(* 210 (^ x 6)))
(* 252 (^ x 5)))
(* 210 (^ x 4)))
(* 120 (^ x 3)))
(* 45 (^ x 2)))
(* 10 x))
1)
Type: InputForm
fricas
unparse(res::InputForm)      --- what we want
(4) "x^10+10*x^9+45*x^8+120*x^7+210*x^6+252*x^5+210*x^4+120*x^3+45*x^2+10*x+1"
Type: String
fricas
--- this is a one character one parameter macro that implements the idea:
% r ==> unparse(r::InputForm)
Type: Void
fricas
% res
(6) "x^10+10*x^9+45*x^8+120*x^7+210*x^6+252*x^5+210*x^4+120*x^3+45*x^2+10*x+1"
Type: String
fricas
--- this is a 2 characters one parameter macro that implements alternative way but equivalent result:
%%  r ==> unparse convert r
Type: Void
fricas
%% res
(8) "x^10+10*x^9+45*x^8+120*x^7+210*x^6+252*x^5+210*x^4+120*x^3+45*x^2+10*x+1"
Type: String
fricas
% matrix( [[res,res],[res,res]])
(9) "matrix([[x^10+10*x^9+45*x^8+120*x^7+210*x^6+252*x^5+210*x^4+120*x^3+45*x^2+1 0*x+1,x^10+10*x^9+45*x^8+120*x^7+210*x^6+252*x^5+210*x^4+120*x^3+45*x^2+10*x+ 1],[x^10+10*x^9+45*x^8+120*x^7+210*x^6+252*x^5+210*x^4+120*x^3+45*x^2+10*x+1, x^10+10*x^9+45*x^8+120*x^7+210*x^6+252*x^5+210*x^4+120*x^3+45*x^2+10*x+1]])"
Type: String

OPEN QUESTIONS

  • is there a way not to break numbers?
  • is there a way to )set 1D output once for all without macros?