Class: Chemicalml::Model::Matrix

Inherits:
Node
  • Object
show all
Defined in:
lib/chemicalml/model/matrix.rb

Overview

A two-dimensional rectangular matrix of values.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Node

#==, #accept, #children, #hash, short_name

Constructor Details

#initialize(values:, rows:, columns:, data_type: nil, units: nil, id: nil, title: nil, dict_ref: nil) ⇒ Matrix

Returns a new instance of Matrix.



10
11
12
13
14
15
16
17
18
19
20
# File 'lib/chemicalml/model/matrix.rb', line 10

def initialize(values:, rows:, columns:, data_type: nil, units: nil,
               id: nil, title: nil, dict_ref: nil)
  @values = values
  @rows = rows
  @columns = columns
  @data_type = data_type
  @units = units
  @id = id
  @title = title
  @dict_ref = dict_ref
end

Instance Attribute Details

#columnsObject

Returns the value of attribute columns.



7
8
9
# File 'lib/chemicalml/model/matrix.rb', line 7

def columns
  @columns
end

#data_typeObject

Returns the value of attribute data_type.



7
8
9
# File 'lib/chemicalml/model/matrix.rb', line 7

def data_type
  @data_type
end

#dict_refObject

Returns the value of attribute dict_ref.



7
8
9
# File 'lib/chemicalml/model/matrix.rb', line 7

def dict_ref
  @dict_ref
end

#idObject

Returns the value of attribute id.



7
8
9
# File 'lib/chemicalml/model/matrix.rb', line 7

def id
  @id
end

#rowsObject

Returns the value of attribute rows.



7
8
9
# File 'lib/chemicalml/model/matrix.rb', line 7

def rows
  @rows
end

#titleObject

Returns the value of attribute title.



7
8
9
# File 'lib/chemicalml/model/matrix.rb', line 7

def title
  @title
end

#unitsObject

Returns the value of attribute units.



7
8
9
# File 'lib/chemicalml/model/matrix.rb', line 7

def units
  @units
end

#valuesObject

Returns the value of attribute values.



7
8
9
# File 'lib/chemicalml/model/matrix.rb', line 7

def values
  @values
end

Instance Method Details

#value_attributesObject



22
23
24
25
26
# File 'lib/chemicalml/model/matrix.rb', line 22

def value_attributes
  { values: values, rows: rows, columns: columns,
    data_type: data_type, units: units,
    id: id, title: title, dict_ref: dict_ref }
end