Changeset cee0b57 for src/molecule.hpp
- Timestamp:
- Oct 5, 2009, 10:10:53 PM (15 years ago)
- 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:
- ebcade
- Parents:
- d09ff7
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/molecule.hpp
rd09ff7 rcee0b57 1 /** \file molecule s.hpp1 /** \file molecule.hpp 2 2 * 3 3 * Class definitions of atom and molecule, element and periodentafel … … 133 133 134 134 // templates for allowing global manipulation of all vectors 135 template <typename res> void ActOnAllVectors( res (Vector::*f)() ); 135 136 template <typename res, typename T> void ActOnAllVectors( res (Vector::*f)(T), T t ); 136 137 template <typename res, typename T, typename U> void ActOnAllVectors( res (Vector::*f)(T, U), T t, U u ); 137 138 template <typename res, typename T, typename U, typename V> void ActOnAllVectors( res (Vector::*f)(T, U, V), T t, U u, V v); 139 140 // templates for allowing global manipulation of all atoms 141 template <typename res> void ActOnAllAtoms( res (molecule::*f)(atom *) ); 142 template <typename res> void ActOnAllAtoms( res (atom::*f)() ); 143 template <typename res, typename T> void ActOnAllAtoms( res (atom::*f)(T), T t ); 144 template <typename res, typename T, typename U> void ActOnAllAtoms( res (atom::*f)(T, U), T t, U u ); 145 template <typename res, typename T, typename U, typename V> void ActOnAllAtoms( res (atom::*f)(T, U, V), T t, U u, V v); 138 146 139 147 /// remove atoms from molecule. … … 147 155 bool AddXYZFile(string filename); 148 156 bool AddHydrogenReplacementAtom(ofstream *out, bond *Bond, atom *BottomOrigin, atom *TopOrigin, atom *TopReplacement, bond **BondList, int NumBond, bool IsAngstroem); 149 bond * AddBond(atom *first, atom *second, int degree );157 bond * AddBond(atom *first, atom *second, int degree = 1); 150 158 bool RemoveBond(bond *pointer); 151 159 bool RemoveBonds(atom *BondPartner); … … 255 263 256 264 265 template <typename res> void molecule::ActOnAllVectors( res (Vector::*f)() ) { 266 atom *Walker = start; 267 while (Walker->next != end) { 268 Walker = Walker->next; 269 ((Walker->node)->*f)(); 270 } 271 }; 257 272 template <typename res, typename T> void molecule::ActOnAllVectors( res (Vector::*f)(T), T t ) 258 273 { … … 260 275 while (Walker->next != end) { 261 276 Walker = Walker->next; 262 ((*Walker->node)->*f)(t); 263 } 264 }; 265 277 ((Walker->node)->*f)(t); 278 } 279 }; 266 280 template <typename res, typename T, typename U> void molecule::ActOnAllVectors( res (Vector::*f)(T, U), T t, U u ) 267 281 { … … 269 283 while (Walker->next != end) { 270 284 Walker = Walker->next; 271 ((*Walker->node)->*f)(t, u); 272 } 273 }; 274 285 ((Walker->node)->*f)(t, u); 286 } 287 }; 275 288 template <typename res, typename T, typename U, typename V> void molecule::ActOnAllVectors( res (Vector::*f)(T, U, V), T t, U u, V v) 276 289 { … … 278 291 while (Walker->next != end) { 279 292 Walker = Walker->next; 280 ((*Walker->node)->*f)(t, u, v); 293 ((Walker->node)->*f)(t, u, v); 294 } 295 }; 296 297 template <typename res> void molecule::ActOnAllAtoms( res (molecule::*f)(atom *)) { 298 atom *Walker = start; 299 while (Walker->next != end) { 300 Walker = Walker->next; 301 (*f)(Walker); 302 } 303 }; 304 305 template <typename res> void molecule::ActOnAllAtoms( res (atom::*f)()) { 306 atom *Walker = start; 307 while (Walker->next != end) { 308 Walker = Walker->next; 309 (Walker->*f)(); 310 } 311 }; 312 template <typename res, typename T> void molecule::ActOnAllAtoms( res (atom::*f)(T), T t ) 313 { 314 atom *Walker = start; 315 while (Walker->next != end) { 316 Walker = Walker->next; 317 (Walker->*f)(t); 318 } 319 }; 320 template <typename res, typename T, typename U> void molecule::ActOnAllAtoms( res (atom::*f)(T, U), T t, U u ) 321 { 322 atom *Walker = start; 323 while (Walker->next != end) { 324 Walker = Walker->next; 325 (Walker->*f)(t, u); 326 } 327 }; 328 template <typename res, typename T, typename U, typename V> void molecule::ActOnAllAtoms( res (atom::*f)(T, U, V), T t, U u, V v) 329 { 330 atom *Walker = start; 331 while (Walker->next != end) { 332 Walker = Walker->next; 333 (Walker->*f)(t, u, v); 281 334 } 282 335 };
Note:
See TracChangeset
for help on using the changeset viewer.