Below you can find code snippets. For full examples and some tests, see the <i>examples</i> folder. In some cases, sample programs are included in the header files themselves, and they can be enabled by specific CPP defines.
Collection of new and extended SL algorithms. Contents:
</p>
<ulclass="org-ul">
<li><code>for_each[_it][_advance]</code>: Apply functor to elements in range. Options: take iterator pair or range as input; pass iterator instead of element to functor; store next iterator prior to applying functor (e.g. use: remove elements from a list in one pass.)
</li>
<li><code>(min|max|minmax)[_value]_of</code>: Find min and/or max in range. Options: take iterator pair or range as input; optionally use functor to extract key; return iterator(s) or value(s).
</li>
<li><code>mean_stdv_of</code>: Find mean and sample stdv of elements in range. Options: take iterator pair or range as input; optionally use functor to extract key.
</li>
<li><code>(equal|all|any)_of</code>: Check that all elements in a range are equal, or that all are true, or that at least one is true. Options: take iterator pair or range as input; optionally use functor to extract key.
</li>
<li><code>os_join</code>: Use <code>operator <<</code> overloads to print range or to convert it to string using a custom separator. Options: take iterator pair or range as input; optionally use functor to extract key.
</li>
</ul>
<preclass="example">
#include "alg.hpp"
...
std::list<int> l{3, 6, 10, 18};
// erase elements == 0 mod 5 => l == {3, 6, 18}
Floating point additions in logarithmic space using table lookup.
</p>
<p>
<b>Note</b>: This library is based on Sean Eddy's code, originall part of HMMER. The version included in here is header-only, and it using implicit table initialization (no need to explicitly call <code>p7_FLogsumInit()</code>).
</p>
<preclass="example">
#include "logsum.hpp"
...
float r = p7_FLogsum(.5, .3); // ~= log(exp(.5) + exp(.3))