Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re^9: Odometer pattern iterator (in C).

by hdb (Monsignor)
on May 29, 2015 at 15:12 UTC ( [id://1128298]=note: print w/replies, xml ) Need Help??


in reply to Re^8: Odometer pattern iterator (in C).
in thread Odometer pattern iterator (in C). (Updated.)

You cannot do this inplace:

for( j = i+1; j < M; ++j ) idx[ i ] += N - idx[ M - j + i ];

as you are overwriting values that are still needed. This corresponds to the "reversing" the string part of the regex. In addition, you misread the formula, there is no += involved.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (5)
As of 2024-03-28 20:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found