Set Matrix's col amd row to single value (#113)

This commit is contained in:
kritz
2019-12-05 18:16:14 +01:00
committed by Julian Kent
parent ef442fab92
commit 5cbcf6035a
4 changed files with 34 additions and 3 deletions
+2 -2
View File
@@ -119,9 +119,9 @@ public:
}
}
Vector<Type, P<Q?P:Q> diag()
Vector<Type, P<Q?P:Q> diag() const
{
Slice<Type, P, Q, M, N>& self = *this;
const Slice<Type, P, Q, M, N>& self = *this;
Vector<Type,P<Q?P:Q> res;
for (size_t j = 0; j < (P<Q?P:Q); j++) {
res(j) = self(j,j);