public class MatrixWriter<R,C> extends Object
Modifier and Type | Field and Description |
---|---|
protected Map<C,String> |
colNameMap |
static String |
DEFAULT_SEP |
static String |
DEFAULT_TOP_LEFT |
protected Format |
formatter |
protected Writer |
out |
protected Map<R,String> |
rowNameMap |
protected String |
sep |
protected Map<?,String> |
sliceNameMap |
protected String |
topLeft |
Constructor and Description |
---|
MatrixWriter(OutputStream out) |
MatrixWriter(OutputStream out,
Format formatter) |
MatrixWriter(OutputStream out,
Format formatter,
String sep) |
MatrixWriter(String fileName,
Format formatter) |
MatrixWriter(String fileName,
Format formatter,
String sep) |
MatrixWriter(Writer out) |
MatrixWriter(Writer out,
Format formatter) |
MatrixWriter(Writer out,
Format formatter,
String sep) |
MatrixWriter(Writer out,
String sep) |
Modifier and Type | Method and Description |
---|---|
void |
setColNameMap(Map<C,String> colNameMap)
Use to customize the labels instead of relying on the toString method of the column object
|
void |
setRowNameMap(Map<R,String> rowNameMap)
Use to customize the labels instead of relying on the toString method of the row object
|
void |
setSep(String sep) |
void |
setSliceNameMap(Map<?,String> sliceNameMap) |
void |
setTopLeft(String topLeft) |
void |
writeMatrix(cern.colt.matrix.DoubleMatrix1D coltMatrix)
Write a bare 1D matrix (one value per line)
|
void |
writeMatrix(cern.colt.matrix.DoubleMatrix2D coltMatrix)
Write a bare matrix without row names or columns
|
<V> void |
writeMatrix(Matrix2D<R,C,V> matrix,
boolean printNames) |
<S,V> void |
writeMatrix(Matrix3D<R,C,S,V> matrix,
boolean printNames)
Writes a 3d matrix, collapsing the rows and columns
|
public static final String DEFAULT_SEP
public static final String DEFAULT_TOP_LEFT
protected Format formatter
protected Writer out
protected String sep
protected String topLeft
public MatrixWriter(OutputStream out)
public MatrixWriter(OutputStream out, Format formatter)
public MatrixWriter(OutputStream out, Format formatter, String sep)
public MatrixWriter(String fileName, Format formatter) throws IOException
IOException
public MatrixWriter(String fileName, Format formatter, String sep) throws IOException
IOException
public MatrixWriter(Writer out)
public void setColNameMap(Map<C,String> colNameMap)
colNameMap
- public void setRowNameMap(Map<R,String> rowNameMap)
rowNameMap
- public void setSep(String sep)
public void setTopLeft(String topLeft)
public <V> void writeMatrix(Matrix2D<R,C,V> matrix, boolean printNames) throws IOException
V
- matrix
- printNames
- Should the row and column names be included; FIXME this fails if names aren't providedIOException
public void writeMatrix(cern.colt.matrix.DoubleMatrix2D coltMatrix) throws IOException
coltMatrix
- IOException
public void writeMatrix(cern.colt.matrix.DoubleMatrix1D coltMatrix) throws IOException
coltMatrix
- IOException
public <S,V> void writeMatrix(Matrix3D<R,C,S,V> matrix, boolean printNames) throws IOException
matrix
- printNames
- IOException
Copyright © 2003–2023 UBC Michael Smith Laboratories. All rights reserved.