Ignore:
Timestamp:
Apr 9, 2010, 2:45:49 PM (16 years ago)
Author:
Tillmann Crueger <crueger@…>
Children:
1f591b
Parents:
71910a
Message:

Started work on the VectorComposites

File:
1 edited

Legend:

Unmodified
Added
Removed
  • molecuilder/src/vector.cpp

    r71910a r0f55b2  
    431431 * \return a == b
    432432 */
    433 bool operator==(const Vector& a, const Vector& b)
     433bool Vector::operator==(const Vector& b) const
    434434{
    435435  bool status = true;
    436436  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);
    438438  return status;
    439439};
     
    444444 * \return lhs + a
    445445 */
    446 const Vector& operator+=(Vector& a, const Vector& b)
    447 {
    448   a.AddVector(&b);
    449   return a;
     446const Vector& Vector::operator+=(const Vector& b)
     447{
     448  this->AddVector(&b);
     449  return *this;
    450450};
    451451
     
    455455 * \return lhs - a
    456456 */
    457 const Vector& operator-=(Vector& a, const Vector& b)
    458 {
    459   a.SubtractVector(&b);
    460   return a;
     457const Vector& Vector::operator-=(const Vector& b)
     458{
     459  this->SubtractVector(&b);
     460  return *this;
    461461};
    462462
     
    477477 * \return a + b
    478478 */
    479 Vector const operator+(const Vector& a, const Vector& b)
    480 {
    481   Vector x(a);
     479Vector const Vector::operator+(const Vector& b) const
     480{
     481  Vector x = *this;
    482482  x.AddVector(&b);
    483483  return x;
     
    489489 * \return a - b
    490490 */
    491 Vector const operator-(const Vector& a, const Vector& b)
    492 {
    493   Vector x(a);
     491Vector const Vector::operator-(const Vector& b) const
     492{
     493  Vector x = *this;
    494494  x.SubtractVector(&b);
    495495  return x;
Note: See TracChangeset for help on using the changeset viewer.