Class: PageRank::SparseNative
- Defined in:
- lib/page_rank/sparse_native.rb
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
- #add(source, dest, weight: 1.0) ⇒ nil
-
#calculate(max_iterations: -1,, **_) ⇒ Hash<Object, Float>
Perform the PageRank calculation.
Methods inherited from Base
Constructor Details
This class inherits a constructor from PageRank::Base
Instance Method Details
#add(source, dest, weight: 1.0) ⇒ nil
9 10 11 |
# File 'lib/page_rank/sparse_native.rb', line 9 def add(source, dest, weight: 1.0) _add_edge(source, dest, weight) unless source == dest end |
#calculate(max_iterations: -1,, **_) ⇒ Hash<Object, Float>
Perform the PageRank calculation
16 17 18 |
# File 'lib/page_rank/sparse_native.rb', line 16 def calculate(max_iterations: -1, **_) _calculate(max_iterations, damping, tolerance) end |