class Charty::VectorAdapters::NMatrixAdapter

Public Class Methods

new(data) click to toggle source
# File lib/charty/vector_adapters/nmatrix_adapter.rb, line 13
def initialize(data)
  @data = check_data(data)
  self.index = index || RangeIndex.new(0 ... length)
end
supported?(data) click to toggle source
# File lib/charty/vector_adapters/nmatrix_adapter.rb, line 9
def self.supported?(data)
  defined?(NMatrix) && data.is_a?(NMatrix)
end

Public Instance Methods

compare_data_equality(other) click to toggle source
# File lib/charty/vector_adapters/nmatrix_adapter.rb, line 18
def compare_data_equality(other)
  case other
  when NMatrixAdapter
    data == other.data
  else
    data.to_a == other.data.to_a
  end
end