Class Jacobian#

Class Documentation#

class Jacobian#

Class used to create a Jacobian for a given function using numerical differencing.

Public Functions

Jacobian(int input_dim, int value_dim, fn f, std::string_view mode = "forward")#

Creates a Jacobian class. This class outputs the Jacobian of the input function f.

Parameters:
  • input_dim – The number of inputs to f.

  • value_dim – The number of outputs of f.

  • f – The function to use finite difference to find the Jacobian of.

  • mode – The finite difference mode. “forward” for forward difference and “central” for central difference.

fn getF()#

Get the function that this Jacobian class calculates the jacobian of.

Returns:

f The function that this Jacobian class calculates the jacobian of.

void setF(fn f)#

Set the function that this class calculates the jacobian of.

Parameters:

f – The function that you want to calculate the jacobian of.

std::string_view getMode()#

Get the finite difference mode.

Returns:

f The finite difference mode.

void setMode(std::string_view mode)#

Sets finite difference mode.

Parameters:

mode – The finite difference mode. One of “forward” or “central”.

Mat operator()(const Vec &x) const#

Calculate the jacobian of the supplied function.

Parameters:

x – The input vector we want to calculate the jacobian with respect to.

Returns:

The jacobian of the supplied function about x.