lib/libsvm/node.rb in rb-libsvm-1.3.1 vs lib/libsvm/node.rb in rb-libsvm-1.4.0
- old
+ new
@@ -88,16 +88,18 @@
def initialize(index=0, value=0.0)
self.index = index
self.value = value
end
- # Compare features for equality.
+ # Compare feature node for equality.
#
# Nodes with equal index and value are equal.
#
# @return [Boolean]
- def ==(other)
- index == other.index && value == other.value
+ def == (other)
+ other.class == self.class &&
+ index == other.index &&
+ value == other.value
end
def inspect
vars = %w(index value).map { |name|
"#{name}=#{send(name)}"