Class Jacobian

java.lang.Object
org.wpilib.math.autodiff.Jacobian
All Implemented Interfaces:
AutoCloseable

public class Jacobian extends Object implements AutoCloseable
This class calculates the Jacobian of a vector of variables with respect to a vector of variables.

The Jacobian is only recomputed if the variable expression is quadratic or higher order.

  • Constructor Details

    • Jacobian

      public Jacobian(Variable variable, Variable wrt)
      Constructs a Jacobian object.
      Parameters:
      variable - Variable of which to compute the Jacobian.
      wrt - Variable with respect to which to compute the Jacobian.
    • Jacobian

      public Jacobian(Variable variable, VariableMatrix wrt)
      Constructs a Jacobian object.
      Parameters:
      variable - Variable of which to compute the Jacobian.
      wrt - Vector of variables with respect to which to compute the Jacobian.
    • Jacobian

      public Jacobian(Variable variable, VariableBlock wrt)
      Constructs a Jacobian object.
      Parameters:
      variable - Variable of which to compute the Jacobian.
      wrt - Vector of variables with respect to which to compute the Jacobian.
    • Jacobian

      public Jacobian(VariableMatrix variables, VariableMatrix wrt)
      Constructs a Jacobian object.
      Parameters:
      variables - Vector of variables of which to compute the Jacobian.
      wrt - Vector of variables with respect to which to compute the Jacobian.
    • Jacobian

      public Jacobian(VariableMatrix variables, VariableBlock wrt)
      Constructs a Jacobian object.
      Parameters:
      variables - Vector of variables of which to compute the Jacobian.
      wrt - Vector of variables with respect to which to compute the Jacobian.
  • Method Details

    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
    • get

      public VariableMatrix get()
      Returns the Jacobian as a VariableMatrix.

      This is useful when constructing optimization problems with derivatives in them.

      Returns:
      The Jacobian as a VariableMatrix.
    • value

      public org.ejml.simple.SimpleMatrix value()
      Evaluates the Jacobian at wrt's value.
      Returns:
      The Jacobian at wrt's value.