Loadable Function: res = fl_compose(A, B)
Loadable Function: res = fl_compose(A, B, LOCK)
Loadable Function: res = fl_compose(A, B, T)
Loadable Function: res = fl_compose(A, B, T, S)
Loadable Function: res = fl_compose(A, B, LOCK, T)
Returns the T-Norm / S-Norm composition as basic inference mechanism of Fuzzy Logic. By default, it calculates the max-min composition.
A and B must be matrices with conformant dimensions as in matrix product. If they are both full matrices or mixed (one full and one sparse), a full matrix will be returned. If they are both sparse matrices, a sparse matrix will be returned. However the best computation method (sparse or full) is optimally chosen at runtime.
When true, the boolean LOCK option forces to calculate the diagonal results only and returns it as a column vector.
The arguments T and S allows to specify a custom T-Norm and S-Norm function respectively. They can be:
Note that only the predefined functions are calculated rapidly and in multithread mode. Using a user-defined function as T-Norm and/or S-Norm will result in a long time calculation.
- 'min': use the minimum function (default for T-Norm);
- 'prod': use the product function;
- 'max': use the maximum function (default for S-Norm);
- 'sum': use the probabilistic sum function;
- function_handle: a user-defined function (at most 2 arguments).
Furthermore, no check is performed to be sure the provided functions have the T-Norm or S-Norm properties. The results will be correct as expected, but the semantic correctness is only a user responsibility.