Class: Hornetseye::OBJECT

Inherits:
Element show all
Defined in:
lib/multiarray/object.rb

Overview

Class for representing Ruby objects

Defined Under Namespace

Modules: Match

Class Method Summary collapse

Methods inherited from Element

#assign, #compilable?, construct, #descriptor, #dup, fetch, #get, #initialize, #skip, #strip, #values, #write

Methods inherited from Node

#+@, #<=>, ===, #[], #[]=, #allocate, #b=, #b_with_decompose, basetype, #basetype, #between?, byte, #check_shape, #clip, #coerce, coercion_bool, coercion_byte, coercion_maxint, #collect, #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_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, 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, typecodes, #unmask, #unroll, #variables, variables, #warp, #width

Methods included from Field_::Match

#align, #fit

Methods included from FLOAT_::Match

#align, #fit

Methods included from Match

#align, #fit

Methods included from COMPLEX_::Match

#align, #fit

Methods included from BOOL::Match

#fit

Methods included from RGB_::Match

#align, #fit

Methods included from INT_::Match

#fit

Constructor Details

This class inherits a constructor from Hornetseye::Element

Class Method Details

.boolClass

Get corresponding boolean-based datatype

Returns:

  • (Class)

    Returns self.



95
96
97
# File 'lib/multiarray/object.rb', line 95

def bool
  self
end

.coerce(other) ⇒ Array<Node>

Type coercion for native elements

Parameters:

Returns:



88
89
90
# File 'lib/multiarray/object.rb', line 88

def coerce( other )
  return self, self
end

.coercion(other) ⇒ Class

Compute balanced type for binary operation

Parameters:

  • other (Class)

    Other type to coerce with.

Returns:

  • (Class)

    Result of coercion.



79
80
81
# File 'lib/multiarray/object.rb', line 79

def coercion( other )
  self
end

.compilable?Boolean

Check whether this term is compilable

Returns:

  • (Boolean)

    Returns false.



113
114
115
# File 'lib/multiarray/object.rb', line 113

def compilable?
  false
end

.defaultObject

Get default value for elements of this type

Returns:



68
69
70
# File 'lib/multiarray/object.rb', line 68

def default
  nil
end

.descriptor(hash) ⇒ String

Get unique descriptor of this class

Parameters:

  • hash (Hash)

    Labels for any variables.

Returns:

  • (String)

    Descriptor of this class.



39
40
41
# File 'lib/multiarray/object.rb', line 39

def descriptor( hash )
  inspect
end

.floatClass

Convert to type based on floating point numbers

Returns:

  • (Class)

    Corresponding type based on floating point numbers.



104
105
106
# File 'lib/multiarray/object.rb', line 104

def float
  OBJECT
end

.inspectString

Get string with information about this class

Returns:

  • (String)

    Returns ‘OBJECT’.



28
29
30
# File 'lib/multiarray/object.rb', line 28

def inspect
  'OBJECT'
end

.memory_typeClass

Get memory type required to store elements of this type

Returns:

  • (Class)

    Returns List.

See Also:



50
51
52
# File 'lib/multiarray/object.rb', line 50

def memory_type
  List
end

.storage_sizeInteger

Get storage size to store an element of this type

Returns:

  • (Integer)

    Returns 1.



59
60
61
# File 'lib/multiarray/object.rb', line 59

def storage_size
  1
end