Fuzzy Logic Tools  v1.0.5.1
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Macros Pages
Public Member Functions | Protected Attributes | List of all members
FLT::Constmf Class Reference

Constant Membership function. More...

#include <membership.hpp>

Inheritance diagram for FLT::Constmf:
Inheritance graph
[legend]
Collaboration diagram for FLT::Constmf:
Collaboration graph
[legend]

Public Member Functions

double eval (double x) const
 Evaluates the Membership function. More...
 
double evalder (double x) const
 Evaluates the derivative of the Membership function with respect to x, $ d\mu(x) / dx $. More...
 
double paramder (size_t parameter, double x) const
 Evaluates the derivative of the Membership function with respect to a parameter, $ d\mu(x) / dparam $. More...
 
 Constmf (double c=1.0)
 
virtual int test (void) const
 This function checks parameters in the Membership function, and corrects them if possible. More...
 
size_t num_params (void) const
 Reads the number of parameters that define the Membership function. More...
 
TYPE_MF type (void) const
 Returns the type of Membership function. More...
 
int type (TYPE_MF type_mf)
 Changes the Membership function type. More...
 
int edit (size_t index, double value)
 Changes a parameter. More...
 
void edit (const double *const parameters)
 Changes the vector of parameters. More...
 
double read (size_t index) const
 Reads a parameter of the Membership function. More...
 
TNT::Array1D< double > read (void) const
 Returns the vector of parameters.
 

Protected Attributes

double * param
 Vector of parameters that define the Membership function.
 
size_t n
 Number of parameters of the Membership function.
 
TYPE_MF type_mf
 Type of Membership function.
 

Detailed Description

Constant Membership function.

Constmf is a constant Membership function with 1 parameter.
This function always return its parameter.

\[ \mu [c](x) = c, \; 0 \leq c \leq 1 \]

Member Function Documentation

int Membership::edit ( size_t  index,
double  value 
)
inherited

Changes a parameter.

Returns
Returns 0 if no errors occurred.
An error means the index value is greater than the number of function parameters.
Note
The parameter value is not checked. If you want to check it, you must use Membership::test method.
void Membership::edit ( const double *const  parameters)
inherited

Changes the vector of parameters.

Note
The values of the parameters are not checked. If you want to check it, you must use Membership::test method.
double Constmf::eval ( double  x) const
virtual

Evaluates the Membership function.

Remarks
You must first ensure that the function is not Anymf.

Implements FLT::Membership.

double Constmf::evalder ( double  x) const
virtual

Evaluates the derivative of the Membership function with respect to x, $ d\mu(x) / dx $.

Remarks
You must first ensure that the function is not Anymf.

Implements FLT::Membership.

size_t Membership::num_params ( void  ) const
inherited

Reads the number of parameters that define the Membership function.

We recommend using this function instead of the constant FLT::MF_PARAM_NUMBER, since it is possible to create Membership functions with a variable number of parameters.

Examples:
matlab_utilities/fuzderantec.cpp.
double Constmf::paramder ( size_t  parameter,
double  x 
) const
virtual

Evaluates the derivative of the Membership function with respect to a parameter, $ d\mu(x) / dparam $.

Remarks
You must first ensure that the function is not Anymf.

Implements FLT::Membership.

double Membership::read ( size_t  index) const
inherited

Reads a parameter of the Membership function.

Returns
If index is greater than the number of function parameters, an error is sent to the standard error stream and return 0.
int Membership::test ( void  ) const
virtualinherited

This function checks parameters in the Membership function, and corrects them if possible.

Returns
Returns 0 if no errors, 1 if an error occurs, and -1 if the parameters were corrected.

Reimplemented in FLT::Trimf, FLT::Trapmf, FLT::GBellmf, FLT::Gauss2mf, and FLT::Gaussmf.

TYPE_MF Membership::type ( void  ) const
inherited

Returns the type of Membership function.

The type of Membership function is represented with the enumeration FLT::TYPE_MF.

Examples:
matlab_utilities/fuzcomb.cpp, and matlab_utilities/fuzderantec.cpp.
int Membership::type ( TYPE_MF  type_mf)
inherited

Changes the Membership function type.

Returns
Returns 0 if no errors occurred.
An error means the type of Membership function is not recognized.
Note
The parameters of the new Membership function are not assigned, you must do so by Membership::edit method.

The documentation for this class was generated from the following files: