- Timestamp:
- Apr 30, 2010, 9:53:16 AM (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:
- 1513a74
- Parents:
- 0e01b4
- Location:
- src
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Plane.cpp
r0e01b4 r005e18 172 172 /************ Methods inherited from Space ****************/ 173 173 174 double Plane::distance( Vector &point){174 double Plane::distance(const Vector &point) const{ 175 175 double res = point.ScalarProduct(*normalVector)-offset; 176 176 return fabs(res); 177 177 } 178 178 179 Vector Plane::getClosestPoint( Vector &point){179 Vector Plane::getClosestPoint(const Vector &point) const{ 180 180 Vector difference = distance(point) * (*normalVector); 181 181 if(difference.IsZero()){ … … 189 189 return (point - (sign * difference)); 190 190 } 191 192 bool Plane::isContained(Vector &point){193 return (fabs(point.ScalarProduct(*normalVector) - offset)) < MYEPSILON;194 } -
src/Plane.hpp
r0e01b4 r005e18 52 52 /****** Methods inherited from Space ***********/ 53 53 54 virtual double distance(Vector &point); 55 virtual Vector getClosestPoint(Vector &point); 56 virtual bool isContained(Vector &point); 57 54 virtual double distance(const Vector &point) const; 55 virtual Vector getClosestPoint(const Vector &point) const; 58 56 59 57 private: -
src/Space.cpp
r0e01b4 r005e18 7 7 8 8 #include "Space.hpp" 9 #include "vector.hpp" 9 10 10 11 Space::Space() … … 13 14 Space::~Space() 14 15 {} 16 17 bool Space::hasZero() const{ 18 return isContained(zeroVec); 19 } 20 21 bool Space::isContained(const Vector &point) const{ 22 return (distance(point)) < MYEPSILON; 23 } -
src/Space.hpp
r0e01b4 r005e18 17 17 virtual ~Space(); 18 18 19 virtual double distance(Vector &point)=0; 20 virtual Vector getClosestPoint(Vector &point)=0; 21 virtual bool isContained(Vector &point)=0; 19 virtual double distance(const Vector &point) const=0; 20 virtual Vector getClosestPoint(const Vector &point) const=0; 21 virtual bool isContained(const Vector &point) const; 22 virtual bool hasZero() const; 23 22 24 }; 23 25 -
src/vector.cpp
r0e01b4 r005e18 719 719 return isInside; 720 720 } 721 722 723 // some comonly used vectors 724 const Vector zeroVec(0,0,0); 725 const Vector e1(1,0,0); 726 const Vector e2(0,1,0); 727 const Vector e3(0,0,1); -
src/vector.hpp
r0e01b4 r005e18 101 101 }; 102 102 103 // some commonly used and fixed vectors 104 const extern Vector zeroVec; 105 const extern Vector e1; 106 const extern Vector e2; 107 const extern Vector e3; 108 103 109 ostream & operator << (ostream& ost, const Vector &m); 104 110 const Vector& operator*=(Vector& a, const double m);
Note:
See TracChangeset
for help on using the changeset viewer.