Method: MDArray#initialize

Defined in:
lib/mdarray.rb

#initialize(type, storage, section = false) ⇒ MDArray


Initializes an MDArray


Parameters:

  • type (String)

    the type of the mdarray: boolean, byte, int, short, long, float, double

  • storage (Array)

    a ruby array with the initialization data to the MDArray

  • section (defaults to: false)

    True if this is an mdarray section



116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
# File 'lib/mdarray.rb', line 116

def initialize(type, storage, section = false)
  
  @id = (0..8).map{MDArray.characters.sample}.join
  @type = type
  @nc_array = storage
  @local_index = Counter.new(self)
  @local_iterator = nil
  @section = section
  @coerced = false            # should never be set by the user! For internal use only!
  @binary_operator = nil
  @unary_operator = nil

  # initialize printing defaults
  printing_defaults

end