73
edits
Changes
→Library Utilities
This procedure writes a square array out to a file.
proc writeSquareArray(n, X, filename) { // Create and open an output file with the specified filename in write mode. var outfile = open(filename, iomode.cw); var writer = outfile.writer(); // Write the problem size in each dimension to the file. writer.writeln(n, " ", n); // Write out the array itself. writer.write(X); // Close the file. writer.close(); outfile.close(); }
This procedure reads a new array out of a file and returns it.