WPILibC++ 2025.1.1
Loading...
Searching...
No Matches
SQP.hpp
Go to the documentation of this file.
1// Copyright (c) Sleipnir contributors
2
3#pragma once
4
5#include <span>
6
7#include <Eigen/Core>
8
15
16namespace sleipnir {
17
18/**
19Finds the optimal solution to a nonlinear program using Sequential Quadratic
20Programming (SQP).
21
22A nonlinear program has the form:
23
24@verbatim
25 min_x f(x)
26subject to cₑ(x) = 0
27@endverbatim
28
29where f(x) is the cost function and cₑ(x) are the equality constraints.
30
31@param[in] decisionVariables The list of decision variables.
32@param[in] equalityConstraints The list of equality constraints.
33@param[in] f The cost function.
34@param[in] callback The user callback.
35@param[in] config Configuration options for the solver.
36@param[in,out] x The initial guess and output location for the decision
37 variables.
38@param[out] status The solver status.
39*/
41 std::span<Variable> decisionVariables,
42 std::span<Variable> equalityConstraints, Variable& f,
43 function_ref<bool(const SolverIterationInfo& info)> callback,
44 const SolverConfig& config, Eigen::VectorXd& x, SolverStatus* status);
45
46} // namespace sleipnir
#define SLEIPNIR_DLLEXPORT
Definition SymbolExports.hpp:34
An autodiff variable pointing to an expression node.
Definition Variable.hpp:31
An implementation of std::function_ref, a lightweight non-owning reference to a callable.
Definition FunctionRef.hpp:17
Definition Hessian.hpp:18
SLEIPNIR_DLLEXPORT void SQP(std::span< Variable > decisionVariables, std::span< Variable > equalityConstraints, Variable &f, function_ref< bool(const SolverIterationInfo &info)> callback, const SolverConfig &config, Eigen::VectorXd &x, SolverStatus *status)
Finds the optimal solution to a nonlinear program using Sequential Quadratic Programming (SQP).
Solver configuration.
Definition SolverConfig.hpp:15
Solver iteration information exposed to a user callback.
Definition SolverIterationInfo.hpp:13
Return value of OptimizationProblem::Solve() containing the cost function and constraint types and so...
Definition SolverStatus.hpp:15