Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Fast sliding submatrix sums with PDL (inspired by PWC 248 task 2)

by tybalt89 (Monsignor)
on Dec 26, 2023 at 21:19 UTC ( [id://11156544]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    q(May all your Christmases be white.) =~ s/Christmase/loop/r =~ s/whit
    +e/implicit/r
    
  2. or download this
    #!/usr/bin/perl
    
    ...
          zip_by { [ @_ ] } map [ slide @$_ ], @$_;
        print 'Output: $b = ', pp(\@new), "\n\n";
        }
    
  3. or download this
    Input: $a = [[1 .. 4], [5 .. 8], [9 .. 12]]
    Output: $b = [[14, 18, 22], [30, 34, 38]]
    
    Input: $a = [[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]
    Output: $b = [[2, 1, 0], [1, 2, 1], [0, 1, 2]]
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11156544]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (2)
As of 2024-06-17 03:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuli‥ 🛈The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.