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.core.util; samer@0: samer@0: /** samer@0: This class maps a given interval of real numbers samer@0: to the interval [0,1], returning either the real samer@0: number, or converting it to an integer between 0 samer@0: and a given value (defaults to 256). samer@0: */ samer@0: samer@0: public class LinearMap extends IMap samer@0: { samer@0: public LinearMap() { this(0.0,1.0,256); } samer@0: public LinearMap(int m) { this(0.0,1.0,m); } samer@0: public LinearMap(double t1, double t2) { this(t1,t2,256); } samer@0: public LinearMap(double t1, double t2, int m) { setDomain(t1,t2); setIntRange(m); } samer@0: } samer@0: samer@0: samer@0: samer@0: samer@0: samer@0: samer@0: samer@0: