Changeset 675cd6


Ignore:
Timestamp:
Oct 17, 2013, 7:24:06 AM (11 years ago)
Author:
Frederik Heber <heber@…>
Branches:
Action_Thermostats, Add_AtomRandomPerturbation, Add_FitFragmentPartialChargesAction, Add_RotateAroundBondAction, Add_SelectAtomByNameAction, Added_ParseSaveFragmentResults, AddingActions_SaveParseParticleParameters, Adding_Graph_to_ChangeBondActions, Adding_MD_integration_tests, Adding_ParticleName_to_Atom, Adding_StructOpt_integration_tests, AtomFragments, Automaking_mpqc_open, AutomationFragmentation_failures, Candidate_v1.5.4, Candidate_v1.6.0, Candidate_v1.6.1, ChangeBugEmailaddress, ChangingTestPorts, ChemicalSpaceEvaluator, CombiningParticlePotentialParsing, 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_BoundInBox_CenterInBox_MoleculeActions, Fix_ChargeSampling_PBC, Fix_ChronosMutex, Fix_FitPartialCharges, Fix_FitPotential_needs_atomicnumbers, Fix_ForceAnnealing, Fix_IndependentFragmentGrids, Fix_ParseParticles, Fix_ParseParticles_split_forward_backward_Actions, Fix_PopActions, Fix_QtFragmentList_sorted_selection, Fix_Restrictedkeyset_FragmentMolecule, Fix_StatusMsg, Fix_StepWorldTime_single_argument, Fix_Verbose_Codepatterns, Fix_fitting_potentials, Fixes, ForceAnnealing_goodresults, ForceAnnealing_oldresults, ForceAnnealing_tocheck, ForceAnnealing_with_BondGraph, ForceAnnealing_with_BondGraph_continued, ForceAnnealing_with_BondGraph_continued_betteresults, ForceAnnealing_with_BondGraph_contraction-expansion, FragmentAction_writes_AtomFragments, FragmentMolecule_checks_bonddegrees, GeometryObjects, Gui_Fixes, Gui_displays_atomic_force_velocity, ImplicitCharges, IndependentFragmentGrids, IndependentFragmentGrids_IndividualZeroInstances, IndependentFragmentGrids_IntegrationTest, IndependentFragmentGrids_Sole_NN_Calculation, JobMarket_RobustOnKillsSegFaults, JobMarket_StableWorkerPool, JobMarket_unresolvable_hostname_fix, MoreRobust_FragmentAutomation, ODR_violation_mpqc_open, PartialCharges_OrthogonalSummation, PdbParser_setsAtomName, PythonUI_with_named_parameters, QtGui_reactivate_TimeChanged_changes, Recreated_GuiChecks, Rewrite_FitPartialCharges, RotateToPrincipalAxisSystem_UndoRedo, SaturateAtoms_findBestMatching, SaturateAtoms_singleDegree, StoppableMakroAction, Subpackage_CodePatterns, Subpackage_JobMarket, Subpackage_LinearAlgebra, Subpackage_levmar, Subpackage_mpqc_open, Subpackage_vmg, Switchable_LogView, ThirdParty_MPQC_rebuilt_buildsystem, TrajectoryDependenant_MaxOrder, TremoloParser_IncreasedPrecision, TremoloParser_MultipleTimesteps, TremoloParser_setsAtomName, Ubuntu_1604_changes, stable
Children:
0588e9
Parents:
58952a
git-author:
Frederik Heber <heber@…> (09/26/13 16:17:15)
git-committer:
Frederik Heber <heber@…> (10/17/13 07:24:06)
Message:

(Orthogonal)Summator are notified via out-of-range matrixnr to omit contribution.

  • (Orthogonal)Summator uses ZeroInstance as default value and sets the value only when given matrixnr from lookup is within range.
  • this is preparatory for masking certain fragment results in the summation process.
Location:
src/Fragmentation/Summation
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • src/Fragmentation/Summation/AllLevelOrthogonalSummator.hpp

    r58952a r675cd6  
    3737   * \param _container container of IndexSet's such that each set has correct order
    3838   *        to job id and hence to _data.
    39    * \param _MatrixNrLookup lookup from job id to ordering in above vectors
     39   * \param _MatrixNrLookup lookup from job id to ordering in above vectors, if
     40   *        out of range this value is set to zero, hence ignored.
    4041   * \param _results vector place results into
    4142   */
  • src/Fragmentation/Summation/AllLevelSummator.hpp

    r58952a r675cd6  
    3737   * \param _container container of IndexSet's such that each set has correct order
    3838   *        to job id and hence to _data.
    39    * \param _MatrixNrLookup lookup from job id to ordering in above vectors
     39   * \param _MatrixNrLookup lookup from job id to ordering in above vectors, if
     40   *        out of range this value is set to zero, hence ignored.
    4041   * \param _levelresults vector place levelresults into
    4142   */
  • src/Fragmentation/Summation/OrthogonalSummator.hpp

    r58952a r675cd6  
    2222#include "Fragmentation/Summation/OrthogonalSummation.hpp"
    2323#include "Fragmentation/Summation/SetValue.hpp"
     24#include "Fragmentation/Summation/ZeroInstance.hpp"
    2425
    2526/** OrthogonalSummator is a general class for making us of OrthogonalSummation.
     
    5051 * \endcode
    5152 * i.e. at_key knows the correct type!
     53 *
     54 * Note that you may skip values in the summation by setting their index in
     55 * _MatrixNrLookup to something outside the range of [0,_data.size()], e.g.
     56 * -1.
    5257 *
    5358 */
     
    155160  {
    156161    // if the power set of , we don't need to get rid of the "union index set"
    157     typename OrthogonalSummation<MapValue>::InputValues_t values(data.size());
     162    typename OrthogonalSummation<MapValue>::InputValues_t values(data.size(), ZeroInstance<MapValue>());
    158163    for (typename std::map<JobId_t, MapType>::const_iterator dataiter = data.begin();
    159164        dataiter != data.end(); ++dataiter) {
     
    165170          "OrthogonalSummation<>::createValues() - MatrixNrLookup does not contain id "
    166171          +toString(jobid)+".");
    167       values[ nriter->second ] = value;
     172      if ((nriter->second >= 0 ) && (nriter->second < data.size()))
     173        values[ nriter->second ] = value;
    168174    }
    169175    return values;
  • src/Fragmentation/Summation/Summation_impl.hpp

    r58952a r675cd6  
    1919
    2020#include "Fragmentation/Summation/printKeyNames.hpp"
     21#include "Fragmentation/Summation/ZeroInstance.hpp"
    2122
    2223/** Constructor of class Summation.
     
    6869{
    6970  typename SetValueMap<T>::const_iterator iter = setvalues.begin();
    70   T sum; // we must assume here that cstor initializes to 0
     71  T sum = ZeroInstance<T>();
    7172  if (iter->first->size() <= level)
    7273    sum = (iter->second)->getValue();
  • src/Fragmentation/Summation/Summator.hpp

    r58952a r675cd6  
    2222#include "Fragmentation/Summation/Summation.hpp"
    2323#include "Fragmentation/Summation/SetValue.hpp"
     24#include "Fragmentation/Summation/ZeroInstance.hpp"
    2425
    2526/** Summator is a general class for making us of Summation.
     
    5051 * \endcode
    5152 * i.e. at_key knows the correct type!
     53 *
     54 * Note that you may skip values in the summation by setting their index in
     55 * _MatrixNrLookup to something outside the range of [0,_data.size()], e.g.
     56 * -1.
    5257 *
    5358 */
     
    157162  {
    158163    // if we just have one indexset, we don't need to get rid of the "union index set"
    159     typename Summation<MapValue>::InputValues_t values(data.size());
     164    typename Summation<MapValue>::InputValues_t values(data.size(), ZeroInstance<MapValue>());
    160165    for (typename std::map<JobId_t, MapType>::const_iterator dataiter = data.begin();
    161166        dataiter != data.end(); ++dataiter) {
     
    167172          "Summation<>::createValues() - MatrixNrLookup does not contain id "
    168173          +toString(jobid)+".");
    169       values[ nriter->second ] = value;
     174      if ((nriter->second >= 0 ) && (nriter->second < data.size()))
     175        values[ nriter->second ] = value;
    170176    }
    171177    return values;
Note: See TracChangeset for help on using the changeset viewer.