.. oe:namespace:: OEGraphSim


.. _OEGraphSim_OESimSearchResult:

.. oe:class:: OESimSearchResult

   .. oe:api::

       class OESimSearchResult

   The :ref:`OESimSearchResult <OEGraphSim_OESimSearchResult>` class is used to store the results
   of a similarity search along with reporting the progress of the search and the
   histogram of the similarity scores.

   .. seealso::

      * :oe:meth:`OEGraphSim::OEFastFPDatabase::SortedSearch` method

   .. oe:method:: Constructor

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

         .. oe:api::
            OESimSearchResult(const size_t nrbins = 50u,
                              const double min = 0.0, const double max = 1.0)


      .. oe:language:: python

         .. oe:api:: python

            OESimSearchResult(nrbins: int = 50, min: float = 0.0,
                              max: float = 1.0) -> OESimSearchResult

      Constructor an empty result object with parameters for the score histogram.

      nrbins
        Number of bins in the histogram (default = 50).

      minv
        Minimum bound (inclusive) of the histogram range (default = 0.0).

      maxv
        Maximum bound (inclusive) of the histogram range (default = 1.0).

   .. oe:method:: GetHistogram

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

         .. oe:api::

            OEFPHistogram GetHistogram() const

      .. oe:language:: python

         .. oe:api:: python

            GetHistogram() -> OEFPHistogram

      Returns an :ref:`OEFPHistogram <OEGraphSim_OEFPHistogram>` object that stores the
      histogram of similarity scores.

   .. oe:method:: GetSearchStatus

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

         .. oe:api::

            unsigned GetSearchStatus() const

      .. oe:language:: python

         .. oe:api:: python

            GetSearchStatus() -> int

      Returns the status of the similarity search defined in
      the :oe:constns:`OEGraphSim::OESimSearchStatus` namespace.

   .. oe:method:: GetSortedScores

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

         .. oe:api::

            OESystem::OEIterBase<OESimScore>* GetSortedScores()

      .. oe:language:: python

         .. oe:api:: python

            GetSortedScores() -> Iterable[OESimScore]

      Returns an iterator over the calculated similarity scores
      (:ref:`OESimScore <OEGraphSim_OESimScore>`) in the sorted order.
      Each :ref:`OESimScore <OEGraphSim_OESimScore>` holds a similarity score and
      index of the corresponding fingerprint of the database.

   .. oe:method:: IsValid

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

         .. oe:api::

            bool IsValid() const

      .. oe:language:: python

         .. oe:api:: python

            IsValid() -> bool

      Returns whether the :ref:`OESimSearchResult <OEGraphSim_OESimSearchResult>` object is valid.

   .. oe:method:: NumSearched

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

         .. oe:api::

            size_t NumSearched() const

      .. oe:language:: python

         .. oe:api:: python

            NumSearched() -> int

      Returns the number of fingerprints that have been already searched.
      This counter is continuously updated and provides the progress of the
      similarity search.

   .. oe:method:: NumTargets

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

         .. oe:api::

            size_t NumTargets() const

      .. oe:language:: python

         .. oe:api:: python

            NumTargets() -> int

      Returns the number of targets (i.e. the number of fingerprints
      in the database).
