lib/onedclusterer/jenks.rb
def bounds(n = n_classes)
      raise ArgumentError, "n must be lesser than or equal to n_classes: #{n_classes}" if n > n_classes

      k = data.size
      bounds = []

      # the calculation of classes will never include the upper and
      # lower bounds, so we need to explicitly set them
      bounds[n] = data.last
      bounds[0] = 0

      for countNum in n.downto 2
        id = @lower_class_limits[k][countNum]
        bounds[countNum - 1] = data[id - 2]
        k = id - 1
      end

      bounds
    end
def bounds(n = n_classes)
      raise ArgumentError, "n must be lesser than or equal to n_classes: #{n_classes}" if n > n_classes

      k = data.size
      bounds = []

      # the calculation of classes will never include the upper and
      # lower bounds, so we need to explicitly set them
      bounds[n] = data.last
      bounds[0] = 0

      for countNum in n.downto 2
        id = @lower_class_limits[k][countNum]
        bounds[countNum - 1] = data[id - 2]
        k = id - 1
      end

      bounds
    end
def bounds ( n = n_classes ) raise ArgumentError , "n must be lesser than or equal to n_classes: #{n_classes}" if n > n_classes k = data . size bounds = [ ] # the calculation of classes will never include the upper and
 # lower bounds, so we need to explicitly set them
 bounds [ n ] = data . last bounds [ 0 ] = 0 for countNum in n . downto 2 id = @lower_class_limits [ k ] [ countNum ] bounds [ countNum - 1 ] = data [ id - 2 ] k = id - 1 end bounds end
get bounds array for `n` number of classes
get bounds array for n number of classes