Class: Clusta::Geometry::Assortativity
- Defined in:
- lib/clusta/geometry/assortativity.rb
Instance Attribute Summary
Attributes included from Schema
Instance Method Summary collapse
Methods inherited from Element
Methods included from Serialization::TSV
#extra_inputs=, #extra_outputs, included, #process_args, #suffix, #to_flat, #to_tsv_component
Methods included from Serialization::JSON
included, #non_key_field_data, #process_args, #to_flat, #to_hash
Methods included from Serialization
included, #initialize, #process_args, #stream_name
Methods included from Schema
#extra_outputs, #fields, included, #keys, #non_key_fields
Instance Method Details
#+(other) ⇒ Object
23 24 25 26 |
# File 'lib/clusta/geometry/assortativity.rb', line 23 def +(other) raise DirectednessMismatchError.new if other.directed? self.class.new(*(key + [count + other.count])) end |
#directed? ⇒ Boolean
11 12 13 |
# File 'lib/clusta/geometry/assortativity.rb', line 11 def directed? false end |
#key ⇒ Object
15 16 17 |
# File 'lib/clusta/geometry/assortativity.rb', line 15 def key [source_degree_value, target_degree_value] end |
#zero ⇒ Object
19 20 21 |
# File 'lib/clusta/geometry/assortativity.rb', line 19 def zero self.class.new(*(key + [0])) end |