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 TypeMethodDescriptionvoidadd(int num, int[] indices) Shifts the indices.voidprintArray(double[] data) Prints an array to the underlying stream.voidprintArray(double[] dataR, double[] dataI) Prints an array to the underlying stream.voidprintArray(float[] data) Prints an array to the underlying stream.voidprintArray(float[] dataR, float[] dataI) Prints an array to the underlying stream.voidprintArray(int[] data) Prints an array to the underlying stream.voidprintArray(long[] data) Prints an array to the underlying stream.voidprintComments(String[] comments) Prints all the comments.voidprintCoordinate(int[] index, double[] data) Prints the coordinate format to the underlying stream.voidprintCoordinate(int[] index, double[] dataR, double[] dataI) Prints the coordinate format to the underlying stream.voidprintCoordinate(int[] index, double[] dataR, double[] dataI, int offset) Prints the coordinate format to the underlying stream.voidprintCoordinate(int[] index, double[] data, int offset) Prints the coordinate format to the underlying stream.voidprintCoordinate(int[] index, float[] data) Prints the coordinate format to the underlying stream.voidprintCoordinate(int[] index, float[] dataR, float[] dataI) Prints the coordinate format to the underlying stream.voidprintCoordinate(int[] index, float[] dataR, float[] dataI, int offset) Prints the coordinate format to the underlying stream.voidprintCoordinate(int[] index, float[] data, int offset) Prints the coordinate format to the underlying stream.voidprintCoordinate(int[] index, int[] data) Prints the coordinate format to the underlying stream.voidprintCoordinate(int[] row, int[] column, double[] data) Prints the coordinate format to the underlying stream.voidprintCoordinate(int[] row, int[] column, double[] dataR, double[] dataI) Prints the coordinate format to the underlying stream.voidprintCoordinate(int[] row, int[] column, double[] dataR, double[] dataI, int offset) Prints the coordinate format to the underlying stream.voidprintCoordinate(int[] row, int[] column, double[] data, int offset) Prints the coordinate format to the underlying stream.voidprintCoordinate(int[] row, int[] column, float[] data) Prints the coordinate format to the underlying stream.voidprintCoordinate(int[] row, int[] column, float[] dataR, float[] dataI) Prints the coordinate format to the underlying stream.voidprintCoordinate(int[] row, int[] column, float[] dataR, float[] dataI, int offset) Prints the coordinate format to the underlying stream.voidprintCoordinate(int[] row, int[] column, float[] data, int offset) Prints the coordinate format to the underlying stream.voidprintCoordinate(int[] index, int[] data, int offset) Prints the coordinate format to the underlying stream.voidprintCoordinate(int[] row, int[] column, int[] data) Prints the coordinate format to the underlying stream.voidprintCoordinate(int[] row, int[] column, int[] data, int offset) Prints the coordinate format to the underlying stream.voidprintCoordinate(int[] row, int[] column, long[] data) Prints the coordinate format to the underlying stream.voidprintCoordinate(int[] row, int[] column, long[] data, int offset) Prints the coordinate format to the underlying stream.voidprintCoordinate(int[] index, long[] data) Prints the coordinate format to the underlying stream.voidprintCoordinate(int[] index, long[] data, int offset) Prints the coordinate format to the underlying stream.voidprintMatrixInfo(MatrixInfo info) Prints the matrix infovoidprintMatrixSize(MatrixSize size) Prints the matrix size.voidprintMatrixSize(MatrixSize size, MatrixInfo info) Prints the matrix sizevoidprintPattern(int[] index) Prints the coordinates to the underlying stream.voidprintPattern(int[] index, int offset) Prints the coordinates to the underlying stream.voidprintPattern(int[] row, int[] column) Prints the coordinates to the underlying stream.voidprintPattern(int[] row, int[] column, int offset) Prints the coordinates to the underlying stream.voidprintVectorInfo(VectorInfo info) Prints the vector infovoidprintVectorSize(VectorSize size) Prints the vector size.voidprintVectorSize(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, writeMethods 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
-