Skip to content

[Guidelines] impl_gradient vs impl_jacobian #108

Description

@bchretien

While most plugins do query the full constraint Jacobian through impl_jacobian, CFSQP can and does query single rows of the Jacobian matrix (e.g. gradient w.r.t. the i-th parameter for the j-th output of the k-th constraint). As a result, the plugin relies on proper impl_gradient implementations.

In practice, for complex multidimensional constraints, it is often easier to provide a single impl_jacobian method, and in this case, it is common for users to implement an empty impl_gradient (pure virtual method), and CFSQP fails since it gets a null vector, leaving the user confused.

Thus, we should clarify the guidelines for such cases (e.g. throw exceptions in the empty impl_gradient method), and provide helper classes/functions to detect such issues, for instance by comparing results from impl_jacobian and impl_gradient.

cc @stanislas-brossette

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions