WPILibC++ 2025.1.1
Loading...
Searching...
No Matches
InteriorPoint.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 the interior-point
20method.
21
22A nonlinear program has the form:
23
24@verbatim
25 min_x f(x)
26subject to cₑ(x) = 0
27 cᵢ(x) ≥ 0
28@endverbatim
29
30where f(x) is the cost function, cₑ(x) are the equality constraints, and cᵢ(x)
31are the inequality constraints.
32
33@param[in] decisionVariables The list of decision variables.
34@param[in] equalityConstraints The list of equality constraints.
35@param[in] inequalityConstraints The list of inequality constraints.
36@param[in] f The cost function.
37@param[in] callback The user callback.
38@param[in] config Configuration options for the solver.
39@param[in] feasibilityRestoration Whether to use feasibility restoration instead
40 of the normal algorithm.
41@param[in,out] x The initial guess and output location for the decision
42 variables.
43@param[in,out] s The initial guess and output location for the inequality
44 constraint slack variables.
45@param[out] status The solver status.
46*/
48 std::span<Variable> decisionVariables,
49 std::span<Variable> equalityConstraints,
50 std::span<Variable> inequalityConstraints, Variable& f,
51 function_ref<bool(const SolverIterationInfo& info)> callback,
52 const SolverConfig& config, bool feasibilityRestoration, Eigen::VectorXd& x,
53 Eigen::VectorXd& s, SolverStatus* status);
54
55} // 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 InteriorPoint(std::span< Variable > decisionVariables, std::span< Variable > equalityConstraints, std::span< Variable > inequalityConstraints, Variable &f, function_ref< bool(const SolverIterationInfo &info)> callback, const SolverConfig &config, bool feasibilityRestoration, Eigen::VectorXd &x, Eigen::VectorXd &s, SolverStatus *status)
Finds the optimal solution to a nonlinear program using the interior-point method.
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