Raymond Toy | 1 May 2008 02:24
Picon

Re: Some maxima problems

Michel Talon wrote:
>> Can you start maxima with the -g option.  When you give the plot
>> command, you should be dropped in the Lisp debugger.  At that point,
>> enter "back" to get a backtrace and send the backtrace to the list (or
>> to me)..
>>
>>     
>
> Here it is:
>
>   
[snip]
> 4: (LOG 0.0 NIL)
> 5: (KERNEL::LOG2 0.0 1.0)
> 6: (LOG 0.0 10.0)
> 7: (LISP::FLONUM-TO-DIGITS 0.0 NIL NIL)
> 8: (FORMAT::FORMAT-GENERAL-AUX #<String-Output Stream> 0.0 NIL NIL ...)
> 9: (FORMAT::G-FORMAT-DIRECTIVE-INTERPRETER #<String-Output Stream>
>                                            #<~g>
>                                            (":" #<~g> "]")
>                                            #<unused-arg>
>                                            ...)
>   
Hahaha.  I introduced that bug while fixing the floating-point ~G printer. 

You have several options.  Use an earlier version.  Use a later 
version.  Ask me for a patch to fix that particular bug, if you can't do 
the other two options. :-)

Sorry about that!
(Continue reading)

andre maute | 1 May 2008 14:37
Picon
Picon

mat_cond(M, frobenius) is not html documented in Maxima 5.13.0

See subject
Andre
Alasdair McAndrew | 1 May 2008 17:02
Picon
Gravatar

Exiting from lisp debugger?

For some reason, something I did forced me into the lisp debugger, and now I can't get out of it: my terminal is full of lines like

Break 5 [27]>

and helpful commands (like :top, :R1) which don't in fact seem to have any effect at all, except for driving me deeper into the debugger.  And even Ctrl-C doesn't work.  How do I get out of this loop and back to the Maxima prompt?  I'm using clisp.  What I've done in the past is use Ctrl-Z to exit to the shell, and then kill the maxima session with kill -9.  But surely there's a better way.

Thanks,
Alasdair

_______________________________________________
Maxima mailing list
Maxima <at> math.utexas.edu
http://www.math.utexas.edu/mailman/listinfo/maxima
Michel Talon | 1 May 2008 17:24
Picon
Favicon

Re: Some maxima problems

Raymond Toy wrote:

> You have several options.  Use an earlier version.  Use a later
> version.  

Using the latest snapshot solves the problem. Thanks.

--

-- 
Michel Talon
Raymond Toy (RT/EUS | 1 May 2008 17:15
Picon
Favicon

Re: Exiting from lisp debugger?

Alasdair McAndrew wrote:
> For some reason, something I did forced me into the lisp debugger, and 
> now I can't get out of it: my terminal is full of lines like
> 
> Break 5 [27]>
> 
> and helpful commands (like :top, :R1) which don't in fact seem to have 
> any effect at all, except for driving me deeper into the debugger.  And 
> even Ctrl-C doesn't work.  How do I get out of this loop and back to the 
> Maxima prompt?  I'm using clisp.  What I've done in the past is use 

clisp should have printed out something like:

The following restarts are available:
ABORT          :R1      Abort debug loop
ABORT          :R2      Abort debug loop
ABORT          :R3      Abort debug loop
ABORT          :R4      Abort debug loop
MACSYMA-QUIT   :R5      Maxima top-level

 From this, :r5 is the way to get to maxima top-level, so enter :r5. 
For me, I get back to maxima's repl.  The prompt "Break 5" says you're 5 
levels deep in the debugger, so :r1 just brings you one level up.  The 
prompt should change to "Break 4".

Does this work for you?

Ray
Zach | 1 May 2008 18:20
Picon

Re: Entering hexadecimal numbers?


What about using Lisp's number parsing facilities.  I'm not smart enough with Maxima to see a pretty way of doing this, but certainly:

(%i45) :lisp #x1000
4096
(%i45) :lisp #xFF24
65316

It is easy to write Lisp function that takes a string of hex and converts it to decimal:

:lisp (defun $hex_to_dec (hex-string) (read-from-string (concatenate 'string "#x" hex-string)) )

(notice that this is all on one line)

hex_to_dec("FF24");
==> 65316

Sorry if this is redundant,
Zach


On Fri, Apr 25, 2008 at 6:01 PM, Robert Dodier <robert.dodier <at> gmail.com> wrote:
On Fri, Apr 25, 2008 at 4:08 PM, Alasdair McAndrew <amca01 <at> gmail.com> wrote:

> I have some long hexadecimal numbers (48 hex digits) I want to use.  But
> ibase:16 doesn't seem to accept non-numeric characters as input:

Yes, there is no way to enter a, b, c, ... for digits when ibase > 10.
This came up recently; see:
http://article.gmane.org/gmane.comp.mathematics.maxima.general/20490

The patch mentioned in that message yields
stuff like 1b0 => ibase^2 + 11*ibase when it should be bfloat(1)
(as it is when ibase=10). I've tinkered some more to try to prevent
surprises like that but I haven't gotten it nailed down.
If someone else wants to try it, that would be great.

Hope this helps,

Robert Dodier
_______________________________________________
Maxima mailing list
Maxima <at> math.utexas.edu
http://www.math.utexas.edu/mailman/listinfo/maxima

_______________________________________________
Maxima mailing list
Maxima <at> math.utexas.edu
http://www.math.utexas.edu/mailman/listinfo/maxima
Alasdair McAndrew | 1 May 2008 22:52
Picon
Gravatar

Re: Entering hexadecimal numbers?

Thank you - that's really nice and elegant.  Someday... I should really learn some lisp!

-Alasdair

On Fri, May 2, 2008 at 2:20 AM, Zach <elzacho <at> gmail.com> wrote:

What about using Lisp's number parsing facilities.  I'm not smart enough with Maxima to see a pretty way of doing this, but certainly:

(%i45) :lisp #x1000
4096
(%i45) :lisp #xFF24
65316

It is easy to write Lisp function that takes a string of hex and converts it to decimal:

:lisp (defun $hex_to_dec (hex-string) (read-from-string (concatenate 'string "#x" hex-string)) )

(notice that this is all on one line)

hex_to_dec("FF24");
==> 65316

Sorry if this is redundant,
Zach


On Fri, Apr 25, 2008 at 6:01 PM, Robert Dodier <robert.dodier <at> gmail.com> wrote:
On Fri, Apr 25, 2008 at 4:08 PM, Alasdair McAndrew <amca01 <at> gmail.com> wrote:

> I have some long hexadecimal numbers (48 hex digits) I want to use.  But
> ibase:16 doesn't seem to accept non-numeric characters as input:

Yes, there is no way to enter a, b, c, ... for digits when ibase > 10.
This came up recently; see:
http://article.gmane.org/gmane.comp.mathematics.maxima.general/20490

The patch mentioned in that message yields
stuff like 1b0 => ibase^2 + 11*ibase when it should be bfloat(1)
(as it is when ibase=10). I've tinkered some more to try to prevent
surprises like that but I haven't gotten it nailed down.
If someone else wants to try it, that would be great.

Hope this helps,

Robert Dodier
_______________________________________________
Maxima mailing list
Maxima <at> math.utexas.edu
http://www.math.utexas.edu/mailman/listinfo/maxima


_______________________________________________
Maxima mailing list
Maxima <at> math.utexas.edu
http://www.math.utexas.edu/mailman/listinfo/maxima
Oliver Kullmann | 2 May 2008 02:14
Picon
Picon
Favicon

how to pass the name of a variable as argument?

Hi,

I often have to compute functions f which
compute, say, a set of values f(x), and where
the computation might take a very long time
--- but we don't know how long it will take.
Furthermore we assume that the elements of
the set f(x) are computed one after another.

Now the problem is that apparently it is
not possible to just stop Maxima in a computation
and to inspect the values of local variables of
a function. So there doesn't seem to be a simple
direct solution to the problem that after a day
or so we have enough, we want to stop the
computation of f(x), but we want to get the partial
results (the elements of that set yet computed)
nevertheless.

Since global variables should be avoided, a good
solution would be to pass the name of a variable
to f, so that then we could use

partial_result : {};
f(name of "partial result");
inspect partial_result;

Obviously

f(x) := x : adjoin(1,x);

doesn't work (here the task is, given a set x,
add element 1 to it).

I experimented a bit with "nouns" etc., but
I didn't succeed. Could somebody show me for this
example how to make it work:

a : {5,6};
f(some function of "a");
assert(a = {1,5,6});

Thanks for your attention!

Oliver
Alasdair McAndrew | 2 May 2008 02:17
Picon
Gravatar

Elliptic curves in Maxima

Attached is my first attempt at some procedures for implementing elliptic curves mod p, where p is a prime > 3.  Not all procedures are optimized, and I have not implemented the Schoof-Elkies-Atkins algorithm for finding the order of the curve.  Also, I have not yet implemented curves over general finite fields GF(p^n).

These procedures can perform arithmetic (addition, point multiplication) on curves of arbitrary size, but the procedures for finding the curve order, the order of a point, and logarithms, are only viable on smallish curves (say, p<2^30).

cheers,
Alasdair

Attachment (elliptic.mac): application/octet-stream, 8 KiB
Attachment (elliptic.dem): application/octet-stream, 1569 bytes
_______________________________________________
Maxima mailing list
Maxima <at> math.utexas.edu
http://www.math.utexas.edu/mailman/listinfo/maxima
Stavros Macrakis | 2 May 2008 02:42
Picon
Favicon
Gravatar

Re: how to pass the name of a variable as argument?

On Thu, May 1, 2008 at 8:14 PM, Oliver Kullmann
<O.Kullmann <at> swansea.ac.uk> wrote:
>  Since global variables should be avoided, a good
>  solution would be to pass the name of a variable
>  to f, so that then we could use

I am not sure that global variables are any worse than this method, but....

To name a variable, use 'var.  To assign to a variable through its
name, use var :: newval. To access the value of the value of a
variable, use ev(var).  So your example becomes

    f(x) := x :: adjoin(1,ev(x));

and is called as

    f('var)

I don't know what your overall problem is, but I think I would just
use global variables with a naming convention, e.g. global_x,
global_y, or a hasharray global['x], global['y].

            -s

Gmane