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 T | undefined The tag item item with the most negative data.  
largestNegativeValue number    
largestPositiveItem T | undefined The tag item item with the largest positive data.  
largestPositiveValue number    
negativeItemArray T[] | undefined 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 T[] | undefined Array of positive area items.  
positiveSum number Sum of all positive area items.  
zeroItemArray T[] | undefined Array of zero area items.  

Defined in

Last Updated: 17 December, 2024