/** * <p> * Loads a new matrix from a serialized binary file. * </p> * * @see MatrixIO#loadBin(String) * * @param fileName File which is to be loaded. * @return The matrix. * @throws IOException */ public static SimpleMatrix loadBinary( String fileName ) throws IOException { ReshapeMatrix64F mat = MatrixIO.loadBin(fileName); // see if its a DenseMatrix64F if( mat instanceof DenseMatrix64F ) { return SimpleMatrix.wrap((DenseMatrix64F)mat); } else { // if not convert it into one and wrap it return SimpleMatrix.wrap( new DenseMatrix64F(mat)); } }
/** * <p> * Loads a new matrix from a serialized binary file. * </p> * * @see MatrixIO#loadBin(String) * * @param fileName File which is to be loaded. * @return The matrix. * @throws IOException */ public static SimpleMatrix loadBinary( String fileName ) throws IOException { RealMatrix64F mat = MatrixIO.loadBin(fileName); // see if its a DenseMatrix64F if( mat instanceof DenseMatrix64F ) { return SimpleMatrix.wrap((DenseMatrix64F)mat); } else { // if not convert it into one and wrap it return SimpleMatrix.wrap( new DenseMatrix64F(mat)); } }
/** * <p> * Loads a new matrix from a serialized binary file. * </p> * * @see MatrixIO#loadBin(String) * * @param fileName File which is to be loaded. * @return The matrix. * @throws IOException */ public static SimpleMatrix loadBinary( String fileName ) throws IOException { ReshapeMatrix64F mat = MatrixIO.loadBin(fileName); // see if its a DenseMatrix64F if( mat instanceof DenseMatrix64F ) { return SimpleMatrix.wrap((DenseMatrix64F)mat); } else { // if not convert it into one and wrap it return SimpleMatrix.wrap( new DenseMatrix64F(mat)); } }