Commit ef2c811b authored by Pierre Aubert's avatar Pierre Aubert
Browse files

Add test

parent 64d393de
Pipeline #96653 passed with stages
in 48 seconds
......@@ -119,7 +119,7 @@ void PHistogram<T>::addValue(T value){
*/
template<typename T>
void PHistogram<T>::addValue(const T * tabValue, size_t nbValues){
if(p_nbValue != nbValues || p_value == NULL || tabValue == NULL || nbValues == 0lu) return;
if(p_nbValue == 0lu || p_value == NULL || tabValue == NULL || nbValues == 0lu) return;
for(size_t i(0lu); i < nbValues; ++i){
addValue(tabValue[i]);
}
......@@ -131,7 +131,7 @@ void PHistogram<T>::addValue(const T * tabValue, size_t nbValues){
*/
template<typename T>
void PHistogram<T>::setValueRange(const T * tabValue, size_t nbValues){
if(p_nbValue != nbValues || p_value == NULL || tabValue == NULL || nbValues == 0lu) return;
if(p_nbValue == 0lu || p_value == NULL || tabValue == NULL || nbValues == 0lu) return;
pminmaxTab(p_xMin, p_xMax, tabValue, nbValues);
setRange(p_xMin, p_xMax);
reset();
......@@ -151,7 +151,7 @@ void PHistogram<T>::addAmplitude(T value, T amplitude){
return;
}
size_t pos(((value - p_xMin)*((double)p_nbValue))/p_xRange);
if(pos >= p_nbValue) return;
if(pos >= p_nbValue){return;}
p_value[pos] += amplitude;
++p_nbTirIn;
}
......
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