Module: RubyFunctions

Class Attribute Summary collapse

Instance Method Summary collapse

Class Attribute Details

.binary_helperObject (readonly)

Returns the value of attribute binary_helper.



29
30
31
# File 'lib/mdarray/ruby_functions.rb', line 29

def binary_helper
  @binary_helper
end

.unary_helperObject (readonly)

Returns the value of attribute unary_helper.



30
31
32
# File 'lib/mdarray/ruby_functions.rb', line 30

def unary_helper
  @unary_helper
end

Instance Method Details

#make_binary_operator(name, type, func) ⇒ Object





55
56
57
# File 'lib/mdarray/ruby_functions.rb', line 55

def make_binary_operator(name, type, func)
  make_binary_op(name, type, func, RubyFunctions.binary_helper)
end

#make_binary_operators(name, func, default = true, in_place = true) ⇒ Object





40
41
42
43
44
45
46
47
48
49
# File 'lib/mdarray/ruby_functions.rb', line 40

def make_binary_operators(name, func, default = true, in_place = true)

  if (default)
    make_binary_op(name, :default, func, RubyFunctions.binary_helper)
  end
  if (in_place)
    make_binary_op(name + "!", :in_place, func, RubyFunctions.binary_helper)
  end

end

#make_comparison_operator(name, func) ⇒ Object





86
87
88
# File 'lib/mdarray/ruby_functions.rb', line 86

def make_comparison_operator(name, func)
  make_binary_op(name, "default", func, RubyFunctions.binary_helper, "boolean")
end

#make_unary_operator(name, type, func) ⇒ Object





78
79
80
# File 'lib/mdarray/ruby_functions.rb', line 78

def make_unary_operator(name, type, func)
  make_unary_op(name, type, func, RubyFunctions.unary_helper)
end

#make_unary_operators(name, func, default = true, in_place = true) ⇒ Object





63
64
65
66
67
68
69
70
71
72
# File 'lib/mdarray/ruby_functions.rb', line 63

def make_unary_operators(name, func, default = true, in_place = true)

  if (default)
    make_unary_op(name, :default, func, RubyFunctions.unary_helper)
  end
  if (in_place)
    make_unary_op(name + "!", :in_place, func, RubyFunctions.unary_helper)
  end

end

#ruby_binary_function(long_name, proc) ⇒ Object





94
95
96
# File 'lib/mdarray/ruby_functions.rb', line 94

def ruby_binary_function(long_name, proc)
  [long_name, "RubyFunctions", proc, "*", "*", "*"]
end

#ruby_unary_function(long_name, proc) ⇒ Object





102
103
104
# File 'lib/mdarray/ruby_functions.rb', line 102

def ruby_unary_function(long_name, proc)
  [long_name, "RubyFunctions", proc, "*", "*", "*"]
end