Changes in / [1ac51b:47191b]
- Location:
- src
- Files:
-
- 2 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Makefile.am
r1ac51b r47191b 88 88 Exceptions/LinearDependenceException.cpp \ 89 89 Exceptions/MathException.cpp \ 90 Exceptions/SkewException.cpp \ 90 91 Exceptions/ZeroVectorException.cpp 91 92 … … 93 94 Exceptions/LinearDependenceException.hpp \ 94 95 Exceptions/MathException.hpp \ 96 Exceptions/SkewException.hpp \ 95 97 Exceptions/ZeroVectorException.hpp 96 98 -
src/atom.cpp
r1ac51b r47191b 68 68 atom *atom::GetTrueFather() 69 69 { 70 atom *walker = this; 71 do { 72 if (walker == walker->father) // top most father is the one that points on itself 73 break; 74 walker = walker->father; 75 } while (walker != NULL); 76 return walker; 70 if(father == this){ // top most father is the one that points on itself 71 return this; 72 } 73 else if(!father) { 74 return 0; 75 } 76 else { 77 return father->GetTrueFather(); 78 } 77 79 }; 78 80 -
src/tesselation.cpp
r1ac51b r47191b 442 442 try { 443 443 *Intersection = Plane(NormalVector, *(endpoints[0]->node->node)).GetIntersection(*MolCenter, *x); 444 } 445 catch (LinearDependenceException &excp) { 446 Log() << Verbose(1) << excp; 447 DoeLog(1) && (eLog() << Verbose(1) << "Alas! Intersection with plane failed - at least numerically - the intersection is not on the plane!" << endl); 448 return false; 449 } 450 451 DoLog(1) && (Log() << Verbose(1) << "INFO: Triangle is " << *this << "." << endl); 452 DoLog(1) && (Log() << Verbose(1) << "INFO: Line is from " << *MolCenter << " to " << *x << "." << endl); 453 DoLog(1) && (Log() << Verbose(1) << "INFO: Intersection is " << *Intersection << "." << endl); 454 455 if (Intersection->DistanceSquared(*endpoints[0]->node->node) < MYEPSILON) { 456 DoLog(1) && (Log() << Verbose(1) << "Intersection coindices with first endpoint." << endl); 457 return true; 458 } else if (Intersection->DistanceSquared(*endpoints[1]->node->node) < MYEPSILON) { 459 DoLog(1) && (Log() << Verbose(1) << "Intersection coindices with second endpoint." << endl); 460 return true; 461 } else if (Intersection->DistanceSquared(*endpoints[2]->node->node) < MYEPSILON) { 462 DoLog(1) && (Log() << Verbose(1) << "Intersection coindices with third endpoint." << endl); 463 return true; 464 } 465 // Calculate cross point between one baseline and the line from the third endpoint to intersection 466 int i = 0; 467 do { 468 try { 444 445 DoLog(1) && (Log() << Verbose(1) << "INFO: Triangle is " << *this << "." << endl); 446 DoLog(1) && (Log() << Verbose(1) << "INFO: Line is from " << *MolCenter << " to " << *x << "." << endl); 447 DoLog(1) && (Log() << Verbose(1) << "INFO: Intersection is " << *Intersection << "." << endl); 448 449 if (Intersection->DistanceSquared(*endpoints[0]->node->node) < MYEPSILON) { 450 DoLog(1) && (Log() << Verbose(1) << "Intersection coindices with first endpoint." << endl); 451 return true; 452 } else if (Intersection->DistanceSquared(*endpoints[1]->node->node) < MYEPSILON) { 453 DoLog(1) && (Log() << Verbose(1) << "Intersection coindices with second endpoint." << endl); 454 return true; 455 } else if (Intersection->DistanceSquared(*endpoints[2]->node->node) < MYEPSILON) { 456 DoLog(1) && (Log() << Verbose(1) << "Intersection coindices with third endpoint." << endl); 457 return true; 458 } 459 // Calculate cross point between one baseline and the line from the third endpoint to intersection 460 int i = 0; 461 do { 469 462 CrossPoint = GetIntersectionOfTwoLinesOnPlane(*(endpoints[i%3]->node->node), 470 463 *(endpoints[(i+1)%3]->node->node), … … 477 470 if ((s < -MYEPSILON) || ((s-1.) > MYEPSILON)) { 478 471 DoLog(1) && (Log() << Verbose(1) << "INFO: Crosspoint " << CrossPoint << "outside of triangle." << endl); 479 i=4; 480 break; 472 return false; 481 473 } 482 474 i++; 483 } catch (LinearDependenceException &excp){ 484 break; 485 } 486 } while (i < 3); 487 if (i == 3) { 475 } while (i < 3); 488 476 DoLog(1) && (Log() << Verbose(1) << "INFO: Crosspoint " << CrossPoint << " inside of triangle." << endl); 489 477 return true; 490 } else { 491 DoLog(1) && (Log() << Verbose(1) << "INFO: Crosspoint " << CrossPoint << " outside of triangle." << endl); 478 } 479 catch (MathException &excp) { 480 Log() << Verbose(1) << excp; 481 DoeLog(1) && (eLog() << Verbose(1) << "Alas! Intersection with plane failed - at least numerically - the intersection is not on the plane!" << endl); 492 482 return false; 493 483 } 484 485 494 486 } 495 487 ; -
src/vector_ops.cpp
r1ac51b r47191b 15 15 #include "Helpers/fast_functions.hpp" 16 16 #include "Exceptions/LinearDependenceException.hpp" 17 #include "Exceptions/SkewException.hpp" 17 18 18 19 #include <gsl/gsl_linalg.h> … … 176 177 if (fabs(M->Determinant()) > MYEPSILON) { 177 178 Log() << Verbose(1) << "Determinant of coefficient matrix is NOT zero." << endl; 178 throw LinearDependenceException(__FILE__,__LINE__);179 throw SkewException(__FILE__,__LINE__); 179 180 } 180 181
Note:
See TracChangeset
for help on using the changeset viewer.