00001 /* 00002 * lib/numerics/noise.h 00003 * 00004 * Noise template base class. 00005 * 00006 * Copyright (c) 2004 by Wolfgang Wieser ] wwieser (a) gmx <*> de [. 00007 * 00008 * This file may be distributed and/or modified under the terms of the 00009 * GNU General Public License version 2 as published by the Free Software 00010 * Foundation. (See COPYING.GPL for details.) 00011 * 00012 * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 00013 * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 00014 * 00015 */ 00016 00017 #ifndef _LIB_NUMERICS_NOISE_NOISE_H_ 00018 #define _LIB_NUMERICS_NOISE_NOISE_H_ 1 00019 00027 #include <lib/sconfig.h> 00028 #include <lib/numerics/num_math.h> 00029 00030 namespace NUM // numerics 00031 { 00032 00044 template<typename T>class NoiseGenerator_Base 00045 { 00046 public: 00047 NoiseGenerator_Base() {} 00048 virtual ~NoiseGenerator_Base() {} 00049 00054 virtual T noise1(T) const 00055 { return(0.5); } 00056 00064 virtual T noise2(const T *p) const 00065 { return(0.5); } 00066 00074 virtual T noise3(const T *p) const 00075 { return(0.5); } 00076 00078 inline T noise2(T x,T y) const 00079 { T tmp[2]={x,y}; return(noise2(tmp)); } 00080 00082 inline T noise3(T x,T y,T z) const 00083 { T tmp[3]={x,y,z}; return(noise3(tmp)); } 00084 }; 00085 00086 } // end of namespace NUM 00087 00088 #endif /* _LIB_NUMERICS_NOISE_NOISE_H_ */