Help with compile_file()



-----Joshua Stults <joshua.stults at gmail.com> wrote: -----

>in?the?UNLISP?file,?and
>
>?????????(setq?$M?(simplify?(mfunction-call?$lu_factor?$A)))
>
>in?the?LISP?file.??Does?that?mean?lu_factor?is?already?compiled,?and
>the?generated?LISP?just?calls?the?same?function?I?would?be?calling
>from?a?normal?Maxima?session??Inverting?the?matrix?is?probably?the?big
>pole?in?this?function,?so?if?compiling?doesn't?change?that?part?it
>probably?isn't?worthwhile?in?this?case;?useful?as?a?learning?example
>though.

The function $lu_factor is a Common Lisp function, so (setq $M
($lu_factor $A)) is OK. It should be somewhat faster than (setq $M
(simplify (mfunction-call $lu_factor $A))). Maybe it's possible to
tell the Maxima to CL translator about the function $lu_factor.

For speed, I suggest that you compile all the CL code in linearalgebra;
try something like

map(lambda([s], compile_file(file_search(s))),
["polynomialp.lisp","mring.lisp", "lu.lisp",
"linalgcholesky.lisp",  "eigens-by-jacobi.lisp", "linalg-extra.lisp" ,
"matrixexp.lisp",
"linalg-utilities.lisp"]);

After that, load should load the compiled versions of these files.
Compiling
these files should give more of a speedup than would replacing
(setq $M (simplify (mfunction-call $lu_factor $A))) with ($lu_factor $A)),
I think.

Barton