lib/mikon/core/array.rb in mikon-0.1.0 vs lib/mikon/core/array.rb in mikon-0.1.2.rc1
- old
+ new
@@ -38,10 +38,14 @@
raise "Non-acceptable Argument Error"
end
@dtype = @data.dtype
end
+ def dup
+ Mikon::DArray.new(@data.dup)
+ end
+
def each(&block)
@data.each(&block)
end
def reduce(init, &block)
@@ -100,9 +104,13 @@
if [NMatrix, Array].any?{|cls| other.is_a?(cls) && @data.is_a?(cls)}
return other, @data
else
super
end
+ end
+
+ def to_json
+ @data.to_json
end
def to_a
@data.to_a
end