Class: LazyMDArray::BinaryComp
- Inherits:
-
Object
- Object
- LazyMDArray::BinaryComp
- Defined in:
- lib/mdarray/lazy_mdarray.rb
Overview
Class BinaryComp applies a function f to two arguments. The arguments can be functions on their own right
Instance Method Summary collapse
- #apply ⇒ Object
-
#initialize(f, x, y, *args) ⇒ BinaryComp
constructor
A new instance of BinaryComp.
Constructor Details
#initialize(f, x, y, *args) ⇒ BinaryComp
Returns a new instance of BinaryComp.
41 42 43 44 45 46 |
# File 'lib/mdarray/lazy_mdarray.rb', line 41 def initialize(f, x, y, *args) @x = x @y = y @f = f @other_args = args end |
Instance Method Details
#apply ⇒ Object
48 49 50 |
# File 'lib/mdarray/lazy_mdarray.rb', line 48 def apply @f.apply(@x.apply, @y.apply) end |