Changeset ac6d04 for src/base/index.hpp


Ignore:
Timestamp:
Apr 10, 2012, 1:55:49 PM (14 years ago)
Author:
Julian Iseringhausen <isering@…>
Children:
a40eea
Parents:
d24c2f
Message:

Merge recent changes of the vmg library into ScaFaCos.

Includes a fix for the communication problems on Jugene.

git-svn-id: https://svn.version.fz-juelich.de/scafacos/trunk@1666 5161e1c8-67bf-11de-9fd5-51895aff932f

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/base/index.hpp

    rd24c2f rac6d04  
    5757  }
    5858
     59  bool IsComponentwiseLess(const Index& other) const
     60  {
     61    return this->i[0] < other.i[0]
     62        && this->i[1] < other.i[1]
     63        && this->i[2] < other.i[2];
     64  }
     65
     66  bool IsComponentwiseLessOrEqual(const Index& other) const
     67  {
     68    return this->i[0] <= other.i[0]
     69        && this->i[1] <= other.i[1]
     70        && this->i[2] <= other.i[2];
     71  }
     72
     73  bool IsComponentwiseGreater(const Index& other) const
     74  {
     75    return this->i[0] > other.i[0]
     76        && this->i[1] > other.i[1]
     77        && this->i[2] > other.i[2];
     78  }
     79
     80  bool IsComponentwiseGreaterOrEqual(const Index& other) const
     81  {
     82    return this->i[0] >= other.i[0]
     83        && this->i[1] >= other.i[1]
     84        && this->i[2] >= other.i[2];
     85  }
     86
    5987  Index MaxComponentwise(const Index& rhs) const
    6088  {
     
    6795  }
    6896
    69   Index& Clamp(const Index& lower_bound, const Index& upper_bound)
    70   {
     97  Index Clamp(const Index& lower_bound, const Index& upper_bound) const
     98  {
     99    Index index(*this);
    71100    for (int j=0; j<3; ++j) {
    72       i[j] = std::max(i[j], lower_bound[j]);
    73       i[j] = std::min(i[j], upper_bound[j]);
     101      index.i[j] = std::max(index.i[j], lower_bound[j]);
     102      index.i[j] = std::min(index.i[j], upper_bound[j]);
    74103    }
    75 
    76     return *this;
     104    return index;
    77105  }
    78106
Note: See TracChangeset for help on using the changeset viewer.