[Dune-devel] Random-Access Iterators

Jö Fahlke jorrit at jorrit.de
Thu Oct 2 09:19:28 CEST 2014


Am Wed,  1. Oct 2014, 23:56:24 +0200 schrieb Christian Engwer:
> > > Do you actually think that mixed meshes will provide efficient
> > random-access iterators?
> > I am assuming there is no requirement for this access to be efficient?
> > Or is something like
> > "access in O(1)" part of the suggestion?
> 
> it is not stated explicitly, but I would expect this. If you can't
> provide an efficient immeplementation, just provide a forward
> iterator. If you want to do random-like access on a forward iterator,
> you can do this via stl algorithms, or if they don't fit your need via
> short specialization.

Actually, O(1) is a requirement by the standard:
======================================================================
24.2.1 In general [iterator.requirements.general]

8 All the categories of iterators require only those functions that are
  realizable for a given category in constant time (amortized).  Therefore,
  requirement tables for the iterators do not have a complexity column.
======================================================================

Regards,
Jö.

-- 
Jorrit (Jö) Fahlke, Institute for Computational und Applied Mathematics,
University of Münster, Orleans-Ring 10, D-48149 Münster
Tel: +49 251 83 35146 Fax: +49 251 83 32729

Of all the things I've lost, I miss my mind the most.
-- Ozzy Osbourne
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 828 bytes
Desc: Digital signature
URL: <https://lists.dune-project.org/pipermail/dune-devel/attachments/20141002/e3911653/attachment.sig>


More information about the Dune-devel mailing list