gfuzzylogic.h

来自「一个非常有用的开源代码」· C头文件 代码 · 共 21 行

H
21
字号
#ifndef __GFUZZYLOGIC_H__#define __GFUZZYLOGIC_H__class GFuzzyLogic{public:	// Computes the fuzzy NOT of a value between 0 and 1	inline static double Not(double a) { return 1.0 - a; }	// Computes the fuzzy AND of two values between 0 and 1	inline static double And(double a, double b) { return a * b; }	// Computes the fuzzy OR of two values between 0 and 1	inline static double Or(double a, double b) { return 1.0 - ((1.0 - a) * (1.0 - b)); }	// Computes the fuzzy XOR of two values between 0 and 1	inline static double Xor(double a, double b) { return (a + b - a * b) * (1.0 - a * b); }};#endif // __GFUZZYLOGIC_H__

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?