class WeighedDistribution::InterimWeightsSumsTable
@!visibility private
Constants
Public Class Methods
new(values_and_weights)
click to toggle source
Public Instance Methods
[](index)
click to toggle source
@param [Integer] index @return [Entry, nil] {Entry} if index < {#size} and nil otherwise.
If index < 0 then resultant {Entry#interim_weights_sum} = 0.
# File lib/weighed_distribution.rb, line 132 def [](index) if index < 0 then Entry.new([], 0) else @entries[index] end end
last_index()
click to toggle source
@return [Integer]
# File lib/weighed_distribution.rb, line 141 def last_index size - 1 end
size()
click to toggle source
@return [Integer]
# File lib/weighed_distribution.rb, line 146 def size @entries.size end