Class MatrixVectorWriter

java.lang.Object
java.io.Writer
java.io.PrintWriter
no.uib.cipr.matrix.io.MatrixVectorWriter
All Implemented Interfaces:
Closeable, Flushable, Appendable, AutoCloseable

public class MatrixVectorWriter extends PrintWriter
Writes matrices and vectors
  • Constructor Details

    • MatrixVectorWriter

      public MatrixVectorWriter(OutputStream out)
      Constructor for MatrixVectorWriter
      Parameters:
      out -
    • MatrixVectorWriter

      public MatrixVectorWriter(OutputStream out, boolean autoFlush)
      Constructor for MatrixVectorWriter
      Parameters:
      out -
      autoFlush -
    • MatrixVectorWriter

      public MatrixVectorWriter(Writer out)
      Constructor for MatrixVectorWriter
      Parameters:
      out -
    • MatrixVectorWriter

      public MatrixVectorWriter(Writer out, boolean autoFlush)
      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 index
      indices - 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(String[] comments)
      Prints all the comments. Prepends a '%' and appends a newline to every comment