Revision e8e79779 utility/matrix.h
utility/matrix.h | ||
---|---|---|
216 | 216 |
return ret; |
217 | 217 |
} |
218 | 218 |
|
219 |
double trace() const |
|
220 |
{ |
|
221 |
double tr = 0.0; |
|
222 |
for (int i = 0; i < N; ++i) |
|
223 |
tr += cell(i, i); |
|
224 |
return tr; |
|
225 |
} |
|
226 |
|
|
219 | 227 |
private: |
220 | 228 |
double _cell_data[N*N]; |
221 | 229 |
}; |
Also available in: Unified diff