Computational functions on vectors and matrices iterate over the
entries.
This can happen following index adressing, e.g. v[i]
for a vector, iterators, e.g. ++it
to increment
and *it
to dereference, which can be pointers in
some cases.
A third possibility is to use a pointer or iterator, where for
the dereference, we use a map, i.e. instead of *it
we use map(it)
, where map
is an object
that may transform the data behind the iterator.
These three options should be compared concerning performance. The syntax need not be very different.