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
6#ifndef LIBA_FUZZY_H
7#define LIBA_FUZZY_H
8
9#include "a.h"
10
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_float a_fuzzy_not(a_float 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_float a_fuzzy_cap(a_float a, a_float 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_float a_fuzzy_cap_algebra(a_float a, a_float 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_float 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_float a_fuzzy_cup(a_float a, a_float 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_float a_fuzzy_cup_algebra(a_float a, a_float 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_float const c = a + b;
119 return A_MIN(c, 1);
120}
121#endif /* A_HAVE_INLINE */
122
130
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
150#endif /* a/fuzzy.h */
algorithm library
#define a_float
Definition a.h:785
double a_fuzzy_cup(double a, double b)
fuzzy union operator
double a_fuzzy_equ(double a, double b)
equilibrium operator
double a_fuzzy_cup_algebra(double a, double b)
algebraic sum operator
double a_fuzzy_cup_bounded(double a, double b)
bounded sum operator
double a_fuzzy_cap_bounded(double a, double b)
bounded product operator
double a_fuzzy_equ_(double gamma, double a, double b)
equilibrium operator
double a_fuzzy_not(double x)
complementary operator
double a_fuzzy_cap(double a, double b)
fuzzy intersection operator
double a_fuzzy_cap_algebra(double a, double b)
algebraic product operator
#define A_MIN(x, y)
minimum value between x and y
Definition a.h:844
#define A_MAX(x, y)
maximum value between x and y
Definition a.h:849