Module: CernFunctions
- Included in:
- CernDoubleFunctions, CernFloatFunctions, CernIntFunctions, CernLongFunctions
- Defined in:
- lib/colt/colt.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
-
#cern_binary_function(short_name, long_name, module_name, type) ⇒ Object
————————————————————————————.
-
#cern_comparison_function(short_name, long_name, module_name, type) ⇒ Object
————————————————————————————.
-
#cern_unary_function(short_name, long_name, module_name, type) ⇒ Object
————————————————————————————.
-
#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
————————————————————————————.
Class Attribute Details
.binary_helper ⇒ Object (readonly)
Returns the value of attribute binary_helper.
59 60 61 |
# File 'lib/colt/colt.rb', line 59 def binary_helper @binary_helper end |
.unary_helper ⇒ Object (readonly)
Returns the value of attribute unary_helper.
60 61 62 |
# File 'lib/colt/colt.rb', line 60 def unary_helper @unary_helper end |
Instance Method Details
#cern_binary_function(short_name, long_name, module_name, type) ⇒ Object
124 125 126 |
# File 'lib/colt/colt.rb', line 124 def cern_binary_function(short_name, long_name, module_name, type) [long_name, "CernFunctions", module_name.send(short_name), type, type, type] end |
#cern_comparison_function(short_name, long_name, module_name, type) ⇒ Object
140 141 142 |
# File 'lib/colt/colt.rb', line 140 def cern_comparison_function(short_name, long_name, module_name, type) [long_name, "CernFunctions", module_name.send(short_name), "boolean", type, type] end |
#cern_unary_function(short_name, long_name, module_name, type) ⇒ Object
132 133 134 |
# File 'lib/colt/colt.rb', line 132 def cern_unary_function(short_name, long_name, module_name, type) [long_name, "CernFunctions", module_name.send(short_name), type, type, "void"] end |
#make_binary_operator(name, type, func) ⇒ Object
85 86 87 |
# File 'lib/colt/colt.rb', line 85 def make_binary_operator(name, type, func) make_binary_op(name, type, func, CernFunctions.binary_helper) end |
#make_binary_operators(name, func, default = true, in_place = true) ⇒ Object
70 71 72 73 74 75 76 77 78 79 |
# File 'lib/colt/colt.rb', line 70 def make_binary_operators(name, func, default = true, in_place = true) if (default) make_binary_op(name, :default, func, CernFunctions.binary_helper) end if (in_place) make_binary_op(name + "!", :in_place, func, CernFunctions.binary_helper) end end |
#make_comparison_operator(name, func) ⇒ Object
116 117 118 |
# File 'lib/colt/colt.rb', line 116 def make_comparison_operator(name, func) make_binary_op(name, "default", func, CernFunctions.binary_helper, "boolean") end |
#make_unary_operator(name, type, func) ⇒ Object
108 109 110 |
# File 'lib/colt/colt.rb', line 108 def make_unary_operator(name, type, func) make_unary_op(name, type, func, CernFunctions.unary_helper) end |
#make_unary_operators(name, func, default = true, in_place = true) ⇒ Object
93 94 95 96 97 98 99 100 101 102 |
# File 'lib/colt/colt.rb', line 93 def make_unary_operators(name, func, default = true, in_place = true) if (default) make_unary_op(name, :default, func, CernFunctions.unary_helper) end if (in_place) make_unary_op(name + "!", :in_place, func, CernFunctions.unary_helper) end end |