Introduction
Here, we present various ways to computes the mean of 1d container denoted S1d. It illustrates the different uses to iterate through monodimensional containers Group of Containers like slip::block , slip::Array, slip::Vector...
The classical loop
const std::size_t size = S1.size();
for(std::size_t j = 0; j < size; ++j)
{
}
Global iterators
These iterators follow the RandomAccessIterator concept of the standard library.
Direct iteration
double m = slip::mean<double>(S1d.begin(),S1d.end());
Reverse iteration
double m = slip::mean<double>(S1d.rbegin(),S1d.rend());
Range iterators
These iterators follow the RandomAccessIterator concept of the standard library.
Range direct iterator
double m = slip::mean<double> (S1d.begin(range),S1d.end(range));
Range reverse iterator
double m = slip::mean<double> (S1d.rbegin(range),S1d.rend(range));