Module: StoreFrom

Defined in:
ext/numo/narray/gen/narray_def.rb

Overview


Instance Method Summary collapse

Instance Method Details

#definitionsObject



206
207
208
209
210
211
212
213
214
215
216
217
218
# File 'ext/numo/narray/gen/narray_def.rb', line 206

def definitions
  a = []
  @children.each do |x|
    if x.condition("")
      if x.get(:type_name) == parent.class_name
        a.unshift(x)
      else
        a.push(x)
      end
    end
  end
  a
end

#store_arrayObject



202
203
204
# File 'ext/numo/narray/gen/narray_def.rb', line 202

def store_array
  StoreArray.new(self, "store_array", name:"array")
end

#store_from(cname, dtype = nil, macro = nil) ⇒ Object



188
189
190
191
192
193
194
195
196
# File 'ext/numo/narray/gen/narray_def.rb', line 188

def store_from(cname, dtype=nil, macro=nil)
  tmpl = (cname=="Bit") ? "store_bit" : "store_from"
  h = { name:cname.downcase,
        type_name:cname,
        type_var:"numo_c"+cname,
        dtype:dtype,
        macro:macro }
  Store.new(self, tmpl, **h)
end

#store_numericObject



198
199
200
# File 'ext/numo/narray/gen/narray_def.rb', line 198

def store_numeric
  StoreNum.new(self, "store_numeric", name:"numeric")
end