Mercurial > hg > jslab
view src/samer/maths/FunctionOfGenerator.java @ 0:bf79fb79ee13
Initial Mercurial check in.
author | samer |
---|---|
date | Tue, 17 Jan 2012 17:50:20 +0000 |
parents | |
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()); } }