Class: LazyMDArray::UnaryComp

Inherits:
Object
  • Object
show all
Defined in:
lib/mdarray/lazy_mdarray.rb

Overview

Class UnaryComp applies a function f to one arguments. The arguments can be a function on its own right

Instance Method Summary collapse

Constructor Details

#initialize(f, x, *args) ⇒ UnaryComp

Returns a new instance of UnaryComp.



61
62
63
64
65
# File 'lib/mdarray/lazy_mdarray.rb', line 61

def initialize(f, x, *args)
  @x = x
  @f = f
  @other_args = args
end

Instance Method Details

#applyObject



67
68
69
# File 'lib/mdarray/lazy_mdarray.rb', line 67

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