Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

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

by jo37 (Deacon)
on Dec 30, 2023 at 16:56 UTC ( [id://11156598]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    use strict;
    use warinings;
    ...
        $m->range(ndcoords($m(1:,1:)), 2)->reorder(2, 3, 0, 1)
            ->clump(2)->sumover;
    }
    
  2. or download this
    sub submatrix_sum {
        my $w = shift;
    ...
        $m->range(ndcoords($m($w - 1:, $h - 1:), [$w, $h])->reorder(2, 3, 
    +0, 1)
            ->clump(2)->sumover;
    }
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (2)
As of 2024-06-25 02:13 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.