zhangstar333 opened a new pull request, #39929:
URL: https://github.com/apache/doris/pull/39929
## Proposed changes
the weight should be positive num, as have check the value valid use
DCHECK_GT(c._weight, 0) in Centroid;
```
void add(const Centroid& c) {
DCHECK_GT(c._weight, 0);
if (_weight != 0.0) {
_weight += c._weight;
_mean += c._weight * (c._mean - _mean) / _weight;
} else {
_weight = c._weight;
_mean = c._mean;
}
}
```
<!--Describe your changes.-->
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]