Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   Related Pages  

YagerOp.hpp

00001 #ifndef __YagerOp__
00002 #define __YagerOp__
00003 
00024 #include <stdio.h>
00025 #include <math.h>
00026 
00027 #include "AFuzzyOp.hpp"
00028 
00029 class YagerOp : public AFuzzyOp 
00030 {
00031 private:
00032 
00033 double  q;
00034 
00035 public:
00036 YagerOp(double coeff=1.0){q= coeff;}
00037 virtual ~YagerOp(){}
00038 
00039 
00040 virtual double not(double value){ return pow(1.0 - pow(value,q), 1/q); }
00041 
00042 virtual double and(double v1, double v2)
00043         { 
00044         double val= pow( pow(1.0-v1 ,q) + pow(1.0-v2 ,q),  1/q);
00045 
00046         return (1.0 - ( 1.0 < val ? 1.0 : val ));        
00047         }
00048 
00049 virtual double or(double v1, double v2)
00050         {       
00051         double val= pow( pow(v1, q) + pow(v2, q),  1/q);
00052 
00053         return ( 1.0 < val ? 1.0 : val );
00054         }
00055 
00056 
00057 virtual void report(FILE* file){}
00058 };
00059 
00060 
00061 #endif
SourceForge.net Logo
Restoreinpaint sourceforge project `C++/Java Image Processing, Restoration, Inpainting Project'.

Bernard De Cuyper: Open Project Leader: Concept, design and development.
Bernard De Cuyper & Eddy Fraiha 2002, 2003. Bernard De Cuyper 2004. Open and free, for friendly usage only.
Modifications on Belgium ground of this piece of artistic work, by governement institutions or companies, must be notified to Bernard De Cuyper.
bern_bdc@hotmail.com