Package libai.io
Class MatrixIO
- java.lang.Object
-
- libai.io.MatrixIO
-
public class MatrixIO extends java.lang.ObjectThis class implements basic IO functions forMatrixobjects.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classMatrixIO.TargetSerialization target
-
Constructor Summary
Constructors Constructor Description MatrixIO()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidwrite(java.io.OutputStream output, java.util.Map<java.lang.String,Matrix> m)static voidwrite(java.io.OutputStream output, java.util.Map<java.lang.String,Matrix> m, MatrixIO.Target t)Writes a set ofMatrixobjects to a givenOutputStream.
Note: When saving toMatrixIO.Target.CSVandMatrixIO.Target.TSV, a line separator \n will be inserted between matrices Note 2: Since Java doesn't support deserializing multiple objects from the sameOutputStreamif target isMatrixIO.Target.SERIALthen the wholeMapwill be serialized.static voidwrite(java.io.OutputStream output, Matrix m)static voidwrite(java.io.OutputStream output, Matrix m, MatrixIO.Target t)Writes aMatrixobject to a givenOutputStream.
Note: if the target isMatrixIO.Target.OCTAVEthen the default variable name will be'a'.
-
-
-
Method Detail
-
write
public static void write(java.io.OutputStream output, Matrix m) throws java.lang.IllegalArgumentException, java.io.IOException- Throws:
java.lang.IllegalArgumentExceptionjava.io.IOException
-
write
public static void write(java.io.OutputStream output, Matrix m, MatrixIO.Target t) throws java.lang.IllegalArgumentException, java.io.IOExceptionWrites aMatrixobject to a givenOutputStream.
Note: if the target isMatrixIO.Target.OCTAVEthen the default variable name will be'a'.- Parameters:
output- TheOutputStreamin which to save thisMatrixobjectm- TheMatrixobject to writet-MatrixIO.Targeted format, the default value (ifnull) isMatrixIO.Target.SERIAL- Throws:
java.lang.IllegalArgumentException- if eitheroutputormarenulljava.io.IOException- if an I/O error occurs
-
write
public static void write(java.io.OutputStream output, java.util.Map<java.lang.String,Matrix> m) throws java.lang.IllegalArgumentException, java.io.IOException- Throws:
java.lang.IllegalArgumentExceptionjava.io.IOException
-
write
public static void write(java.io.OutputStream output, java.util.Map<java.lang.String,Matrix> m, MatrixIO.Target t) throws java.lang.IllegalArgumentException, java.io.IOExceptionWrites a set ofMatrixobjects to a givenOutputStream.
Note: When saving toMatrixIO.Target.CSVandMatrixIO.Target.TSV, a line separator \n will be inserted between matrices Note 2: Since Java doesn't support deserializing multiple objects from the sameOutputStreamif target isMatrixIO.Target.SERIALthen the wholeMapwill be serialized.- Parameters:
output- TheOutputStreamin which to write theMatrixobjectsm- aMapwhere the keys are matrix names, if the target is anything butMatrixIO.Target.OCTAVEthe name will be ignoredt-MatrixIO.Targeted format, the default value (ifnull) isMatrixIO.Target.SERIAL- Throws:
java.lang.IllegalArgumentException- if eitheroutputormarenulljava.io.IOException- if an I/O error occurs
-
-