A fuzzy logic C++ library
Robustness and error handling


Error checking

Every public function that needs user input checks by default that the given input value is correct. For example, if you have a membership function 'mf' that is defined by 3 points, and you make the following call:


then an error will be generated (see below).

This behaviour can be changed by compiling the library with the symbol SLIFIS_NO_CHECKING defined globally (see Build options). This might (?) speed up processing, but of course can lead to unexplained crashes, so be cautious.

For the error messages, they are generated from the slifis::EN_ERRMSG value passed to the error handler.

Error handling

In case of detected error, an error message will be written to logfile, and an exception of class ERROR_HANDLER will be thrown. Execution will halt if user code does not catch it.

This is wrapped by macros: SLIFIS_ERROR, SLIFIS_ERROR_1, SLIFIS_ERROR_2 (see file error_handler.hpp)