Class: Keisan::Functions::Reduce
- Inherits:
-
EnumerableFunction
- Object
- Keisan::Function
- EnumerableFunction
- Keisan::Functions::Reduce
- Defined in:
- lib/keisan/functions/reduce.rb
Instance Attribute Summary
Attributes inherited from Keisan::Function
Instance Method Summary collapse
-
#initialize ⇒ Reduce
constructor
Reduces (list, initial, accumulator, variable, expression) e.g.
Methods inherited from EnumerableFunction
#evaluate, #simplify, #unbound_variables, #value
Methods inherited from Keisan::Function
#differentiate, #evaluate, #simplify, #unbound_variables, #value
Constructor Details
#initialize ⇒ Reduce
Reduces (list, initial, accumulator, variable, expression) e.g. reduce([1,2,3,4], 0, total, x, total+x) should give 10 When hash: (hash, initial, accumulator, key, value, expression)
10 11 12 |
# File 'lib/keisan/functions/reduce.rb', line 10 def initialize super("reduce") end |