SignedDataSummary<T> Class

Class to accumulate statistics about a stream of signed numbers with tag items.

  • All sums, counts, extrema, and item values are initialized to zero in the constructor.
  • Each call to announceItem(item, value) updates the various sums, counts, and extrema.

Methods

Name Description
constructor<T>(createArrays: boolean): SignedDataSummary<T> Setup with zero sums and optional arrays.  
announceItem(item: T, data: number): void Update with an item and its data value.  

Properties

Name Type Description
largestNegativeItem undefined | T The tag item item with the most negative data.  
largestNegativeValue number    
largestPositiveItem undefined | T The tag item item with the largest positive data.  
largestPositiveValue number    
negativeItemArray undefined | T[] Array of all negative area items.  
negativeSum number Sum of negative area items.  
numNegative number Number of negative area items.  
numPositive number Number of positive area items.  
numZero number Number of zero area items.  
positiveItemArray undefined | T[] Array of positive area items.  
positiveSum number Sum of all positive area items.  
zeroItemArray undefined | T[] Array of zero area items.  

Defined in

Last Updated: 16 April, 2024