Ignore:
Timestamp:
Aug 20, 2014, 1:06:16 PM (11 years ago)
Author:
Frederik Heber <heber@…>
Children:
ff72fb
Parents:
0b517b
git-author:
Frederik Heber <heber@…> (07/12/14 19:07:44)
git-committer:
Frederik Heber <heber@…> (08/20/14 13:06:16)
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

    r0b517b re6ca85  
    7373  }
    7474
    75   /** Matches a given spherical distribution with another containing more
    76    * points.
     75  /** Returns vacant spots to fill to get a complete spherical point distribution from
     76   * given points \a _polygon, containing then \a _N in total.
    7777   *
    7878   * The idea is to produce a matching from all points in \a _polygon to those
     
    8686   * hydrogens.
    8787   *
    88    * \param _polygon current occupied positions
    89    * \param _newpolygon ideal distribution to match best with current occupied
    90    *        positions
    91    * \return remaining vacant positions relative to \a _polygon
    92    */
    93   static Polygon_t matchSphericalPointDistributions(
    94       const WeightedPolygon_t &_polygon,
    95       Polygon_t &_newpolygon
    96       );
     88   * \param _polygon already filled places to match
     89   * \param _N desired total number fo points
     90   */
     91  Polygon_t getRemainingPoints(const WeightedPolygon_t &_polygon, const int _N);
    9792
    9893  //!> default radius of the spherical distribution
     
    137132
    138133private:
     134  //!> points for the ideal distribution
     135  Polygon_t points;
     136  //!> connection information between these ideal points
     137  adjacency_t adjacency;
     138
     139  /** Initialize inner status (points and adjacency) to desired number of
     140   * points.
     141   *
     142   * \param _N number of points
     143   */
     144  void initSelf(const int _N);
     145
     146private:
    139147  //!> grant unit tests access to private parts
    140148  friend class SphericalPointDistributionTest;
     
    149157
    150158  struct MatchingControlStructure {
     159    MatchingControlStructure(
     160        const adjacency_t &_adjacency,
     161        const VectorArray_t &_oldpoints,
     162        const VectorArray_t &_newpoints,
     163        const WeightsArray_t &_weights
     164        );
    151165    bool foundflag;
    152166    double bestL2;
     167    const adjacency_t &adjacency;
     168    const VectorArray_t oldpoints;
     169    const VectorArray_t newpoints;
     170    const WeightsArray_t weights;
    153171    IndexTupleList_t bestmatching;
    154     VectorArray_t oldpoints;
    155     VectorArray_t newpoints;
    156     WeightsArray_t weights;
    157172  };
    158173
     
    166181      );
    167182
    168   static IndexList_t findBestMatching(
    169       const WeightedPolygon_t &_polygon,
    170       Polygon_t &_newpolygon
    171       );
     183  IndexList_t findBestMatching(const WeightedPolygon_t &_polygon);
    172184
    173185  static IndexList_t joinPoints(
Note: See TracChangeset for help on using the changeset viewer.