.. oe:namespace:: OEShape

.. meta::
   :keywords: OESortOverlayScores

.. oe:function:: OESortOverlayScores

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

      .. oe:api::

         void OESortOverlayScores(OESystem::OEIter<OEBestOverlayScore>& dst,
                                  OESystem::OEIter<OEBestOverlayResults>& scores,
                                  const OESystem::OEBinaryPredicate<OEBestOverlayScore, OEBestOverlayScore>& sorter,
                                  unsigned nbest = 1, bool conforder = false)

   .. oe:language:: python

      .. oe:api:: python

         OESortOverlayScores(dst: OEBestOverlayScoreIter,
                             scores: OEBestOverlayResultsIter,
                             sorter: OEBestOverlayScoreSorterPred,
                             nbest: int = 1, conforder: bool = False) -> None


   Sort the scores from multiple sets of
   :ref:`OEBestOverlayResults <OEShape_OEBestOverlayResults>` into a single iterator of
   :ref:`OEBestOverlayScore <OEShape_OEBestOverlayScore>`. The sorting function can be
   one of the pre-defined functors or a user-defined version.

   The ``nbest`` default value of **1** implies that on the best
   overlay for each ref-fit conformer pair is returned. A value
   greater than one will mean multiple overlays for each ref-fit
   conformer pair will be kept.

   Setting ``conforder`` to **true** forces the results to come out
   in conformer index order.  If ``nbest`` is greater than **1** and
   ``conforder`` is **true**, then for each ref-fit conformer pair,
   the scores will be sorted by the sorting function, but each set of
   ref-fit results will come out together.

   Several of the OEBestOverlay examples show variations of these
   values. Perhaps the easiest way to understand them is to modify one
   of the examples and observe the change in the number and order of
   the scores.
