ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/OpenMD/branches/development/src/math/SquareMatrix.hpp
(Generate patch)

Comparing branches/development/src/math/SquareMatrix.hpp (file contents):
Revision 1753 by gezelter, Tue Jun 12 13:20:28 2012 UTC vs.
Revision 1760 by gezelter, Thu Jun 21 19:26:46 2012 UTC

# Line 184 | Line 184 | namespace OpenMD {
184        return true;
185      }
186  
187 +    /**
188 +     * Returns a column vector that contains the elements from the
189 +     * diagonal of m in the order R(0) = m(0,0), R(1) = m(1,1), and so
190 +     * on.
191 +     */
192 +    Vector<Real, Dim> diagonals() const {
193 +      Vector<Real, Dim> result;
194 +      for (unsigned int i = 0; i < Dim; i++) {
195 +        result(i) = this->data_[i][i];
196 +      }
197 +      return result;
198 +    }
199 +
200      /** Tests if this matrix is the unit matrix. */
201      bool isUnitMatrix() const {
202        if (!isDiagonal())

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines