Fix histogram indexing when accessed via operator [] (#939)

This commit is contained in:
Boris Gromov 2024-07-31 10:04:45 +02:00 committed by GitHub
parent 211b8c2e90
commit f01edbc5c4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 3 deletions

View File

@ -249,7 +249,7 @@ namespace etl
//*********************************
value_type operator [](key_type key) const
{
return this->accumulator[key];
return this->accumulator[key - Start_Index];
}
};
@ -373,7 +373,7 @@ namespace etl
//*********************************
value_type operator [](key_type key) const
{
return this->accumulator[key];
return this->accumulator[key - start_index];
}
private:

View File

@ -247,7 +247,7 @@ namespace
for (size_t i = 0UL; i < output1.size(); ++i)
{
CHECK_EQUAL(int(output1[i]), int(histogram[i]));
CHECK_EQUAL(int(output1[i]), int(histogram[i - 4]));
}
}