Ignore:
Timestamp:
May 25, 2016, 7:13:58 AM (9 years ago)
Author:
Frederik Heber <heber@…>
Children:
4d611d
Parents:
80c119
git-author:
Frederik Heber <heber@…> (06/29/14 21:20:49)
git-committer:
Frederik Heber <heber@…> (05/25/16 07:13:58)
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

    r80c119 r7e9402  
    2121
    2222#include "LinearAlgebra/Vector.hpp"
     23
     24class SphericalPointDistributionTest;
    2325
    2426/** contains getters for the VSEPR model for specific number of electrons.
     
    7173  static Polygon_t matchSphericalPointDistributions(
    7274      const WeightedPolygon_t &_polygon,
    73       const Polygon_t &_newpolygon
     75      Polygon_t &_newpolygon
    7476      );
    7577
     
    7981  static const double SQRT_3;
    8082
     83  //!> typedef for a full rotation specification consisting of axis and angle.
    8184  typedef std::pair<Vector, double> Rotation_t;
    8285
     86  //!> typedef for a list of indices (of points in a polygon)
    8387  typedef std::list<unsigned int> IndexList_t;
     88  //!> typedef enumerating possibly multiple points accumulated as one point
     89  typedef std::list< IndexList_t > IndexTupleList_t;
     90  //!> typedef for a vector of indices
    8491  typedef std::vector<unsigned int> IndexArray_t;
     92  //!> typedef for a Vector of positions
    8593  typedef std::vector<Vector> VectorArray_t;
     94  //!> typedef for a Vector of positions with weights
     95  typedef std::vector< std::pair<Vector, int> > WeightedVectorArray_t;
    8696
    8797  //!> amplitude up to which deviations in checks of rotations are tolerated
     
    8999
    90100private:
     101  //!> grant unit tests access to private parts
     102  friend class SphericalPointDistributionTest;
     103
    91104  static std::pair<double, double> calculateErrorOfMatching(
    92105      const std::vector<Vector> &_old,
     
    115128  static IndexList_t findBestMatching(
    116129      const WeightedPolygon_t &_polygon,
    117       const Polygon_t &_newpolygon
     130      Polygon_t &_newpolygon
     131      );
     132
     133  static IndexList_t joinPoints(
     134      Polygon_t &_newpolygon,
     135      const VectorArray_t &_newpoints,
     136      const IndexTupleList_t &_bestmatching
    118137      );
    119138
Note: See TracChangeset for help on using the changeset viewer.