First, welcome to Maxima.
It's been too long ago for me to recall, but I'm guessing that when I wrote
conjugate.lisp, I thought that $csign was either too buggy or too slow to
use in general. There is also the problem that csign / rectform can generate
huge & messy expressions.
Courtesy of CL, it's possible to redefine functions from a Maxima prompt:
(%i1) 42;
(%o1) 42
(%i2) :lisp(defun manifestly-pure-imaginary-p (e) (eq '$imaginary ($csign e)))
MANIFESTLY-PURE-IMAGINARY-P
(%i3) run_testsuite()
(I think wxMaxima has a bug that the first input cannot be :lisp(XXXX)--thus the 42 input).
When I tried this, there were errors in rtestconjugate 37 and rest_equal 196. These failures
might be due to side effects in calling $csign (the function $csign modifies the fact database--it
should expunge these facts at the right moment). Indeed,
(%i2) :lisp(defun manifestly-pure-imaginary-p (e)
(unwind-protect (eq '$imaginary ($csign e))
(clearsign)))
fixes these bugs. The actual bug might be in the code that runs the testsuite (doesn't call clearsign
after completing each test, for example). Weirdly, this definition of manifestly-pure-imaginary-p fixes
bugs in the share testsuite (do load(share_testsuite)) that seem to have *nothing* to do with conjugates.
Alternatively, maybe the function conjugate-mexpt could be improved (return fewer conjugate nounforms).
Again, welcome to Maxima. Learning or re-learning CL is far easier than learning your way around
the Maxima source code, I think.
--Barton
-----maxima-bounces at math.utexas.edu wrote: -----
>I'm?new?to?maxima?but?I?had?a?quick?look?at?some?of?the?code?and?it
>seems?to?me?that?the?problem?arises?because?there?is?no?version?of
>$rectform?when?*complexsign*?is?set?to?t,?thus?causing?problems?with
>$csign?and,?as?a?result,?the?function?manifestly-pure-imaginary-p?is
>coded?as?follows:
>
>(defun?manifestly-pure-imaginary-p?(e)
>??(let?(($inflag?t))
>????(or?
>?????(and?($mapatom?e)
>???? ??(or
>???? ???(eq?e?'$%i)
>???? ???(and?(symbolp?e)?(kindp?e?'$imaginary)?(not?($nonscalarp?e)))
>???? ???(and?($subvarp?e)?(manifestly-pure-imaginary-p?($op?e)))))
>?????;;?For?now,?let's?use?$csign?on?constant?expressions?only;?once
>$csign?improves,
>?????;;?the?ban?on?nonconstant?expressions?can?be?removed
>?????(and?($constantp?e)?(eq?'$imaginary?($csign?e))))))
>
>Is?this?the?root?of?the?problem??It's?years?since?I've?programmed?in
>Lisp,?but?I?wouldn't?mind?looking?into?this?further.