Changeset 273382 for src/Plane.cpp


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
  • TabularUnified src/Plane.cpp

    r72e7fa r273382  
    2020  normalVector(new Vector())
    2121{
    22   Vector x1, x2;
    23 
    24   x1.CopyVector(&y1);
    25   x1.SubtractVector(&y2);
    26   x2.CopyVector(&y3);
    27   x2.SubtractVector(&y2);
    28   if ((fabs(x1.Norm()) < MYEPSILON) || (fabs(x2.Norm()) < MYEPSILON) || (fabs(x1.Angle(&x2)) < MYEPSILON)) {
     22  Vector x1 = y1 -y2;
     23  Vector x2 = y3 -y2;
     24  if ((fabs(x1.Norm()) < MYEPSILON) || (fabs(x2.Norm()) < MYEPSILON) || (fabs(x1.Angle(x2)) < MYEPSILON)) {
    2925    throw LinearDependenceException(__FILE__,__LINE__);
    3026  }
     
    4137  normalVector->Normalize();
    4238
    43   offset=normalVector->ScalarProduct(&y1);
     39  offset=normalVector->ScalarProduct(y1);
    4440}
    4541/**
     
    5147    offset(_offset)
    5248{
    53   Vector x1,x2;
    54   x1.CopyVector(&y1);
    55   x2.CopyVector(&y2);
    56   if ((fabs(x1.Norm()) < MYEPSILON) || (fabs(x2.Norm()) < MYEPSILON) || (fabs(x1.Angle(&x2)) < MYEPSILON)) {
     49  Vector x1 = y1;
     50  Vector x2 = y2;
     51  if ((fabs(x1.Norm()) < MYEPSILON) || (fabs(x2.Norm()) < MYEPSILON) || (fabs(x1.Angle(x2)) < MYEPSILON)) {
    5752    throw LinearDependenceException(__FILE__,__LINE__);
    5853  }
     
    8479    normalVector(new Vector(_normalVector))
    8580{
    86   offset = normalVector->ScalarProduct(&_offsetVector);
     81  offset = normalVector->ScalarProduct(_offsetVector);
    8782}
    8883
     
    126121  Log() << Verbose(1) << "INFO: Direction is " << Direction << "." << endl;
    127122  //Log() << Verbose(1) << "INFO: PlaneNormal is " << *PlaneNormal << " and PlaneOffset is " << *PlaneOffset << "." << endl;
    128   double factor1 = Direction.ScalarProduct(normalVector.get());
     123  double factor1 = Direction.ScalarProduct(*normalVector.get());
    129124  if (fabs(factor1) < MYEPSILON) { // Uniqueness: line parallel to plane?
    130125    Log() << Verbose(1) << "BAD: Line is parallel to plane, no intersection." << endl;
     
    132127  }
    133128
    134   double factor2 = Origin.ScalarProduct(normalVector.get());
     129  double factor2 = Origin.ScalarProduct(*normalVector.get());
    135130  if (fabs(factor2-offset) < MYEPSILON) { // Origin is in-plane
    136131    Log() << Verbose(1) << "GOOD: Origin of line is in-plane." << endl;
     
    147142
    148143  // test whether resulting vector really is on plane
    149   ASSERT(fabs(res.ScalarProduct(normalVector.get()) - offset) < MYEPSILON,
     144  ASSERT(fabs(res.ScalarProduct((*normalVector.get())) - offset) < MYEPSILON,
    150145         "Calculated line-Plane intersection does not lie on plane.");
    151146  return res;
Note: See TracChangeset for help on using the changeset viewer.