Boost C++ Libraries Home Libraries People FAQ More

Next

The Boost Algorithm Library

Marshall Clow

Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Table of Contents

Description and Rationale
Searching Algorithms
Boyer-Moore Search
Boyer-Moore-Horspool Search
Knuth-Morris-Pratt Search
C++11 Algorithms
all_of
any_of
none_of
one_of
is_sorted
is_partitioned
partition_point
Other Algorithms
clamp
hex
Reference
Header <boost/algorithm/clamp.hpp>
Header <boost/algorithm/hex.hpp>
Header <boost/algorithm/minmax.hpp>
Header <boost/algorithm/minmax_element.hpp>
Header <boost/algorithm/searching/boyer_moore.hpp>
Header <boost/algorithm/searching/boyer_moore_horspool.hpp>
Header <boost/algorithm/searching/knuth_morris_pratt.hpp>
Header <boost/algorithm/string.hpp>
Header <boost/algorithm/string_regex.hpp>

Boost.Algorithm is a collection of general purpose algorithms. While Boost contains many libraries of data structures, there is no single library for general purpose algorithms. Even though the algorithms are generally useful, many tend to be thought of as "too small" for Boost.

An implementation of Boyer-Moore searching, for example, might take a developer a week or so to implement, including test cases and documentation. However, scheduling a review to include that code into Boost might take several months, and run into resistance because "it is too small". Nevertheless, a library of tested, reviewed, documented algorithms can make the developer's life much easier, and that is the purpose of this library.

Future plans

I will be soliciting submissions from other developers, as well as looking through the literature for existing algorithms to include. The Adobe Source Library, for example, contains many useful algorithms that already have documentation and test cases. Knuth's The Art of Computer Programming is chock-full of algorithm descriptions, too.

My goal is to run regular algorithm reviews, similar to the Boost library review process, but with smaller chunks of code.

Dependencies

Boost.Algorithm uses Boost.Range, Boost.Assert, Boost.Array, Boost.TypeTraits, and Boost.StaticAssert.

Acknowledgements

Thanks to all the people who have reviewed this library and made suggestions for improvements. Steven Watanabe and Sean Parent, in particular, have provided a great deal of help.

Last revised: June 23, 2012 at 08:41:34 GMT


Next