diff options
Diffstat (limited to 'fuzzylite/fl/norm/s')
-rw-r--r-- | fuzzylite/fl/norm/s/AlgebraicSum.h | 49 | ||||
-rw-r--r-- | fuzzylite/fl/norm/s/BoundedSum.h | 45 | ||||
-rw-r--r-- | fuzzylite/fl/norm/s/DrasticSum.h | 50 | ||||
-rw-r--r-- | fuzzylite/fl/norm/s/EinsteinSum.h | 46 | ||||
-rw-r--r-- | fuzzylite/fl/norm/s/HamacherSum.h | 46 | ||||
-rw-r--r-- | fuzzylite/fl/norm/s/Maximum.h | 46 | ||||
-rw-r--r-- | fuzzylite/fl/norm/s/NilpotentMaximum.h | 47 | ||||
-rw-r--r-- | fuzzylite/fl/norm/s/NormalizedSum.h | 44 | ||||
-rw-r--r-- | fuzzylite/fl/norm/s/SNormFunction.h | 81 | ||||
-rw-r--r-- | fuzzylite/fl/norm/s/UnboundedSum.h | 52 |
10 files changed, 356 insertions, 150 deletions
diff --git a/fuzzylite/fl/norm/s/AlgebraicSum.h b/fuzzylite/fl/norm/s/AlgebraicSum.h index 786bcbd..2fbf4c1 100644 --- a/fuzzylite/fl/norm/s/AlgebraicSum.h +++ b/fuzzylite/fl/norm/s/AlgebraicSum.h @@ -1,25 +1,17 @@ /* - Author: Juan Rada-Vilela, Ph.D. - Copyright (C) 2010-2014 FuzzyLite Limited - All rights reserved + fuzzylite (R), a fuzzy logic control library in C++. + Copyright (C) 2010-2017 FuzzyLite Limited. All rights reserved. + Author: Juan Rada-Vilela, Ph.D. <jcrada@fuzzylite.com> This file is part of fuzzylite. fuzzylite is free software: you can redistribute it and/or modify it under - the terms of the GNU Lesser General Public License as published by the Free - Software Foundation, either version 3 of the License, or (at your option) - any later version. + the terms of the FuzzyLite License included with the software. - fuzzylite is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License - for more details. - - You should have received a copy of the GNU Lesser General Public License - along with fuzzylite. If not, see <http://www.gnu.org/licenses/>. - - fuzzylite™ is a trademark of FuzzyLite Limited. + You should have received a copy of the FuzzyLite License along with + fuzzylite. If not, see <http://www.fuzzylite.com/license/>. + fuzzylite is a registered trademark of FuzzyLite Limited. */ #ifndef FL_ALGEBRAICSUM_H @@ -27,20 +19,35 @@ #include "fl/norm/SNorm.h" - namespace fl { - class FL_API AlgebraicSum : public SNorm { + /** + The AlgebraicSum class is an SNorm that computes the algebraic sum of + values any two values. + + @author Juan Rada-Vilela, Ph.D. + @see AlgebraicProduct + @see SNorm + @see SNormFactory + @see Norm + @since 4.0 + */ + class FL_API AlgebraicSum FL_IFINAL : public SNorm { public: std::string className() const FL_IOVERRIDE; + + Complexity complexity() const FL_IOVERRIDE; + + /** + Computes the algebraic sum of two membership function values + @param a is a membership function value + @param b is a membership function value + @return @f$a+b-(a \times b)@f$ + */ scalar compute(scalar a, scalar b) const FL_IOVERRIDE; AlgebraicSum* clone() const FL_IOVERRIDE; static SNorm* constructor(); }; - - } - #endif /* FL_ALGEBRAICSUM_H */ - diff --git a/fuzzylite/fl/norm/s/BoundedSum.h b/fuzzylite/fl/norm/s/BoundedSum.h index 5231856..cd9438e 100644 --- a/fuzzylite/fl/norm/s/BoundedSum.h +++ b/fuzzylite/fl/norm/s/BoundedSum.h @@ -1,25 +1,17 @@ /* - Author: Juan Rada-Vilela, Ph.D. - Copyright (C) 2010-2014 FuzzyLite Limited - All rights reserved + fuzzylite (R), a fuzzy logic control library in C++. + Copyright (C) 2010-2017 FuzzyLite Limited. All rights reserved. + Author: Juan Rada-Vilela, Ph.D. <jcrada@fuzzylite.com> This file is part of fuzzylite. fuzzylite is free software: you can redistribute it and/or modify it under - the terms of the GNU Lesser General Public License as published by the Free - Software Foundation, either version 3 of the License, or (at your option) - any later version. + the terms of the FuzzyLite License included with the software. - fuzzylite is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License - for more details. - - You should have received a copy of the GNU Lesser General Public License - along with fuzzylite. If not, see <http://www.gnu.org/licenses/>. - - fuzzylite™ is a trademark of FuzzyLite Limited. + You should have received a copy of the FuzzyLite License along with + fuzzylite. If not, see <http://www.fuzzylite.com/license/>. + fuzzylite is a registered trademark of FuzzyLite Limited. */ #ifndef FL_BOUNDEDSUM_H @@ -29,15 +21,34 @@ namespace fl { - class FL_API BoundedSum : public SNorm { + /** + The BoundedSum class is an SNorm that computes the bounded sum of any two + values. + + @author Juan Rada-Vilela, Ph.D. + @see BoundedDifference + @see SNorm + @see SNormFactory + @see Norm + @since 4.0 + */ + class FL_API BoundedSum FL_IFINAL : public SNorm { public: std::string className() const FL_IOVERRIDE; + + Complexity complexity() const FL_IOVERRIDE; + /** + Computes the bounded sum of two membership function values + @param a is a membership function value + @param b is a membership function value + @return @f$\min(1, a+b)@f$ + */ scalar compute(scalar a, scalar b) const FL_IOVERRIDE; BoundedSum* clone() const FL_IOVERRIDE; static SNorm* constructor(); }; + } #endif /* FL_BOUNDEDSUM_H */ - diff --git a/fuzzylite/fl/norm/s/DrasticSum.h b/fuzzylite/fl/norm/s/DrasticSum.h index 65d4d4c..a1e33fe 100644 --- a/fuzzylite/fl/norm/s/DrasticSum.h +++ b/fuzzylite/fl/norm/s/DrasticSum.h @@ -1,43 +1,55 @@ /* - Author: Juan Rada-Vilela, Ph.D. - Copyright (C) 2010-2014 FuzzyLite Limited - All rights reserved + fuzzylite (R), a fuzzy logic control library in C++. + Copyright (C) 2010-2017 FuzzyLite Limited. All rights reserved. + Author: Juan Rada-Vilela, Ph.D. <jcrada@fuzzylite.com> This file is part of fuzzylite. fuzzylite is free software: you can redistribute it and/or modify it under - the terms of the GNU Lesser General Public License as published by the Free - Software Foundation, either version 3 of the License, or (at your option) - any later version. + the terms of the FuzzyLite License included with the software. - fuzzylite is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License - for more details. - - You should have received a copy of the GNU Lesser General Public License - along with fuzzylite. If not, see <http://www.gnu.org/licenses/>. - - fuzzylite™ is a trademark of FuzzyLite Limited. + You should have received a copy of the FuzzyLite License along with + fuzzylite. If not, see <http://www.fuzzylite.com/license/>. + fuzzylite is a registered trademark of FuzzyLite Limited. */ #ifndef FL_DRASTICSUM_H #define FL_DRASTICSUM_H #include "fl/norm/SNorm.h" + namespace fl { - class FL_API DrasticSum : public SNorm { + /** + The DrasticSum class is an SNorm that computes the drastic sum of any two + values. + + @author Juan Rada-Vilela, Ph.D. + @see DrasticProduct + @see SNorm + @see SNormFactory + @see Norm + @since 4.0 + */ + class FL_API DrasticSum FL_IFINAL : public SNorm { public: std::string className() const FL_IOVERRIDE; + + Complexity complexity() const FL_IOVERRIDE; + /** + Computes the drastic sum of two membership function values + @param a is a membership function value + @param b is a membership function value + @return @f$\begin{cases} + \max(a,b) & \mbox{if $\min(a,b)=0$} \cr + 1 & \mbox{otherwise} + \end{cases}@f$ + */ scalar compute(scalar a, scalar b) const FL_IOVERRIDE; DrasticSum* clone() const FL_IOVERRIDE; static SNorm* constructor(); }; - } - #endif /* FL_DRASTICSUM_H */ - diff --git a/fuzzylite/fl/norm/s/EinsteinSum.h b/fuzzylite/fl/norm/s/EinsteinSum.h index 8114c68..7450330 100644 --- a/fuzzylite/fl/norm/s/EinsteinSum.h +++ b/fuzzylite/fl/norm/s/EinsteinSum.h @@ -1,25 +1,17 @@ /* - Author: Juan Rada-Vilela, Ph.D. - Copyright (C) 2010-2014 FuzzyLite Limited - All rights reserved + fuzzylite (R), a fuzzy logic control library in C++. + Copyright (C) 2010-2017 FuzzyLite Limited. All rights reserved. + Author: Juan Rada-Vilela, Ph.D. <jcrada@fuzzylite.com> This file is part of fuzzylite. fuzzylite is free software: you can redistribute it and/or modify it under - the terms of the GNU Lesser General Public License as published by the Free - Software Foundation, either version 3 of the License, or (at your option) - any later version. + the terms of the FuzzyLite License included with the software. - fuzzylite is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License - for more details. - - You should have received a copy of the GNU Lesser General Public License - along with fuzzylite. If not, see <http://www.gnu.org/licenses/>. - - fuzzylite™ is a trademark of FuzzyLite Limited. + You should have received a copy of the FuzzyLite License along with + fuzzylite. If not, see <http://www.fuzzylite.com/license/>. + fuzzylite is a registered trademark of FuzzyLite Limited. */ #ifndef FL_EINSTEINSUM_H @@ -29,16 +21,32 @@ namespace fl { - class FL_API EinsteinSum : public SNorm { + /** + The EinsteinSum class is an SNorm that computes the einstein sum of any + two values. + + @author Juan Rada-Vilela, Ph.D. + @see EinsteinProduct + @see SNorm + @see SNormFactory + @see Norm + @since 4.0 + */ + class FL_API EinsteinSum FL_IFINAL : public SNorm { public: std::string className() const FL_IOVERRIDE; + + Complexity complexity() const FL_IOVERRIDE; + /** + Computes the Einstein sum of two membership function values + @param a is a membership function value + @param b is a membership function value + @return @f$a+b/(1+a \times b)@f$ + */ scalar compute(scalar a, scalar b) const FL_IOVERRIDE; EinsteinSum* clone() const FL_IOVERRIDE; static SNorm* constructor(); }; - } - #endif /* FL_EINSTEINSUM_H */ - diff --git a/fuzzylite/fl/norm/s/HamacherSum.h b/fuzzylite/fl/norm/s/HamacherSum.h index 3daf852..0242512 100644 --- a/fuzzylite/fl/norm/s/HamacherSum.h +++ b/fuzzylite/fl/norm/s/HamacherSum.h @@ -1,25 +1,17 @@ /* - Author: Juan Rada-Vilela, Ph.D. - Copyright (C) 2010-2014 FuzzyLite Limited - All rights reserved + fuzzylite (R), a fuzzy logic control library in C++. + Copyright (C) 2010-2017 FuzzyLite Limited. All rights reserved. + Author: Juan Rada-Vilela, Ph.D. <jcrada@fuzzylite.com> This file is part of fuzzylite. fuzzylite is free software: you can redistribute it and/or modify it under - the terms of the GNU Lesser General Public License as published by the Free - Software Foundation, either version 3 of the License, or (at your option) - any later version. + the terms of the FuzzyLite License included with the software. - fuzzylite is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License - for more details. - - You should have received a copy of the GNU Lesser General Public License - along with fuzzylite. If not, see <http://www.gnu.org/licenses/>. - - fuzzylite™ is a trademark of FuzzyLite Limited. + You should have received a copy of the FuzzyLite License along with + fuzzylite. If not, see <http://www.fuzzylite.com/license/>. + fuzzylite is a registered trademark of FuzzyLite Limited. */ #ifndef FL_HAMACHERSUM_H @@ -29,16 +21,32 @@ namespace fl { - class FL_API HamacherSum : public SNorm { + /** + The HamacherSum class is an SNorm that computes the Hamacher sum of any + two values. + + @author Juan Rada-Vilela, Ph.D. + @see HamacherProduct + @see SNorm + @see SNormFactory + @see Norm + @since 4.0 + */ + class FL_API HamacherSum FL_IFINAL : public SNorm { public: std::string className() const FL_IOVERRIDE; + + Complexity complexity() const FL_IOVERRIDE; + /** + Computes the Hamacher sum of two membership function values + @param a is a membership function value + @param b is a membership function value + @return @f$a+b-(2\times a \times b)/(1-a\times b)@f$ + */ scalar compute(scalar a, scalar b) const FL_IOVERRIDE; HamacherSum* clone() const FL_IOVERRIDE; static SNorm* constructor(); }; - } - #endif /* FL_HAMACHERSUM_H */ - diff --git a/fuzzylite/fl/norm/s/Maximum.h b/fuzzylite/fl/norm/s/Maximum.h index 28a3b6d..c8ce488 100644 --- a/fuzzylite/fl/norm/s/Maximum.h +++ b/fuzzylite/fl/norm/s/Maximum.h @@ -1,25 +1,17 @@ /* - Author: Juan Rada-Vilela, Ph.D. - Copyright (C) 2010-2014 FuzzyLite Limited - All rights reserved + fuzzylite (R), a fuzzy logic control library in C++. + Copyright (C) 2010-2017 FuzzyLite Limited. All rights reserved. + Author: Juan Rada-Vilela, Ph.D. <jcrada@fuzzylite.com> This file is part of fuzzylite. fuzzylite is free software: you can redistribute it and/or modify it under - the terms of the GNU Lesser General Public License as published by the Free - Software Foundation, either version 3 of the License, or (at your option) - any later version. + the terms of the FuzzyLite License included with the software. - fuzzylite is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License - for more details. - - You should have received a copy of the GNU Lesser General Public License - along with fuzzylite. If not, see <http://www.gnu.org/licenses/>. - - fuzzylite™ is a trademark of FuzzyLite Limited. + You should have received a copy of the FuzzyLite License along with + fuzzylite. If not, see <http://www.fuzzylite.com/license/>. + fuzzylite is a registered trademark of FuzzyLite Limited. */ #ifndef FL_MAXIMUM_H @@ -29,17 +21,31 @@ namespace fl { - class FL_API Maximum : public SNorm { + /** + The Maximum class is an SNorm that computes the maximum of any two values. + + @author Juan Rada-Vilela, Ph.D. + @see Minimum + @see SNorm + @see SNormFactory + @see Norm + @since 4.0 + */ + class FL_API Maximum FL_IFINAL : public SNorm { public: std::string className() const FL_IOVERRIDE; + + Complexity complexity() const FL_IOVERRIDE; + /** + Computes the maximum of two membership function values + @param a is a membership function value + @param b is a membership function value + @return @f$\max(a,b)@f$ + */ scalar compute(scalar a, scalar b) const FL_IOVERRIDE; Maximum* clone() const FL_IOVERRIDE; static SNorm* constructor(); }; - - } - #endif /* FL_MAXIMUM_H */ - diff --git a/fuzzylite/fl/norm/s/NilpotentMaximum.h b/fuzzylite/fl/norm/s/NilpotentMaximum.h index 151d92d..13e9793 100644 --- a/fuzzylite/fl/norm/s/NilpotentMaximum.h +++ b/fuzzylite/fl/norm/s/NilpotentMaximum.h @@ -1,25 +1,17 @@ /* - Author: Juan Rada-Vilela, Ph.D. - Copyright (C) 2010-2014 FuzzyLite Limited - All rights reserved + fuzzylite (R), a fuzzy logic control library in C++. + Copyright (C) 2010-2017 FuzzyLite Limited. All rights reserved. + Author: Juan Rada-Vilela, Ph.D. <jcrada@fuzzylite.com> This file is part of fuzzylite. fuzzylite is free software: you can redistribute it and/or modify it under - the terms of the GNU Lesser General Public License as published by the Free - Software Foundation, either version 3 of the License, or (at your option) - any later version. + the terms of the FuzzyLite License included with the software. - fuzzylite is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License - for more details. - - You should have received a copy of the GNU Lesser General Public License - along with fuzzylite. If not, see <http://www.gnu.org/licenses/>. - - fuzzylite™ is a trademark of FuzzyLite Limited. + You should have received a copy of the FuzzyLite License along with + fuzzylite. If not, see <http://www.fuzzylite.com/license/>. + fuzzylite is a registered trademark of FuzzyLite Limited. */ #ifndef FL_NILPOTENTMAXIMUM_H @@ -29,9 +21,31 @@ namespace fl { - class FL_API NilpotentMaximum : public SNorm { + /** + The NilpotentMaximum class is an SNorm that computes the nilpotent + maximum of any two values. + + @author Juan Rada-Vilela, Ph.D. + @see NilpotentMinimum + @see SNorm + @see SNormFactory + @see Norm + @since 5.0 + */ + class FL_API NilpotentMaximum FL_IFINAL : public SNorm { public: std::string className() const FL_IOVERRIDE; + + Complexity complexity() const FL_IOVERRIDE; + /** + Computes the nilpotent maximum of two membership function values + @param a is a membership function value + @param b is a membership function value + @return @f$\begin{cases} + \max(a,b) & \mbox{if $a+b<0$} \cr + 1 & \mbox{otherwise} + \end{cases}@f$ + */ scalar compute(scalar a, scalar b) const FL_IOVERRIDE; NilpotentMaximum* clone() const FL_IOVERRIDE; @@ -40,4 +54,3 @@ namespace fl { } #endif /* FL_NILPOTENTMAXIMUM_H */ - diff --git a/fuzzylite/fl/norm/s/NormalizedSum.h b/fuzzylite/fl/norm/s/NormalizedSum.h index 59063a6..e2e757b 100644 --- a/fuzzylite/fl/norm/s/NormalizedSum.h +++ b/fuzzylite/fl/norm/s/NormalizedSum.h @@ -1,25 +1,17 @@ /* - Author: Juan Rada-Vilela, Ph.D. - Copyright (C) 2010-2014 FuzzyLite Limited - All rights reserved + fuzzylite (R), a fuzzy logic control library in C++. + Copyright (C) 2010-2017 FuzzyLite Limited. All rights reserved. + Author: Juan Rada-Vilela, Ph.D. <jcrada@fuzzylite.com> This file is part of fuzzylite. fuzzylite is free software: you can redistribute it and/or modify it under - the terms of the GNU Lesser General Public License as published by the Free - Software Foundation, either version 3 of the License, or (at your option) - any later version. + the terms of the FuzzyLite License included with the software. - fuzzylite is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License - for more details. - - You should have received a copy of the GNU Lesser General Public License - along with fuzzylite. If not, see <http://www.gnu.org/licenses/>. - - fuzzylite™ is a trademark of FuzzyLite Limited. + You should have received a copy of the FuzzyLite License along with + fuzzylite. If not, see <http://www.fuzzylite.com/license/>. + fuzzylite is a registered trademark of FuzzyLite Limited. */ #ifndef FL_NORMALIZEDSUM_H @@ -29,16 +21,32 @@ namespace fl { - class FL_API NormalizedSum : public SNorm { + /** + The NormalizedSum class is an SNorm that computes the normalized sum of + any two values. + + @author Juan Rada-Vilela, Ph.D. + @see SNorm + @see SNormFactory + @see Norm + @since 4.0 + */ + class FL_API NormalizedSum FL_IFINAL : public SNorm { public: std::string className() const FL_IOVERRIDE; + + Complexity complexity() const FL_IOVERRIDE; + /** + Computes the normalized sum of two membership function values + @param a is a membership function value + @param b is a membership function value + @return @f$(a+b)/\max(1, a + b)@f$ + */ scalar compute(scalar a, scalar b) const FL_IOVERRIDE; NormalizedSum* clone() const FL_IOVERRIDE; static SNorm* constructor(); }; - } #endif /* FL_NORMALIZEDSUM_H */ - diff --git a/fuzzylite/fl/norm/s/SNormFunction.h b/fuzzylite/fl/norm/s/SNormFunction.h new file mode 100644 index 0000000..a78b1aa --- /dev/null +++ b/fuzzylite/fl/norm/s/SNormFunction.h @@ -0,0 +1,81 @@ +/* + fuzzylite (R), a fuzzy logic control library in C++. + Copyright (C) 2010-2017 FuzzyLite Limited. All rights reserved. + Author: Juan Rada-Vilela, Ph.D. <jcrada@fuzzylite.com> + + This file is part of fuzzylite. + + fuzzylite is free software: you can redistribute it and/or modify it under + the terms of the FuzzyLite License included with the software. + + You should have received a copy of the FuzzyLite License along with + fuzzylite. If not, see <http://www.fuzzylite.com/license/>. + + fuzzylite is a registered trademark of FuzzyLite Limited. + */ + +#ifndef FL_SNORMFUNCTION_H +#define FL_SNORMFUNCTION_H + +#include "fl/norm/SNorm.h" + +#include "fl/term/Function.h" + +namespace fl { + + /** + The SNormFunction class is a customizable SNorm via Function, which + computes any function based on the @f$a@f$ and @f$b@f$ values. + This SNorm is not registered with the SNormFactory. + + @author Juan Rada-Vilela, Ph.D. + @see Function + @see SNorm + @see Norm + @see SNormFactory + @since 6.0 + */ + + class FL_API SNormFunction FL_IFINAL : public SNorm { + private: + Function _function; + public: + explicit SNormFunction(const std::string& formula = ""); + + /** + Returns the reference to the Function + @return the reference to the Function + */ + Function& function(); + + /** + Loads the function with the given formula + @param formula is a valid formula in infix notation + */ + void setFormula(const std::string& formula); + /** + Returns the formula loaded into the function + @return the formula loaded into the function + */ + std::string getFormula() const; + + std::string className() const FL_IOVERRIDE; + + Complexity complexity() const FL_IOVERRIDE; + /** + Computes the S-Norm utilizing the given function via + SNormFunction::setFormula(), which automatically assigns the values + of @f$a@f$ and @f$b@f$. + + @param a is a membership function value + @param b is a membership function value + @return the evaluation of the function + */ + scalar compute(scalar a, scalar b) const FL_IOVERRIDE; + SNormFunction* clone() const FL_IOVERRIDE; + + static SNorm* constructor(); + }; +} +#endif /* FL_SNORMFUNCTION_H */ + diff --git a/fuzzylite/fl/norm/s/UnboundedSum.h b/fuzzylite/fl/norm/s/UnboundedSum.h new file mode 100644 index 0000000..695fdfd --- /dev/null +++ b/fuzzylite/fl/norm/s/UnboundedSum.h @@ -0,0 +1,52 @@ +/* + fuzzylite (R), a fuzzy logic control library in C++. + Copyright (C) 2010-2017 FuzzyLite Limited. All rights reserved. + Author: Juan Rada-Vilela, Ph.D. <jcrada@fuzzylite.com> + + This file is part of fuzzylite. + + fuzzylite is free software: you can redistribute it and/or modify it under + the terms of the FuzzyLite License included with the software. + + You should have received a copy of the FuzzyLite License along with + fuzzylite. If not, see <http://www.fuzzylite.com/license/>. + + fuzzylite is a registered trademark of FuzzyLite Limited. + */ + +#ifndef FL_UNBOUNDEDSUM_H +#define FL_UNBOUNDEDSUM_H + +#include "fl/norm/SNorm.h" + +namespace fl { + + /** + The UnboundedSum class is an SNorm that computes the sum of any two values. + + @author Juan Rada-Vilela, Ph.D. + @see BoundedSum + @see SNorm + @see SNormFactory + @see Norm + @since 4.0 + */ + class FL_API UnboundedSum FL_IFINAL : public SNorm { + public: + std::string className() const FL_IOVERRIDE; + + Complexity complexity() const FL_IOVERRIDE; + /** + Computes the bounded sum of two membership function values + @param a is a membership function value + @param b is a membership function value + @return @f$\min(1, a+b)@f$ + */ + scalar compute(scalar a, scalar b) const FL_IOVERRIDE; + UnboundedSum* clone() const FL_IOVERRIDE; + + static SNorm* constructor(); + }; +} + +#endif /* FL_BOUNDEDSUM_H */ |