.. include:: ../substitutions

.. oe:namespace:: OEChem

.. meta::
   :keywords: OERMSD, OEWeightedRMSD

.. oe:function:: OEWeightedRMSD

   **Array-Based OEWeightedRMSD**

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

      .. oe:api::

         double OEWeightedRMSD(const float* refcrds, const float* fitcrds,
                               const float* weightArray, unsigned int size,
                               bool overlay = false, double* rot = 0,
                               double* trans = 0)
         double OEWeightedRMSD(const double* refcrds, const double* fitcrds,
                               const double* weightArray, unsigned int size,
                               bool overlay = false, double* rot = 0,
                               double* trans = 0)

   .. oe:language:: python

      .. oe:api:: python

         OEWeightedRMSD(refcrds: OEFloatArray, fitcrds: OEFloatArray,
                        weight: OEFloatArray, size: int, overlay: bool = False,
                        rot: OEDoubleArray = None, trans: OEDoubleArray = None) -> float
         OEWeightedRMSD(refcrds: OEDoubleArray, fitcrds: OEDoubleArray,
                        weight: OEDoubleArray, size: int,
                        overlay: bool = False, rot: OEDoubleArray = None,
                        trans: OEDoubleArray = None) -> float


   Returns the weighted root mean squared deviation between two sets of
   Cartesian coordinates.

   *weightArray*
       The array should be of length `size` and should contain the relative
       weight of each coordinate.  The resulting RMSD is only affected by
       the relative weighting, so if all the weights are 1.0 or if all the
       weights are 2.0, the result will be the same.

   .. note::

      This function only differs from the function :oe:func:`OEChem::OERMSD`
      by the additional parameter 'weightArray'. For details of the
      other parameters see :oe:func:`OEChem::OERMSD` function.

   **Full Molecule-Based OEWeightedRMSD**

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

      .. oe:api::

         double OEWeightedRMSD(const OEMolBase& ref, const OEMolBase& fit,
                               const double* weightArray,
                               bool automorph = true, bool heavyOnly = true,
                               bool overlay = false, double* rot = 0,
                               double* trans = 0)
         bool OEWeightedRMSD(const OEMolBase& ref, const OEMCMolBase& fit,
                             const double* weightArray, double* rmsdArray,
                             bool automorph = true, bool heavyOnly = true,
                             bool overlay = false, double* rot = 0,
                             double* trans = 0)

   .. oe:language:: python

      .. oe:api:: python

         OEWeightedRMSD(ref: Union[OEGraphMol,OEMol,OEQMol], fit: OEMol,
                        weight: OEDoubleArray, rmsdArray: OEDoubleArray,
                        automorph: bool = True, heavyOnly: bool = True,
                        overlay: bool = False, rot: OEDoubleArray = None,
                        trans: OEDoubleArray = None) -> bool
         OEWeightedRMSD(ref: Union[OEGraphMol,OEMol,OEQMol],
                        fit: Union[OEGraphMol,OEMol,OEQMol],
                        weight: OEDoubleArray, automorph: bool = True,
                        heavyOnly: bool = True, overlay: bool = False,
                        rot: OEDoubleArray = None, trans: OEDoubleArray = None) -> float

   Calculates the weighted root mean squared deviation between two molecules.

   *weightArray*
       This array should be of length `fit.GetMaxAtomIdx()` and should contain
       the relative weight of each coordinate.  The resulting RMSD is only
       affected by the relative weighting, so if all the weights are 1.0 or
       if all the weights are 2.0, the result will be the same.

   .. note::

      This function only differs from the function :oe:func:`OEChem::OERMSD`
      by the additional parameter 'weightArray'. For details of the other
      parameters see :oe:func:`OEChem::OERMSD` function.

   **Partial Molecule-Based OEWeightedRMSD**

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

      .. oe:api::

         double OEWeightedRMSD(const OEMolBase& ref, const OEMolBase& fit,
                               const double* weightArray,
                               const OEMatchBase& match, bool overlay = false,
                               double* rot = 0, double* trans = 0)
         bool OEWeightedRMSD(const OEMolBase& ref, const OEMCMolBase& fit,
                             const double* weightArray, double* rmsdArray,
                             const OEMatchBase& match, bool overlay = false,
                             double* rot = 0, double* trans = 0)

   .. oe:language:: python

      .. oe:api:: python

         OEWeightedRMSD(ref: Union[OEGraphMol,OEMol,OEQMol], fit: OEMol,
                        weight: OEDoubleArray, rmsdArray: OEDoubleArray,
                        match: OEMatchBase, overlay: bool = False,
                        rot: OEDoubleArray = None, trans: OEDoubleArray = None) -> bool
         OEWeightedRMSD(ref: Union[OEGraphMol,OEMol,OEQMol],
                        fit: Union[OEGraphMol,OEMol,OEQMol],
                        weight: OEDoubleArray, match: OEMatchBase,
                        overlay: bool = False, rot: OEDoubleArray = None,
                        trans: OEDoubleArray = None) -> float
         OEWeightedRMSD(ref: Union[OEGraphMol,OEMol,OEQMol],
                        fit: Union[OEGraphMol,OEQMol], weight: OEDoubleArray,
                        rmsdArray: OEDoubleArray, match: OEMatchBase,
                        overlay: bool = False, rot: OEDoubleArray = None,
                        trans: OEDoubleArray = None) -> bool

   These functions are quite similar to the previous three.  However,
   rather than considering automorphisms and heavy atoms, these
   functions allow a user to explicitly specify which substructure
   of the two molecules should be used to determine the RMSD.
   The match can be generated by hand, or with any of **OEChem TK**'s matching
   algorithms such as :ref:`OESubSearch <OEChem_OESubSearch>` or
   :ref:`OEMCSSearch <OEChem_OEMCSSearch>`.

   *weightArray*
       This array should be of length `fit.GetMaxAtomIdx()` and should
       contain the relative weight of each coordinate.  The resulting
       RMSD is only affected by the relative weighting, so if all the
       weights are 1.0 or if all the weights are 2.0, the result will
       be the same. The 'match' parameter takes precedence over the
       weights, so only weights that are part of the match will be
       relevant to the calculation.

   .. note::

      This function only differs from the function :oe:func:`OEChem::OERMSD`
      by the additional parameter 'weightArray'. For details of the other
      parameters see :oe:func:`OEChem::OERMSD` function.

   .. seealso::

      * :oe:func:`OEChem::OERMSD` function
      * :ref:`OEConfRMSD <OEChem_OEConfRMSD>` class
      * :ref:`section_patternmatch_sss` section
      * :ref:`section_patternmatch_mcss` section
