Mercurial > hg > jslab
view src/samer/maths/FunctionOfGenerator.java @ 8:5e3cbbf173aa tip
Reorganise some more
author | samer |
---|---|
date | Fri, 05 Apr 2019 22:41:58 +0100 |
parents | bf79fb79ee13 |
children |
line wrap: on
line source
package samer.maths; public class FunctionOfGenerator implements Generator { Generator g; Function f; public FunctionOfGenerator(Function f, Generator g) { this.f=f; this.g=g; } public double next() { return f.apply(g.next()); } public void next(double [] x) { g.next(x); f.apply(x); } public void dispose() { f.dispose(); g.dispose(); } public String toString() { return f.format(g.toString()); } }