Ignore:
Timestamp:
Aug 20, 2014, 1:04:08 PM (11 years ago)
Author:
Frederik Heber <heber@…>
Children:
23c605
Parents:
260540
git-author:
Frederik Heber <heber@…> (06/29/14 21:20:49)
git-committer:
Frederik Heber <heber@…> (08/20/14 13:04:08)
Message:

Extracted joinPoints() function to make it accessible to tests.

  • added unit test.
  • moved some function definitions around and added documentation.
File:
1 edited

Legend:

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

    r260540 r1ae9aa  
    2121
    2222#include "LinearAlgebra/Vector.hpp"
     23
     24class SphericalPointDistributionTest;
    2325
    2426/** contains getters for the VSEPR model for specific number of electrons.
     
    8082  static Polygon_t matchSphericalPointDistributions(
    8183      const WeightedPolygon_t &_polygon,
    82       const Polygon_t &_newpolygon
     84      Polygon_t &_newpolygon
    8385      );
    8486
     
    8890  const double SQRT_3;
    8991
     92  //!> typedef for a full rotation specification consisting of axis and angle.
    9093  typedef std::pair<Vector, double> Rotation_t;
    9194
     95  //!> typedef for a list of indices (of points in a polygon)
    9296  typedef std::list<unsigned int> IndexList_t;
     97  //!> typedef enumerating possibly multiple points accumulated as one point
     98  typedef std::list< IndexList_t > IndexTupleList_t;
     99  //!> typedef for a vector of indices
    93100  typedef std::vector<unsigned int> IndexArray_t;
     101  //!> typedef for a Vector of positions
    94102  typedef std::vector<Vector> VectorArray_t;
     103  //!> typedef for a Vector of positions with weights
     104  typedef std::vector< std::pair<Vector, int> > WeightedVectorArray_t;
    95105
    96106  //!> amplitude up to which deviations in checks of rotations are tolerated
     
    98108
    99109private:
     110  //!> grant unit tests access to private parts
     111  friend class SphericalPointDistributionTest;
     112
    100113  static std::pair<double, double> calculateErrorOfMatching(
    101114      const std::vector<Vector> &_old,
     
    124137  static IndexList_t findBestMatching(
    125138      const WeightedPolygon_t &_polygon,
    126       const Polygon_t &_newpolygon
     139      Polygon_t &_newpolygon
     140      );
     141
     142  static IndexList_t joinPoints(
     143      Polygon_t &_newpolygon,
     144      const VectorArray_t &_newpoints,
     145      const IndexTupleList_t &_bestmatching
    127146      );
    128147
Note: See TracChangeset for help on using the changeset viewer.