Changeset 564f17


Ignore:
Timestamp:
Apr 28, 2021, 10:02:49 PM (5 years ago)
Author:
Frederik Heber <frederik.heber@…>
Branches:
Candidate_v1.7.0, stable
Children:
5aa337
Parents:
e0e77e
git-author:
Frederik Heber <frederik.heber@…> (04/18/21 12:23:17)
git-committer:
Frederik Heber <frederik.heber@…> (04/28/21 22:02:49)
Message:

Extended HomologyContainer::value_t by fragment energy.

  • renamed energy to contribution to notice all old usages.
Location:
src
Files:
9 edited

Legend:

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

    re0e77e r564f17  
    380380    }
    381381    value.edges = *edgeiter;
    382     value.energy = boost::fusion::at_key<MPQCDataFused::energy_total>(energyiter->second.second); // contributions
     382    value.contribution = boost::fusion::at_key<MPQCDataFused::energy_total>(energyiter->second.second); // contributions
     383    value.fragmentenergy = boost::fusion::at_key<MPQCDataFused::energy_total>(energyiter->second.first); // contributions
    383384
    384385    // only store sampled grids if desired
     
    442443      output << "DEBUG: graph " << iter->first
    443444          << " has Fragment " << iter->second.fragment
    444           << ", associated energy " << iter->second.energy;
     445          << ", associated energy contribution " << iter->second.contribution;
    445446      if (iter->second.containsGrids)
    446447#if defined(HAVE_JOBMARKET) && defined(HAVE_VMG)
  • src/Actions/GraphAction/ChemicalSpaceEvaluatorAction.cpp

    re0e77e r564f17  
    535535            std::max_element(range.first, range.second, HomologyContainer::compareEnergyContribution);
    536536        LOG(2, "INFO: Fragment graph " << nodes_graph << " has energy contributions from "
    537             << lowest_contribution_graph->second.energy << " Ht till "
    538             << highest_contribution_graph->second.energy << " Ht, picking lowest.");
    539         total_energy += lowest_contribution_graph->second.energy;
     537            << lowest_contribution_graph->second.contribution << " Ht till "
     538            << highest_contribution_graph->second.contribution << " Ht, picking lowest.");
     539        total_energy += lowest_contribution_graph->second.contribution;
    540540      }
    541541    }
  • src/Actions/PotentialAction/FitCompoundPotentialAction.cpp

    re0e77e r564f17  
    7878    LOG(1, "INFO: graph " << iter->first
    7979        << " has Fragment " << iter->second.fragment
    80         << ", associated energy " << iter->second.energy
     80        << ", associated energy " << iter->second.contribution
    8181        << ", and sampled grid integral " << iter->second.charge_distribution.integral()
    8282        << ".");
  • src/Actions/PotentialAction/FitPotentialAction.cpp

    re0e77e r564f17  
    130130    LOG(1, "INFO: graph " << iter->first
    131131        << " has Fragment " << iter->second.fragment
    132         << ", associated energy " << iter->second.energy
     132        << ", associated energy " << iter->second.contribution
    133133        << ", and sampled grid integral " << iter->second.charge_distribution.integral()
    134134        << ".");
  • src/Actions/PotentialAction/ParseHomologiesAction.cpp

    re0e77e r564f17  
    8787            std::max_element(range.first, range.second, HomologyContainer::compareEnergyContribution);
    8888        LOG(3, "DEBUG: Energy contributions range from "
    89             <<  lowest_contribution_graph->second.energy << " Ht to "
    90             << highest_contribution_graph->second.energy << " Ht.");
     89            <<  lowest_contribution_graph->second.contribution << " Ht to "
     90            << highest_contribution_graph->second.contribution << " Ht.");
    9191                    olditer = iter;
    9292                  }
  • src/Fragmentation/Homology/HomologyContainer.cpp

    re0e77e r564f17  
    6363    out << "Graph: " << iter->first
    6464        << ", (Fragment " << iter->second.fragment
    65         << ":" << iter->second.energy
     65        << ":" << iter->second.fragmentenergy
     66        << ":" << iter->second.contribution
    6667        << ":" << iter->second.charge_distribution.integral()
    6768        << ")\n";
     
    7475  if (fragment != othervalue.fragment)
    7576    return false;
    76   if (energy != othervalue.energy)
     77  if (fragmentenergy != othervalue.fragmentenergy)
     78    return false;
     79  if (contribution != othervalue.contribution)
    7780    return false;
    7881  if (charge_distribution != othervalue.charge_distribution)
     
    117120      const std::pair<const HomologyGraph, HomologyContainer::value_t> &a,
    118121      const std::pair<const HomologyGraph, HomologyContainer::value_t> &b) {
    119   return a.second.energy < b.second.energy;
     122  return a.second.contribution < b.second.contribution;
     123}
     124
     125bool HomologyContainer::compareEnergy(
     126      const std::pair<const HomologyGraph, HomologyContainer::value_t> &a,
     127      const std::pair<const HomologyGraph, HomologyContainer::value_t> &b) {
     128  return a.second.fragmentenergy < b.second.fragmentenergy;
    120129}
    121130
  • src/Fragmentation/Homology/HomologyContainer.hpp

    re0e77e r564f17  
    6060    Fragment fragment;
    6161    FragmentationEdges::edges_t edges;
    62     double energy;
     62    double fragmentenergy;
     63    double contribution;
    6364    bool containsGrids;
    6465    SamplingGrid charge_distribution;
     
    6667
    6768    value_t() :
    68       energy(0.),
     69      fragmentenergy(0.),
     70      contribution(0.),
    6971      containsGrids(false)
    7072    {}
     
    8183      if (version > 1)
    8284        ar & edges;
    83       ar & energy;
     85      if (version <= 2)
     86        ar & contribution;
     87      if (version > 2) {
     88        ar & fragmentenergy;
     89        ar & contribution;
     90      }
    8491      if (version > 0) {
    8592        ar & containsGrids;
     
    96103      const std::pair<const HomologyGraph, HomologyContainer::value_t> &b);
    97104
     105  static bool compareEnergy(
     106      const std::pair<const HomologyGraph, HomologyContainer::value_t> &a,
     107      const std::pair<const HomologyGraph, HomologyContainer::value_t> &b);
     108
    98109public:
    99110  typedef std::multimap< HomologyGraph, value_t> container_t;
     
    229240
    230241// version for serialized information associated to HomologyGraph
    231 BOOST_CLASS_VERSION(HomologyContainer::value_t, 2)
     242BOOST_CLASS_VERSION(HomologyContainer::value_t, 3)
    232243
    233244#endif /* HOMOLOGYCONTAINER_HPP_ */
  • src/Fragmentation/Homology/unittests/HomologyContainerUnitTest.cpp

    re0e77e r564f17  
    103103  HomologyContainer::value_t value1;
    104104  value1.fragment = dummy1;
    105   value1.energy = 1.;
     105  value1.contribution = 1.;
    106106  HomologyContainer::value_t value2;
    107107  value2.fragment = dummy2;
    108   value2.energy = 1.5;
     108  value2.contribution = 1.5;
    109109  HomologyContainer::value_t value3;
    110110  value3.fragment = dummy;
    111   value3.energy = 2.;
     111  value3.contribution = 2.;
    112112  container +=
    113113      std::make_pair( graph, value1 ),
     
    139139  HomologyContainer::value_t value;
    140140  value.fragment = dummy;
    141   value.energy = 1.;
     141  value.contribution = 1.;
    142142  newcontainer +=
    143143      std::make_pair( graph, value );
     
    165165  HomologyContainer::value_t value;
    166166  value.fragment = dummy;
    167   value.energy = 1.;
     167  value.contribution = 1.;
    168168  newcontainer +=
    169169      std::make_pair( graph, value );
  • src/FunctionApproximation/TrainingData.cpp

    re0e77e r564f17  
    6868        );
    6969    DistanceVector.push_back( all_args );
    70     const double &energy = iter->second.energy;
     70    const double &energy = iter->second.contribution;
    7171    EnergyVector.push_back( FunctionModel::results_t(1, energy) );
    7272    // filter distances out of list of all arguments
Note: See TracChangeset for help on using the changeset viewer.