mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-27 14:33:34 +08:00
Getter function for the diag elements of slice (#112)
This commit is contained in:
@@ -119,6 +119,16 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
Vector<Type, P<Q?P:Q> diag()
|
||||
{
|
||||
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);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
Type norm_squared()
|
||||
{
|
||||
Slice<Type, P, Q, M, N>& self = *this;
|
||||
|
||||
Reference in New Issue
Block a user