/** Loads elements from a given buffered reader, storing them in a given array. * * @param reader a buffered reader. * @param array an array which will be filled with data from {@code reader}. * @return the number of elements actually read from {@code reader} (it might be less than the array length if {@code reader} ends). */ public static int loadInts(final BufferedReader reader, final int[] array) throws IOException { return loadInts(reader, array, 0, array.length); } /** Loads elements from a file given by a {@link File} object, storing them in a given array fragment.
/** Loads elements from a file given by a {@link File} object, storing them in a given array. * * @param file a file. * @param array an array which will be filled with data from the specified file. * @return the number of elements actually read from the given file (it might be less than the array length if the file is too short). */ public static int loadInts(final File file, final int[] array) throws IOException { return loadInts(file, array, 0, array.length); } /** Loads elements from a file given by a filename, storing them in a given array.
/** Loads elements from a file given by a filename, storing them in a given array. * * @param filename a filename. * @param array an array which will be filled with data from the specified file. * @return the number of elements actually read from the given file (it might be less than the array length if the file is too short). */ public static int loadInts(final CharSequence filename, final int[] array) throws IOException { return loadInts(filename, array, 0, array.length); } /** Stores an array fragment to a given print stream.
/** Loads elements from a file given by a filename, storing them in a given array fragment. * * @param filename a filename. * @param array an array which will be filled with data from the specified file. * @param offset the index of the first element of {@code array} to be filled. * @param length the number of elements of {@code array} to be filled. * @return the number of elements actually read from the given file (it might be less than {@code length} if the file is too short). */ public static int loadInts(final CharSequence filename, final int[] array, final int offset, final int length) throws IOException { return loadInts(new File(filename.toString()), array, offset, length); } /** Loads elements from a file given by a {@link File} object, storing them in a given array.
/** Loads elements from a file given by a filename, storing them in a given big-array fragment. * * @param filename a filename. * @param array a big array which will be filled with data from the specified file. * @param offset the index of the first element of {@code array} to be filled. * @param length the number of elements of {@code array} to be filled. * @return the number of elements actually read from the given file (it might be less than {@code length} if the file is too short). */ public static long loadInts(final CharSequence filename, final int[][] array, final long offset, final long length) throws IOException { return loadInts(new File(filename.toString()), array, offset, length); } /** Loads elements from a file given by a {@link File} object, storing them in a given array.
/** Loads elements from a file given by a {@link File} object, storing them in a given array fragment. * * @param file a file. * @param array an array which will be filled with data from the specified file. * @param offset the index of the first element of {@code array} to be filled. * @param length the number of elements of {@code array} to be filled. * @return the number of elements actually read from the given file (it might be less than {@code length} if the file is too short). */ public static int loadInts(final File file, final int[] array, final int offset, final int length) throws IOException { final BufferedReader reader = new BufferedReader(new FileReader(file)); final int result = loadInts(reader, array, offset, length); reader.close(); return result; } /** Loads elements from a file given by a filename, storing them in a given array fragment.
/** Loads elements from a file given by a {@link File} object, storing them in a given big-array fragment. * * @param file a file. * @param array a big array which will be filled with data from the specified file. * @param offset the index of the first element of {@code array} to be filled. * @param length the number of elements of {@code array} to be filled. * @return the number of elements actually read from the given file (it might be less than {@code length} if the file is too short). */ public static long loadInts(final File file, final int[][] array, final long offset, final long length) throws IOException { final BufferedReader reader = new BufferedReader(new FileReader(file)); final long result = loadInts(reader, array, offset, length); reader.close(); return result; } /** Loads elements from a file given by a filename, storing them in a given big-array fragment.
/** Loads elements from a file given by a {@link File} object, storing them in a given array. * * @param file a file. * @param array a big array which will be filled with data from the specified file. * @return the number of elements actually read from the given file (it might be less than the array length if the file is too short). */ public static long loadInts(final File file, final int[][] array) throws IOException { return loadInts(file, array, 0, it.unimi.dsi.fastutil.ints.IntBigArrays.length(array)); } /** Loads elements from a file given by a filename, storing them in a given array.
/** Loads elements from a given buffered reader, storing them in a given array. * * @param reader a buffered reader. * @param array a big array which will be filled with data from {@code reader}. * @return the number of elements actually read from {@code reader} (it might be less than the array length if {@code reader} ends). */ public static long loadInts(final BufferedReader reader, final int[][] array) throws IOException { return loadInts(reader, array, 0, it.unimi.dsi.fastutil.ints.IntBigArrays.length(array)); } /** Loads elements from a file given by a {@link File} object, storing them in a given big-array fragment.
/** Loads elements from a file given by a filename, storing them in a given array. * * @param filename a filename. * @param array a big array which will be filled with data from the specified file. * @return the number of elements actually read from the given file (it might be less than the array length if the file is too short). */ public static long loadInts(final CharSequence filename, final int[][] array) throws IOException { return loadInts(filename, array, 0, it.unimi.dsi.fastutil.ints.IntBigArrays.length(array)); } /** Stores a big-array fragment to a given print stream.
final int[] f = new int[n]; final long loaded; if (ascii) loaded = TextIO.loadInts(map, f); else loaded = BinIO.loadInts(map, f); if (graph0IsLabelled) LOGGER.warn(notForLabelled); final int[] f = new int[graph[0].numNodes()]; if (ascii) TextIO.loadInts(map, f); else BinIO.loadInts(map, f); result = map(graph[0], hostByHostGrayCodePermutation(graph[0], f, true)); if (graph0IsLabelled) LOGGER.warn(notForLabelled); final int[] f = new int[graph[0].numNodes()]; if (ascii) TextIO.loadInts(map, f); else BinIO.loadInts(map, f); BinIO.storeInts(hostByHostGrayCodePermutation(graph[0], f, true), param[1]); if (graph0IsLabelled) LOGGER.warn(notForLabelled); final int[] f = new int[graph[0].numNodes()]; if (ascii) TextIO.loadInts(map, f); else BinIO.loadInts(map, f); result = map(graph[0], hostByHostGrayCodePermutation(graph[0], f, false)); if (graph0IsLabelled) LOGGER.warn(notForLabelled); final int[] f = new int[graph[0].numNodes()]; if (ascii) TextIO.loadInts(map, f); else BinIO.loadInts(map, f); BinIO.storeInts(hostByHostGrayCodePermutation(graph[0], f, false), param[1]);