Example usage for java.util.stream DoubleStream iterate

List of usage examples for java.util.stream DoubleStream iterate

Introduction

In this page you can find the example usage for java.util.stream DoubleStream iterate.

Prototype

public static DoubleStream iterate(final double seed, final DoubleUnaryOperator f) 

Source Link

Document

Returns an infinite sequential ordered DoubleStream produced by iterative application of a function f to an initial element seed , producing a Stream consisting of seed , f(seed) , f(f(seed)) , etc.

Usage

From source file:Main.java

public static void main(String[] args) {
    DoubleStream i = DoubleStream.iterate(1.2, d -> d * d);
    i.limit(3).forEach(System.out::println);
}

From source file:pl.umk.lgorski.Equation.java

public double[] initialConditions() {
    return DoubleStream.iterate(2, x -> x).limit(getDimension()).toArray();
}