Ignore:
Timestamp:
May 25, 2016, 7:13:59 AM (9 years ago)
Author:
Frederik Heber <heber@…>
Children:
ec9bd2
Parents:
a52369
git-author:
Frederik Heber <heber@…> (07/12/14 19:07:44)
git-committer:
Frederik Heber <heber@…> (05/25/16 07:13:59)
Message:

recurseMatching() now takes connections into account.

  • matchSphericalPointDistribution() replaced by getRemainingPoints() as that describes what it does. match...() sounds symmetrical which the function is no longer as connection is associated with former _newpolygon.
  • SphericalPointDistribution now has internal points and adjacency, initialized by initSelf().
  • findBestMatching() and getRemainingPoints() are no longer static functions.
  • all unit tests are working again, including the .._multiple() that tests for joint points due to bond degree greater than 1.
  • the huge case switch in SaturatedFragment::saturateAtom() now resides in initSelf().
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Fragmentation/Exporters/SphericalPointDistribution.hpp

    ra52369 r9cf90e  
    7272  }
    7373
    74   /** Matches a given spherical distribution with another containing more
    75    * points.
     74  /** Returns vacant spots to fill to get a complete spherical point distribution from
     75   * given points \a _polygon, containing then \a _N in total.
    7676   *
    7777   * This is a helper to determine points where to best insert saturation
    7878   * hydrogens.
    7979   *
    80    * \param _polygon current occupied positions
    81    * \param _newpolygon ideal distribution to match best with current occupied
    82    *        positions
    83    * \return remaining vacant positions relative to \a _polygon
    84    */
    85   static Polygon_t matchSphericalPointDistributions(
    86       const WeightedPolygon_t &_polygon,
    87       Polygon_t &_newpolygon
    88       );
     80   * \param _polygon already filled places to match
     81   * \param _N desired total number fo points
     82   */
     83  Polygon_t getRemainingPoints(const WeightedPolygon_t &_polygon, const int _N);
    8984
    9085  //!> default radius of the spherical distribution
     
    129124
    130125private:
     126  //!> points for the ideal distribution
     127  Polygon_t points;
     128  //!> connection information between these ideal points
     129  adjacency_t adjacency;
     130
     131  /** Initialize inner status (points and adjacency) to desired number of
     132   * points.
     133   *
     134   * \param _N number of points
     135   */
     136  void initSelf(const int _N);
     137
     138private:
    131139  //!> grant unit tests access to private parts
    132140  friend class SphericalPointDistributionTest;
     
    141149
    142150  struct MatchingControlStructure {
     151    MatchingControlStructure(
     152        const adjacency_t &_adjacency,
     153        const VectorArray_t &_oldpoints,
     154        const VectorArray_t &_newpoints,
     155        const WeightsArray_t &_weights
     156        );
    143157    bool foundflag;
    144158    double bestL2;
     159    const adjacency_t &adjacency;
     160    const VectorArray_t oldpoints;
     161    const VectorArray_t newpoints;
     162    const WeightsArray_t weights;
    145163    IndexTupleList_t bestmatching;
    146     VectorArray_t oldpoints;
    147     VectorArray_t newpoints;
    148     WeightsArray_t weights;
    149164  };
    150165
     
    158173      );
    159174
    160   static IndexList_t findBestMatching(
    161       const WeightedPolygon_t &_polygon,
    162       Polygon_t &_newpolygon
    163       );
     175  IndexList_t findBestMatching(const WeightedPolygon_t &_polygon);
    164176
    165177  static IndexList_t joinPoints(
Note: See TracChangeset for help on using the changeset viewer.