Re: what's it worth to write a short program for polynomial multiplication?
- From: Christopher Creutzig <christopher@xxxxxxxxxxx>
- Date: Sun, 15 Jun 2008 21:58:03 +0200
rjf wrote:
This is somewhat off topic; I do not myself consider unadorned common
lisp to be an ideal language for expression of mathematics for
applications. It is pretty handy for programming, though, and I think
that is illustrated by the short programs for multiplication of
polynomials in the referenced paper. If shorter programs can be
written in other languages, (other than Tim's x*y) I'd like to see
them.
I'm not really sure about the value of short multiplication codes other
than for pedagogical applications, but maybe that's just me. In any
case, I thought I'd throw a ruby program to multiply polynomials stored
as hash tables with exponents as keys into the pot:
c = Hash.new(0)
a.each {|ea,ca| b.each {|eb,cb| c[ea+eb] += ca*cb }}
Certainly not optimized for anything, maybe(!) except for code size. The
code would look virtually the same in almost any language that provides
hash tables, which certainly includes C++, Python, MuPAD, Maple, and I
would be very surprised if it did not include LISP, Axiom etc.
--
seit wann sind Vertragsinhalte für NewsGroup-Frager relevant?Sie sind lebensnotwendig um sie sofort auf überraschende Inhalte
abzuklopfen oder sonst in Frage zu stellen.
(Kurt Gunter und Konrad Wilhelm in dsrm)
.
- Follow-Ups:
- References:
- what's it worth to write a short program for polynomial multiplication?
- From: rjf
- Re: what's it worth to write a short program for polynomial multiplication?
- From: Herman Rubin
- Re: what's it worth to write a short program for polynomial multiplication?
- From: rjf
- Re: what's it worth to write a short program for polynomial multiplication?
- From: Herman Rubin
- Re: what's it worth to write a short program for polynomial multiplication?
- From: rjf
- Re: what's it worth to write a short program for polynomial multiplication?
- From: Christopher Creutzig
- Re: what's it worth to write a short program for polynomial multiplication?
- From: rjf
- what's it worth to write a short program for polynomial multiplication?
- Prev by Date: Re: which calculator or PDA to buy for calculus study? (HP-50G, TI-89, Classpad 330, PDA....)
- Next by Date: Re: which calculator or PDA to buy for calculus study? (HP-50G, TI-89, Classpad 330, PDA....)
- Previous by thread: Re: what's it worth to write a short program for polynomial multiplication?
- Next by thread: Re: what's it worth to write a short program for polynomial multiplication?
- Index(es):
Relevant Pages
|