Package ubic.basecode.io.writer
Class MatrixWriter<R,C>
java.lang.Object
ubic.basecode.io.writer.MatrixWriter<R,C>
Class for writing matrices to disk
- Author:
- Raymond Lim, paul
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionMatrixWriter(OutputStream out) MatrixWriter(OutputStream out, Format formatter) MatrixWriter(OutputStream out, Format formatter, String sep) MatrixWriter(Writer out) MatrixWriter(Writer out, String sep) MatrixWriter(Writer out, Format formatter) MatrixWriter(Writer out, Format formatter, String sep) MatrixWriter(String fileName, Format formatter) MatrixWriter(String fileName, Format formatter, String sep) -
Method Summary
Modifier and TypeMethodDescriptionvoidsetColNameMap(Map<C, String> colNameMap) Use to customize the labels instead of relying on the toString method of the column objectvoidsetRowNameMap(Map<R, String> rowNameMap) Use to customize the labels instead of relying on the toString method of the row objectvoidvoidsetSliceNameMap(Map<?, String> sliceNameMap) voidsetTopLeft(String topLeft) voidwriteMatrix(DoubleMatrix1D coltMatrix) Write a bare 1D matrix (one value per line)voidwriteMatrix(DoubleMatrix2D coltMatrix) Write a bare matrix without row names or columns<V> voidwriteMatrix(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
-
Field Details
-
DEFAULT_SEP
- See Also:
-
DEFAULT_TOP_LEFT
- See Also:
-
colNameMap
-
formatter
-
out
-
rowNameMap
-
sep
-
sliceNameMap
-
topLeft
-
-
Constructor Details
-
MatrixWriter
-
MatrixWriter
-
MatrixWriter
-
MatrixWriter
- Throws:
IOException
-
MatrixWriter
- Throws:
IOException
-
MatrixWriter
-
MatrixWriter
-
MatrixWriter
-
MatrixWriter
-
-
Method Details
-
setColNameMap
Use to customize the labels instead of relying on the toString method of the column object- Parameters:
colNameMap-
-
setRowNameMap
Use to customize the labels instead of relying on the toString method of the row object- Parameters:
rowNameMap-
-
setSep
-
setSliceNameMap
-
setTopLeft
-
writeMatrix
- Type Parameters:
V-- Parameters:
matrix-printNames- Should the row and column names be included; FIXME this fails if names aren't provided- Throws:
IOException
-
writeMatrix
Write a bare matrix without row names or columns- Parameters:
coltMatrix-- Throws:
IOException
-
writeMatrix
Write a bare 1D matrix (one value per line)- Parameters:
coltMatrix-- Throws:
IOException
-
writeMatrix
Writes a 3d matrix, collapsing the rows and columns- Parameters:
matrix-printNames-- Throws:
IOException
-