Class: Alf::Aggregator::Stddev
- Inherits:
-
Variance
- Object
- Alf::Aggregator
- Variance
- Alf::Aggregator::Stddev
- Defined in:
- lib/alf-aggregator/alf/aggregator/stddev.rb
Overview
Defines a ‘stddev()` aggregation operator.
Example:
# direct ruby usage
Alf::Aggregator.stddev{ qty }.aggregate(...)
# lispy
(summarize :supplies, [:sid], :stddev => stddev{ qty })
Instance Attribute Summary
Attributes inherited from Alf::Aggregator
Instance Method Summary collapse
-
#finalize(memo) ⇒ Object
Finalizes the computation.
Methods inherited from Variance
Methods inherited from Alf::Aggregator
#==, #aggregate, coerce, #default_options, #happens, #has_source_code!, #infer_type, inherited, #initialize, #least, #to_lispy
Methods included from Support::Registry
#each, #listen, #listeners, #register, #registered
Constructor Details
This class inherits a constructor from Alf::Aggregator
Instance Method Details
#finalize(memo) ⇒ Object
Finalizes the computation.
19 20 21 |
# File 'lib/alf-aggregator/alf/aggregator/stddev.rb', line 19 def finalize(memo) Math.sqrt(super(memo)) end |