Changeset 658efb for src


Ignore:
Timestamp:
Aug 19, 2009, 12:22:08 PM (15 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:
ef9df36
Parents:
54a746
Message:

Replaced Vector::Projection() by Vector::ScalarProduct()

  • Projection before was just a return of the Vector::ScalarProduct(). We change it now, to make it return a projected vector, the counterpart to ProjectOntoPlane
Location:
src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • src/boundary.cpp

    r54a746 r658efb  
    308308
    309309      //*out << "Checking sign in quadrant : " << ProjectedVector.Projection(&AngleReferenceNormalVector) << "." << endl;
    310       if (ProjectedVector.Projection(&AngleReferenceNormalVector) > 0) {
     310      if (ProjectedVector.ScalarProduct(&AngleReferenceNormalVector) > 0) {
    311311        angle = 2. * M_PI - angle;
    312312      }
     
    804804      G = sqrt(((a + b + c) * (a + b + c) - 2 * (a * a + b * b + c * c)) / 16.); // area of tesselated triangle
    805805      x.MakeNormalVector(runner->second->endpoints[0]->node->node, runner->second->endpoints[1]->node->node, runner->second->endpoints[2]->node->node);
    806       x.Scale(runner->second->endpoints[1]->node->node->Projection(&x));
     806      x.Scale(runner->second->endpoints[1]->node->node->ScalarProduct(&x));
    807807      h = x.Norm(); // distance of CoG to triangle
    808808      PyramidVolume = (1. / 3.) * G * h; // this formula holds for _all_ pyramids (independent of n-edge base or (not) centered peak)
  • src/builder.cpp

    r54a746 r658efb  
    188188          // remove the projection onto the rotation plane of the second angle
    189189          n.CopyVector(&y);
    190           n.Scale(first->x.Projection(&y));
     190          n.Scale(first->x.ScalarProduct(&y));
    191191          cout << "N1: ",
    192192          n.Output((ofstream *)&cout);
     
    197197          cout << endl;
    198198          n.CopyVector(&z);
    199           n.Scale(first->x.Projection(&z));
     199          n.Scale(first->x.ScalarProduct(&z));
    200200          cout << "N2: ",
    201201          n.Output((ofstream *)&cout);
  • src/tesselation.cpp

    r54a746 r658efb  
    349349
    350350  // make it always point inward (any offset vector onto plane projected onto normal vector suffices)
    351   if (NormalVector.Projection(&OtherVector) > 0)
     351  if (NormalVector.ScalarProduct(&OtherVector) > 0.)
    352352    NormalVector.Scale(-1.);
    353353};
     
    737737          TrialVector.CopyVector(checker->second->node->node);
    738738          TrialVector.SubtractVector(A->second->node->node);
    739           distance = TrialVector.Projection(&PlaneVector);
     739          distance = TrialVector.ScalarProduct(&PlaneVector);
    740740          if (fabs(distance) < 1e-4) // we need to have a small epsilon around 0 which is still ok
    741741            continue;
     
    897897        TempVector.SubtractVector(baseline->second->endpoints[0]->node->node); // TempVector is vector on triangle plane pointing from one baseline egde towards center!
    898898        //*out << Verbose(2) << "Projection of propagation onto temp: " << PropagationVector.Projection(&TempVector) << "." << endl;
    899         if (PropagationVector.Projection(&TempVector) > 0) // make sure normal propagation vector points outward from baseline
     899        if (PropagationVector.ScalarProduct(&TempVector) > 0) // make sure normal propagation vector points outward from baseline
    900900          PropagationVector.Scale(-1.);
    901901        *out << Verbose(4) << "PropagationVector of base triangle is " << PropagationVector << endl;
     
    957957            TempVector.SubtractVector(Center);
    958958            // make it always point outward
    959             if (VirtualNormalVector.Projection(&TempVector) < 0)
     959            if (VirtualNormalVector.ScalarProduct(&TempVector) < 0)
    960960              VirtualNormalVector.Scale(-1.);
    961961            // calculate angle
     
    15301530        AddTesselationLine(TPS[0], TPS[1], 0);
    15311531      }
    1532       cout << Verbose(2) << "Projection is " << BTS->NormalVector.Projection(&Oben) << "." << endl;
     1532      cout << Verbose(2) << "Projection is " << BTS->NormalVector.ScalarProduct(&Oben) << "." << endl;
    15331533    }
    15341534    if (BTS != NULL) // we have created one starting triangle
  • src/tesselationhelpers.cpp

    r54a746 r658efb  
    359359  HeightA.SubtractVector(&par.x1);
    360360
    361   t1 = HeightA.Projection(&SideA)/SideA.ScalarProduct(&SideA);
     361  t1 = HeightA.ScalarProduct(&SideA)/SideA.ScalarProduct(&SideA);
    362362
    363363  SideB.CopyVector(&par.x4);
     
    366366  HeightB.SubtractVector(&par.x3);
    367367
    368   t2 = HeightB.Projection(&SideB)/SideB.ScalarProduct(&SideB);
     368  t2 = HeightB.ScalarProduct(&SideB)/SideB.ScalarProduct(&SideB);
    369369
    370370  cout << Verbose(2) << "Intersection " << intersection << " is at "
Note: See TracChangeset for help on using the changeset viewer.