Ignore:
Timestamp:
Apr 13, 2010, 1:22:42 PM (16 years ago)
Author:
Tillmann Crueger <crueger@…>
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, Candidate_v1.7.0, 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:
1bd79e
Parents:
72e7fa
Message:

Prepared interface of Vector Class for transition to VectorComposites

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/analysis_correlation.cpp

    r72e7fa r273382  
    5555                if (Walker->nr < OtherWalker->nr)
    5656                  if ((type2 == NULL) || (OtherWalker->type == type2)) {
    57                     distance = Walker->node->PeriodicDistance(OtherWalker->node, (*MolWalker)->cell_size);
     57                    distance = Walker->node->PeriodicDistance(*(OtherWalker->node), (*MolWalker)->cell_size);
    5858                    //Log() << Verbose(1) <<"Inserting " << *Walker << " and " << *OtherWalker << endl;
    5959                    outmap->insert ( pair<double, pair <atom *, atom*> > (distance, pair<atom *, atom*> (Walker, OtherWalker) ) );
     
    104104        Log() << Verbose(3) << "Current atom is " << *Walker << "." << endl;
    105105        if ((type1 == NULL) || (Walker->type == type1)) {
    106           periodicX.CopyVector(Walker->node);
     106          periodicX = *(Walker->node);
    107107          periodicX.MatrixMultiplication(FullInverseMatrix);  // x now in [0,1)^3
    108108          // go through every range in xyz and get distance
     
    110110            for (n[1]=-ranges[1]; n[1] <= ranges[1]; n[1]++)
    111111              for (n[2]=-ranges[2]; n[2] <= ranges[2]; n[2]++) {
    112                 checkX.Init(n[0], n[1], n[2]);
    113                 checkX.AddVector(&periodicX);
     112                checkX = Vector(n[0], n[1], n[2]) + periodicX;
    114113                checkX.MatrixMultiplication(FullMatrix);
    115114                for (MoleculeList::const_iterator MolOtherWalker = MolWalker; MolOtherWalker != molecules->ListOfMolecules.end(); MolOtherWalker++)
     
    122121                      if (Walker->nr < OtherWalker->nr)
    123122                        if ((type2 == NULL) || (OtherWalker->type == type2)) {
    124                           periodicOtherX.CopyVector(OtherWalker->node);
     123                          periodicOtherX = *(OtherWalker->node);
    125124                          periodicOtherX.MatrixMultiplication(FullInverseMatrix);  // x now in [0,1)^3
    126125                          // go through every range in xyz and get distance
     
    128127                            for (Othern[1]=-ranges[1]; Othern[1] <= ranges[1]; Othern[1]++)
    129128                              for (Othern[2]=-ranges[2]; Othern[2] <= ranges[2]; Othern[2]++) {
    130                                 checkOtherX.Init(Othern[0], Othern[1], Othern[2]);
    131                                 checkOtherX.AddVector(&periodicOtherX);
     129                                checkOtherX = Vector(Othern[0], Othern[1], Othern[2]) + periodicOtherX;
    132130                                checkOtherX.MatrixMultiplication(FullMatrix);
    133                                 distance = checkX.Distance(&checkOtherX);
     131                                distance = checkX.Distance(checkOtherX);
    134132                                //Log() << Verbose(1) <<"Inserting " << *Walker << " and " << *OtherWalker << endl;
    135133                                outmap->insert ( pair<double, pair <atom *, atom*> > (distance, pair<atom *, atom*> (Walker, OtherWalker) ) );
     
    174172        Log() << Verbose(3) << "Current atom is " << *Walker << "." << endl;
    175173        if ((type == NULL) || (Walker->type == type)) {
    176           distance = Walker->node->PeriodicDistance(point, (*MolWalker)->cell_size);
     174          distance = Walker->node->PeriodicDistance(*point, (*MolWalker)->cell_size);
    177175          Log() << Verbose(4) << "Current distance is " << distance << "." << endl;
    178176          outmap->insert ( pair<double, pair<atom *, const Vector*> >(distance, pair<atom *, const Vector*> (Walker, point) ) );
     
    216214        Log() << Verbose(3) << "Current atom is " << *Walker << "." << endl;
    217215        if ((type == NULL) || (Walker->type == type)) {
    218           periodicX.CopyVector(Walker->node);
     216          periodicX = *(Walker->node);
    219217          periodicX.MatrixMultiplication(FullInverseMatrix);  // x now in [0,1)^3
    220218          // go through every range in xyz and get distance
     
    222220            for (n[1]=-ranges[1]; n[1] <= ranges[1]; n[1]++)
    223221              for (n[2]=-ranges[2]; n[2] <= ranges[2]; n[2]++) {
    224                 checkX.Init(n[0], n[1], n[2]);
    225                 checkX.AddVector(&periodicX);
     222                checkX = Vector(n[0], n[1], n[2]) + periodicX;
    226223                checkX.MatrixMultiplication(FullMatrix);
    227                 distance = checkX.Distance(point);
     224                distance = checkX.Distance(*point);
    228225                Log() << Verbose(4) << "Current distance is " << distance << "." << endl;
    229226                outmap->insert ( pair<double, pair<atom *, const Vector*> >(distance, pair<atom *, const Vector*> (Walker, point) ) );
     
    320317        Log() << Verbose(3) << "Current atom is " << *Walker << "." << endl;
    321318        if ((type == NULL) || (Walker->type == type)) {
    322           periodicX.CopyVector(Walker->node);
     319          periodicX = *(Walker->node);
    323320          periodicX.MatrixMultiplication(FullInverseMatrix);  // x now in [0,1)^3
    324321          // go through every range in xyz and get distance
     
    327324            for (n[1]=-ranges[1]; n[1] <= ranges[1]; n[1]++)
    328325              for (n[2]=-ranges[2]; n[2] <= ranges[2]; n[2]++) {
    329                 checkX.Init(n[0], n[1], n[2]);
    330                 checkX.AddVector(&periodicX);
     326                checkX = Vector(n[0], n[1], n[2]) + periodicX;
    331327                checkX.MatrixMultiplication(FullMatrix);
    332328                triangle = Surface->FindClosestTriangleToVector(&checkX, LC);
Note: See TracChangeset for help on using the changeset viewer.