Property definitions

graph $ PRMap :: defaultinit
# Map each Vertice of a Digraph to it's PageRank.
#
# See: `Digraph::pagerank`.
class PRMap[V]
	super HashMap[V, Float]

	# Init `self` by copying `other` values.
	init from(other: PRMap[V]) do
		init
		for k, v in other do self[k] = v
	end

	# Is `self` approximately equal to another PRMap?
	#
	# `self` is approximately equal to `o` if `o` contains all the key from `self`
	# with the same values.
	#
	# Values equality is based on `Float::is_approx` with `precision`.
	fun is_approx(o: SELF, precision: Float): Bool do
		for k1, v1 in self do
			if not o.has_key(k1) then return false
			if not v1.is_approx(o[k1], precision) then return false
		end
		return true
	end
end
lib/graph/pagerank.nit:63,1--88,3