[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Axiom-math] Axiom: Printing multiple variables in axiom.
From: |
Bill Page |
Subject: |
Re: [Axiom-math] Axiom: Printing multiple variables in axiom. |
Date: |
Mon, 12 Nov 2007 19:05:39 -0500 |
On 11/12/07, Constantine Frangos wrote:
>
> On Monday 12 November 2007 08:45, Martin Rubey wrote:
> > Bill Page writes:
> > > Why do you write 'unparse(y::INFORM)' ? Do you mean you literally
> > > want to output a ' * ' character for multiplication? If so, I think there
> > > must be a better way than this ...
> >
> > I guess that Constantine also wants 1-dimensional output. I.e., x^2
> > instead of
> >
> > 2
> > x
> >
> > But I'm not sure.
>
>
> Yes, that's correct. It would be helpful to obtain one-dimensional
> output (ala Maxima with display2d : false) that can be pasted as
> is, in other axiom functions, and run correctly.
>
Ok, I understand.
>
> >
> > Of course, the real solution would be to overwrite the coercion
> > to OutputForm in Expression. But that's probably too much to
> > ask for from Constantine, and I don't have the time to play around
> > with that.
> >
> ...
> I was thinking of defining
>
> DCOS(x) == cos(x)
> DSIN(x) == sin(x)
> etc.
>
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) ->
If you would like an explanation of how this works, just ask.
Regards,
Bill Page.
- [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 <=
- Re: [Axiom-math] Axiom: Printing multiple variables in axiom., Bill Page, 2007/11/12
- [Axiom-math] Axiom: Printing multiple variables in axiom., Constantine Frangos, 2007/11/13
- [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