How to do matrix operation programatically in lisp



On Sat, 24 Nov 2007 16:25:00 -0500, Stavros Macrakis  
<macrakis at alum.mit.edu> wrote:

> On Nov 24, 2007 12:29 PM, Kun Lin <klin at umd.edu> wrote:
>
>> Maybe i am gonna write a parser so i can do something like
>>
>>     (eval (parse-maxima-to-lisp "invert(matrix[1,2],[3,4])"))
>>
>> to automate the conversion between maxima and lisp.
>>
>
> ? I don't understand what you're trying to do here.  Maxima already  
> includes
> a parser, but why would your Lisp program be representing a matrix or its
> inversion as a string?
>
>         -s


Sounds like i might be trying to re-invent the wheel here.

"The #$ Lisp macro allows the use of Maxima expressions in Lisp code.  
#$expr$ expands to a Lisp expression equivalent to the Maxima expression  
expr."

this is exactly what i am looking for.  I just want an easy way to embed  
maxima commands in lisp. Basically, if i know what the maxima command is,  
i should easily recognize it in my lisp code.

after all #$matrix([1,2],[2,4]))$ is alot easier to read than (($matrix  
simp) ((mlist simp) 1 2) ((mlist simp) 2 4)).

And i also just found the maxima::displa function which prints the maxima  
expression.

Thank guys for the help!

- Kun