dune-community / dune-xt-common

Other
2 stars 3 forks source link

Float Compare ::le and ::ge are not correct #149

Closed TiKeil closed 5 years ago

TiKeil commented 5 years ago

I just realize that our less or equal and greater or equal in common::FloatCmp::le resp. common::FloatCmp::ge are wrongly implemented.

Say we have two vectors v = (v_1, ..., v_n) and w = (w_1, ..., w_n). In le(v,w) we say

either v = w or v_i < w_i for all i.

This is wrong since we want to have

for all i , either v_i = w_i or v_i < w_i.

Do you agree?

This leads to bugs in the indicator function in dune-xt-functions since only lower left and upper right have the correct value.
I will try to fix this soon

tobiasleibner commented 5 years ago

Agreed. We should probably also add a test that fails with the current implementation.

renefritze commented 5 years ago

Fixed by #154

Btw, you can do this automagically, @TiKeil