lib/mcg/signal_analysis/sar.rb
# Sum the values of all positive indexes
Sum the values of all positive indexes
Sum the values of all positive indexes
def sum_indexes( indexes=nil )
          if not indexes
            indexes = @indexes.map{ |x| x.name }
          end
          sum = 0
          indexes.each do |name| 
            idx = index(name)
            sum += ((idx.is_set?) ? idx.value : 0)
          end
          return sum
        end
def sum_indexes ( indexes = nil ) if not indexes indexes = @indexes . map { | x | x . name } end sum = 0 indexes . each do | name | idx = index ( name ) sum += ( ( idx . is_set? ) ? idx . value : 0 ) end return sum end
Sum the values of all positive indexes
Sum the values of all positive indexes
indexes