MatrixIO
org.ejml.ops

Class MatrixIO



  • public class MatrixIOextends Object
    Provides simple to use routines for reading and writing matrices to and from files.
    • Constructor Detail

      • MatrixIO

        public MatrixIO()
    • Method Detail

      • saveBin

        public static void saveBin(Matrix64F A,           String fileName)                    throws IOException
        Saves a matrix to disk using Java binary serialization.
        Parameters:
        A - The matrix being saved.
        fileName - Name of the file its being saved at.
        Throws:
        IOException
      • loadBin

        public static <T extends Matrix64F> T loadBin(String fileName)                                   throws IOException
        Loads a DeneMatrix64F which has been saved to file using Java binary serialization.
        Parameters:
        fileName - The file being loaded.
        Returns:
        DenseMatrix64F
        Throws:
        IOException
      • saveCSV

        public static void saveCSV(Matrix64F A,           String fileName)                    throws IOException
        Saves a matrix to disk using in a Column Space Value (CSV) format. For a description of the format see loadCSV(String).
        Parameters:
        A - The matrix being saved.
        fileName - Name of the file its being saved at.
        Throws:
        IOException
      • loadCSV

        public static DenseMatrix64F loadCSV(String fileName)                              throws IOException
        Reads a matrix in which has been encoded using a Column Space Value (CSV) file format. The number of rows and columns are read in on the first line. Then each row is read in the subsequent lines.
        Parameters:
        fileName - The file being loaded.
        Returns:
        DenseMatrix64F
        Throws:
        IOException
      • loadCSV

        public static DenseMatrix64F loadCSV(String fileName,                     int numRows,                     int numCols)                              throws IOException
        Reads a matrix in which has been encoded using a Column Space Value (CSV) file format. For a description of the format see loadCSV(String).
        Parameters:
        fileName - The file being loaded.
        numRows - number of rows in the matrix.
        numCols - number of columns in the matrix.
        Returns:
        DenseMatrix64F
        Throws:
        IOException

SCaVis 1.7 © jWork.org