Package no.uib.cipr.matrix.io
Class MatrixVectorWriter
java.lang.Object
java.io.Writer
java.io.PrintWriter
no.uib.cipr.matrix.io.MatrixVectorWriter
- All Implemented Interfaces:
Closeable
,Flushable
,Appendable
,AutoCloseable
Writes matrices and vectors
-
Field Summary
Fields inherited from class java.io.PrintWriter
out
-
Constructor Summary
ConstructorsConstructorDescriptionConstructor for MatrixVectorWriterMatrixVectorWriter
(OutputStream out, boolean autoFlush) Constructor for MatrixVectorWriterMatrixVectorWriter
(Writer out) Constructor for MatrixVectorWriterMatrixVectorWriter
(Writer out, boolean autoFlush) Constructor for MatrixVectorWriter -
Method Summary
Modifier and TypeMethodDescriptionvoid
add
(int num, int[] indices) Shifts the indices.void
printArray
(double[] data) Prints an array to the underlying stream.void
printArray
(double[] dataR, double[] dataI) Prints an array to the underlying stream.void
printArray
(float[] data) Prints an array to the underlying stream.void
printArray
(float[] dataR, float[] dataI) Prints an array to the underlying stream.void
printArray
(int[] data) Prints an array to the underlying stream.void
printArray
(long[] data) Prints an array to the underlying stream.void
printComments
(String[] comments) Prints all the comments.void
printCoordinate
(int[] index, double[] data) Prints the coordinate format to the underlying stream.void
printCoordinate
(int[] index, double[] dataR, double[] dataI) Prints the coordinate format to the underlying stream.void
printCoordinate
(int[] index, double[] dataR, double[] dataI, int offset) Prints the coordinate format to the underlying stream.void
printCoordinate
(int[] index, double[] data, int offset) Prints the coordinate format to the underlying stream.void
printCoordinate
(int[] index, float[] data) Prints the coordinate format to the underlying stream.void
printCoordinate
(int[] index, float[] dataR, float[] dataI) Prints the coordinate format to the underlying stream.void
printCoordinate
(int[] index, float[] dataR, float[] dataI, int offset) Prints the coordinate format to the underlying stream.void
printCoordinate
(int[] index, float[] data, int offset) Prints the coordinate format to the underlying stream.void
printCoordinate
(int[] index, int[] data) Prints the coordinate format to the underlying stream.void
printCoordinate
(int[] row, int[] column, double[] data) Prints the coordinate format to the underlying stream.void
printCoordinate
(int[] row, int[] column, double[] dataR, double[] dataI) Prints the coordinate format to the underlying stream.void
printCoordinate
(int[] row, int[] column, double[] dataR, double[] dataI, int offset) Prints the coordinate format to the underlying stream.void
printCoordinate
(int[] row, int[] column, double[] data, int offset) Prints the coordinate format to the underlying stream.void
printCoordinate
(int[] row, int[] column, float[] data) Prints the coordinate format to the underlying stream.void
printCoordinate
(int[] row, int[] column, float[] dataR, float[] dataI) Prints the coordinate format to the underlying stream.void
printCoordinate
(int[] row, int[] column, float[] dataR, float[] dataI, int offset) Prints the coordinate format to the underlying stream.void
printCoordinate
(int[] row, int[] column, float[] data, int offset) Prints the coordinate format to the underlying stream.void
printCoordinate
(int[] index, int[] data, int offset) Prints the coordinate format to the underlying stream.void
printCoordinate
(int[] row, int[] column, int[] data) Prints the coordinate format to the underlying stream.void
printCoordinate
(int[] row, int[] column, int[] data, int offset) Prints the coordinate format to the underlying stream.void
printCoordinate
(int[] row, int[] column, long[] data) Prints the coordinate format to the underlying stream.void
printCoordinate
(int[] row, int[] column, long[] data, int offset) Prints the coordinate format to the underlying stream.void
printCoordinate
(int[] index, long[] data) Prints the coordinate format to the underlying stream.void
printCoordinate
(int[] index, long[] data, int offset) Prints the coordinate format to the underlying stream.void
printMatrixInfo
(MatrixInfo info) Prints the matrix infovoid
printMatrixSize
(MatrixSize size) Prints the matrix size.void
printMatrixSize
(MatrixSize size, MatrixInfo info) Prints the matrix sizevoid
printPattern
(int[] index) Prints the coordinates to the underlying stream.void
printPattern
(int[] index, int offset) Prints the coordinates to the underlying stream.void
printPattern
(int[] row, int[] column) Prints the coordinates to the underlying stream.void
printPattern
(int[] row, int[] column, int offset) Prints the coordinates to the underlying stream.void
printVectorInfo
(VectorInfo info) Prints the vector infovoid
printVectorSize
(VectorSize size) Prints the vector size.void
printVectorSize
(VectorSize size, VectorInfo info) Prints the vector sizeMethods inherited from class java.io.PrintWriter
append, append, append, checkError, clearError, close, flush, format, format, print, print, print, print, print, print, print, print, print, printf, printf, println, println, println, println, println, println, println, println, println, println, setError, write, write, write, write, write
Methods inherited from class java.io.Writer
nullWriter
-
Constructor Details
-
MatrixVectorWriter
Constructor for MatrixVectorWriter- Parameters:
out
-
-
MatrixVectorWriter
Constructor for MatrixVectorWriter- Parameters:
out
-autoFlush
-
-
MatrixVectorWriter
Constructor for MatrixVectorWriter- Parameters:
out
-
-
MatrixVectorWriter
Constructor for MatrixVectorWriter- Parameters:
out
-autoFlush
-
-
-
Method Details
-
add
public void add(int num, int[] indices) Shifts the indices. Useful for converting between 0- and 1-based indicing.- Parameters:
num
- Added to every indexindices
- Indices to shift
-
printMatrixInfo
Prints the matrix info -
printVectorInfo
Prints the vector info -
printMatrixSize
Prints the matrix size -
printMatrixSize
Prints the matrix size. Assumes coordinate format -
printVectorSize
Prints the vector size -
printVectorSize
Prints the vector size. Assumes coordinate format -
printArray
public void printArray(float[] data) Prints an array to the underlying stream. One entry per line. -
printArray
public void printArray(double[] data) Prints an array to the underlying stream. One entry per line. -
printArray
public void printArray(float[] dataR, float[] dataI) Prints an array to the underlying stream. One entry per line. The first array specifies the real entries, and the second is the imaginary entries -
printArray
public void printArray(double[] dataR, double[] dataI) Prints an array to the underlying stream. One entry per line. The first array specifies the real entries, and the second is the imaginary entries -
printArray
public void printArray(int[] data) Prints an array to the underlying stream. One entry per line. -
printArray
public void printArray(long[] data) Prints an array to the underlying stream. One entry per line. -
printCoordinate
public void printCoordinate(int[] index, float[] data, int offset) Prints the coordinate format to the underlying stream. One index and entry on each line. The offset is added to the index, typically, this can transform from a 0-based indicing to a 1-based. -
printCoordinate
public void printCoordinate(int[] index, double[] data, int offset) Prints the coordinate format to the underlying stream. One index and entry on each line. The offset is added to the index, typically, this can transform from a 0-based indicing to a 1-based. -
printCoordinate
public void printCoordinate(int[] index, int[] data, int offset) Prints the coordinate format to the underlying stream. One index and entry on each line. The offset is added to the index, typically, this can transform from a 0-based indicing to a 1-based. -
printCoordinate
public void printCoordinate(int[] index, long[] data, int offset) Prints the coordinate format to the underlying stream. One index and entry on each line. The offset is added to the index, typically, this can transform from a 0-based indicing to a 1-based. -
printCoordinate
public void printCoordinate(int[] row, int[] column, float[] data, int offset) Prints the coordinate format to the underlying stream. One index pair and entry on each line. The offset is added to each index, typically, this can transform from a 0-based indicing to a 1-based. -
printCoordinate
public void printCoordinate(int[] row, int[] column, double[] data, int offset) Prints the coordinate format to the underlying stream. One index pair and entry on each line. The offset is added to each index, typically, this can transform from a 0-based indicing to a 1-based. -
printCoordinate
public void printCoordinate(int[] index, float[] dataR, float[] dataI, int offset) Prints the coordinate format to the underlying stream. One index and entry on each line. The offset is added to each index, typically, this can transform from a 0-based indicing to a 1-based. The first float array specifies the real entries, and the second is the imaginary entries -
printCoordinate
public void printCoordinate(int[] index, double[] dataR, double[] dataI, int offset) Prints the coordinate format to the underlying stream. One index and entry on each line. The offset is added to each index, typically, this can transform from a 0-based indicing to a 1-based. The first double array specifies the real entries, and the second is the imaginary entries -
printCoordinate
public void printCoordinate(int[] row, int[] column, float[] dataR, float[] dataI, int offset) Prints the coordinate format to the underlying stream. One index pair and entry on each line. The offset is added to each index, typically, this can transform from a 0-based indicing to a 1-based. The first float array specifies the real entries, and the second is the imaginary entries -
printCoordinate
public void printCoordinate(int[] row, int[] column, double[] dataR, double[] dataI, int offset) Prints the coordinate format to the underlying stream. One index pair and entry on each line. The offset is added to each index, typically, this can transform from a 0-based indicing to a 1-based. The first double array specifies the real entries, and the second is the imaginary entries -
printCoordinate
public void printCoordinate(int[] row, int[] column, int[] data, int offset) Prints the coordinate format to the underlying stream. One index pair and entry on each line. The offset is added to each index, typically, this can transform from a 0-based indicing to a 1-based. -
printCoordinate
public void printCoordinate(int[] row, int[] column, long[] data, int offset) Prints the coordinate format to the underlying stream. One index pair and entry on each line. The offset is added to each index, typically, this can transform from a 0-based indicing to a 1-based. -
printPattern
public void printPattern(int[] row, int[] column, int offset) Prints the coordinates to the underlying stream. One index pair on each line. The offset is added to each index, typically, this can transform from a 0-based indicing to a 1-based. -
printPattern
public void printPattern(int[] index, int offset) Prints the coordinates to the underlying stream. One index on each line. The offset is added to each index, typically, this can transform from a 0-based indicing to a 1-based. -
printCoordinate
public void printCoordinate(int[] row, int[] column, float[] data) Prints the coordinate format to the underlying stream. One index pair and entry on each line -
printCoordinate
public void printCoordinate(int[] row, int[] column, double[] data) Prints the coordinate format to the underlying stream. One index pair and entry on each line -
printCoordinate
public void printCoordinate(int[] row, int[] column, float[] dataR, float[] dataI) Prints the coordinate format to the underlying stream. One index pair and entry on each line. The first double array specifies the real entries, and the second is the imaginary entries -
printCoordinate
public void printCoordinate(int[] row, int[] column, double[] dataR, double[] dataI) Prints the coordinate format to the underlying stream. One index pair and entry on each line. The first double array specifies the real entries, and the second is the imaginary entries -
printCoordinate
public void printCoordinate(int[] row, int[] column, int[] data) Prints the coordinate format to the underlying stream. One index pair and entry on each line -
printCoordinate
public void printCoordinate(int[] row, int[] column, long[] data) Prints the coordinate format to the underlying stream. One index pair and entry on each line -
printPattern
public void printPattern(int[] row, int[] column) Prints the coordinates to the underlying stream. One index pair on each line -
printCoordinate
public void printCoordinate(int[] index, float[] data) Prints the coordinate format to the underlying stream. One index and entry on each line -
printCoordinate
public void printCoordinate(int[] index, double[] data) Prints the coordinate format to the underlying stream. One index and entry on each line -
printCoordinate
public void printCoordinate(int[] index, float[] dataR, float[] dataI) Prints the coordinate format to the underlying stream. One index and entry on each line. The first double array specifies the real entries, and the second is the imaginary entries -
printCoordinate
public void printCoordinate(int[] index, double[] dataR, double[] dataI) Prints the coordinate format to the underlying stream. One index and entry on each line. The first double array specifies the real entries, and the second is the imaginary entries -
printCoordinate
public void printCoordinate(int[] index, int[] data) Prints the coordinate format to the underlying stream. One index and entry on each line -
printCoordinate
public void printCoordinate(int[] index, long[] data) Prints the coordinate format to the underlying stream. One index and entry on each line -
printPattern
public void printPattern(int[] index) Prints the coordinates to the underlying stream. One index on each line -
printComments
Prints all the comments. Prepends a '%' and appends a newline to every comment
-