Boost logo

Boost :

From: Jeremy Siek (jsiek_at_[hidden])
Date: 2002-05-15 14:32:39

Hi Herve,

Sounds like a good addition to the algorithms. I'll check this stuff into
the boost-sandbox.


On Mon, 13 May 2002, Herve Bronnimann wrote:

hbr> Hello boosters:
hbr> I've recently assigned and completed a homework, an extension of
hbr> std::min_element and std::max_element. I've put in the Files section of
hbr> the website (under non-capitalized minmax_element) and also
hbr> created a Wiki entry in STLAlgorithmExtensions for recording the
hbr> discussion.
hbr> I sollicit your feedback and, if nobody objects, would like to propose
hbr> this as a boost library. It's a single file <boost/minmax.hpp>.
hbr> The story is, minmax_element does the work of both min_element and
hbr> max_element, in a single traversal and using only 3n/2+1 comparisons.
hbr> Experimentally, it's just a tad slower than min_element alone. The
hbr> algorithm is well known, but I found it quite tricky to implement
hbr> correctly (esp. when elements can be identical and you want to return
hbr> the FIRST occurence of both min and max). Try it!
hbr> Everything else is on the web site:
hbr> Please reply to me directly as well as the mailing list, as I read the
hbr> boost digest only (and not that frequently).
hbr> --
hbr> Herve Bronnimann
hbr> Assistant Professor, Computer Science Dept
hbr> Polytechnic University Tel (718) 260 3538
hbr> Six Metrotech Center Fax (718) 260 3609
hbr> Brooklyn, NY 11201 http://photon.poly/edu/~hbr/
hbr> _______________________________________________
hbr> Unsubscribe & other changes:

 Jeremy Siek
 Ph.D. Student, Indiana Univ. B'ton email: jsiek_at_[hidden]
 C++ Booster ( office phone: (812) 855-3608

Boost list run by bdawes at, gregod at, cpdaniel at, john at