Commit bb8579aa authored by Jö Fahlke's avatar Jö Fahlke

[!384] Make reading weight of weighted accumulation views const.

Merge branch 'const-weight-getters' into 'master'

ref:pdelab/dune-pdelab The weighted accumulation views of LocalVector and
LocalMatrix used to set an internal _modified flag when *reading* the weight,
making the weight() getter method non-const.

This change skips setting the modified flag. If the underlying vector is
indeed modified through the view, other non-const methods will be used to do
so, and will mark the view as modified.

See merge request [pdelab/dune-pdelab!384]

  [pdelab/dune-pdelab!384]: gitlab.dune-project.org/pdelab/dune-pdelab/merge_requests/384
parents d562523b 033c7834
Pipeline #15255 passed with stage
in 15 minutes and 8 seconds
......@@ -58,9 +58,8 @@ namespace Dune {
* \note This can be used together with rawAccumulate() to avoid applying the weight at
* each loop iteration.
*/
weight_type weight()
weight_type weight() const
{
_modified = true;
return _weight;
}
......
......@@ -57,9 +57,8 @@ namespace Dune {
* \note This can be used together with rawAccumulate() to avoid applying the weight at
* each loop iteration.
*/
weight_type weight()
weight_type weight() const
{
_modified = true;
return _weight;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment