- Nov 13, 2017
-
-
Jö Fahlke authored
This introduces a helper function that enables `auto` type deduction even in the presence of proxies and pre-C++11 libraries with a tendency to capture references to temporaries. Note: the motivating examples below make use of specializations of `autoCopy()` that will be introduced in later commits. Example 1: deducing the element type of a vector when proxies are a possibility: ```c++ template<class Vector> auto pop_and_clear(Vector &v) { auto head = autoCopy(v[0]); v.clear(); return head; } ``` Without `autoCopy()` this would be undefined behaviour if `Vector` happens to be `std::vector<bool>`. Example 2: a custom number type with lazy evaluation: ```c++ template<class MaybeCustomType> auto f(MaybeCustomType v) { return 2 * v - 1; } ``` This fails for the custom number type from the automatic differentiation library Adept, because Adept constructs an expression object that holds references to its subexpressions and is evaluated only when it is assigned to a number object later. Due to the use of `auto` this expression object is passed out of the function, but the temporary object for the subexpression `2*v` is destroyed when the function returns. Wrapping the expression in the `return` statement with `autoCopy()` ensures that the evaluation happens while the reference to the subexpression is still valid, and has no ill effect when fundamental types instead of Adept's custom types are used. See merge request !345
-
- Nov 10, 2017
-
-
Martin Nolte authored
Remove noexcept from ParallelIndexSet::operator[] See merge request !238
-
Martin Nolte authored
[cmake] enable position independent code by default See merge request !360
-
Andreas Dedner authored
added empty changelog See merge request !375
-
Andreas Dedner authored
-
- Nov 08, 2017
-
-
Jö Fahlke authored
This replaces `remoteindices.hh` with `plocalindices.hh`; as a result this test can now be compiled without MPI. Thanks to @felix.gruber for the initial report (see !372).
- Nov 06, 2017
-
-
Steffen Müthing authored
[bugfix] make `dune_add_test` play nicely with MPICH Closes #24 See merge request !363
-
Martin Nolte authored
Thanks to @smuething for the hint. Note: This patch changes the semantics of the command. Up to now, the command was allowed to contain arguments (unless it was a target). With this patch, the arguments must be passed separately.
-
Ansgar Burchardt authored
[cmake] Fix vverb not recognized as MINIMAL_DEBUG_LEVEL See merge request !356
-
Jö Fahlke authored
This deprecates the header `<dune/common/array.hh>` and all of its members. - `Dune::array`: use `std::array` instead. - `Dune::make_array()`: use `Dune::Std::make_array()` instead. - `Dune::fill_array()`: use `Dune::filledArray()` instead. Note that deprecation warnings for `array` and `make_array` could not be implemented, since those were implemented by using declarations and it seems to be impossible to deprecate those. Users should still get a note though since the entire header is deprecated. For `fill_array()` there was no replacement, so this commit introduces `filledArray()` with a slightly improved calling syntax, a better name, and (in C++17) support for `constexpr` arrays. To make it possible to deprecate `array.hh`, that replacement is in its own header `filledarray.hh`. This commit also introduces two unit tests: - `filledarraytest.cc` to test `filledArray()`, and - `arraydeprecationtest.cc` to make sure the deprecation syntax is supported for all tested compilers. (It also has a feature to check that deprecation warnings are really displayed, but that is disabled for regular unit testing since the logs have to be checked manually for the warnings.)
- Nov 05, 2017
-
-
Martin Nolte authored
[bugfix] fix version detection in `dune_python_find_package` Closes #75 See merge request !364
-
Martin Nolte authored
There were two bugs: - The variable `PYPACKAGE_RESULT` was set instead of `${PYPACKAGE_RESULT}`. - The output script `pyversion.py` was silently ignored, yielding an empty version string. This fixes #75.
-
Martin Nolte authored
The standard `add_test` allows CMake targets to be passed as commands. However, when passing them to MPI, this does not work in two cases: - MPICH does not search for the executable in the current working directory. - The name of the executable need not coincide with the name of the target (e.g., on Windows). This patch fixes both issues by checking whether the command is a CMake target and obtaining the location of the primary output file in this case. This name is then passed to MPI or `add_test`, respectively. This closes #24.
-
- Nov 03, 2017
-
-
Jö Fahlke authored
-
Martin Nolte authored
This patch add an option `CMAKE_POSITION_INDEPENDENT_CODE` defaulting to `ON`, but only if `BUILD_SHARED_LIBS` is `OFF`. Otherwise we always build position independent code, anyway.
- Nov 02, 2017
-
-
Jö Fahlke authored
- Nov 01, 2017
-
-
Christoph Grüninger authored
-
- Oct 31, 2017
-
-
Christian Engwer authored
[dunecontrol] evaluate CMAKE_MODULE_PATH from opts file Closes #25 See merge request !355
-
Christian Engwer authored
up to now a CMAKE_MODULE_PATH environment variable was properly considered and appended to the cmake parameters. This did not work for an environment variable specified in the opts file. This patch makes the behaviour consistent between shell environment and opts file variables. (fixes #25)
-
- Oct 30, 2017
-
-
Martin Nolte authored
The semantics of the old macro DUNE_VERSION_NEWER is DUNE_VERSION_GTE, not the opposite. While we're at it, also fix the deprecation message to suggest DUNE_VERSION_GTE instead of DUNE_VERSION_GE.
-
Carsten Gräser authored
[bugfix] Fix compile error with NDEBUG See merge request !352
-
Carsten Gräser authored
It seems that the `#if ...` was originally introduced to avoid a compiler warning in case later `assert()` are removed due to NDEBUG. When changing to `TestSuite` in e7b592a2 this was not adjusted. **Surprisingly no one compiled our tests with NDEBUG since June 2017 otherwise this would have triggered a compile error!**
-
Martin Nolte authored
[bugfix] silence signed/unsigned comparison warning See merge request !349
-
Martin Nolte authored
- Oct 27, 2017
-
-
Ansgar Burchardt authored
cmake: fix regex for hidden files See merge request !330
-
Jö Fahlke authored
-
Jö Fahlke authored
-
Jö Fahlke authored
This introduces a helper function that enables `auto` type deduction even in the presence of proxies and pre-C++11 libraries with a tendency to capture references to temporaries. Note: the motivating examples below make use of specializations of `autoCopy()` that will be introduced in later commits. Example 1: deducing the element type of a vector when proxies are a possibility: ```c++ template<class Vector> auto pop_and_clear(Vector &v) { auto head = autoCopy(v[0]); v.clear(); return head; } ``` Without `autoCopy()` this would be undefined behaviour if `Vector` happens to be `std::vector<bool>`. Example 2: a custom number type with lazy evaluation: ```c++ template<class MaybeCustomType> auto f(MaybeCustomType v) { return 2 * v - 1; } ``` This fails for the custom number type from the automatic differentiation library Adept, because Adept constructs an expression object that holds references to its subexpressions and is evaluated only when it is assigned to a number object later. Due to the use of `auto` this expression object is passed out of the function, but the temporary object for the subexpression `2*v` is destroyed when the function returns. Wrapping the expression in the `return` statement with `autoCopy()` ensures that the evaluation happens while the reference to the subexpression is still valid, and has no ill effect when fundamental types instead of Adept's custom types are used.
-
- Oct 26, 2017
-
-
Carsten Gräser authored
[Vc] Deal with the missing swap() on Vc proxies. Closes #59 See merge request !339
-
- Oct 24, 2017