Changeset 2199c2 for src/Fragmentation


Ignore:
Timestamp:
Sep 12, 2016, 11:48:36 PM (8 years ago)
Author:
Frederik Heber <heber@…>
Branches:
Action_Thermostats, Add_AtomRandomPerturbation, Add_FitFragmentPartialChargesAction, Add_RotateAroundBondAction, Add_SelectAtomByNameAction, Adding_Graph_to_ChangeBondActions, Adding_MD_integration_tests, Adding_StructOpt_integration_tests, Automaking_mpqc_open, AutomationFragmentation_failures, Candidate_v1.5.4, Candidate_v1.6.0, Candidate_v1.6.1, ChangeBugEmailaddress, ChangingTestPorts, ChemicalSpaceEvaluator, Combining_Subpackages, Debian_Package_split, Debian_package_split_molecuildergui_only, Disabling_MemDebug, Docu_Python_wait, EmpiricalPotential_contain_HomologyGraph, EmpiricalPotential_contain_HomologyGraph_documentation, Enable_parallel_make_install, Enhance_userguide, Enhanced_StructuralOptimization, Enhanced_StructuralOptimization_continued, Example_ManyWaysToTranslateAtom, Exclude_Hydrogens_annealWithBondGraph, FitPartialCharges_GlobalError, Fix_ChargeSampling_PBC, Fix_ChronosMutex, Fix_FitPartialCharges, Fix_FitPotential_needs_atomicnumbers, Fix_ForceAnnealing, Fix_IndependentFragmentGrids, Fix_ParseParticles, Fix_ParseParticles_split_forward_backward_Actions, Fix_StatusMsg, Fix_StepWorldTime_single_argument, Fix_Verbose_Codepatterns, ForceAnnealing_goodresults, ForceAnnealing_oldresults, ForceAnnealing_tocheck, ForceAnnealing_with_BondGraph, ForceAnnealing_with_BondGraph_continued, ForceAnnealing_with_BondGraph_continued_betteresults, ForceAnnealing_with_BondGraph_contraction-expansion, GeometryObjects, Gui_displays_atomic_force_velocity, IndependentFragmentGrids, IndependentFragmentGrids_IndividualZeroInstances, IndependentFragmentGrids_IntegrationTest, IndependentFragmentGrids_Sole_NN_Calculation, JobMarket_RobustOnKillsSegFaults, JobMarket_StableWorkerPool, JobMarket_unresolvable_hostname_fix, ODR_violation_mpqc_open, PartialCharges_OrthogonalSummation, PythonUI_with_named_parameters, QtGui_reactivate_TimeChanged_changes, Recreated_GuiChecks, RotateToPrincipalAxisSystem_UndoRedo, SaturateAtoms_findBestMatching, StoppableMakroAction, Subpackage_CodePatterns, Subpackage_JobMarket, Subpackage_LinearAlgebra, Subpackage_levmar, Subpackage_mpqc_open, Subpackage_vmg, ThirdParty_MPQC_rebuilt_buildsystem, TrajectoryDependenant_MaxOrder, TremoloParser_IncreasedPrecision, TremoloParser_MultipleTimesteps, Ubuntu_1604_changes, stable
Children:
450adf
Parents:
b67d89
git-author:
Frederik Heber <heber@…> (06/29/14 18:02:32)
git-committer:
Frederik Heber <heber@…> (09/12/16 23:48:36)
Message:

Extended SphericalPointDistribution::Polygon_t to WeightedPolygon_t.

  • contains additionally the weights from the already present points.
  • in order to deal sensibly with present bonds of higher degree (>1) that shift neighboring occupied orbitals even further away, we additionally pass on the bond degree. This indicates how many points of the N points have to be accumulated for this on present bond.
  • TESTS: Regression test FragmentMolecule-cylces failing for the moment.
Location:
src/Fragmentation/Exporters
Files:
3 edited

Legend:

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

    rb67d89 r2199c2  
    255255 */
    256256SphericalPointDistribution::IndexList_t SphericalPointDistribution::findBestMatching(
    257     const SphericalPointDistribution::Polygon_t &_polygon,
     257    const SphericalPointDistribution::WeightedPolygon_t &_polygon,
    258258    const SphericalPointDistribution::Polygon_t &_newpolygon
    259259    )
     
    262262  MCS.foundflag = false;
    263263  MCS.bestL2 = std::numeric_limits<double>::max();
    264   MCS.oldpoints.insert(MCS.oldpoints.begin(), _polygon.begin(),_polygon.end() );
     264  for (WeightedPolygon_t::const_iterator iter = _polygon.begin();
     265      iter != _polygon.end(); ++iter)
     266    MCS.oldpoints.push_back(iter->first);
    265267  MCS.newpoints.insert(MCS.newpoints.begin(), _newpolygon.begin(),_newpolygon.end() );
    266268
     
    494496SphericalPointDistribution::Polygon_t
    495497SphericalPointDistribution::matchSphericalPointDistributions(
    496     const SphericalPointDistribution::Polygon_t &_polygon,
     498    const SphericalPointDistribution::WeightedPolygon_t &_polygon,
    497499    const SphericalPointDistribution::Polygon_t &_newpolygon
    498500    )
    499501{
    500   SphericalPointDistribution::Polygon_t remainingreturnpolygon;
    501   VectorArray_t remainingold(_polygon.begin(), _polygon.end());
     502  SphericalPointDistribution::Polygon_t remainingpoints;
     503  VectorArray_t remainingold;
     504  for (WeightedPolygon_t::const_iterator iter = _polygon.begin();
     505      iter != _polygon.end(); ++iter)
     506    remainingold.push_back(iter->first);
    502507  VectorArray_t remainingnew(_newpolygon.begin(), _newpolygon.end());
    503508  LOG(2, "INFO: Matching old polygon " << _polygon
     
    507512    // same number of points desired as are present? Do nothing
    508513    LOG(2, "INFO: There are no vacant points to return.");
    509     return remainingreturnpolygon;
     514    return remainingpoints;
    510515  }
    511516
  • src/Fragmentation/Exporters/SphericalPointDistribution.hpp

    rb67d89 r2199c2  
    4444  //!> typedef for the list of points
    4545  typedef std::list<Vector> Polygon_t;
     46  //!> typedef for the list of points with integral weights
     47  typedef std::list<std::pair<Vector, int> > WeightedPolygon_t;
    4648
    4749  /** General getter function for the distribution of points on the surface.
     
    6971   */
    7072  static Polygon_t matchSphericalPointDistributions(
    71       const Polygon_t &_polygon,
     73      const WeightedPolygon_t &_polygon,
    7274      const Polygon_t &_newpolygon
    7375      );
     
    113115
    114116  static IndexList_t findBestMatching(
    115       const Polygon_t &_polygon,
     117      const WeightedPolygon_t &_polygon,
    116118      const Polygon_t &_newpolygon
    117119      );
  • src/Fragmentation/Exporters/unittests/SphericalPointDistributionUnitTest.cpp

    rb67d89 r2199c2  
    9090  // test with one point, matching trivially
    9191  {
    92     SphericalPointDistribution::Polygon_t polygon;
    93     polygon += Vector(1.,0.,0.);
     92    SphericalPointDistribution::WeightedPolygon_t polygon;
     93    polygon += std::make_pair(Vector(1.,0.,0.), 1);
    9494    SphericalPointDistribution::Polygon_t newpolygon =
    9595        SPD.get<2>();
     
    105105  // test with one point, just a flip of axis
    106106  {
    107     SphericalPointDistribution::Polygon_t polygon;
    108     polygon += Vector(0.,1.,0.);
     107    SphericalPointDistribution::WeightedPolygon_t polygon;
     108    polygon += std::make_pair( Vector(0.,1.,0.), 1);
    109109    SphericalPointDistribution::Polygon_t newpolygon =
    110110        SPD.get<2>();
     
    120120  // test with one point, just a flip to another axis
    121121  {
    122     SphericalPointDistribution::Polygon_t polygon;
    123     polygon += Vector(0.,0.,-1.);
     122    SphericalPointDistribution::WeightedPolygon_t polygon;
     123    polygon += std::make_pair( Vector(0.,0.,-1.), 1);
    124124    SphericalPointDistribution::Polygon_t newpolygon =
    125125        SPD.get<2>();
     
    136136  {
    137137    Line RotationAxis(zeroVec, Vector(0.2, 0.43, 0.6893248));
    138     SphericalPointDistribution::Polygon_t polygon;
    139     polygon += RotationAxis.rotateVector(Vector(1.,0.,0.), 47.6/180*M_PI);
     138    SphericalPointDistribution::WeightedPolygon_t polygon;
     139    polygon += std::make_pair(RotationAxis.rotateVector(Vector(1.,0.,0.), 47.6/180*M_PI), 1);
    140140    SphericalPointDistribution::Polygon_t newpolygon =
    141141        SPD.get<2>();
     
    151151
    152152void perturbPolygon(
    153     SphericalPointDistribution::Polygon_t &_polygon,
     153    SphericalPointDistribution::WeightedPolygon_t &_polygon,
    154154    double _amplitude
    155155    )
    156156{
    157   for (SphericalPointDistribution::Polygon_t::iterator iter = _polygon.begin();
     157  for (SphericalPointDistribution::WeightedPolygon_t::iterator iter = _polygon.begin();
    158158      iter != _polygon.end(); ++iter) {
    159159    Vector perturber;
    160     perturber.GetOneNormalVector((*iter));
     160    perturber.GetOneNormalVector(iter->first);
    161161    perturber.Scale(_amplitude);
    162     *iter = *iter + perturber;
    163     (*iter).Normalize();
     162    iter->first = iter->first + perturber;
     163    (iter->first).Normalize();
    164164  }
    165165}
     
    254254  // test with one point, matching trivially
    255255  {
    256     SphericalPointDistribution::Polygon_t polygon;
    257     polygon += Vector(1.,0.,0.);
     256    SphericalPointDistribution::WeightedPolygon_t polygon;
     257    polygon += std::make_pair( Vector(1.,0.,0.), 1);
    258258    SphericalPointDistribution::Polygon_t newpolygon =
    259259        SPD.get<3>();
     
    269269  // test with one point, just a flip of x and y axis
    270270  {
    271     SphericalPointDistribution::Polygon_t polygon;
    272     polygon += Vector(0.,1.,0.);
     271    SphericalPointDistribution::WeightedPolygon_t polygon;
     272    polygon += std::make_pair( Vector(0.,1.,0.), 1);
    273273    SphericalPointDistribution::Polygon_t newpolygon =
    274274        SPD.get<3>();
     
    289289  // test with two points, matching trivially
    290290  {
    291     SphericalPointDistribution::Polygon_t polygon;
    292     polygon += Vector(1.,0.,0.), Vector(-0.5, sqrt(3)*0.5,0.);
     291    SphericalPointDistribution::WeightedPolygon_t polygon;
     292    polygon += std::make_pair( Vector(1.,0.,0.), 1);
     293    polygon += std::make_pair( Vector(-0.5, sqrt(3)*0.5,0.), 1);
    293294    SphericalPointDistribution::Polygon_t newpolygon =
    294295        SPD.get<3>();
     
    310311  {
    311312    Line RotationAxis(zeroVec, Vector(0.2, 0.43, 0.6893248));
    312     SphericalPointDistribution::Polygon_t polygon;
    313     polygon +=
    314         RotationAxis.rotateVector(Vector(1.,0.,0.), 47.6/180*M_PI),
    315         RotationAxis.rotateVector(Vector(-0.5, sqrt(3)*0.5,0.), 47.6/180*M_PI);
     313    SphericalPointDistribution::WeightedPolygon_t polygon;
     314    polygon += std::make_pair(RotationAxis.rotateVector(Vector(1.,0.,0.), 47.6/180*M_PI), 1);
     315    polygon += std::make_pair(RotationAxis.rotateVector(Vector(-0.5, sqrt(3)*0.5,0.), 47.6/180*M_PI), 1);
    316316    SphericalPointDistribution::Polygon_t newpolygon =
    317317        SPD.get<3>();
     
    335335  // test with three points, matching trivially
    336336  {
    337     SphericalPointDistribution::Polygon_t polygon;
    338     polygon += Vector(1.,0.,0.), Vector(-0.5, sqrt(3)*0.5,0.), Vector(-0.5, -sqrt(3)*0.5,0.);
     337    SphericalPointDistribution::WeightedPolygon_t polygon;
     338    polygon += std::make_pair( Vector(1.,0.,0.), 1);
     339    polygon += std::make_pair( Vector(-0.5, sqrt(3)*0.5,0.), 1);
     340    polygon += std::make_pair( Vector(-0.5, -sqrt(3)*0.5,0.), 1);
    339341    SphericalPointDistribution::Polygon_t newpolygon =
    340342        SPD.get<3>();
     
    355357  {
    356358    Line RotationAxis(zeroVec, Vector(0.2, 0.43, 0.6893248));
    357     SphericalPointDistribution::Polygon_t polygon;
    358     polygon +=
    359         RotationAxis.rotateVector(Vector(1.,0.,0.), 47.6/180*M_PI),
    360         RotationAxis.rotateVector(Vector(-0.5, sqrt(3)*0.5,0.), 47.6/180*M_PI),
    361         RotationAxis.rotateVector(Vector(-0.5, -sqrt(3)*0.5,0.), 47.6/180*M_PI);
     359    SphericalPointDistribution::WeightedPolygon_t polygon;
     360    polygon += std::make_pair(RotationAxis.rotateVector(Vector(1.,0.,0.), 47.6/180*M_PI), 1);
     361    polygon += std::make_pair(RotationAxis.rotateVector(Vector(-0.5, sqrt(3)*0.5,0.), 47.6/180*M_PI), 1);
     362    polygon += std::make_pair(RotationAxis.rotateVector(Vector(-0.5, -sqrt(3)*0.5,0.), 47.6/180*M_PI), 1);
    362363    SphericalPointDistribution::Polygon_t newpolygon =
    363364        SPD.get<3>();
     
    383384  // test with one point, matching trivially
    384385  {
    385     SphericalPointDistribution::Polygon_t polygon;
    386     polygon += Vector(1.,0.,0.);
     386    SphericalPointDistribution::WeightedPolygon_t polygon;
     387    polygon += std::make_pair( Vector(1.,0.,0.), 1);
    387388    SphericalPointDistribution::Polygon_t newpolygon =
    388389        SPD.get<4>();
     
    398399  // test with one point, just a flip of axis
    399400  {
    400     SphericalPointDistribution::Polygon_t polygon;
    401     polygon += Vector(0.,1.,0.);
     401    SphericalPointDistribution::WeightedPolygon_t polygon;
     402    polygon += std::make_pair( Vector(0.,1.,0.), 1);
    402403    SphericalPointDistribution::Polygon_t newpolygon =
    403404        SPD.get<4>();
     
    418419  // test with two points, matching trivially
    419420  {
    420     SphericalPointDistribution::Polygon_t polygon;
    421     polygon += Vector(1.,0.,0.), Vector(-1./3.0, 2.0*M_SQRT2/3.0,0.);
     421    SphericalPointDistribution::WeightedPolygon_t polygon;
     422    polygon += std::make_pair( Vector(1.,0.,0.), 1);
     423    polygon += std::make_pair( Vector(-1./3.0, 2.0*M_SQRT2/3.0,0.), 1);
    422424    SphericalPointDistribution::Polygon_t newpolygon =
    423425        SPD.get<4>();
     
    438440  // test with two points, matching trivially, also with slightly perturbed
    439441  {
    440     SphericalPointDistribution::Polygon_t polygon;
    441     polygon += Vector(1.,0.,0.), Vector(-1./3.0, 2.0*M_SQRT2/3.0,0.);
     442    SphericalPointDistribution::WeightedPolygon_t polygon;
     443    polygon += std::make_pair( Vector(1.,0.,0.), 1);
     444    polygon += std::make_pair( Vector(-1./3.0, 2.0*M_SQRT2/3.0,0.), 1);
    442445    SphericalPointDistribution::Polygon_t newpolygon =
    443446        SPD.get<4>();
     
    459462  {
    460463    Line RotationAxis(zeroVec, Vector(0.2, 0.43, 0.6893248));
    461     SphericalPointDistribution::Polygon_t polygon;
    462     polygon +=
    463         RotationAxis.rotateVector(Vector(1.,0.,0.), 47.6/180*M_PI),
    464         RotationAxis.rotateVector(Vector(-1./3.0, 2.0*M_SQRT2/3.0,0.), 47.6/180*M_PI);
     464    SphericalPointDistribution::WeightedPolygon_t polygon;
     465    polygon += std::make_pair(RotationAxis.rotateVector(Vector(1.,0.,0.), 47.6/180*M_PI), 1);
     466    polygon += std::make_pair(RotationAxis.rotateVector(Vector(-1./3.0, 2.0*M_SQRT2/3.0,0.), 47.6/180*M_PI), 1);
    465467    SphericalPointDistribution::Polygon_t newpolygon =
    466468        SPD.get<4>();
     
    484486  // test with three points, matching trivially
    485487  {
    486     SphericalPointDistribution::Polygon_t polygon;
    487     polygon +=
    488         Vector(1.,0.,0.),
    489         Vector(-1./3.0, 2.0*M_SQRT2/3.0,0.),
    490         Vector(-1./3.0, -M_SQRT2/3.0, M_SQRT2/sqrt(3));
     488    SphericalPointDistribution::WeightedPolygon_t polygon;
     489    polygon += std::make_pair( Vector(1.,0.,0.), 1);
     490    polygon += std::make_pair( Vector(-1./3.0, 2.0*M_SQRT2/3.0,0.), 1);
     491    polygon += std::make_pair( Vector(-1./3.0, -M_SQRT2/3.0, M_SQRT2/sqrt(3)), 1);
    491492    SphericalPointDistribution::Polygon_t newpolygon =
    492493        SPD.get<4>();
     
    509510  {
    510511    Line RotationAxis(zeroVec, Vector(0.2, 0.43, 0.6893248));
    511     SphericalPointDistribution::Polygon_t polygon;
    512     polygon +=
    513         RotationAxis.rotateVector(Vector(1.,0.,0.), 47.6/180*M_PI),
    514         RotationAxis.rotateVector(Vector(-1./3.0, 2.0*M_SQRT2/3.0,0.), 47.6/180*M_PI),
    515         RotationAxis.rotateVector(Vector(-1./3.0, -M_SQRT2/3.0, M_SQRT2/sqrt(3)), 47.6/180*M_PI);
     512    SphericalPointDistribution::WeightedPolygon_t polygon;
     513    polygon += std::make_pair(RotationAxis.rotateVector(Vector(1.,0.,0.), 47.6/180*M_PI), 1);
     514    polygon += std::make_pair(RotationAxis.rotateVector(Vector(-1./3.0, 2.0*M_SQRT2/3.0,0.), 47.6/180*M_PI), 1);
     515    polygon += std::make_pair(RotationAxis.rotateVector(Vector(-1./3.0, -M_SQRT2/3.0, M_SQRT2/sqrt(3)), 47.6/180*M_PI), 1);
    516516    SphericalPointDistribution::Polygon_t newpolygon =
    517517        SPD.get<4>();
     
    543543  // test with one point, matching trivially
    544544  {
    545     SphericalPointDistribution::Polygon_t polygon;
    546     polygon += Vector(1.,0.,0.);
     545    SphericalPointDistribution::WeightedPolygon_t polygon;
     546    polygon += std::make_pair( Vector(1.,0.,0.), 1);
    547547    SphericalPointDistribution::Polygon_t newpolygon =
    548548        SPD.get<5>();
     
    558558  // test with one point, just a flip of axis
    559559  {
    560     SphericalPointDistribution::Polygon_t polygon;
    561     polygon += Vector(0.,1.,0.);
     560    SphericalPointDistribution::WeightedPolygon_t polygon;
     561    polygon += std::make_pair( Vector(0.,1.,0.), 1);
    562562    SphericalPointDistribution::Polygon_t newpolygon =
    563563        SPD.get<5>();
     
    578578  // test with two points, matching trivially
    579579  {
    580     SphericalPointDistribution::Polygon_t polygon;
    581     polygon += Vector(1.,0.,0.), Vector(-1.,0.,0.);
     580    SphericalPointDistribution::WeightedPolygon_t polygon;
     581    polygon += std::make_pair( Vector(1.,0.,0.), 1);
     582    polygon += std::make_pair( Vector(-1.,0.,0.), 1);
    582583    SphericalPointDistribution::Polygon_t newpolygon =
    583584        SPD.get<5>();
     
    599600  {
    600601    Line RotationAxis(zeroVec, Vector(0.2, 0.43, 0.6893248));
    601     SphericalPointDistribution::Polygon_t polygon;
    602     polygon +=
    603         RotationAxis.rotateVector(Vector(1.,0.,0.), 47.6/180.*M_PI),
    604         RotationAxis.rotateVector(Vector(-1.,0.,0.), 47.6/180.*M_PI);
     602    SphericalPointDistribution::WeightedPolygon_t polygon;
     603    polygon += std::make_pair(RotationAxis.rotateVector(Vector(1.,0.,0.), 47.6/180.*M_PI), 1);
     604    polygon += std::make_pair(RotationAxis.rotateVector(Vector(-1.,0.,0.), 47.6/180.*M_PI), 1);
    605605    SphericalPointDistribution::Polygon_t newpolygon =
    606606        SPD.get<5>();
     
    619619    // hence, we just check that they are orthogonal to the first two points
    620620    CPPUNIT_ASSERT_EQUAL( expected.size(), remaining.size() );
    621     for (SphericalPointDistribution::Polygon_t::const_iterator fixiter = polygon.begin();
     621    for (SphericalPointDistribution::WeightedPolygon_t::const_iterator fixiter = polygon.begin();
    622622        fixiter != polygon.end(); ++fixiter) {
    623623      for (SphericalPointDistribution::Polygon_t::const_iterator iter = remaining.begin();
    624624          iter != remaining.end(); ++iter) {
    625         CPPUNIT_ASSERT( (*fixiter).IsNormalTo(*iter) );
     625        CPPUNIT_ASSERT( (fixiter->first).IsNormalTo(*iter) );
    626626      }
    627627    }
     
    630630  // test with three points, matching trivially
    631631  {
    632     SphericalPointDistribution::Polygon_t polygon;
    633     polygon +=
    634         Vector(1.,0.,0.),
    635         Vector(-1., 0.0, 0.0),
    636         Vector(0.0, 1., 0.0);
     632    SphericalPointDistribution::WeightedPolygon_t polygon;
     633    polygon += std::make_pair( Vector(1.,0.,0.), 1);
     634    polygon += std::make_pair( Vector(-1., 0.0, 0.0), 1);
     635    polygon += std::make_pair( Vector(0.0, 1., 0.0), 1);
    637636    SphericalPointDistribution::Polygon_t newpolygon =
    638637        SPD.get<5>();
     
    655654  {
    656655    Line RotationAxis(zeroVec, Vector(0.2, 0.43, 0.6893248));
    657     SphericalPointDistribution::Polygon_t polygon;
    658     polygon +=
    659         RotationAxis.rotateVector(Vector(1.,0.,0.), 47.6/180*M_PI),
    660         RotationAxis.rotateVector(Vector(-1., 0.0, 0.0), 47.6/180*M_PI),
    661         RotationAxis.rotateVector(Vector(0.0, 1., 0.0), 47.6/180*M_PI);
     656    SphericalPointDistribution::WeightedPolygon_t polygon;
     657    polygon += std::make_pair(RotationAxis.rotateVector(Vector(1.,0.,0.), 47.6/180*M_PI), 1);
     658    polygon += std::make_pair(RotationAxis.rotateVector(Vector(-1., 0.0, 0.0), 47.6/180*M_PI), 1);
     659    polygon += std::make_pair(RotationAxis.rotateVector(Vector(0.0, 1., 0.0), 47.6/180*M_PI), 1);
    662660    SphericalPointDistribution::Polygon_t newpolygon =
    663661        SPD.get<5>();
     
    689687  // test with one point, matching trivially
    690688  {
    691     SphericalPointDistribution::Polygon_t polygon;
    692     polygon += Vector(1.,0.,0.);
     689    SphericalPointDistribution::WeightedPolygon_t polygon;
     690    polygon += std::make_pair( Vector(1.,0.,0.), 1);
    693691    SphericalPointDistribution::Polygon_t newpolygon =
    694692        SPD.get<6>();
     
    704702  // test with one point, just a flip of axis
    705703  {
    706     SphericalPointDistribution::Polygon_t polygon;
    707     polygon += Vector(0.,1.,0.);
     704    SphericalPointDistribution::WeightedPolygon_t polygon;
     705    polygon += std::make_pair( Vector(0.,1.,0.), 1);
    708706    SphericalPointDistribution::Polygon_t newpolygon =
    709707        SPD.get<6>();
     
    724722  // test with two points, matching trivially
    725723  {
    726     SphericalPointDistribution::Polygon_t polygon;
    727     polygon += Vector(1.,0.,0.), Vector(-1.,0.,0.);
     724    SphericalPointDistribution::WeightedPolygon_t polygon;
     725    polygon += std::make_pair( Vector(1.,0.,0.), 1);
     726    polygon += std::make_pair( Vector(-1.,0.,0.), 1);
    728727    SphericalPointDistribution::Polygon_t newpolygon =
    729728        SPD.get<6>();
     
    745744  {
    746745    Line RotationAxis(zeroVec, Vector(0.2, 0.43, 0.6893248));
    747     SphericalPointDistribution::Polygon_t polygon;
    748     polygon +=
    749         RotationAxis.rotateVector(Vector(1.,0.,0.), 47.6/180*M_PI),
    750         RotationAxis.rotateVector(Vector(-1.,0.,0.), 47.6/180*M_PI);
     746    SphericalPointDistribution::WeightedPolygon_t polygon;
     747    polygon += std::make_pair(RotationAxis.rotateVector(Vector(1.,0.,0.), 47.6/180*M_PI), 1);
     748    polygon += std::make_pair(RotationAxis.rotateVector(Vector(-1.,0.,0.), 47.6/180*M_PI), 1);
    751749    SphericalPointDistribution::Polygon_t newpolygon =
    752750        SPD.get<6>();
     
    765763    // hence, we just check that they are orthogonal to the first two points
    766764    CPPUNIT_ASSERT_EQUAL( expected.size(), remaining.size() );
    767     for (SphericalPointDistribution::Polygon_t::const_iterator fixiter = polygon.begin();
     765    for (SphericalPointDistribution::WeightedPolygon_t::const_iterator fixiter = polygon.begin();
    768766        fixiter != polygon.end(); ++fixiter) {
    769767      for (SphericalPointDistribution::Polygon_t::const_iterator iter = remaining.begin();
    770768          iter != remaining.end(); ++iter) {
    771         CPPUNIT_ASSERT( (*fixiter).IsNormalTo(*iter) );
     769        CPPUNIT_ASSERT( (fixiter->first).IsNormalTo(*iter) );
    772770      }
    773771    }
     
    776774  // test with three points, matching trivially
    777775  {
    778     SphericalPointDistribution::Polygon_t polygon;
    779     polygon +=
    780         Vector(1.,0.,0.),
    781         Vector(-1., 0.0, 0.0),
    782         Vector(0.0, 1., 0.0);
     776    SphericalPointDistribution::WeightedPolygon_t polygon;
     777    polygon += std::make_pair( Vector(1.,0.,0.), 1);
     778    polygon += std::make_pair( Vector(-1., 0.0, 0.0), 1);
     779    polygon += std::make_pair( Vector(0.0, 1., 0.0), 1);
    783780    SphericalPointDistribution::Polygon_t newpolygon =
    784781        SPD.get<6>();
     
    801798  {
    802799    Line RotationAxis(zeroVec, Vector(0.2, 0.43, 0.6893248));
    803     SphericalPointDistribution::Polygon_t polygon;
    804     polygon +=
    805         RotationAxis.rotateVector(Vector(1.,0.,0.), 47.6/180*M_PI),
    806         RotationAxis.rotateVector(Vector(-1., 0.0, 0.0), 47.6/180*M_PI),
    807         RotationAxis.rotateVector(Vector(0.0, 1., 0.0), 47.6/180*M_PI);
     800    SphericalPointDistribution::WeightedPolygon_t polygon;
     801    polygon += std::make_pair(RotationAxis.rotateVector(Vector(1.,0.,0.), 47.6/180*M_PI), 1);
     802    polygon += std::make_pair(RotationAxis.rotateVector(Vector(-1., 0.0, 0.0), 47.6/180*M_PI), 1);
     803    polygon += std::make_pair(RotationAxis.rotateVector(Vector(0.0, 1., 0.0), 47.6/180*M_PI), 1);
    808804    SphericalPointDistribution::Polygon_t newpolygon =
    809805        SPD.get<6>();
     
    835831  // test with one point, matching trivially
    836832  {
    837     SphericalPointDistribution::Polygon_t polygon;
    838     polygon += Vector(1.,0.,0.);
     833    SphericalPointDistribution::WeightedPolygon_t polygon;
     834    polygon += std::make_pair( Vector(1.,0.,0.), 1);
    839835    SphericalPointDistribution::Polygon_t newpolygon =
    840836        SPD.get<7>();
     
    850846  // test with one point, just a flip of axis
    851847  {
    852     SphericalPointDistribution::Polygon_t polygon;
    853     polygon += Vector(0.,1.,0.);
     848    SphericalPointDistribution::WeightedPolygon_t polygon;
     849    polygon += std::make_pair( Vector(0.,1.,0.), 1);
    854850    SphericalPointDistribution::Polygon_t newpolygon =
    855851        SPD.get<7>();
     
    870866  // test with two points, matching trivially
    871867  {
    872     SphericalPointDistribution::Polygon_t polygon;
    873     polygon += Vector(1.,0.,0.), Vector(-1.,0.,0.);
     868    SphericalPointDistribution::WeightedPolygon_t polygon;
     869    polygon += std::make_pair( Vector(1.,0.,0.), 1);
     870    polygon += std::make_pair( Vector(-1.,0.,0.), 1);
    874871    SphericalPointDistribution::Polygon_t newpolygon =
    875872        SPD.get<7>();
     
    891888  {
    892889    Line RotationAxis(zeroVec, Vector(0.2, 0.43, 0.6893248));
    893     SphericalPointDistribution::Polygon_t polygon;
    894     polygon +=
    895         RotationAxis.rotateVector(Vector(1.,0.,0.), 47.6/180*M_PI),
    896         RotationAxis.rotateVector(Vector(-1.,0.,0.), 47.6/180*M_PI);
     890    SphericalPointDistribution::WeightedPolygon_t polygon;
     891    polygon += std::make_pair(RotationAxis.rotateVector(Vector(1.,0.,0.), 47.6/180*M_PI), 1);
     892    polygon += std::make_pair(RotationAxis.rotateVector(Vector(-1.,0.,0.), 47.6/180*M_PI), 1);
    897893    SphericalPointDistribution::Polygon_t newpolygon =
    898894        SPD.get<7>();
     
    911907    // hence, we just check that they are orthogonal to the first two points
    912908    CPPUNIT_ASSERT_EQUAL( expected.size(), remaining.size() );
    913     for (SphericalPointDistribution::Polygon_t::const_iterator fixiter = polygon.begin();
     909    for (SphericalPointDistribution::WeightedPolygon_t::const_iterator fixiter = polygon.begin();
    914910        fixiter != polygon.end(); ++fixiter) {
    915911      for (SphericalPointDistribution::Polygon_t::const_iterator iter = remaining.begin();
    916912          iter != remaining.end(); ++iter) {
    917         CPPUNIT_ASSERT( (*fixiter).IsNormalTo(*iter) );
     913        CPPUNIT_ASSERT( (fixiter->first).IsNormalTo(*iter) );
    918914      }
    919915    }
     
    922918  // test with three points, matching trivially
    923919  {
    924     SphericalPointDistribution::Polygon_t polygon;
    925     polygon +=
    926         Vector(1.,0.,0.),
    927         Vector(-1., 0.0, 0.0),
    928         Vector(0.0, 1., 0.0);
     920    SphericalPointDistribution::WeightedPolygon_t polygon;
     921    polygon += std::make_pair( Vector(1.,0.,0.), 1);
     922    polygon += std::make_pair( Vector(-1., 0.0, 0.0), 1);
     923    polygon += std::make_pair( Vector(0.0, 1., 0.0), 1);
    929924    SphericalPointDistribution::Polygon_t newpolygon =
    930925        SPD.get<7>();
     
    947942  {
    948943    Line RotationAxis(zeroVec, Vector(0.2, 0.43, 0.6893248));
    949     SphericalPointDistribution::Polygon_t polygon;
    950     polygon +=
    951         RotationAxis.rotateVector(Vector(1.,0.,0.), 47.6/180*M_PI),
    952         RotationAxis.rotateVector(Vector(-1., 0.0, 0.0), 47.6/180*M_PI),
    953         RotationAxis.rotateVector(Vector(0.0, 1., 0.0), 47.6/180*M_PI);
     944    SphericalPointDistribution::WeightedPolygon_t polygon;
     945    polygon += std::make_pair(RotationAxis.rotateVector(Vector(1.,0.,0.), 47.6/180*M_PI), 1);
     946    polygon += std::make_pair(RotationAxis.rotateVector(Vector(-1., 0.0, 0.0), 47.6/180*M_PI), 1);
     947    polygon += std::make_pair(RotationAxis.rotateVector(Vector(0.0, 1., 0.0), 47.6/180*M_PI), 1);
    954948    SphericalPointDistribution::Polygon_t newpolygon =
    955949        SPD.get<7>();
     
    981975  // test with one point, matching trivially
    982976  {
    983     SphericalPointDistribution::Polygon_t polygon;
    984     polygon += Vector(1.,0.,0.);
     977    SphericalPointDistribution::WeightedPolygon_t polygon;
     978    polygon += std::make_pair( Vector(1.,0.,0.), 1);
    985979    SphericalPointDistribution::Polygon_t newpolygon =
    986980        SPD.get<8>();
     
    996990  // test with one point, just a flip of axis
    997991  {
    998     SphericalPointDistribution::Polygon_t polygon;
    999     polygon += Vector(0.,1.,0.);
     992    SphericalPointDistribution::WeightedPolygon_t polygon;
     993    polygon += std::make_pair( Vector(0.,1.,0.), 1);
    1000994    SphericalPointDistribution::Polygon_t newpolygon =
    1001995        SPD.get<8>();
     
    10161010  // test with two points, matching trivially
    10171011  {
    1018     SphericalPointDistribution::Polygon_t polygon;
    1019     polygon += Vector(1.,0.,0.), Vector(-1.,0.,0.);
     1012    SphericalPointDistribution::WeightedPolygon_t polygon;
     1013    polygon += std::make_pair( Vector(1.,0.,0.), 1);
     1014    polygon += std::make_pair( Vector(-1.,0.,0.), 1);
    10201015    SphericalPointDistribution::Polygon_t newpolygon =
    10211016        SPD.get<8>();
     
    10371032  {
    10381033    Line RotationAxis(zeroVec, Vector(0.2, 0.43, 0.6893248));
    1039     SphericalPointDistribution::Polygon_t polygon;
    1040     polygon +=
    1041         RotationAxis.rotateVector(Vector(1.,0.,0.), 47.6/180*M_PI),
    1042         RotationAxis.rotateVector(Vector(-1.,0.,0.), 47.6/180*M_PI);
     1034    SphericalPointDistribution::WeightedPolygon_t polygon;
     1035    polygon += std::make_pair(RotationAxis.rotateVector(Vector(1.,0.,0.), 47.6/180*M_PI), 1);
     1036    polygon += std::make_pair(RotationAxis.rotateVector(Vector(-1.,0.,0.), 47.6/180*M_PI), 1);
    10431037    SphericalPointDistribution::Polygon_t newpolygon =
    10441038        SPD.get<8>();
     
    10571051    // hence, we just check that they are orthogonal to the first two points
    10581052    CPPUNIT_ASSERT_EQUAL( expected.size(), remaining.size() );
    1059     for (SphericalPointDistribution::Polygon_t::const_iterator fixiter = polygon.begin();
     1053    for (SphericalPointDistribution::WeightedPolygon_t::const_iterator fixiter = polygon.begin();
    10601054        fixiter != polygon.end(); ++fixiter) {
    10611055      SphericalPointDistribution::Polygon_t::const_iterator expectiter = expected.begin();
     
    10641058        // check that points in expected/remaining have same angle to the given ones
    10651059//        CPPUNIT_ASSERT_EQUAL( (*expectiter).Angle(*fixiter), (*remainiter).Angle(*fixiter) );
    1066         CPPUNIT_ASSERT( fabs( (*expectiter).Angle(*fixiter) - (*remainiter).Angle(*fixiter) )
     1060        CPPUNIT_ASSERT( fabs( (*expectiter).Angle(fixiter->first) - (*remainiter).Angle(fixiter->first) )
    10671061            < std::numeric_limits<double>::epsilon()*1e4 );
    10681062      }
     
    10721066  // test with three points, matching trivially
    10731067  {
    1074     SphericalPointDistribution::Polygon_t polygon;
    1075     polygon +=
    1076         Vector(1.,0.,0.),
    1077         Vector(-1., 0.0, 0.0),
    1078         Vector(-1./3.0, 2.0*M_SQRT2/3.0, 0.0);
     1068    SphericalPointDistribution::WeightedPolygon_t polygon;
     1069    polygon += std::make_pair( Vector(1.,0.,0.), 1);
     1070    polygon += std::make_pair( Vector(-1., 0.0, 0.0), 1);
     1071    polygon += std::make_pair( Vector(-1./3.0, 2.0*M_SQRT2/3.0, 0.0), 1);
    10791072    SphericalPointDistribution::Polygon_t newpolygon =
    10801073        SPD.get<8>();
     
    10971090  {
    10981091    Line RotationAxis(zeroVec, Vector(0.2, 0.43, 0.6893248));
    1099     SphericalPointDistribution::Polygon_t polygon;
    1100     polygon +=
    1101         RotationAxis.rotateVector(Vector(1.,0.,0.), 47.6/180*M_PI),
    1102         RotationAxis.rotateVector(Vector(-1., 0.0, 0.0), 47.6/180*M_PI),
    1103         RotationAxis.rotateVector(Vector(-1./3.0, 2.0*M_SQRT2/3.0, 0.0), 47.6/180*M_PI);
     1092    SphericalPointDistribution::WeightedPolygon_t polygon;
     1093    polygon += std::make_pair(RotationAxis.rotateVector(Vector(1.,0.,0.), 47.6/180*M_PI), 1);
     1094    polygon += std::make_pair(RotationAxis.rotateVector(Vector(-1., 0.0, 0.0), 47.6/180*M_PI), 1);
     1095    polygon += std::make_pair(RotationAxis.rotateVector(Vector(-1./3.0, 2.0*M_SQRT2/3.0, 0.0), 47.6/180*M_PI), 1);
    11041096    SphericalPointDistribution::Polygon_t newpolygon =
    11051097        SPD.get<8>();
Note: See TracChangeset for help on using the changeset viewer.