Class: Hornetseye::INDEX_
- Defined in:
- lib/multiarray/index.rb
Overview
Class for representing native array index types
Class Attribute Summary collapse
-
.size ⇒ Object
Size of range for this index.
Class Method Summary collapse
-
.descriptor(hash) ⇒ String
Get unique descriptor of this class.
-
.inspect ⇒ String
Display information about this class.
- .shape ⇒ Object
-
.strip ⇒ Array<Array,Node>
Strip of all values.
-
.subst(hash) ⇒ Class
Substitute variables.
- .typecode ⇒ Object
-
.variables ⇒ Set
Get variables contained in this class.
Instance Method Summary collapse
-
#initialize ⇒ INDEX_
constructor
This value must not be instantiated.
Methods inherited from Element
#assign, coercion, #compilable?, construct, #descriptor, #dup, fetch, #get, #skip, #strip, #values, #write
Methods inherited from Node
#+@, #<=>, ===, #[], #[]=, #allocate, #b=, #b_with_decompose, #basetype, basetype, #between?, bool, byte, #check_shape, #clip, #coerce, coercion_bool, coercion_byte, coercion_maxint, #collect, #compilable?, compilable?, #components, cond, #conditional, #convolve, #decompose, define_binary_op, define_unary_op, #demand, #descriptor, #diagonal, #dilate, #dimension, dimension, #downsample, #dup, #each, #empty?, #eq_with_multiarray, #erode, #fill!, finalised?, #finalised?, #flip, float, float_scalar, floating, #fmod_with_float, #force, #g=, #g_with_decompose, #gauss_blur, #gauss_gradient, #get, #height, #histogram, #histogram_with_rgb, identity, #if, #if_else, #imag=, #imag_with_decompose, indgen, #inject, #inspect, #integral, #lut, #lut_with_rgb, #malloc, #mask, match, #matched?, #max, maxint, #mean, #memorise, #memory, #min, #normalise, #prod, #r=, #r_with_decompose, #range, #real=, #real_with_decompose, #reshape, #rgb?, rgb?, #roll, scalar, #shape, #shift, #simplify, #size, #sobel, #stretch, #stride, #strides, #strip, #subst, #sum, #swap_rgb_with_scalar, #table, #to_a, #to_s, to_s, #to_type, to_type, #to_type_with_identity, #to_type_with_rgb, #transpose, #typecode, typecodes, #unmask, #unroll, #variables, #warp, #width
Methods included from Field_::Match
Methods included from FLOAT_::Match
Methods included from OBJECT::Match
Methods included from COMPLEX_::Match
Methods included from BOOL::Match
Methods included from RGB_::Match
Methods included from Hornetseye::INT_::Match
Constructor Details
#initialize ⇒ INDEX_
This value must not be instantiated
The method throws an exception.
104 105 106 |
# File 'lib/multiarray/index.rb', line 104 def initialize raise "#{self.class.inspect} must not be instantiated" end |
Class Attribute Details
.size ⇒ Object
Size of range for this index
28 29 30 |
# File 'lib/multiarray/index.rb', line 28 def size @size end |
Class Method Details
.descriptor(hash) ⇒ String
Get unique descriptor of this class
45 46 47 |
# File 'lib/multiarray/index.rb', line 45 def descriptor( hash ) "INDEX(#{size.descriptor( hash )})" end |
.inspect ⇒ String
Display information about this class
34 35 36 |
# File 'lib/multiarray/index.rb', line 34 def inspect "INDEX(#{size.inspect})" end |
.shape ⇒ Object
53 54 55 |
# File 'lib/multiarray/index.rb', line 53 def shape [] end |
.strip ⇒ Array<Array,Node>
Strip of all values
Split up into variables, values, and a term where all values have been replaced with variables.
values, and the term based on variables.
66 67 68 69 70 71 72 73 |
# File 'lib/multiarray/index.rb', line 66 def strip , = size.strip if .empty? return [], [], self else return , , Hornetseye::INDEX( .first ) end end |
.subst(hash) ⇒ Class
Substitute variables
Substitute the variables with the values given in the hash.
84 85 86 |
# File 'lib/multiarray/index.rb', line 84 def subst( hash ) Hornetseye::INDEX size.subst( hash ) end |
.variables ⇒ Set
Get variables contained in this class
93 94 95 |
# File 'lib/multiarray/index.rb', line 93 def variables size.variables end |