/** * Produces an array containing cumulative results of applying the * accumulation function going left to right using given seed value. * * <p> * This is a terminal operation. * * <p> * For parallel stream it's not guaranteed that accumulator will always be * executed in the same thread. * * <p> * This method cannot take all the advantages of parallel streams as it must * process elements strictly left to right. * * @param seed the starting value * @param accumulator a * <a href="package-summary.html#NonInterference">non-interfering * </a>, <a href="package-summary.html#Statelessness">stateless</a> * function for incorporating an additional element into a result * @return the array where the first element is the seed and every successor * element is the result of applying accumulator function to the * previous array element and the corresponding stream element. The * resulting array is one element longer than this stream. * @see #foldLeft(double, DoubleBinaryOperator) * @since 0.5.1 */ public double[] scanLeft(double seed, DoubleBinaryOperator accumulator) { return prepend(seed).scanLeft(accumulator); }