.. oe:namespace:: OEChem



.. meta::
   :keywords: OEFuzzy, Fuzzy


.. _OEChem_OEFuzzy:

.. oe:class:: OEFuzzy

   .. oe:api::


      class OEFuzzy

   This class represents `OEFuzzy`.

   The :ref:`OEFuzzy <OEChem_OEFuzzy>` class represents fuzzy logic used in
   expression tests.

   .. oe:method:: Constructors

      .. oe:language:: c++ java csharp

         .. oe:api::

            OEFuzzy()

      .. oe:language:: python

         .. oe:api:: python

            OEFuzzy() -> OEFuzzy

      Default constructor.

      .. oe:language:: c++ java csharp

         .. oe:api::

            OEFuzzy(const unsigned int v)

      .. oe:language:: python

         .. oe:api:: python

            OEFuzzy(v: int) -> OEFuzzy

      Construct an :ref:`OEFuzzy <OEChem_OEFuzzy>` object given with an
      integer value.
      The integer values should be one of the values give in the
      :oe:constns:`OEChem::OEFuzzVal` namespace.
      Three pre-defined global constant fuzzy values
      (:oe:const:`OEChem::OEFuzzVal::True`,
      :oe:const:`OEChem::OEFuzzVal::False`, and 
      :oe:const:`OEChem::OEFuzzVal::Maybe`) are define in
      *OEChem* which represent the fuzzy values of true, false, and
      maybe, respectively.

      Default and copy constructors.

   .. oe:method:: operator!
      :language: c++

      .. oe:api::

         const OEFuzzy &operator!() const

      Negation operator. 
      Negation of true(:oe:const:`OEChem::OEFuzzVal::True`) will return
      false(:oe:const:`OEChem::OEFuzzVal::False`).
      Negation of false(:oe:const:`OEChem::OEFuzzVal::False`) will
      return true(:oe:const:`OEChem::OEFuzzVal::True`).
      Negation of maybe(:oe:const:`OEChem::OEFuzzVal::Maybe`) will
      return maybe (:oe:const:`OEChem::OEFuzzVal::Maybe`).

   .. oe:method:: operator!=
      :language: c++

      .. oe:api::

         bool operator!=(const OEFuzzy &) const

      Not equal operator. Two :ref:`OEFuzzy <OEChem_OEFuzzy>` objects are not
      equivalent if their fuzzy logic values differ.
 
   .. oe:method:: operator&&
      :language: c++

      .. oe:api::

         const OEFuzzy &operator&&(const OEFuzzy &) const

      And operator. Logic values for ''fuzzy and'' is the following:

      * ``False && False`` -> :oe:const:`OEChem::OEFuzzVal::False`
      * ``False && Maybe`` -> :oe:const:`OEChem::OEFuzzVal::False`
      * ``False && True`` -> :oe:const:`OEChem::OEFuzzVal::False`
      * ``Maybe && False`` -> :oe:const:`OEChem::OEFuzzVal::False`
      * ``Maybe && Maybe`` -> :oe:const:`OEChem::OEFuzzVal::Maybe`
      * ``Maybe && True`` -> :oe:const:`OEChem::OEFuzzVal::Maybe`
      * ``True && False`` -> :oe:const:`OEChem::OEFuzzVal::False`
      * ``True && Maybe`` -> :oe:const:`OEChem::OEFuzzVal::Maybe`
      * ``True && True`` -> :oe:const:`OEChem::OEFuzzVal::True`

   .. oe:method:: operator==
      :language: c++

      .. oe:api::

         bool operator==(const OEFuzzy &) const

      Equivalence operator. Two :ref:`OEFuzzy <OEChem_OEFuzzy>` objects are
      equivalent if their fuzzy logic values are identical.

   .. oe:method:: operator||
      :language: c++

      .. oe:api::

         const OEFuzzy &operator||(const OEFuzzy &) const

      Or operator. Logic values for ''fuzzy or'' is the following:

      * ``False || False`` -> :oe:const:`OEChem::OEFuzzVal::False`
      * ``False || Maybe`` -> :oe:const:`OEChem::OEFuzzVal::Maybe`
      * ``False || True`` -> :oe:const:`OEChem::OEFuzzVal::True`
      * ``Maybe || False`` -> :oe:const:`OEChem::OEFuzzVal::Maybe`
      * ``Maybe || Maybe`` -> :oe:const:`OEChem::OEFuzzVal::Maybe`
      * ``Maybe || True`` -> :oe:const:`OEChem::OEFuzzVal::True`
      * ``True || False`` -> :oe:const:`OEChem::OEFuzzVal::True`
      * ``True || Maybe`` -> :oe:const:`OEChem::OEFuzzVal::True`
      * ``True || True`` -> :oe:const:`OEChem::OEFuzzVal::True`

   .. oe:method:: operator bool

      .. oe:language:: c++ java csharp

         .. oe:api::

            operator bool() const

      .. oe:language:: python

         .. oe:api:: python

            IsValid() -> bool

      Boolean test operator. Both fuzzy true
      (:oe:const:`OEChem::OEFuzzVal::True`) and maybe
      (:oe:const:`OEChem::OEFuzzVal::Maybe`) values will return
      ``true``. A fuzzy false(:oe:const:`OEChem::OEFuzzVal::False`)
      value will return ``false``.
