def _cumulate(exact = false, force = false)
      unless force
        factor = if @last_cumulate == 0
                   Float::INFINITY
                 else
                   (@n.to_f / @last_cumulate)
                 end
        return if @n == @last_cumulate || (!exact && @cx && @cx > factor)
      end

      cumn = 0
      @centroids.each do |_, c|
        c.mean_cumn = cumn + c.n / 2.0
        cumn = c.cumn = cumn + c.n
      end
      @n = @last_cumulate = cumn
      nil
    end
def _cumulate(exact = false, force = false)
      unless force
        factor = if @last_cumulate == 0
                   Float::INFINITY
                 else
                   (@n.to_f / @last_cumulate)
                 end
        return if @n == @last_cumulate || (!exact && @cx && @cx > factor)
      end

      cumn = 0
      @centroids.each do |_, c|
        c.mean_cumn = cumn + c.n / 2.0
        cumn = c.cumn = cumn + c.n
      end
      @n = @last_cumulate = cumn
      nil
    end
rubocop:disable Metrics/PerceivedComplexity, Metrics/CyclomaticComplexity