Jafar
|
We use strict rules for manipulating and naming Jacobians:
Here is an example of a composed function and the chain rule (a real example is the whole file quatTools.hpp.).
void f(const vec3 x, vec2 y, mat Y_x); // This is y = f(x), Y_x = dy/dx = df(x)/dx. void g(const vec2 x, vec2 y, mat Y_x); // This is y = g(x), Y_x = dy/dx = dg(x)/dx. void h(const vec3 x, vec2 z, mat Z_x){ // This will perform g(f(x)) and return Jacobians. vec2 y; mat23 Y_x; f(x, y, Y_x); // This computes y and --------> Y_x = dy/dx = df(x)/dx. mat22 Z_y; g(y, z, Z_y); // This is z = g(y) = g(f(x)) and -> Z_y = dz/dy = dg(y)/dy. Z_x = Z_y * Y_x; // This is the chain rule doing -> Z_x = dz/dx = dz/dy * dy/dx. }
As a general rule (but always depending on usability requirements) a function should be implemented several times:
void
and the result must be passed as a non-const parameter. void
, all results are in the parameter list. Generated on Wed Oct 15 2014 00:37:30 for Jafar by doxygen 1.7.6.1 |