@Override public float[] toFloatArray() { synchronized (sync) { return collection.toFloatArray(); } } @Override
@Override public float[] toFloatArray() { return collection.toFloatArray(); } /*
/** * Creates a queue using the elements in a type-specific collection using a * given comparator. * * <p> * This constructor is more efficient than enqueing the elements of * {@code collection} one by one. * * @param collection * a collection; its elements will be used to initialize the queue. * @param c * the comparator used in this queue, or {@code null} for the natural * order. */ public FloatHeapPriorityQueue(final FloatCollection collection, final FloatComparator c) { this(collection.toFloatArray(), c); } /**
private static void convertSparseFloatModel(Configuration conf, FSDataOutputStream output, String modelInputDir, ModelLineConvert lineConvert) throws IOException { Int2FloatOpenHashMap[] data = ModelLoader.loadToFloatMaps(modelInputDir, conf); for (int i = 0; i < data.length; i++) { Int2FloatOpenHashMap row = data[i]; data[i] = null; if (row == null) { continue; } lineConvert.convertRowIndex(output, i); int[] indexes = row.keySet().toIntArray(); float[] values = row.values().toFloatArray(); row = null; Sort.quickSort(indexes, values, 0, indexes.length - 1); for (int j = 0; j < indexes.length; j++) { lineConvert.convertFloat(output, indexes[j], values[j]); } } }