From: Wolfgang Bangerth Date: Sun, 22 Feb 2015 22:10:21 +0000 (-0600) Subject: Add a local typedef IndexSet::value_type. X-Git-Tag: v8.3.0-rc1~434^2~1 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7bf4e98a23a0175107fce0477f6227ff8baa5b13;p=dealii.git Add a local typedef IndexSet::value_type. --- diff --git a/doc/news/changes.h b/doc/news/changes.h index 77ca21aa83..403c8ef4fd 100644 --- a/doc/news/changes.h +++ b/doc/news/changes.h @@ -350,6 +350,11 @@ inconvenience this causes.

Specific improvements

    +
  1. New: IndexSet now has a local typedef IndexSet::value_type/ +
    + (Wolfgang Bangerth, 2015/02/22) +
  2. +
  3. Fixed: MappingQEulerian would previously not move interior points in 1D for higher order mappings. This has been fixed by removing a few specializations of MappingQ for 1D that are no longer necessary. diff --git a/include/deal.II/base/index_set.h b/include/deal.II/base/index_set.h index 96aaa9bf7f..89ccbeffba 100644 --- a/include/deal.II/base/index_set.h +++ b/include/deal.II/base/index_set.h @@ -59,6 +59,27 @@ DEAL_II_NAMESPACE_OPEN class IndexSet { public: + /** + * One can see an IndexSet as a container of size size(), where the + * elements of the containers are bool values that are either false + * or true, depending on whether a particular index is an element of + * the IndexSet or not. In other words, an IndexSet is a bit like a + * vector in which the elements we store are booleans. In this view, + * the correct local typedef indicating the type of the elements of + * the vector would then be @p bool. + * + * On the other hand, @p bool has the disadvantage that it is not a + * numerical type that, for example, allows multiplication with a @p + * double. In other words, one can not easily use a vector of + * booleans in a place where other vectors are + * allowed. Consequently, we declare the type of the elements of + * such a vector as a signed integer. This uses the fact that in the + * C++ language, booleans are implicitly convertible to integers. In + * other words, declaring the type of the elements of the vector as + * a signed integer is only a small lie, but it is a useful one. + */ + typedef signed int value_type; + /** * Default constructor. */