naive_bayes/resources/ruby/bit_vector.rb
# Deserializes vector by decoding the symbol according to its mask
#
# @param io [IO] Stream containing the vector to be deserialized
# @return [Array<Symbol>] Flags contained in the vector
Deserializes vector by decoding the symbol according to its mask
Deserializes vector by decoding the symbol according to its mask
def deserialize(io)
          vector = io.read(4).unpack(INT32_PACK).first
          flags = []
          @masks.each do |flag, mask|
            flags << flag if mask & vector != 0
          end
          flags
        end
def deserialize ( io ) vector = io . read ( 4 ) . unpack ( INT32_PACK ) . first flags = [ ] @masks . each do | flag , mask | flags << flag if mask & vector != 0 end flags end
Deserializes vector by decoding the symbol according to its mask
Deserializes vector by decoding the symbol according to its mask
Flags contained in the vector
Flags contained in the vector
Array<Symbol>
io
Stream containing the vector to be deserialized
Stream containing the vector to be deserialized