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:
Julian Kent
2019-10-23 12:07:51 +02:00
committed by GitHub
parent 92d1c8761e
commit 215203fc6f
7 changed files with 699 additions and 14 deletions
+2 -2
View File
@@ -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));
}