This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Search algorithms in __gnu_cxx::


Hello again,
I have attached 3 files.
[1] search_algo --> This contains the Boyer Moore search algorithm
implementation, and a certain __is_char<> struct, which I would like
to shift to cpp_type_traits.h.
[2] boyer_moore.cpp --> This is the test file which checks the output
of the new search algorithm against the original std::search algorithm
for correctness of output.
[3] rtest.html --> This is the input file we feed to the program
generated using: g++411 boyer_moore.cpp

Tested with g++ 4.1.1
Run it as: ./a.out rtest.html
Let me know if there is any problem, or if I can go ahead and make a patch.


Regards, -Dhruv.



On 9/13/06, Paolo Carlini <pcarlini@suse.de> wrote:
Dhruv Matani wrote:
> Here are numbers for strings that do occur in the text:
> Boyer Moore             std::search
>  8.485s                          13.257s
>
> That said, since I don't have the patched library with the find()
> member implemented NOT as using std::search, I'll get down to testing
> that as soon as I get it.
Ok, just fetch current mainline. In any case, we are going to patch
mainline only...
> What I meant was not to provide a specialization of the algorithm
> proper, but of the __bm_struct<> implementation when instantiated with
> char, string, etc.... so that instead of using the hash(associative)
> containers, we can use an array.
I see. So, good work! ;)

Paolo.



--
  -Dhruv Matani.
http://www.geocities.com/dhruvbird/

"Life is wasted on the living"
 - Zaphod Beeblebrox the Fourth.

Attachment: bm.tar.bz2
Description: BZip2 compressed data


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]