public final class MatrixWritable extends Object implements org.apache.hadoop.io.Writable
| Modifier and Type | Field and Description |
|---|---|
static byte |
DENSE_DOUBLE_MATRIX |
static byte |
SPARSE_DOUBLE_ROW_MATRIX |
| Constructor and Description |
|---|
MatrixWritable() |
MatrixWritable(de.jungblut.math.DoubleMatrix mat) |
| Modifier and Type | Method and Description |
|---|---|
de.jungblut.math.DoubleMatrix |
getMatrix() |
static de.jungblut.math.dense.DenseDoubleMatrix |
readDenseMatrix(DataInput in)
Reads a dense matrix from the given input stream.
|
void |
readFields(DataInput in) |
static de.jungblut.math.sparse.SparseDoubleRowMatrix |
readSparseMatrix(DataInput in)
Reads a sparse matrix from the given input stream.
|
void |
write(DataOutput out) |
static void |
writeDenseMatrix(de.jungblut.math.dense.DenseDoubleMatrix mat,
DataOutput out)
Writes a dense matrix to the given output stream.
|
static void |
writeSparseMatrix(de.jungblut.math.sparse.SparseDoubleRowMatrix mat,
DataOutput out)
Writes a sparse matrix to the given output stream.
|
public static final byte DENSE_DOUBLE_MATRIX
public static final byte SPARSE_DOUBLE_ROW_MATRIX
public MatrixWritable()
public MatrixWritable(de.jungblut.math.DoubleMatrix mat)
public void readFields(DataInput in) throws IOException
readFields in interface org.apache.hadoop.io.WritableIOExceptionpublic void write(DataOutput out) throws IOException
write in interface org.apache.hadoop.io.WritableIOExceptionpublic de.jungblut.math.DoubleMatrix getMatrix()
public static void writeSparseMatrix(de.jungblut.math.sparse.SparseDoubleRowMatrix mat,
DataOutput out)
throws IOException
mat - the sparse matrix to serialize.out - the output.IOException - in case of an IO error.public static de.jungblut.math.sparse.SparseDoubleRowMatrix readSparseMatrix(DataInput in) throws IOException
in - the input stream.IOException - in case of an IO error.public static void writeDenseMatrix(de.jungblut.math.dense.DenseDoubleMatrix mat,
DataOutput out)
throws IOException
mat - the dense matrix to serialize.out - the output.IOException - in case of an IO error.public static de.jungblut.math.dense.DenseDoubleMatrix readDenseMatrix(DataInput in) throws IOException
in - the input stream.IOException - in case of an IO error.Copyright © 2016. All rights reserved.