Class: BOAST::Dimension
Instance Attribute Summary collapse
-
#size ⇒ Object
readonly
Returns the value of attribute size.
-
#val1 ⇒ Object
readonly
Returns the value of attribute val1.
-
#val2 ⇒ Object
readonly
Returns the value of attribute val2.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(v1 = nil, v2 = nil) ⇒ Dimension
constructor
A new instance of Dimension.
- #to_s ⇒ Object
- #to_str ⇒ Object
Constructor Details
#initialize(v1 = nil, v2 = nil) ⇒ Dimension
Returns a new instance of Dimension.
973 974 975 976 977 978 979 980 981 982 983 984 985 |
# File 'lib/BOAST/Algorithm.rb', line 973 def initialize(v1=nil,v2=nil) @size = nil @val1 = nil @val2 = nil if v2.nil? and v1 then @val1 = BOAST::get_array_start @val2 = v1 + BOAST::get_array_start - 1 @size = v1 else @val1 = v1 @val2 = v2 end end |
Instance Attribute Details
#size ⇒ Object (readonly)
Returns the value of attribute size.
972 973 974 |
# File 'lib/BOAST/Algorithm.rb', line 972 def size @size end |
#val1 ⇒ Object (readonly)
Returns the value of attribute val1.
970 971 972 |
# File 'lib/BOAST/Algorithm.rb', line 970 def val1 @val1 end |
#val2 ⇒ Object (readonly)
Returns the value of attribute val2.
971 972 973 |
# File 'lib/BOAST/Algorithm.rb', line 971 def val2 @val2 end |
Class Method Details
.parens(*args, &block) ⇒ Object
966 967 968 |
# File 'lib/BOAST/Algorithm.rb', line 966 def self.parens(*args,&block) return self::new(*args,&block) end |
Instance Method Details
#to_s ⇒ Object
1003 1004 1005 |
# File 'lib/BOAST/Algorithm.rb', line 1003 def to_s self.to_str end |
#to_str ⇒ Object
986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 |
# File 'lib/BOAST/Algorithm.rb', line 986 def to_str s = "" if @val2 then if BOAST::get_lang == FORTRAN then s += @val1.to_s s += ":" s += @val2.to_s elsif [C, CL, CUDA].include?( BOAST::get_lang ) then s += (@val2 - @val1 + 1).to_s end elsif @val1.nil? then return nil else s += @val1.to_s end return s end |