Ignore:
Timestamp:
Apr 13, 2010, 1:22:42 PM (15 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, 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/SingleVector.cpp

    r72e7fa r273382  
    119119        TranslationVector.MatrixMultiplication(matrix);
    120120        // add onto the original vector to compare with
    121         Shiftedy.CopyVector(y);
    122         Shiftedy.AddVector(&TranslationVector);
     121        Shiftedy = y + TranslationVector;
    123122        // get distance and compare with minimum so far
    124123        tmp = Distance(Shiftedy);
     
    157156        TranslationVector.MatrixMultiplication(matrix);
    158157        // add onto the original vector to compare with
    159         Shiftedy.CopyVector(y);
    160         Shiftedy.AddVector(&TranslationVector);
     158        Shiftedy = y + TranslationVector;
    161159        // get distance and compare with minimum so far
    162160        tmp = DistanceSquared(Shiftedy);
     
    180178//  Output(out);
    181179//  Log() << Verbose(0) << endl;
    182   TestVector.CopyVector(this);
     180  TestVector = *this;
    183181  TestVector.InverseMatrixMultiplication(matrix);
    184182  for(int i=NDIM;i--;) { // correct periodically
     
    190188  }
    191189  TestVector.MatrixMultiplication(matrix);
    192   CopyVector(&TestVector);
     190  CopyVector(TestVector);
    193191//  Log() << Verbose(2) << "New corrected vector is: ";
    194192//  Output(out);
     
    250248
    251249  // first create part that is orthonormal to PlaneNormal with withdraw
    252   temp = *this - PlaneOffset;
     250  temp = (*this )- PlaneOffset;
    253251  temp.MakeNormalTo(PlaneNormal);
    254252  temp.Scale(-1.);
    255253  // then add connecting vector from plane to point
    256   temp += *this-PlaneOffset;
    257   double sign = temp.ScalarProduct(&PlaneNormal);
     254  temp += (*this)-PlaneOffset;
     255  double sign = temp.ScalarProduct(PlaneNormal);
    258256  if (fabs(sign) > MYEPSILON)
    259257    sign /= fabs(sign);
     
    271269  Vector helper = y;
    272270  helper.Scale(-(ScalarProduct(y)));
    273   AddVector(&helper);
     271  AddVector(helper);
    274272};
    275273
     
    556554{
    557555  bool result = false;
    558   double factor = y1.ScalarProduct(this)/y1.NormSquared();
     556  double factor = y1.ScalarProduct(*this)/y1.NormSquared();
    559557  Vector x1;
    560   x1.CopyVector(&y1);
    561   x1.Scale(factor);
    562   SubtractVector(&x1);
     558  x1 = factor * y1;
     559  SubtractVector(x1);
    563560  for (int i=NDIM;i--;)
    564561    result = result || (fabs(x[i]) > MYEPSILON);
     
    618615bool SingleVector::IsInParallelepiped(const Vector &offset, const double * const parallelepiped) const
    619616{
    620   Vector a;
    621   a.CopyVector(this);
    622   a.SubtractVector(&offset);
     617  Vector a = (*this) - offset;
    623618  a.InverseMatrixMultiplication(parallelepiped);
    624619  bool isInside = true;
Note: See TracChangeset for help on using the changeset viewer.