mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-18 18:03:33 +08:00
Automatic Differentiation 'Dual' Type (#100)
* Dual numbers initial implementation * Add test coverage, with partial derivative example * Add Jacobian test, fix small issues * Improve test to demonstrate non-square jacobian * Better naming for collectReals/Derivatives * Improve comments * Potential GCC 4.8 bug workaround * Add fallback workaround for non-IEEE float platforms
This commit is contained in:
+2
-2
@@ -54,7 +54,7 @@ public:
|
||||
|
||||
Type dot(const MatrixM1 & b) const {
|
||||
const Vector &a(*this);
|
||||
Type r = 0;
|
||||
Type r(0);
|
||||
for (size_t i = 0; i<M; i++) {
|
||||
r += a(i)*b(i,0);
|
||||
}
|
||||
@@ -66,7 +66,7 @@ public:
|
||||
return a.dot(b);
|
||||
}
|
||||
|
||||
inline Vector operator*(float b) const {
|
||||
inline Vector operator*(Type b) const {
|
||||
return Vector(MatrixM1::operator*(b));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user