Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re^3: Uninitialized warnings trouble

by Anonymous Monk
on Dec 15, 2022 at 20:33 UTC ( [id://11148900]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Uninitialized warnings trouble
in thread Uninitialized warnings trouble

This next version of turn_tables seems less ugly.

sub turn_tables { my ( $pdl, $dir ) = @_; # dir = 0 => forward # 1 => backward my @t = ( # transform sub { $_[0]-> copy-> transpose-> slice( '-1:0, X' )}, # 90 sub { $_[0]-> copy-> slice( '-1:0, -1:0' )}, # 180 sub { $_[0]-> copy-> transpose-> slice( 'X, -1:0' )}, # 270 ); @t = reverse @t if $dir; for ( 1 .. 3 ) { my $s = $pdl-> slice( "X, X, $_" ); $s .= $t[ $_ - 1 ]-> ( $s ) } }

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (3)
As of 2024-04-25 22:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found