summaryrefslogtreecommitdiffstats
path: root/ml/kmeans/SamplesBuffer.h
diff options
context:
space:
mode:
Diffstat (limited to 'ml/kmeans/SamplesBuffer.h')
-rw-r--r--ml/kmeans/SamplesBuffer.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/ml/kmeans/SamplesBuffer.h b/ml/kmeans/SamplesBuffer.h
index fccd216d5..5c3cb1a97 100644
--- a/ml/kmeans/SamplesBuffer.h
+++ b/ml/kmeans/SamplesBuffer.h
@@ -20,8 +20,9 @@ public:
Sample(CalculatedNumber *Buf, size_t N) : CNs(Buf), NumDims(N) {}
void initDSample(DSample &DS) const {
- for (size_t Idx = 0; Idx != NumDims; Idx++)
- DS(Idx) = CNs[Idx];
+ for (size_t Idx = 0; Idx != NumDims; Idx++) {
+ DS(Idx) = std::abs(CNs[Idx]);
+ }
}
void add(const Sample &RHS) const {