[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Axiom-math] Axiom: Printing multiple variables in axiom.
From: |
Constantine Frangos |
Subject: |
[Axiom-math] Axiom: Printing multiple variables in axiom. |
Date: |
Tue, 13 Nov 2007 22:51:26 +0200 |
Thanks for the program.
I tried this program on a simple matrix (see below). I was expecting to get
matrix([[x1,x2],[x3,x4]])
but the result is different.
C. Frangos.
(67) -> s:=matrix([[x1,x2],[x3,x4]])
(67) ->
+x1 x2+
(67) | |
+x3 x4+
Type: Matrix Polynomial Integer
(68) -> output1d(s)
(68) ->
(68) matrix(construct(construct(x1,x2),construct(x3,x4)))
Type: OutputForm
(69) ->
On Tuesday 13 November 2007 04:32, Bill Page wrote:
> On 11/12/07, Bill Page wrote:
> > After looking at the Axiom source code I see that 'unparse' is
> > actually internally calling functions which convert an expression in
> > Axiom form to Fortran form. The necessary code is found here:
> >
> > http://wiki.axiom-developer.org/axiom--test--1/src/algebra/MkfuncSpad
> > http://wiki.axiom-developer.org/axiom--test--1/src/interp/NewfortBoot
> > http://wiki.axiom-developer.org/axiom--test--1/src/interp/FormatBoot
> >
> > But it isn't really necessary for you to understand all that. Here is
> > a distillation of the important parts into a fairly simple function
> > that I think probably does what you want:
> >
> > (1) -> output1d(e)== _
> > message( _
> > concat map(string,destruct _
> > fortranCleanUp( _
> > exp2Fort1( _
> > exp2FortOptimize( _
> > outputTran(e::INFORM)$Lisp _
> > )$Lisp _
> > )$Lisp _
> > )$Lisp _
> > ) _
> > )$OutputForm
> > Type: Void
> > (2) -> output1d(cos(x2) + 2*x1)
> > Compiling function output1d with type Expression Integer ->
> > OutputForm
> > `-mcpu=' is deprecated. Use `-mtune=' or '-march=' instead.
> >
> > (2) cos(x2)+2*x1
> > Type: OutputForm
> > (3) ->
>
> Oops, the version about fails for expressions like:
>
> output1d(x2/x2)
>
> because of some additional unnecessary Fortran processing by
> the routine 'outputTran'. Please use this slightly simpler version:
>
> (1) -> output1d(e)== _
> message( _
> concat map(string,destruct _
> fortranCleanUp( _
> exp2Fort1( _
> exp2FortOptimize( _
> e::INFORM _
> )$Lisp _
> )$Lisp _
> )$Lisp _
> ) _
> )$OutputForm
> Type: Void
> (2) -> output1d(cos(x2) + 2*x1)
> Compiling function output1d with type Expression Integer ->
> OutputForm
> `-mcpu=' is deprecated. Use `-mtune=' or '-march=' instead.
>
> (2) cos(x2)+2*x1
> Type: OutputForm
> (3) -> output1d(x2/x1)
> Compiling function output1d with type Fraction Polynomial Integer
> -> OutputForm
> `-mcpu=' is deprecated. Use `-mtune=' or '-march=' instead.
>
> (3) x2/x1
> Type: OutputForm
> (4) -> output1d(sqrt(x1))
>
> (4) x1**(1/2)
> Type: OutputForm
> (5) ->
>
> -------------
>
> I have recorded this issue at:
>
> http://axiom-wiki.newsynthesis.org/401UnparseGeneratesFortranFunctionNames
>
> since I think that really this is due to a bug in 'unparse'. It really
> should not generate those Fortran-type names if it's purpose is really
> to unparse Axiom commands in such a manner that they can be re-parsed
> by the Axiom interpreter.
>
> At the above link I also proposed a more general solution that
> corrects this problem for other parts of Axiom as well.
>
> Regards,
> Bill Page.
>
> --~--~---------~--~----~------------~-------~--~----~
> You received this message because you are subscribed to the Google Groups
> "FriCAS - computer algebra system" group. To post to this group, send email
> to address@hidden To unsubscribe from this group, send email
> to address@hidden For more options, visit this
> group at http://groups.google.com/group/fricas-devel?hl=en
> -~----------~----~----~----~------~----~------~--~---
- [Axiom-math] Axiom: Printing multiple variables in axiom., Constantine Frangos, 2007/11/08
- Re: [Axiom-math] Axiom: Printing multiple variables in axiom., Martin Rubey, 2007/11/09
- Re: [Axiom-math] Axiom: Printing multiple variables in axiom., Constantine Frangos, 2007/11/10
- Re: [Axiom-math] Axiom: Printing multiple variables in axiom., Martin Rubey, 2007/11/10
- Re: [Axiom-math] Axiom: Printing multiple variables in axiom., Constantine Frangos, 2007/11/11
- Re: [Axiom-math] Axiom: Printing multiple variables in axiom., Bill Page, 2007/11/11
- Re: [Axiom-math] Axiom: Printing multiple variables in axiom., Martin Rubey, 2007/11/12
- Re: [Axiom-math] Axiom: Printing multiple variables in axiom., Constantine Frangos, 2007/11/12
- Re: [Axiom-math] Axiom: Printing multiple variables in axiom., Bill Page, 2007/11/12
- Re: [Axiom-math] Axiom: Printing multiple variables in axiom., Bill Page, 2007/11/12
- [Axiom-math] Axiom: Printing multiple variables in axiom.,
Constantine Frangos <=
- [Axiom-math] Re: Axiom: Printing multiple variables in axiom., Bill Page, 2007/11/13
- [Axiom-math] Axiom: Installing Aldor, Constantine Frangos, 2007/11/13
- Re: [Axiom-math] Axiom: Installing Aldor, Ralf Hemmecke, 2007/11/13
- [Axiom-math] Aldor: Installing Aldor, Constantine Frangos, 2007/11/13
- Re: [Axiom-math] Aldor: Installing Aldor, Bill Page, 2007/11/13
- Re: [Axiom-math] Aldor: Installing Aldor, Ralf Hemmecke, 2007/11/14
- [Axiom-math] Aldor: Installing Aldor, Constantine Frangos, 2007/11/14
- [Axiom-math] Re: Aldor: Installing Aldor, Bill Page, 2007/11/14
- [Axiom-math] Axiom: Installing Aldor, Constantine Frangos, 2007/11/17
- Re: [Axiom-math] Axiom: Installing Aldor, Ralf Hemmecke, 2007/11/17