[dune-functions] SizePrefix

Carsten Gräser graeser at mi.fu-berlin.de
Fri Oct 2 22:59:40 CEST 2015


Am 02.10.2015 um 20:38 schrieb Oliver Sander:
> Hi Carsten,
> 
>> The problem would no longer exist, if we require the type of a size
>> prefix to be a ReservedVector<size_type,k> where k is a template
>> parameter of the size(...) method. For convince we could still
>> export a fixed SizePrefix type which is always large enough to
>> traverse the whole index tree.
Maybe using a static capacity deque would be even better.
I just added a prototype for review. It's basically a
ReservedVector storing the index of the first entry.
Then we can also do push_front and pop_front without
index shuffling, but at the price of some more index
computations.

Remarks? Comments?

Carsten

>>
>> Does anyone see potential problems with this solution?
> 
> I don't currently see a problem with this, but I wonder whether std::array
> would be noticeably faster in the many situations where the multi-index
> size is fixed.
> 
> How about requiring ReservedVector for the time being, until somebody
> comes up with a convincing use-case for an alternative?
> 
> Best,
> Oliver
> 
>>
>> Best,
>> Carsten

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: OpenPGP digital signature
URL: <https://lists.dune-project.org/pipermail/dune-functions/attachments/20151002/72928fc0/attachment.sig>


More information about the dune-functions mailing list