Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw

Re: (Golf) Multiply polynomials

by jeroenes (Priest)
on May 11, 2001 at 13:30 UTC ( #79662=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download

  1. or download this
    use PDL:
    sub p{$t=pdl+pop;$t=$t*(pdl$_)for@_;[list$t]}
  2. or download this
    print join " ", @{p([1..5],[1..5])}; 
    1 4 9 16 25
  3. or download this
    sub p{my $t=pdl+pop;$t=$t*(pdl$_)for@_;[list$t]}
  4. or download this
    A = p1'*p2;
    product = crossdiags(A);
  5. or download this
    sub p{$t=pdl+pop;for(@_){
      my $a=outer$t,pdl+pop;
      $t->slice("$_:".($_+$n))+=$a->slice("$_,:")for 0..$n;

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://79662]
[LanX]: Socrates was a Troll
[Your Mother]: It's very, very dangerous... Thinking that a group is intrinsically evil... buries the fact that all humans can be so deep that it starts to become likely they will be.
[Your Mother]: LanX++
[Corion]: (also the "troll for trolls sake" could seen be much like the "punk for punks beer")
[Your Mother]: I'm completely (historically anyway) a troll in real life. It's not fun online, you can't really win. :P
Happy-the-monk orders a Punk IPA.
[Your Mother]: Also, I'm too old to start fights with strangers anymore.
[LanX]: concentrating on omestic violence?
[LanX]: d
[Your Mother]: Open air violence. Or on campus.

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (18)
As of 2018-03-19 13:49 GMT
Find Nodes?
    Voting Booth?
    When I think of a mole I think of:

    Results (240 votes). Check out past polls.