Class: Clusta::Geometry::Assortativity

Inherits:
Element
  • Object
show all
Defined in:
lib/clusta/geometry/assortativity.rb

Instance Attribute Summary

Attributes included from Schema

#extra_inputs

Instance Method Summary collapse

Methods inherited from Element

inherited

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

Returns:

  • (Boolean)


11
12
13
# File 'lib/clusta/geometry/assortativity.rb', line 11

def directed?
  false
end

#keyObject



15
16
17
# File 'lib/clusta/geometry/assortativity.rb', line 15

def key
  [source_degree_value, target_degree_value]
end

#zeroObject



19
20
21
# File 'lib/clusta/geometry/assortativity.rb', line 19

def zero
  self.class.new(*(key + [0]))
end