1 /*
2  fuzzylite (R), a fuzzy logic control library in C++.
3  Copyright (C) 2010-2017 FuzzyLite Limited. All rights reserved.
4  Author: Juan Rada-Vilela, Ph.D. <jcrada@fuzzylite.com>
5 
6  This file is part of fuzzylite.
7 
8  fuzzylite is free software: you can redistribute it and/or modify it under
9  the terms of the FuzzyLite License included with the software.
10 
11  You should have received a copy of the FuzzyLite License along with
12  fuzzylite. If not, see <http://www.fuzzylite.com/license/>.
13 
14  fuzzylite is a registered trademark of FuzzyLite Limited.
15  */
16 
17 #ifndef FL_DRASTICPRODUCT_H
18 #define FL_DRASTICPRODUCT_H
19 
20 #include "fl/norm/TNorm.h"
21 
22 namespace fl {
23 
24     /**
25       The DrasticProduct class is a TNorm that computes the drastic product of
26       any two values.
27 
28       @author Juan Rada-Vilela, Ph.D.
29       @see DrasticSum
30       @see TNorm
31       @see TNormFactory
32       @see Norm
33       @since 4.0
34      */
35     class FL_API DrasticProduct FL_IFINAL : public TNorm {
36     public:
37         std::string className() const FL_IOVERRIDE;
38 
39         Complexity complexity() const FL_IOVERRIDE;
40         /**
41           Computes the drastic product of two membership function values
42           @param a is a membership function value
43           @param b is a membership function value
44           @return @f$\begin{cases}
45           \min(a,b) & \mbox{if $\max(a,b)=1$} \cr
46           0 & \mbox{otherwise}
47           \end{cases}@f$
48          */
49         scalar compute(scalar a, scalar b) const FL_IOVERRIDE;
50         DrasticProduct* clone() const FL_IOVERRIDE;
51 
52         static TNorm* constructor();
53     };
54 }
55 #endif  /* FL_DRASTICPRODUCT_H */
56