Class: SFRP::Flat::Function
- Inherits:
-
Struct
- Object
- Struct
- SFRP::Flat::Function
- Defined in:
- lib/sfrp/flat/elements.rb
Instance Attribute Summary collapse
-
#exp ⇒ Object
Returns the value of attribute exp.
-
#ffi_str ⇒ Object
Returns the value of attribute ffi_str.
-
#pstrs ⇒ Object
Returns the value of attribute pstrs.
-
#ptas ⇒ Object
Returns the value of attribute ptas.
-
#ret_ta ⇒ Object
Returns the value of attribute ret_ta.
-
#sp ⇒ Object
Returns the value of attribute sp.
-
#str ⇒ Object
Returns the value of attribute str.
Instance Method Summary collapse
Instance Attribute Details
#exp ⇒ Object
Returns the value of attribute exp
3 4 5 |
# File 'lib/sfrp/flat/elements.rb', line 3 def exp @exp end |
#ffi_str ⇒ Object
Returns the value of attribute ffi_str
3 4 5 |
# File 'lib/sfrp/flat/elements.rb', line 3 def ffi_str @ffi_str end |
#pstrs ⇒ Object
Returns the value of attribute pstrs
3 4 5 |
# File 'lib/sfrp/flat/elements.rb', line 3 def pstrs @pstrs end |
#ptas ⇒ Object
Returns the value of attribute ptas
3 4 5 |
# File 'lib/sfrp/flat/elements.rb', line 3 def ptas @ptas end |
#ret_ta ⇒ Object
Returns the value of attribute ret_ta
3 4 5 |
# File 'lib/sfrp/flat/elements.rb', line 3 def ret_ta @ret_ta end |
#sp ⇒ Object
Returns the value of attribute sp
3 4 5 |
# File 'lib/sfrp/flat/elements.rb', line 3 def sp @sp end |
#str ⇒ Object
Returns the value of attribute str
3 4 5 |
# File 'lib/sfrp/flat/elements.rb', line 3 def str @str end |
Instance Method Details
#to_poly(_src_set, dest_set) ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/sfrp/flat/elements.rb', line 4 def to_poly(_src_set, dest_set) pstrs.reject(&:nil?).each do |s| raise DuplicatedVariableError.new(s) if pstrs.count(s) > 1 end dest_set << P.func(str, ret_ta && ret_ta.to_poly) do |f| pstrs.zip(ptas) do |s, ta| f.param(s, ta && ta.to_poly) end if exp f.exp do table = Hash[pstrs.map { |s| [s, s] }] exp.alpha_convert(table, (0..1000).to_a).to_poly end end f.ffi_str(ffi_str) if ffi_str end end |