Class: Array

Inherits:
Object
  • Object
show all
Includes:
DistanceMeasures
Defined in:
lib/distance_measures.rb

Constant Summary

Constants included from DistanceMeasures

DistanceMeasures::R, DistanceMeasures::RAD_PER_DEG, DistanceMeasures::R_KM, DistanceMeasures::R_MILES

Instance Method Summary collapse

Methods included from DistanceMeasures

#binary_jaccard_distance, #binary_jaccard_index, #cosine_similarity, #haversine_distance, #jaccard_distance, #jaccard_index, #tanimoto_coefficient

Instance Method Details

#intersection_with(other) ⇒ Object



14
15
16
# File 'lib/distance_measures.rb', line 14

def intersection_with(other)
  (self & other)
end

#union_with(other) ⇒ Object



19
20
21
# File 'lib/distance_measures.rb', line 19

def union_with(other)
  (self + other).uniq
end