Class: LazyMDArray::BinaryComp

Inherits:
Object
  • Object
show all
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

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

#applyObject



48
49
50
# File 'lib/mdarray/lazy_mdarray.rb', line 48

def apply
  @f.apply(@x.apply, @y.apply)
end