Changeset 0f55b2 for molecuilder/src/vector.cpp
- Timestamp:
- Apr 9, 2010, 2:45:49 PM (16 years ago)
- Children:
- 1f591b
- Parents:
- 71910a
- File:
-
- 1 edited
-
molecuilder/src/vector.cpp (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
molecuilder/src/vector.cpp
r71910a r0f55b2 431 431 * \return a == b 432 432 */ 433 bool operator==(const Vector& a, const Vector& b)433 bool Vector::operator==(const Vector& b) const 434 434 { 435 435 bool status = true; 436 436 for (int i=0;i<NDIM;i++) 437 status = status && (fabs( a[i] - b[i]) < MYEPSILON);437 status = status && (fabs((*this)[i] - b[i]) < MYEPSILON); 438 438 return status; 439 439 }; … … 444 444 * \return lhs + a 445 445 */ 446 const Vector& operator+=(Vector& a,const Vector& b)447 { 448 a.AddVector(&b);449 return a;446 const Vector& Vector::operator+=(const Vector& b) 447 { 448 this->AddVector(&b); 449 return *this; 450 450 }; 451 451 … … 455 455 * \return lhs - a 456 456 */ 457 const Vector& operator-=(Vector& a,const Vector& b)458 { 459 a.SubtractVector(&b);460 return a;457 const Vector& Vector::operator-=(const Vector& b) 458 { 459 this->SubtractVector(&b); 460 return *this; 461 461 }; 462 462 … … 477 477 * \return a + b 478 478 */ 479 Vector const operator+(const Vector& a, const Vector& b)480 { 481 Vector x (a);479 Vector const Vector::operator+(const Vector& b) const 480 { 481 Vector x = *this; 482 482 x.AddVector(&b); 483 483 return x; … … 489 489 * \return a - b 490 490 */ 491 Vector const operator-(const Vector& a, const Vector& b)492 { 493 Vector x (a);491 Vector const Vector::operator-(const Vector& b) const 492 { 493 Vector x = *this; 494 494 x.SubtractVector(&b); 495 495 return x;
Note:
See TracChangeset
for help on using the changeset viewer.
