class Jubatus::Clustering::WeightedDatum

Constants

TYPE

Attributes

point[R]
weight[R]

Public Class Methods

from_msgpack(m) click to toggle source
# File lib/jubatus/clustering/types.rb, line 25
def WeightedDatum.from_msgpack(m)
  val = TYPE.from_msgpack(m)
  WeightedDatum.new(*val)
end
new(weight, point) click to toggle source
# File lib/jubatus/clustering/types.rb, line 15
def initialize(weight, point)
  @weight = weight
  @point = point
end

Public Instance Methods

to_msgpack(out = '') click to toggle source
# File lib/jubatus/clustering/types.rb, line 20
def to_msgpack(out = '')
  t = [@weight, @point]
  return TYPE.to_msgpack(t)
end
to_s() click to toggle source
# File lib/jubatus/clustering/types.rb, line 30
def to_s
  gen = Jubatus::Common::MessageStringGenerator.new
  gen.open("weighted_datum")
  gen.add("weight", @weight)
  gen.add("point", @point)
  gen.close()
  return gen.to_s
end