liba 0.1.15
An algorithm library based on C/C++
 
Loading...
Searching...
No Matches
fuzzy.h
Go to the documentation of this file.
1
5
6#ifndef LIBA_FUZZY_H
7#define LIBA_FUZZY_H
8
9#include "a.h"
10
16
17#if defined(__cplusplus)
18extern "C" {
19#endif /* __cplusplus */
20#if defined(LIBA_FUZZY_C)
21#undef A_INTERN
22#define A_INTERN A_INLINE
23#endif /* LIBA_FUZZY_C */
24
30#if !defined A_HAVE_INLINE || defined(LIBA_FUZZY_C)
32#endif /* A_HAVE_INLINE */
33#if defined(A_HAVE_INLINE) || defined(LIBA_FUZZY_C)
34A_INTERN a_real a_fuzzy_not(a_real x) { return 1 - x; }
35#endif /* A_HAVE_INLINE */
36
43#if !defined A_HAVE_INLINE || defined(LIBA_FUZZY_C)
45#endif /* A_HAVE_INLINE */
46#if defined(A_HAVE_INLINE) || defined(LIBA_FUZZY_C)
47A_INTERN a_real a_fuzzy_cap(a_real a, a_real b) { return A_MIN(a, b); }
48#endif /* A_HAVE_INLINE */
49
56#if !defined A_HAVE_INLINE || defined(LIBA_FUZZY_C)
58#endif /* A_HAVE_INLINE */
59#if defined(A_HAVE_INLINE) || defined(LIBA_FUZZY_C)
60A_INTERN a_real a_fuzzy_cap_algebra(a_real a, a_real b) { return a * b; }
61#endif /* A_HAVE_INLINE */
62
69#if !defined A_HAVE_INLINE || defined(LIBA_FUZZY_C)
71#endif /* A_HAVE_INLINE */
72#if defined(A_HAVE_INLINE) || defined(LIBA_FUZZY_C)
74{
75 a_real const c = a + b - 1;
76 return A_MAX(c, 0);
77}
78#endif /* A_HAVE_INLINE */
79
86#if !defined A_HAVE_INLINE || defined(LIBA_FUZZY_C)
88#endif /* A_HAVE_INLINE */
89#if defined(A_HAVE_INLINE) || defined(LIBA_FUZZY_C)
90A_INTERN a_real a_fuzzy_cup(a_real a, a_real b) { return A_MAX(a, b); }
91#endif /* A_HAVE_INLINE */
92
99#if !defined A_HAVE_INLINE || defined(LIBA_FUZZY_C)
101#endif /* A_HAVE_INLINE */
102#if defined(A_HAVE_INLINE) || defined(LIBA_FUZZY_C)
103A_INTERN a_real a_fuzzy_cup_algebra(a_real a, a_real b) { return a + b - a * b; }
104#endif /* A_HAVE_INLINE */
105
112#if !defined A_HAVE_INLINE || defined(LIBA_FUZZY_C)
114#endif /* A_HAVE_INLINE */
115#if defined(A_HAVE_INLINE) || defined(LIBA_FUZZY_C)
117{
118 a_real const c = a + b;
119 return A_MIN(c, 1);
120}
121#endif /* A_HAVE_INLINE */
122
130
138A_EXTERN a_real a_fuzzy_equ_(a_real gamma, a_real a, a_real b);
139
140#if defined(LIBA_FUZZY_C)
141#undef A_INTERN
142#define A_INTERN static A_INLINE
143#endif /* LIBA_FUZZY_C */
144#if defined(__cplusplus)
145} /* extern "C" */
146#endif /* __cplusplus */
147
149
150#endif /* a/fuzzy.h */
algorithm library
a_real a_fuzzy_cup_bounded(a_real a, a_real b)
bounded sum operator
a_real a_fuzzy_cap_bounded(a_real a, a_real b)
bounded product operator
a_real a_fuzzy_cup(a_real a, a_real b)
fuzzy union operator
a_real a_fuzzy_cup_algebra(a_real a, a_real b)
algebraic sum operator
a_real a_fuzzy_equ(a_real a, a_real b)
equilibrium operator
a_real a_fuzzy_equ_(a_real gamma, a_real a, a_real b)
equilibrium operator
a_real a_fuzzy_cap(a_real a, a_real b)
fuzzy intersection operator
a_real a_fuzzy_not(a_real x)
complementary operator
a_real a_fuzzy_cap_algebra(a_real a, a_real b)
algebraic product operator
double a_real
compiler built-in floating-point number type
Definition a.h:1003
#define A_MIN(x, y)
minimum value between x and y
Definition a.h:1062
#define A_MAX(x, y)
maximum value between x and y
Definition a.h:1067