@Override public <P_IN> Node<Double> opEvaluateParallel(PipelineHelper<Double> helper, Spliterator<P_IN> spliterator, IntFunction<Double[]> generator) { if (StreamOpFlag.SORTED.isKnown(helper.getStreamAndOpFlags())) { return helper.evaluate(spliterator, false, generator); } else { Node.OfDouble n = (Node.OfDouble) helper.evaluate(spliterator, true, generator); double[] content = n.asPrimitiveArray(); java8.util.J8Arrays.parallelSort(content); return Nodes.node(content); } } }
@Override public <P_IN> Node<Double> opEvaluateParallel(PipelineHelper<Double> helper, Spliterator<P_IN> spliterator, IntFunction<Double[]> generator) { if (StreamOpFlag.SORTED.isKnown(helper.getStreamAndOpFlags())) { return helper.evaluate(spliterator, false, generator); } else { Node.OfDouble n = (Node.OfDouble) helper.evaluate(spliterator, true, generator); double[] content = n.asPrimitiveArray(); java8.util.J8Arrays.parallelSort(content); return Nodes.node(content); } } }
/** * {@inheritDoc} * * <p><b>Implementation Requirements:</b><br> the default implementation invokes {@link Node.OfDouble#asPrimitiveArray()} * to obtain a double[] array then and copies the elements from that * double[] array into the boxed Double[] array. This is not efficient * and it is recommended to invoke {@link #copyInto(Object, int)}. */ static void copyInto(Node.OfDouble this_, Double[] boxed, int offset) { double[] array = this_.asPrimitiveArray(); for (int i = 0; i < array.length; i++) { boxed[offset + i] = array[i]; } }
/** * {@inheritDoc} * * <p><b>Implementation Requirements:</b><br> the default implementation invokes {@link Node.OfDouble#asPrimitiveArray()} * to obtain a double[] array then and copies the elements from that * double[] array into the boxed Double[] array. This is not efficient * and it is recommended to invoke {@link #copyInto(Object, int)}. */ static void copyInto(Node.OfDouble this_, Double[] boxed, int offset) { double[] array = this_.asPrimitiveArray(); for (int i = 0; i < array.length; i++) { boxed[offset + i] = array[i]; } }
@Override public final double[] toArray() { return Nodes.flattenDouble((Node.OfDouble) evaluateToArrayNode(WhileOps.DOUBLE_ARR_GEN)) .asPrimitiveArray(); }
@Override public final double[] toArray() { return Nodes.flattenDouble((Node.OfDouble) evaluateToArrayNode(WhileOps.DOUBLE_ARR_GEN)) .asPrimitiveArray(); }