Class: Hornetseye::Composite
- Defined in:
- lib/multiarray/composite.rb
Overview
Base class for composite types
Class Attribute Summary collapse
-
.element_type ⇒ Class
Access element type of composite type.
-
.num_elements ⇒ Integer
Get number of elements of composite type.
Class Method Summary collapse
-
.basetype ⇒ Class
Base type of this data type.
-
.descriptor(hash) ⇒ String
Get unique descriptor of this class.
-
.directive ⇒ String
Directive for packing/unpacking elements of this type.
-
.memory_type ⇒ Class
Memory type required to store elements of this type.
-
.scalar ⇒ Class
Scalar type to this type.
-
.storage_size ⇒ Integer
Get storage size to store an element of this type.
-
.typecodes ⇒ Array<Class>
Get list of types of composite type.
Instance Method Summary collapse
-
#decompose(i) ⇒ Node
Decompose composite number.
Methods inherited from Element
#assign, coercion, #compilable?, construct, #descriptor, #dup, fetch, #get, #initialize, #skip, #strip, #values, #write
Methods inherited from Node
#+@, #<=>, ===, #[], #[]=, #allocate, #b=, #b_with_decompose, #basetype, #between?, bool, byte, #check_shape, #clip, #coerce, coercion_bool, coercion_byte, coercion_maxint, #collect, #compilable?, compilable?, #components, cond, #conditional, #convolve, 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, #shape, shape, #shift, #simplify, #size, #sobel, #stretch, #stride, #strides, #strip, strip, #subst, 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, typecode, #unmask, #unroll, #variables, variables, #warp, #width
Methods included from Field_::Match
Methods included from FLOAT_::Match
Methods included from OBJECT::Match
Methods included from Hornetseye::COMPLEX_::Match
Methods included from BOOL::Match
Methods included from RGB_::Match
Methods included from INT_::Match
Constructor Details
This class inherits a constructor from Hornetseye::Element
Class Attribute Details
.element_type ⇒ Class
Access element type of composite type
28 29 30 |
# File 'lib/multiarray/composite.rb', line 28 def element_type @element_type end |
.num_elements ⇒ Integer
Get number of elements of composite type
33 34 35 |
# File 'lib/multiarray/composite.rb', line 33 def num_elements @num_elements end |
Class Method Details
.basetype ⇒ Class
Base type of this data type
82 83 84 |
# File 'lib/multiarray/composite.rb', line 82 def basetype element_type end |
.descriptor(hash) ⇒ String
Get unique descriptor of this class
69 70 71 72 73 74 75 |
# File 'lib/multiarray/composite.rb', line 69 def descriptor( hash ) unless element_type.nil? inspect else super end end |
.directive ⇒ String
Directive for packing/unpacking elements of this type
58 59 60 |
# File 'lib/multiarray/composite.rb', line 58 def directive element_type.directive * num_elements end |
.memory_type ⇒ Class
Memory type required to store elements of this type
40 41 42 |
# File 'lib/multiarray/composite.rb', line 40 def memory_type element_type.memory_type end |
.scalar ⇒ Class
Scalar type to this type
100 101 102 |
# File 'lib/multiarray/composite.rb', line 100 def scalar element_type end |
.storage_size ⇒ Integer
Get storage size to store an element of this type
49 50 51 |
# File 'lib/multiarray/composite.rb', line 49 def storage_size element_type.storage_size * num_elements end |
.typecodes ⇒ Array<Class>
Get list of types of composite type
91 92 93 |
# File 'lib/multiarray/composite.rb', line 91 def typecodes [ element_type ] * num_elements end |
Instance Method Details
#decompose(i) ⇒ Node
Decompose composite number
This method decomposes the composite number.
113 114 115 |
# File 'lib/multiarray/composite.rb', line 113 def decompose( i ) self.class.element_type.new @value.decompose( i ) end |