Skip to content

Commit

Permalink
fix(DataTomeAnalysis): 🚑 fix var method miscalculation
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexandreHiroyuki committed Jun 11, 2024
1 parent 8c343aa commit b5f5128
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/DataTomeAnalysis.h
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ class DataTomeAnalysis : public DataTomeMvAvg<TypeOfArray, TypeOfSum> {
TypeOfArray var = 0;
for (size_t i = 0; i < this->point_count(); i++) {
TypeOfArray data_point = (*this)[i] - average;
var += (data_point - average) * (data_point - average);
var += (data_point) * (data_point);
}

return var;
Expand Down Expand Up @@ -266,7 +266,7 @@ class DataTomeAnalysis : public DataTomeMvAvg<TypeOfArray, TypeOfSum> {
TypeOfArray var = 0;
for (size_t i = 0; i < this->partial_point_count(partial_id); i++) {
TypeOfArray data_point = (*this)[i] - average;
var += (data_point - average) * (data_point - average);
var += (data_point) * (data_point);
}

return var;
Expand Down

0 comments on commit b5f5128

Please sign in to comment.