Create a boost/algorithm/math sub-library?

We have a general algorithms directory, currently with a subdirectory with string routines. I want to add a parallel subdirectory with math routines. The routines I want to add are for the Greatest Common Factor and the Least Common Multiple. Now, I already have a header for that in Boost at $ROOT/boost/math/common_factor_rt.hpp, but the main function and function object class templates in that header encapsulate the real implementation. It's those implementation functions that I want to public place in the algorithm collection. They would be: 1. GCD for unsigned numbers and other non-signed entities, like polynomials, using division & modulus reduction. 2. GCD for signed entities; similar to [1] but there are sign comparisons and possible negations, which types in [1] don't have to support. 3. GCD for binary unsigned integers using bit-level operations; it has the same complexity as [1] and [2], O(digit_count^2), but is generally faster because bit twiddling is faster than division. The wrapping code currently in the math libraries, and elsewhere, would be changed to call these routines. Would this require a full-blown review, a mini-review, or no review? Note that we currently do _not_ implement [3] anywhere in Boost (AFAIK). For the future, I envision algorithm/math to only hold function (templates) that compute specific ways to evaluate a relation of interest. Full blown wrapping functions and function objects, as well as types, would stay within the regular math libraries (and call the algorithms as needed). -- Daryle Walker Mac, Internet, and Video Game Junkie darylew AT hotmail DOT com

On Mon, 24 Jul 2006 04:39:06 -0400, Daryle Walker <darylew@hotmail.com> wrote:
We have a general algorithms directory, currently with a subdirectory with string routines. I want to add a parallel subdirectory with math routines.
I second that. Not the most useful thing in the world, but you might want to consider integer_log2.hpp and lowest_bit.hpp from the pending/ directory. -- [ Gennaro Prota, C++ developer for hire ]

On 7/24/06, Gennaro Prota <gennaro_prota@yahoo.com> wrote:
I second that. Not the most useful thing in the world, but you might want to consider integer_log2.hpp and lowest_bit.hpp from the pending/ directory.
Would Boost.Integer's static_log2 go there too, then? ( http://boost.org/libs/integer/doc/static_log2.html )

On Mon, 24 Jul 2006 23:05:12 -0400, me22 <me22.ca@gmail.com> wrote:
On 7/24/06, Gennaro Prota <gennaro_prota@yahoo.com> wrote:
I second that. Not the most useful thing in the world, but you might want to consider integer_log2.hpp and lowest_bit.hpp from the pending/ directory.
Would Boost.Integer's static_log2 go there too, then? ( http://boost.org/libs/integer/doc/static_log2.html )
Not sure. As you can see, integer_log2 and lowest_bit are not "algorithms" in a strict sense, but they come handy to implement many of them (for instance dynamic_bitset<> bit searching). Maybe all three templates should be in the integer library and, as an implementation detail, be used for some algorithm implementations. As I said they are no rocket science but it's a pity that they are in the pending/ directory (as other useful code), where they mostly get unnoticed. -- [ Gennaro Prota, C++ developer for hire ]
participants (3)
-
Daryle Walker
-
Gennaro Prota
-
me22