org.apache.mahout.math.hadoop.stochasticsvd
Class SparseRowBlockWritable
java.lang.Object
org.apache.mahout.math.hadoop.stochasticsvd.SparseRowBlockWritable
- All Implemented Interfaces:
- org.apache.hadoop.io.Writable
public class SparseRowBlockWritable
- extends Object
- implements org.apache.hadoop.io.Writable
block that supports accumulating rows and their sums , suitable for combiner
and reducers of multiplication jobs.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SparseRowBlockWritable
public SparseRowBlockWritable()
SparseRowBlockWritable
public SparseRowBlockWritable(int initialCapacity)
getRowIndices
public int[] getRowIndices()
getRows
public Vector[] getRows()
readFields
public void readFields(DataInput in)
throws IOException
- Specified by:
readFields
in interface org.apache.hadoop.io.Writable
- Throws:
IOException
write
public void write(DataOutput out)
throws IOException
- Specified by:
write
in interface org.apache.hadoop.io.Writable
- Throws:
IOException
plusRow
public void plusRow(int index,
Vector row)
plusBlock
public void plusBlock(SparseRowBlockWritable bOther)
- pluses one block into another. Use it for accumulation of partial products in
combiners and reducers.
- Parameters:
bOther
- block to add
getNumRows
public int getNumRows()
clear
public void clear()
Copyright © 2008–2014 The Apache Software Foundation. All rights reserved.