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:
java.io.Closeable
,java.io.Flushable
,java.lang.Appendable
,java.lang.AutoCloseable
public class MatrixVectorWriter extends java.io.PrintWriter
Writes matrices and vectors
-
-
Constructor Summary
Constructors Constructor Description MatrixVectorWriter(java.io.OutputStream out)
Constructor for MatrixVectorWriterMatrixVectorWriter(java.io.OutputStream out, boolean autoFlush)
Constructor for MatrixVectorWriterMatrixVectorWriter(java.io.Writer out)
Constructor for MatrixVectorWriterMatrixVectorWriter(java.io.Writer out, boolean autoFlush)
Constructor for MatrixVectorWriter
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
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(java.lang.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 size-
Methods 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
-
-
-
-
Constructor Detail
-
MatrixVectorWriter
public MatrixVectorWriter(java.io.OutputStream out)
Constructor for MatrixVectorWriter- Parameters:
out
-
-
MatrixVectorWriter
public MatrixVectorWriter(java.io.OutputStream out, boolean autoFlush)
Constructor for MatrixVectorWriter- Parameters:
out
-autoFlush
-
-
MatrixVectorWriter
public MatrixVectorWriter(java.io.Writer out)
Constructor for MatrixVectorWriter- Parameters:
out
-
-
MatrixVectorWriter
public MatrixVectorWriter(java.io.Writer out, boolean autoFlush)
Constructor for MatrixVectorWriter- Parameters:
out
-autoFlush
-
-
-
Method Detail
-
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
public void printMatrixInfo(MatrixInfo info)
Prints the matrix info
-
printVectorInfo
public void printVectorInfo(VectorInfo info)
Prints the vector info
-
printMatrixSize
public void printMatrixSize(MatrixSize size, MatrixInfo info)
Prints the matrix size
-
printMatrixSize
public void printMatrixSize(MatrixSize size)
Prints the matrix size. Assumes coordinate format
-
printVectorSize
public void printVectorSize(VectorSize size, VectorInfo info)
Prints the vector size
-
printVectorSize
public void printVectorSize(VectorSize size)
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
public void printComments(java.lang.String[] comments)
Prints all the comments. Prepends a '%' and appends a newline to every comment
-
-