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)
22#undef A_INTERN
23#define A_INTERN A_INLINE
25#endif /* LIBA_FUZZY_C */
26
32#if !defined A_HAVE_INLINE || defined(LIBA_FUZZY_C)
34#endif /* A_HAVE_INLINE */
35#if defined(A_HAVE_INLINE) || defined(LIBA_FUZZY_C)
36A_INTERN a_real a_fuzzy_not(a_real x) { return 1 - x; }
37#endif /* A_HAVE_INLINE */
38
45#if !defined A_HAVE_INLINE || defined(LIBA_FUZZY_C)
47#endif /* A_HAVE_INLINE */
48#if defined(A_HAVE_INLINE) || defined(LIBA_FUZZY_C)
49A_INTERN a_real a_fuzzy_cap(a_real a, a_real b) { return A_MIN(a, b); }
50#endif /* A_HAVE_INLINE */
51
58#if !defined A_HAVE_INLINE || defined(LIBA_FUZZY_C)
60#endif /* A_HAVE_INLINE */
61#if defined(A_HAVE_INLINE) || defined(LIBA_FUZZY_C)
62A_INTERN a_real a_fuzzy_cap_algebra(a_real a, a_real b) { return a * b; }
63#endif /* A_HAVE_INLINE */
64
71#if !defined A_HAVE_INLINE || defined(LIBA_FUZZY_C)
73#endif /* A_HAVE_INLINE */
74#if defined(A_HAVE_INLINE) || defined(LIBA_FUZZY_C)
76{
77 a_real const c = a + b - 1;
78 return A_MAX(c, 0);
79}
80#endif /* A_HAVE_INLINE */
81
88#if !defined A_HAVE_INLINE || defined(LIBA_FUZZY_C)
90#endif /* A_HAVE_INLINE */
91#if defined(A_HAVE_INLINE) || defined(LIBA_FUZZY_C)
92A_INTERN a_real a_fuzzy_cup(a_real a, a_real b) { return A_MAX(a, b); }
93#endif /* A_HAVE_INLINE */
94
101#if !defined A_HAVE_INLINE || defined(LIBA_FUZZY_C)
103#endif /* A_HAVE_INLINE */
104#if defined(A_HAVE_INLINE) || defined(LIBA_FUZZY_C)
105A_INTERN a_real a_fuzzy_cup_algebra(a_real a, a_real b) { return a + b - a * b; }
106#endif /* A_HAVE_INLINE */
107
114#if !defined A_HAVE_INLINE || defined(LIBA_FUZZY_C)
116#endif /* A_HAVE_INLINE */
117#if defined(A_HAVE_INLINE) || defined(LIBA_FUZZY_C)
119{
120 a_real const c = a + b;
121 return A_MIN(c, 1);
122}
123#endif /* A_HAVE_INLINE */
124
132
140A_EXTERN a_real a_fuzzy_equ_(a_real gamma, a_real a, a_real b);
141
142#if defined(LIBA_FUZZY_C)
144#undef A_INTERN
145#define A_INTERN static A_INLINE
147#endif /* LIBA_FUZZY_C */
148#if defined(__cplusplus)
149} /* extern "C" */
150#endif /* __cplusplus */
151
153
154#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:1012
#define A_MIN(x, y)
minimum value between x and y
Definition a.h:1071
#define A_MAX(x, y)
maximum value between x and y
Definition a.h:1076