Class: Hornetseye::Lookup
- Defined in:
- docs/multiarray/lib/multiarray/lookup.rb
Overview
Class for lazy array lookup
Instance Method Summary collapse
-
#decompose(i) ⇒ Node
Decompose composite elements.
-
#initialize(p, index, stride) ⇒ Lookup
constructor
Create array lookup.
-
#memory ⇒ Malloc, ...
Get storage object if there is any.
-
#shape ⇒ Array<Integer>
Get shape of this term.
-
#typecode ⇒ Class
Element-type of this term.
Methods inherited from Node
#<=>, ===, #[], #[]=, #allocate, #b=, #b_with_decompose, #basetype, #between?, bool, #check_shape, #clip, coercion_bool, coercion_byte, coercion_maxint, #collect, #components, cond, #conditional, #convolve, #dilate, dimension, #dimension, #downsample, #dup, #each, #empty?, #eq_with_multiarray, #erode, #fill!, #flip, float_scalar, floating, #fmod_with_float, #g=, #g_with_decompose, #gauss_blur, #gauss_gradient, #height, #histogram, #histogram_with_rgb, #if, #if_else, #imag=, #imag_with_decompose, indgen, #inject, #inspect, #integral, #lut, #lut_with_rgb, #mask, #matched?, #max, #mean, #memorise, #min, #normalise, #orig_to_cvmat, #orig_to_type_with_frame, #prod, #r=, #r_with_decompose, #range, #real=, #real_with_decompose, #reshape, rgb?, #rgb?, #roll, #save_dfloat, #save_dfloatrgb, #save_magick, #save_openexr, #save_sfloat, #save_sfloatrgb, #save_ubyte, #save_ubytergb, #save_uint, #save_uintrgb, #save_usint, #save_usintrgb, scalar, shape, #shift, #show, #size, #sobel, #stretch, #sum, #swap_rgb_with_scalar, #to_a, #to_cvmat, #to_magick, #to_narray, to_type, #to_type, #to_type_with_frame, #to_type_with_identity, #to_type_with_rgb, #transpose, typecode, #unmask, #unroll, #warp, #width
Constructor Details
#initialize(p, index, stride) ⇒ Lookup
Create array lookup
28 29 30 |
# File 'docs/multiarray/lib/multiarray/lookup.rb', line 28 def initialize( p, index, stride ) @p, @index, @stride = p, index, stride end |
Instance Method Details
#decompose(i) ⇒ Node
Decompose composite elements
This method decomposes composite elements into array.
179 180 181 182 183 184 185 |
# File 'docs/multiarray/lib/multiarray/lookup.rb', line 179 def decompose( i ) if typecode < Composite Lookup.new @p.decompose( i ), @index, @stride * typecode.num_elements else Lookup.new @p.decompose( i ), @index, @stride end end |
#memory ⇒ Malloc, ...
Get storage object if there is any
35 36 37 |
# File 'docs/multiarray/lib/multiarray/lookup.rb', line 35 def memory @p.memory end |
#shape ⇒ Array<Integer>
Get shape of this term
42 43 44 |
# File 'docs/multiarray/lib/multiarray/lookup.rb', line 42 def shape @p.shape end |
#typecode ⇒ Class
Element-type of this term
79 80 81 |
# File 'docs/multiarray/lib/multiarray/lookup.rb', line 79 def typecode @p.typecode end |