13 @addtogroup A_FUZZY fuzzy operator
17 #if defined(__cplusplus)
19 #endif /* __cplusplus */
20 #if defined(LIBA_FUZZY_C)
22 #define A_INTERN A_INLINE
23 #endif /* LIBA_FUZZY_C */
26 @brief complementary operator
27 @param[in] x membership
30 #if !defined A_HAVE_INLINE || defined(LIBA_FUZZY_C)
31 A_EXTERN a_float
a_fuzzy_not(a_float x
);
32 #endif /* A_HAVE_INLINE */
33 #if defined(A_HAVE_INLINE) || defined(LIBA_FUZZY_C)
34 A_INTERN a_float
a_fuzzy_not(a_float x
) { return 1 - x
; }
35 #endif /* A_HAVE_INLINE */
38 @brief fuzzy intersection operator
39 @param[in] a left-hand operand
40 @param[in] b right-hand operand
41 @return = \f$ \min(a,b) \f$
43 #if !defined A_HAVE_INLINE || defined(LIBA_FUZZY_C)
44 A_EXTERN a_float
a_fuzzy_cap(a_float a
, a_float b
);
45 #endif /* A_HAVE_INLINE */
46 #if defined(A_HAVE_INLINE) || defined(LIBA_FUZZY_C)
47 A_INTERN a_float
a_fuzzy_cap(a_float a
, a_float b
) { return A_MIN(a
, b
); }
48 #endif /* A_HAVE_INLINE */
51 @brief algebraic product operator
52 @param[in] a left-hand operand
53 @param[in] b right-hand operand
56 #if !defined A_HAVE_INLINE || defined(LIBA_FUZZY_C)
57 A_EXTERN a_float
a_fuzzy_cap_algebra(a_float a
, a_float b
);
58 #endif /* A_HAVE_INLINE */
59 #if defined(A_HAVE_INLINE) || defined(LIBA_FUZZY_C)
60 A_INTERN a_float
a_fuzzy_cap_algebra(a_float a
, a_float b
) { return a
* b
; }
61 #endif /* A_HAVE_INLINE */
64 @brief bounded product operator
65 @param[in] a left-hand operand
66 @param[in] b right-hand operand
67 @return = \f$ \max(a+b-1,0) \f$
69 #if !defined A_HAVE_INLINE || defined(LIBA_FUZZY_C)
70 A_EXTERN a_float
a_fuzzy_cap_bounded(a_float a
, a_float b
);
71 #endif /* A_HAVE_INLINE */
72 #if defined(A_HAVE_INLINE) || defined(LIBA_FUZZY_C)
73 A_INTERN a_float
a_fuzzy_cap_bounded(a_float a
, a_float b
)
75 a_float
const c
= a
+ b
- 1;
78 #endif /* A_HAVE_INLINE */
81 @brief fuzzy union operator
82 @param[in] a left-hand operand
83 @param[in] b right-hand operand
84 @return = \f$ \max(a,b) \f$
86 #if !defined A_HAVE_INLINE || defined(LIBA_FUZZY_C)
87 A_EXTERN a_float
a_fuzzy_cup(a_float a
, a_float b
);
88 #endif /* A_HAVE_INLINE */
89 #if defined(A_HAVE_INLINE) || defined(LIBA_FUZZY_C)
90 A_INTERN a_float
a_fuzzy_cup(a_float a
, a_float b
) { return A_MAX(a
, b
); }
91 #endif /* A_HAVE_INLINE */
94 @brief algebraic sum operator
95 @param[in] a left-hand operand
96 @param[in] b right-hand operand
97 @return = \f$ a+b-ab \f$
99 #if !defined A_HAVE_INLINE || defined(LIBA_FUZZY_C)
100 A_EXTERN a_float
a_fuzzy_cup_algebra(a_float a
, a_float b
);
101 #endif /* A_HAVE_INLINE */
102 #if defined(A_HAVE_INLINE) || defined(LIBA_FUZZY_C)
103 A_INTERN a_float
a_fuzzy_cup_algebra(a_float a
, a_float b
) { return a
+ b
- a
* b
; }
104 #endif /* A_HAVE_INLINE */
107 @brief bounded sum operator
108 @param[in] a left-hand operand
109 @param[in] b right-hand operand
110 @return = \f$ \min(a+b,1) \f$
112 #if !defined A_HAVE_INLINE || defined(LIBA_FUZZY_C)
113 A_EXTERN a_float
a_fuzzy_cup_bounded(a_float a
, a_float b
);
114 #endif /* A_HAVE_INLINE */
115 #if defined(A_HAVE_INLINE) || defined(LIBA_FUZZY_C)
116 A_INTERN a_float
a_fuzzy_cup_bounded(a_float a
, a_float b
)
118 a_float
const c
= a
+ b
;
121 #endif /* A_HAVE_INLINE */
124 @brief equilibrium operator
125 @param[in] a left-hand operand
126 @param[in] b right-hand operand
127 @return = \f$ \sqrt{ab}\sqrt{1-(1-a)(1-b)} \f$
129 A_EXTERN a_float
a_fuzzy_equ(a_float a
, a_float b
);
132 @brief equilibrium operator
133 @param[in] gamma gamma operator
134 @param[in] a left-hand operand
135 @param[in] b right-hand operand
136 @return = \f$ (ab)^{1-\gamma}(1-(1-a)(1-b))^{\gamma} \f$
138 A_EXTERN a_float
a_fuzzy_equ_(a_float gamma
, a_float a
, a_float b
);
140 #if defined(LIBA_FUZZY_C)
142 #define A_INTERN static A_INLINE
143 #endif /* LIBA_FUZZY_C */
144 #if defined(__cplusplus)
146 #endif /* __cplusplus */
150 #endif /* a/fuzzy.h */