Changeset e598f5 for src/Actions


Ignore:
Timestamp:
Sep 9, 2016, 5:04:06 PM (8 years ago)
Author:
Frederik Heber <heber@…>
Branches:
Action_Thermostats, Add_AtomRandomPerturbation, Add_FitFragmentPartialChargesAction, Add_RotateAroundBondAction, Add_SelectAtomByNameAction, Added_ParseSaveFragmentResults, 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_Restrictedkeyset_FragmentMolecule, Fix_StatusMsg, Fix_StepWorldTime_single_argument, Fix_Verbose_Codepatterns, Fixes, 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, SaturateAtoms_singleDegree, 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:
ce0f63
Parents:
4fa333
git-author:
Frederik Heber <heber@…> (09/01/16 21:18:19)
git-committer:
Frederik Heber <heber@…> (09/09/16 17:04:06)
Message:

FIX: appendToHomologies() sorted force keysets which brough them out of sequence with keysets.

  • we converted them from KeySetsContainer to IndexSetContainer but the conversion does not take place in the same manner as for the normal keysets as there is a different amount of (valid) keysets depending on the number of saturation hydrogen.
  • now we use the original containers which are in the same order (we checked that thoroughly via debugging) and convert to IndexSet when needed.
  • TEST: Removed all XFAIL from AnalyseFragmentationResults regression tests.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Actions/FragmentationAction/AnalyseFragmentationResultsAction.cpp

    r4fa333 re598f5  
    303303
    304304  // convert KeySetContainer to IndexSetContainer
    305   IndexSetContainer::ptr ForceContainer(new IndexSetContainer(shortrangeresults.getForceKeySet()));
    306   const IndexSetContainer::Container_t &Indices = shortrangeresults.getContainer();
    307   const IndexSetContainer::Container_t &ForceIndices = ForceContainer->getContainer();
    308   ASSERT( Indices.size() == ForceIndices.size(),
    309       "appendToHomologies() - Indices ("+toString(Indices.size())
    310       +") and ForceIndices ("+toString(ForceIndices.size())+") sizes differ.");
    311   IndexSetContainer::Container_t::const_iterator iter = Indices.begin();
    312   IndexSetContainer::Container_t::const_iterator forceiter = ForceIndices.begin();
     305  // BUG: Conversion changes order w.r.t to Indices(!)
     306  const IndexSetContainer::Container_t &container = shortrangeresults.getContainer();
     307  const KeySetsContainer &Indices = shortrangeresults.getKeySet();
     308  const KeySetsContainer &ForceIndices = shortrangeresults.getForceKeySet();
     309  if (Indices.KeySets.size() != ForceIndices.KeySets.size()) {
     310    ELOG(1, "appendToHomologies() - Indices (" << Indices.KeySets.size()
     311        << ") and ForceIndices (" << ForceIndices.KeySets.size() << ") sizes differ.");
     312    return false;
     313  }
     314  KeySetsContainer::ArrayOfIntVectors::const_iterator iter = Indices.KeySets.begin();
     315  KeySetsContainer::ArrayOfIntVectors::const_iterator forceiter = ForceIndices.KeySets.begin();
    313316
    314317  /// go through all fragments
    315   for (;iter != Indices.end(); ++iter, ++forceiter) // go through each IndexSet
     318  for (;iter != Indices.KeySets.end(); ++iter, ++forceiter) // go through each IndexSet
    316319  {
    317320    /// create new graph entry in HomologyContainer which is (key,value) type
    318     LOG(1, "INFO: Creating new graph with " << **forceiter << ".");
    319     HomologyGraph graph(**forceiter);
    320     const IndexSet::ptr &index = *iter;
    321     if (!(**forceiter).contains(**iter)) {
     321    LOG(1, "INFO: Creating new graph with " << *forceiter << ".");
     322    IndexSet forceindexset;
     323    forceindexset.insert(forceiter->begin(), forceiter->end());
     324    const HomologyGraph graph(forceindexset);
     325    // get index set entity from container for lookup to fragment result
     326    IndexSet::ptr indexset(new IndexSet);
     327    indexset->insert(iter->begin(), iter->end());
     328    if (!forceindexset.contains(*indexset)) {
    322329      // this caught an error with faulty KeySetsContainer::insert().
    323330      // indexset and forceindexset need to be in same order and differ
    324331      // only in forceindexset contains extra indices for saturation hydrogens
    325       ELOG(1, "appendToHomologies() - force index set " << (**forceiter)
    326           << " does not contain index set " << (**iter) << ".");
     332      ELOG(1, "appendToHomologies() - force index set " << forceindexset
     333          << " does not contain index set " << (*indexset) << ".");
    327334      return false;
    328335    }
     336    const IndexSetContainer::Container_t::const_iterator indexiter =
     337        std::lower_bound(container.begin(), container.end(), indexset);
     338    const IndexSet::ptr &index = *indexiter;
     339    ASSERT( *index == *indexset,
     340        "appendToHomologies() - could not find index set "+toString(*indexset)
     341        +" in the sorted IndexSetContainer.");
     342 
    329343
    330344    /// we fill the value structure
Note: See TracChangeset for help on using the changeset viewer.