Your skill will accomplishwhat the force of many cannot PerlMonks

### Re^2: Optimization Help

 on Aug 01, 2013 at 23:33 UTC ( #1047517=note: print w/replies, xml ) Need Help??

in reply to Re: Optimization Help

Oh and all the matrices are 2D and the mapping vector is 1D

Replies are listed 'Best First'.
Re^3: Optimization Help
by BrowserUk (Pope) on Aug 01, 2013 at 23:57 UTC

Try:

```sub equate2 {
my (\$self, \$other, \$mapping) = @_;
my \$sm = \$self->{Matrix};
my \$om = \$other->{Matrix};
for my \$row ( 0 .. \$#\$mapping ) {
my \$smrow = \$sm->[ \$row ];
my \$omrow = \$om->[ \$mapping->[ \$row ] ];
for my \$col ( 0 .. \$#\$mapping ) {
return 0 if \$smrow->[ \$col ] != \$omrow->[ \$mapping->[ \$col
+ ] ];
}
}
return 1;
}

With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
I am in your debt!!!!! In my test case this is 40% faster, that's going to save me a couple of days right there.

How big is \$mapping? (And can you show us (some of) what it contains? Eg. the mapping sequence.)

With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

BrowserUK has a well-earned reputation for doing things like that ...   :-)

Create A New User
Node Status?
node history
Node Type: note [id://1047517]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (4)
As of 2018-04-25 05:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
Voting Booth?
My travels bear the most uncanny semblance to ...

Results (88 votes). Check out past polls.

Notices?