Go to the previous, next section.

## FlFSetArray -- Fuzzy set based on array with membership values

### SYNOPSIS

`#include <FuzzyLib/FSetArray.h>`

### TYPE

`Fl_FSETARRAY`

### BASE CLASSES

FlFSet

### DERIVED CLASSES

None

### RELATED CLASSES

None

### DESCRIPTION

This class realizes a fuzzy set as an array. The array is containing the membership values and the index is its corrosponding x-value. Thus membership values of non-integers are interpolated.

Constructors:

`FlFSetArray();`
`FlFSetArray(FlParam *param);`
`FlFSetArray(size_t sz, double min, double max);`
  Initializes `FlFSetArray`.

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

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

`virtual double center_of_gravity(double min, double max)const;`
  Computes the center of gravity.

`double get(int i) const;`
  Gets the value from the array.

`void put(int i, double x);`
  Puts value `x` into array at position `i`.

`double &operator [] (int i);`
  Provides the direct access to the internal array.

`int get_n() const;`
  Returns the size of the array.

Go to the previous, next section.