|
Boost : |
Subject: Re: [boost] Review Request: Creasing (Sequence Properties)
From: Ronald Garcia (rxg_at_[hidden])
Date: 2010-01-26 16:23:09
Hi Grant,
I have added your library to the review queue.
Best,
Ron
On Jan 24, 2010, at 2:39 PM, Grant Erickson wrote:
> The creasing algorithm templates define four template functions for
> determining the order properties of sequences, specifically:
>
> * Increasing
> * Decreasing
> * Strictly Increasing
> * Strictly Decreasing
>
> The implementation is a fairly trivial composition of the STL
> adjacent_find,
> not2 and {greater,less,greater_equal,less_equal}.
>
> For the purposes of sequence ordering validation, using these
> templates is
> more efficient and straightforward than creating a temporary, sorted
> version
> of some sequence and comparing it against the original sequence.
>
> Example:
>
> bool
> CheckPoints(const Points & inPoints)
> {
> const bool strictlyIncreasing =
> is_strictly_increasing(inPoints.begin(),
> inPoints.end());
>
> if (!strictlyIncreasing) {
> cerr << "Points must be in increasing order with "
> "no duplicate values."
> << endl;
> }
>
> return strictlyIncreasing;
> }
>
> The review files are available in both Sandbox and Vault:
>
> Sandbox:
>
> boost/algorithm/creasing.hpp
> libs/algorithm/creasing/example/creasing_ex.cpp
> libs/algorithm/creasing/example/Jamfile
> libs/algorithm/creasing/test/creasing_test.cpp
> libs/algorithm/creasing/test/Jamfile.v2
>
> Vault:
>
> http://www.boostpro.com/vault/index.php?action=downloadfile&filename=creasin
> g.zip&directory=Algorithms
>
> Regards,
>
> Grant Erickson
>
>
> _______________________________________________
> Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
>
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk