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 1787 by gezelter, Wed Aug 29 18:13:11 2012 UTC

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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines