Go to the previous, next section.

## FlFSetLR -- Fuzzy set with L and R functions

### SYNOPSIS

`#include <FuzzyLib/FSetLR.h>`

### TYPE

`Fl_FSETLR`

### BASE CLASSES

FlFSet

### DERIVED CLASSES

FlFSetTrapez

### RELATED CLASSES

None

### DESCRIPTION

`FlFSetLR` provides the LR-representation of fuzzy sets. At this representation, the interval [xm1, xm2] is considered to have the maximum membership value ( 1 if normalized ), the left (L) and right (R) approach is described by a shape function. Additionally, a left (alpha) and a right (beta) slope is defined, thus the whole membership function is:
L ( (xm1 - x) / alpha ) for x <= xm1
max (1 if normalized) for xm1 <= x <= xm2
R ( (x - xm2) / beta ) for x >= xm2

Constructors:

`FlFSetLR();`
`FlFSetLR(FlParam *param);`
`FlFSetLR(double xm1, double xm2, double xalpha, double xbeta, FlFuncType fL, FlFuncType fR);`
`FlFSetLR(double min, double max, double xm1, double xm2, double xalpha, double xbeta,`
`FlFuncType fL, FlFuncType fR);`
`FlFSetLR(FlStringR xname, double min, double max, double xm1, double xm2`
`double xalpha, double xbeta, FlFuncType fL, FlFuncType fR);`
`FlFSetLR(FlStringR xname, double xm1, double xm2, double xalpha, double xbeta,`
`FlFuncType fL, FlFuncType fR);`

  Initializes `FlFSetLR`. The possible variables and their default values are:
  left/right maximum `(xm1,xm2)` (0,0), the left/right slope `(alpha,beta)` (0,0), the left/right function `(fL,fR)` (FlFuncLin,FlFuncLin) and the values for the named `FlFSet` `xname,min,max` with the according default settings of that class.

In addition to the member functions required by FuzzyLib, `FlFSetLR` provides:

`typedef double (*FlFuncType)(double x);`
  Function pointer to the functions for L/R use. Implemented functions are:
`double FlFuncExp (double x);`
  exp(-x)
`double FlFuncExp2(double x);`
  exp(-x^2)
`double FlFuncLin (double x);`
  1-x
`double FlFuncSqr (double x);`
  1-x^2
`double FlFuncHyp (double x);`
  1/(1+x)
`double FlFuncHyp2(double x);`
  1/(1+x^2)

`virtual double get_membership(double x) const;`
  Gets the membership values for `x`.

`double get_m1() const;`
  Returns the value `m1` (left maximum).

`double get_m2() const;`
  Returns the value `m2` (right maximum).

`double get_alpha() const;`
  Returns the value `alpha` (left slope).

`double get_beta() const;`
  Returns the value `beta` (right slope).

Go to the previous, next section.