Changeset 7672551
- Timestamp:
- Mar 30, 2012, 9:18:25 AM (13 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:
- c67c65
- Parents:
- e9ad43
- git-author:
- Frederik Heber <heber@…> (01/30/12 08:14:10)
- git-committer:
- Frederik Heber <heber@…> (03/30/12 09:18:25)
- Files:
-
- 3 added
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
LinearAlgebra/src/LinearAlgebra/Line.cpp
re9ad43 r7672551 31 31 #include "defs.hpp" 32 32 #include "Exceptions.hpp" 33 #include "LinePoint.hpp" 33 34 #include "MatrixContent.hpp" 34 35 #include "Plane.hpp" … … 308 309 } 309 310 310 /******************************** Points on the line ********************/ 311 312 LinePoint::LinePoint(const LinePoint &src) : 313 line(src.line),param(src.param) 314 {} 315 316 LinePoint::LinePoint(const Line &_line, double _param) : 317 line(_line),param(_param) 318 {} 319 320 LinePoint& LinePoint::operator=(const LinePoint &src){ 321 line=src.line; 322 param=src.param; 323 return *this; 324 } 325 326 Vector LinePoint::getPoint() const{ 327 ASSERT(!isInfinite(),"getPoint() on infinite LinePoint called"); 328 return (*line.origin)+param*(*line.direction); 329 } 330 331 Line LinePoint::getLine() const{ 332 return line; 333 } 334 335 bool LinePoint::isInfinite() const{ 336 return isPosInfinity() || isNegInfinity(); 337 } 338 bool LinePoint::isPosInfinity() const{ 339 return param == numeric_limits<double>::infinity(); 340 } 341 bool LinePoint::isNegInfinity() const{ 342 return param ==-numeric_limits<double>::infinity(); 343 } 344 345 bool operator==(const LinePoint &x, const LinePoint &y){ 346 ASSERT(x.line==y.line,"Operation on two points of different lines"); 347 return x.param == y.param; 348 349 } 350 bool operator<(const LinePoint &x, const LinePoint &y){ 351 ASSERT(x.line==y.line,"Operation on two points of different lines"); 352 return x.param<y.param; 353 } 354 355 ostream& operator<<(ostream& ost, const Line& m) 311 std::ostream& operator<<(std::ostream& ost, const Line& m) 356 312 { 357 313 const Vector origin = m.getOrigin(); … … 373 329 }; 374 330 331 332 /******************************** Points on the line ********************/ -
LinearAlgebra/src/LinearAlgebra/Line.hpp
re9ad43 r7672551 25 25 class LinePoint; 26 26 27 /** This class represents a line in space stretching to infinity. 28 * 29 * It is defined by its origin and a direction. 30 * 31 * \sa LinePoint and LineSegment 32 */ 27 33 class Line : public Space 28 34 { … … 74 80 Line makeLineThrough(const Vector &x1, const Vector &x2); 75 81 76 /**77 * Class for representing points on a line78 * These objects allow comparison of points on the same line as well as specifying the79 * infinite "endpoints" of a line.80 */81 class LinePoint{82 friend class Line;83 friend bool operator==(const LinePoint&, const LinePoint&);84 friend bool operator<(const LinePoint&, const LinePoint&);85 public:86 LinePoint(const LinePoint&);87 LinePoint& operator=(const LinePoint&);88 Vector getPoint() const;89 Line getLine() const;90 bool isInfinite() const;91 bool isPosInfinity() const;92 bool isNegInfinity() const;93 94 private:95 LinePoint(const Line&,double);96 Line line;97 double param;98 };99 100 bool operator==(const LinePoint&, const LinePoint&);101 bool operator<(const LinePoint&, const LinePoint&);102 103 inline bool operator!= (const LinePoint& x, const LinePoint& y) { return !(x==y); }104 inline bool operator> (const LinePoint& x, const LinePoint& y) { return y<x; }105 inline bool operator<= (const LinePoint& x, const LinePoint& y) { return !(y<x); }106 inline bool operator>= (const LinePoint& x, const LinePoint& y) { return !(x<y); }107 108 109 82 #endif /* LINE_HPP_ */ -
LinearAlgebra/src/LinearAlgebra/LineSegment.cpp
re9ad43 r7672551 24 24 25 25 #include "Line.hpp" 26 #include "LinePoint.hpp" 26 27 #include "Vector.hpp" 27 28 -
LinearAlgebra/src/LinearAlgebra/LineSegment.hpp
re9ad43 r7672551 21 21 class LinePoint; 22 22 23 /** This class represents a specific segment of a line, defined through 24 * two points on the same line that form start and end. 25 * 26 */ 23 27 class LineSegment 24 28 { -
LinearAlgebra/src/LinearAlgebra/LineSegmentSet.cpp
re9ad43 r7672551 24 24 #include "CodePatterns/Assert.hpp" 25 25 #include "Line.hpp" 26 #include "LinePoint.hpp" 26 27 #include "LineSegment.hpp" 27 28 -
LinearAlgebra/src/LinearAlgebra/LineSegmentSet.hpp
re9ad43 r7672551 22 22 class LineSegment; 23 23 24 /** This class represents a continous set of LineSegment's all on the same 25 * underlying line. 26 * 27 * Hence, it is basically a sorted container for LinePoints but 28 * we iterate over it segment-wise. 29 * 30 */ 24 31 class LineSegmentSet { 25 32 friend LineSegmentSet merge(const LineSegmentSet&,const LineSegmentSet&); -
LinearAlgebra/src/LinearAlgebra/Makefile.am
re9ad43 r7672551 11 11 leastsquaremin.cpp \ 12 12 Line.cpp \ 13 LinePoint.cpp \ 13 14 LineSegment.cpp \ 14 15 LineSegmentSet.cpp \ … … 31 32 leastsquaremin.hpp \ 32 33 Line.hpp \ 34 LinePoint.hpp \ 33 35 LineSegment.hpp \ 34 36 LineSegmentSet.hpp \ -
LinearAlgebra/src/documentation/mainpage.dox
re9ad43 r7672551 25 25 * 26 26 * 27 * \ref lines Lines and subtypes 28 * 27 29 * \date 2011-11-02 28 30 * -
src/Shapes/Shape_impl.hpp
re9ad43 r7672551 24 24 #include "Shapes/ShapeType.hpp" 25 25 #include "LinearAlgebra/Line.hpp" 26 #include "LinearAlgebra/LinePoint.hpp" 26 27 #include "LinearAlgebra/LineSegment.hpp" 27 28 #include "LinearAlgebra/LineSegmentSet.hpp"
Note:
See TracChangeset
for help on using the changeset viewer.