samer@0: /* samer@0: * Function.java 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: /** samer@0: * Defines a real-valued function of a single real variable. samer@0: * samer@0: */ samer@0: samer@0: public abstract class Function samer@0: { samer@0: public abstract double apply(double in); samer@0: samer@0: /** apply function to each element of in, placing result in out */ samer@0: public void apply(double [] in, double [] out) { samer@0: for (int i=0; i