Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Efficient selection mechanism?

by davido (Cardinal)
on Jan 14, 2014 at 16:56 UTC ( [id://1070573]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my @control = (
      [  2, 13,  3, 16 ],
      [ 10,  1, 11,  6 ],
    );
    
  2. or download this
    #   0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 <-- Indicies rep
    +resent original ints.
    my @control = (
      [ 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, ],
      [ 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, ],
    );
    
  3. or download this
    my @valid_row_ix = grep { sum( @{$control[$_]}[@test] ) == 0 } 0 .. $#
    +control;
    
  4. or download this
    my @valid_row_ix = grep { List::MoreUtils::none { $_ == 1 } @{$control
    +[$_]}[@test] } 0 .. $#control;
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (3)
As of 2024-03-29 14:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found