Changeset 6d5280 for LinearAlgebra
- Timestamp:
- Oct 19, 2014, 5:13:10 PM (10 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:
- c2c786
- Parents:
- b8d215
- git-author:
- Frederik Heber <heber@…> (10/03/14 09:38:16)
- git-committer:
- Frederik Heber <heber@…> (10/19/14 17:13:10)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
LinearAlgebra/src/LinearAlgebra/Line.cpp
rb8d215 r6d5280 120 120 */ 121 121 Vector Line::getIntersection(const Line& otherLine) const{ 122 Info FunctionInfo(__func__);123 124 122 pointset line1Points = getPointsOnLine(); 125 123 … … 151 149 //} 152 150 if (fabs(M->Determinant()) > LINALG_MYEPSILON()) { 153 Log() << Verbose(1) << "Determinant of coefficient matrix is NOT zero." << endl;151 eLog() << Verbose(2) << "Determinant of coefficient matrix is NOT zero." << endl; 154 152 throw SkewException() << LinearAlgebraDeterminant(M->Determinant()) << LinearAlgebraMatrixContent(&(*M)); 155 153 } 156 154 157 Log() << Verbose( 1) << "INFO: Line1a = " << Line1a << ", Line1b = " << Line1b << ", Line2a = " << Line2a << ", Line2b = " << Line2b << "." << endl;155 Log() << Verbose(6) << "INFO: Line1a = " << Line1a << ", Line1b = " << Line1b << ", Line2a = " << Line2a << ", Line2b = " << Line2b << "." << endl; 158 156 159 157 … … 163 161 Vector c = Line2a - Line1a; 164 162 Vector d = Line2b - Line1b; 165 Log() << Verbose( 1) << "INFO: a = " << a << ", b = " << b << ", c = " << c << "." << endl;163 Log() << Verbose(7) << "INFO: a = " << a << ", b = " << b << ", c = " << c << "." << endl; 166 164 if ((a.NormSquared() <= LINALG_MYEPSILON()) || (b.NormSquared() <= LINALG_MYEPSILON())) { 167 165 res.Zero(); 168 Log() << Verbose(1) << "At least one of the lines is ill-defined, i.e. offset equals second vector." << endl;166 eLog() << Verbose(2) << "At least one of the lines is ill-defined, i.e. offset equals second vector." << endl; 169 167 throw LinearDependenceException() << LinearAlgebraVectorPair( make_pair(&a, &b) ); 170 168 } … … 178 176 if ((factor > -LINALG_MYEPSILON()) && (factor - 1. <= LINALG_MYEPSILON())) { 179 177 res = Line2a; 180 Log() << Verbose( 1) << "Lines conincide." << endl;178 Log() << Verbose(5) << "Lines conincide." << endl; 181 179 return res; 182 180 } else { … … 185 183 if ((factor > -LINALG_MYEPSILON()) && (factor - 1. <= LINALG_MYEPSILON())) { 186 184 res = Line2b; 187 Log() << Verbose( 1) << "Lines conincide." << endl;185 Log() << Verbose(5) << "Lines conincide." << endl; 188 186 return res; 189 187 } 190 188 } 191 Log() << Verbose(1) << "Lines are parallel." << endl;189 eLog() << Verbose(2) << "Lines are parallel." << endl; 192 190 res.Zero(); 193 191 throw LinearDependenceException() << LinearAlgebraVectorPair( make_pair(&a, &b) ); … … 201 199 temp2 = a; 202 200 temp2.VectorProduct(b); 203 Log() << Verbose( 1) << "INFO: temp1 = " << temp1 << ", temp2 = " << temp2 << "." << endl;201 Log() << Verbose(7) << "INFO: temp1 = " << temp1 << ", temp2 = " << temp2 << "." << endl; 204 202 if (fabs(temp2.NormSquared()) > LINALG_MYEPSILON()) 205 203 s = temp1.ScalarProduct(temp2)/temp2.NormSquared(); 206 204 else 207 205 s = 0.; 208 Log() << Verbose( 1) << "Factor s is " << temp1.ScalarProduct(temp2) << "/" << temp2.NormSquared() << " = " << s << "." << endl;206 Log() << Verbose(6) << "Factor s is " << temp1.ScalarProduct(temp2) << "/" << temp2.NormSquared() << " = " << s << "." << endl; 209 207 210 208 // construct intersection … … 212 210 res.Scale(s); 213 211 res += Line1a; 214 Log() << Verbose( 1) << "Intersection is at " << res << "." << endl;212 Log() << Verbose(5) << "Intersection is at " << res << "." << endl; 215 213 216 214 return res;
Note:
See TracChangeset
for help on using the changeset viewer.