VectorWritable extends Configured implements Writable { public void set(Vector vector) { this.vector = vector; } VectorWritable();  VectorWritable(Vector vector);  VectorWritable(Vector vector, boolean writesLaxPrecision); Vector get(); void set(Vector vector); boolean isWritesLaxPrecision(); void setWritesLaxPrecision(boolean writesLaxPrecision); @Override void write(DataOutput out); @Override void readFields(DataInput in); static void writeVector(DataOutput out, Vector vector); static void writeVector(DataOutput out, Vector vector, boolean laxPrecision); static Vector readVector(DataInput in); static VectorWritable merge(Iterator<VectorWritable> vectors); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); static final int FLAG_DENSE; static final int FLAG_SEQUENTIAL; static final int FLAG_NAMED; static final int FLAG_LAX_PRECISION; static final int NUM_FLAGS; }
@Test public void testSequentialAccessSparseVectorWritable() throws Exception { Vector v = new SequentialAccessSparseVector(5); v.set(1, 3.0); v.set(3, 5.0); doTestVectorWritableEquals(v); }
@Test public void testRandomAccessSparseVectorWritable() throws Exception { Vector v = new RandomAccessSparseVector(5); v.set(1, 3.0); v.set(3, 5.0); doTestVectorWritableEquals(v); }
@Test public void testDenseVectorWritable() throws Exception { Vector v = new DenseVector(5); v.set(1, 3.0); v.set(3, 5.0); doTestVectorWritableEquals(v); }
@Test public void testNamedVectorWritable() throws Exception { Vector v = new DenseVector(5); v = new NamedVector(v, "Victor"); v.set(1, 3.0); v.set(3, 5.0); doTestVectorWritableEquals(v); }