Module: RubyFunctions
- Included in:
- BitwiseOperators, BooleanFunctions, ComparisonOperators, GenericFunctions, NumericFunctions, RubyMath, RubyStats, UserFunction
- Defined in:
- lib/mdarray/ruby_functions.rb
Class Attribute Summary collapse
-
.binary_helper ⇒ Object
readonly
Returns the value of attribute binary_helper.
-
.unary_helper ⇒ Object
readonly
Returns the value of attribute unary_helper.
Instance Method Summary collapse
-
#make_binary_operator(name, type, func) ⇒ Object
————————————————————————————.
-
#make_binary_operators(name, func, default = true, in_place = true) ⇒ Object
————————————————————————————.
-
#make_comparison_operator(name, func) ⇒ Object
————————————————————————————.
-
#make_unary_operator(name, type, func) ⇒ Object
————————————————————————————.
-
#make_unary_operators(name, func, default = true, in_place = true) ⇒ Object
————————————————————————————.
-
#ruby_binary_function(long_name, proc) ⇒ Object
————————————————————————————.
-
#ruby_unary_function(long_name, proc) ⇒ Object
————————————————————————————.
Class Attribute Details
.binary_helper ⇒ Object (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_helper ⇒ Object (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 |