Class: Clusta::Geometry::Neighborhood
- Inherits:
-
Vertex
show all
- Defined in:
- lib/clusta/geometry/neighborhood.rb
Instance Attribute Summary
Attributes included from Schema
#extra_inputs
Instance Method Summary
collapse
Methods inherited from Element
inherited
#extra_inputs=, #extra_outputs, included, #process_args, #suffix, #to_flat, #to_tsv_component
included, #non_key_field_data, #process_args, #to_flat, #to_hash
included, #initialize, #process_args, #stream_name
Methods included from Schema
#extra_outputs, #fields, included, #keys, #non_key_fields
Instance Method Details
#degree_pairs ⇒ Object
20
21
22
23
24
25
26
27
28
29
30
|
# File 'lib/clusta/geometry/neighborhood.rb', line 20
def degree_pairs
neighbors.map do |neighbor|
DegreePair.new(label, neighbor.label, size, 1)
end
end
|
#directed? ⇒ Boolean
12
13
14
|
# File 'lib/clusta/geometry/neighborhood.rb', line 12
def directed?
false
end
|
#joins?(label) ⇒ Boolean
8
9
10
|
# File 'lib/clusta/geometry/neighborhood.rb', line 8
def joins? label
neighbors.detect { |neighbor| neighbor.label == label }
end
|
#reversed_degree_pairs ⇒ Object
32
33
34
35
36
|
# File 'lib/clusta/geometry/neighborhood.rb', line 32
def reversed_degree_pairs
neighbors.map do |neighbor|
DegreePair.new(neighbor.label, label, 1, size)
end
end
|
#size ⇒ Object
16
17
18
|
# File 'lib/clusta/geometry/neighborhood.rb', line 16
def size
neighbors.size
end
|