.. oe:namespace:: OEFastROCS



.. _OEFastROCS_OEFastROCSHistogram:

.. oe:class:: OEFastROCSHistogram

   .. oe:api::


      class OEFastROCSHistogram

   This class is returned from
   :oe:meth:`OEFastROCS::OEDBTracer::GetHistogram` during and after a
   query is sent to :oe:meth:`OEFastROCS::OEShapeDatabase::GetScores`
   or :oe:meth:`OEFastROCS::OEShapeDatabase::GetSortedScores`. It is
   used to contain a list of frequencies representing the distribution
   of scores. This same container is used to contain the frequencies
   of the following 3 score types:

   - :oe:const:`OEFastROCS::OEShapeDatabaseType::Shape`
   - :oe:const:`OEFastROCS::OEShapeDatabaseType::Color`
   - :oe:const:`OEFastROCS::OEShapeDatabaseType::Combo`

   .. oe:method:: Constructors

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

         .. oe:api::

            OEFastROCSHistogram(size_t numBins = 200)

      .. oe:language:: python

         .. oe:api:: python

            OEFastROCSHistogram(numBins: int = 200) -> OEFastROCSHistogram

      Construct a new histogram with the specified number of "bins" in
      which to bin the score distribution. The same number of bins is
      applied to each score type.

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

         .. oe:api::

            OEFastROCSHistogram(const OEFastROCSHistogram& rhs)

      .. oe:language:: python

         .. oe:api:: python

            OEFastROCSHistogram(rhs: OEFastROCSHistogram) -> OEFastROCSHistogram

      Copy constructor for moving a
      :ref:`OEFastROCSHistogram <OEFastROCS_OEFastROCSHistogram>` in memory.

   .. oe:language:: c++

      .. oe:method:: operator=

         .. oe:api::

            OEFastROCSHistogram& operator=(const OEFastROCSHistogram& rhs)

         Assignment operator for moving a
         :ref:`OEFastROCSHistogram <OEFastROCS_OEFastROCSHistogram>` in memory.

      Assignment operator.


   .. oe:method:: GetHistogram

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

         .. oe:api::

            void GetHistogram(std::vector<unsigned int>& frequencies,
                              unsigned int scoreType)

      .. oe:language:: python

         .. oe:api:: python

            GetHistogram(frequencies: OEUIntVector, scoreType: int) -> None

      Initializes the ``frequencies`` vector to the required size to
      contain the number of bins for this histogram, then fills it
      with the number of molecules that falls within each bin for the
      ``scoreType`` specified. The ``scoreType`` should be one of the following:

      - :oe:const:`OEFastROCS::OEShapeDatabaseType::Shape`
      - :oe:const:`OEFastROCS::OEShapeDatabaseType::Color`
      - :oe:const:`OEFastROCS::OEShapeDatabaseType::Combo`


   .. oe:method:: GetNumBins

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

         .. oe:api::

            size_t GetNumBins() const

      .. oe:language:: python

         .. oe:api:: python

            GetNumBins() -> int

      Returns the number of bins used for this histogram. The number
      of bins determines the granularity of the scores.

   .. oe:method:: Update

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

         .. oe:api::

            void Update(const OEFastROCSHistogram& rhs)

      .. oe:language:: python

         .. oe:api:: python

            Update(rhs: OEFastROCSHistogram) -> None

      Sum the histogram ``rhs`` into this histogram. This histogram
      will then reflect the total of the two histograms. Used for
      aggregating histograms during the execution of
      :oe:meth:`OEFastROCS::OEShapeDatabase::GetScores` or
      :oe:meth:`OEFastROCS::OEShapeDatabase::GetSortedScores`.

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

         .. oe:api::

            void Update(const OEShapeDatabaseScore& score)

      .. oe:language:: python

         .. oe:api:: python

            Update(score: OEShapeDatabaseScore) -> None

      Updates this histogram from an individual
      :ref:`OEShapeDatabaseScore <OEFastROCS_OEShapeDatabaseScore>` object usually
      representing one molecule during the execution of
      :oe:meth:`OEFastROCS::OEShapeDatabase::GetScores` or
      :oe:meth:`OEFastROCS::OEShapeDatabase::GetSortedScores`.
