Class: Clusta::Geometry::DirectedNeighborhood
- Inherits:
-
Neighborhood
- Object
- Element
- Vertex
- Neighborhood
- Clusta::Geometry::DirectedNeighborhood
- Defined in:
- lib/clusta/geometry/directed/neighborhood.rb
Instance Attribute Summary
Attributes included from Schema
Instance Method Summary collapse
Methods inherited from Neighborhood
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
#degree_pairs ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/clusta/geometry/directed/neighborhood.rb', line 10 def degree_pairs neighbors.map do |neighbor| # This vertex's in-degree is not known to us; we just have # its out-degree based on the size of this neighborhood. # # We don't know anything about each neighbor's degree than # its in-degree is at least 1 b/c it's in this vertex's # neighborhood. DirectedDegreePair.new(label, neighbor.label, 0, size, 1, 0) end end |
#directed? ⇒ Boolean
6 7 8 |
# File 'lib/clusta/geometry/directed/neighborhood.rb', line 6 def directed? true end |
#reversed_degree_pairs ⇒ Object
22 23 24 25 26 |
# File 'lib/clusta/geometry/directed/neighborhood.rb', line 22 def reversed_degree_pairs neighbors.map do |neighbor| DirectedDegreePair.new(neighbor.label, label, 1, 0, 0, size) end end |