Дипломная работа: Исполняемое Win32 приложение
#endif
#ifndef MIN
# define MIN(x,y) ( (x) < (y) ? (x) : (y) )
#endif
CFuzzy_::CFuzzy_()
{
}
CFuzzy_::~CFuzzy_()
{
}
/* Triangular membership function */
double CFuzzy_::fisTriangleMf(double x, double *params)
{
double a = params[0], b = params[1], c = params[2];
if (a>b)
{fisError("Illegal parameters in fisTriangleMf() --> a > b");return -1;}
if (b>c)
{fisError("Illegal parameters in fisTriangleMf() --> b > c");return -1;}
if (a == b && b == c)
return(x == a);
if (a == b)
return((c-x)/(c-b)*(b<=x)*(x<=c));
if (b == c)
return((x-a)/(b-a)*(a<=x)*(x<=b));
return(MAX(MIN((x-a)/(b-a), (c-x)/(c-b)), 0));
}
/* Trapezpoidal membership function */
double CFuzzy_::fisTrapezoidMf(double x, double *params)
{