samer@0: /* samer@0: * Copyright (c) 2000, Samer Abdallah, King's College London. samer@0: * All rights reserved. samer@0: * samer@0: * This software is provided AS iS and WITHOUT ANY WARRANTY; samer@0: * without even the implied warranty of MERCHANTABILITY or samer@0: * FITNESS FOR A PARTICULAR PURPOSE. samer@0: */ samer@0: samer@0: package samer.maths; samer@0: samer@0: public class Product implements Generator samer@0: { samer@0: Generator g1, g2; samer@0: samer@0: public Product( Generator g1, Generator g2) { this.g1=g1; this.g2=g2; } samer@0: samer@0: public void dispose() { g1.dispose(); g2.dispose(); } samer@0: public double next() { return g1.next()*g2.next(); } samer@0: public void next(double [] x) { samer@0: g1.next(x); samer@0: for (int i=0; i