]> https://gitweb.dealii.org/ - dealii.git/commit
Bugfix: Fix return value of StoredIndex<1, S>
authorMatthias Maier <tamiko@43-1.org>
Sat, 12 Sep 2015 04:49:21 +0000 (23:49 -0500)
committerMatthias Maier <tamiko@43-1.org>
Sat, 12 Sep 2015 20:55:14 +0000 (15:55 -0500)
commit58f1e231804a4e7b5a51cb40de927ec0c7120c6c
treef2d18b5975e5aaf393022ebefda6b7c9865e7b95
parent978b8dcb770c2845874335d6bf1611f692dff2b4
Bugfix: Fix return value of StoredIndex<1, S>

The problem is subtle. TensorAccessors::reordered_index_view returns an
internal object that behaves like a tensor.

The problem is that fully accessing the tensorial object, i.e., applying
operator[](unsigned int) rank times returned an object of type

  StoreIndex<0, [...]>

instead of type Number of the original tensor. The problem is that the
compiler has no way of knowing whether we want to cast this object to
Number during type matching, thus something like

  std::min( StoreIndex<0, [...]>(...), (double)4.);

fails.
include/deal.II/base/tensor_accessors.h
tests/base/tensor_accessors_01.cc

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.