[Dune] [#587] GenericReferenceElements should use unsigned for indices, sizes etc.

Dune flyspray at dune-project.org
Tue Apr 24 22:48:35 CEST 2012


THIS IS AN AUTOMATED MESSAGE, DO NOT REPLY.

The following task has a new comment added:

FS#587 - GenericReferenceElements should use unsigned for indices, sizes etc.
User who did this - Martin Nolte (nolte)

----------
The use of int vs. unsigned int for dimensions (including mydimension, dimensionworld, and codimension) is actually annoying. However, I do not think this issue is resolved by changing these types in one class in either direction. It is rather a fundamental decision that is required here that should be made on a developer meeting. Moreover, such changes should not be made shortly before a release. It is hard to anticipate all potential problems with such a change (e.g., do you really know what will happen if you cast int( -1 ) into a std::size_t on different compilers, different architectures, etc.?).

With respect to the natural choice for indices, I disagree. std::size_t is usually an 8 byte integer on 64 bit architectures and becomes a real waste of memory for storing small index sets (like the DUNE's subentity numbering). Moreover, the standard does to my knowledge not specify std::size_t as _the_ type to store size information in. Maybe we should add another template argument to the reference element ;-). What I actually mean to say is that in my opinion such basic decisions should long have been made on a developer meeting and that they require thorough knowledge of the C++ standard.

A similar argument holds with respect to the GeometryType. Personally, I never liked this object at all. One reason is that nearly all uses of this object can be replaced by e.g., a pointer to a singleton reference element, which actually holds all the necessary information. But let's not mourn, I think this issue, too, needs discussion.

Finally, I would like to thank you for all the effort you put into DUNE maintenance lately. It is great to someone actively trying to improve the code (and not just talking about it). Nevertheless, you should keep the bigger picture in mind. For example, it is not really important whether the reference element returns an int, an unsigned int or a std::size_t. What is important is, e.g., the return type the user expects. To this end, a lot of internal consistency is required and it is exactly this consistency that requires meetings to talk them over.

Please don't get me wrong, I am not trying to slow you down. On the contrary, I would not like to see your resources wasted on unnecessary changes that definitely require revision (says he who tends to change such inconsistencies whereever he finds them). But I do think that we both have to learn to be patient. Making such changes a real success requires a lot of discipline from all developers. And there are a lot of small construction sites within DUNE.

If you still feel like changing these types, just go ahead. All I ask is that you do it thoroughly and consistently. We have had enough easy and ill-done changes since the last release (remember the removal of compactify?).
----------

More information can be found at the following URL:
http://www.dune-project.org/flyspray/index.php?do=details&task_id=587#comment3403

You are receiving this message because you have requested it from the Flyspray bugtracking system.  If you did not expect this message or don't want to receive mails in future, you can change your notification settings at the URL shown above.




More information about the Dune mailing list