List of usage examples for org.apache.mahout.math Varint writeSignedVarLong
public static void writeSignedVarLong(long value, DataOutput out) throws IOException
From source file:org.gpfvic.mahout.cf.taste.hadoop.EntityEntityWritable.java
License:Apache License
@Override public void write(DataOutput out) throws IOException { Varint.writeSignedVarLong(aID, out); Varint.writeSignedVarLong(bID, out); }
From source file:org.gpfvic.mahout.cf.taste.hadoop.item.VectorAndPrefsWritable.java
License:Apache License
@Override public void write(DataOutput out) throws IOException { VectorWritable vw = new VectorWritable(vector); vw.setWritesLaxPrecision(true);// w w w .ja v a 2s . c o m vw.write(out); Varint.writeUnsignedVarInt(userIDs.size(), out); for (int i = 0; i < userIDs.size(); i++) { Varint.writeSignedVarLong(userIDs.get(i), out); out.writeFloat(values.get(i)); } }
From source file:org.gpfvic.mahout.cf.taste.hadoop.item.VectorOrPrefWritable.java
License:Apache License
@Override public void write(DataOutput out) throws IOException { if (vector == null) { out.writeBoolean(false);/*from w ww.j av a 2 s . co m*/ Varint.writeSignedVarLong(userID, out); out.writeFloat(value); } else { out.writeBoolean(true); VectorWritable vw = new VectorWritable(vector); vw.setWritesLaxPrecision(true); vw.write(out); } }
From source file:org.gpfvic.mahout.cf.taste.hadoop.RecommendedItemsWritable.java
License:Apache License
@Override public void write(DataOutput out) throws IOException { out.writeInt(recommended.size());//from w ww.j a va 2s. c o m for (RecommendedItem item : recommended) { Varint.writeSignedVarLong(item.getItemID(), out); out.writeFloat(item.getValue()); } }