vle-forge / vle

Virtual Laboratory Environment
http://www.vle-project.org
GNU General Public License v3.0
21 stars 22 forks source link

manager: index overflow in accu_mono #387

Closed quesnel closed 4 years ago

quesnel commented 4 years ago

@rtrepos In quantileOnSortedVect function, an index overflow occurred at line 517: quantile = (1-g)*x[j-1] + g*x[j]; in the manager/details/accu_mono.cpp with the libstdc++ preprocessor option -D_GLIBCXX_ASSERTIONS.

The vector x have a size of 1 double.

If I protect the vector (if (j == 1) quantile = (1-g) * x[j-1]; else ...), I get the following error:

../tests/manager/test_accumulators.cpp(60): test 'acc.quantile(0.25) != 2.95 (epsilon: 10e-4)

rtrepos commented 4 years ago

Hello, Ok I will have a look to it. How can i set easily the -D_GLIBCXX_ASSERTIONS in vle cmake ? when does it occur ? every time ? whe nthe size of the vector is 1 ? Thanks.

rtrepos commented 4 years ago

If the length of the vector is one, we can return the value of the vector whatever is the qualite specified.