10namespace quadratic_programming {
91 Solver(
int xdim,
int rdim,
const Scalar& tolerance);
94 template<
class D1,
class D2>
96 const Eigen::EigenBase<D1>&
Q,
97 const Eigen::EigenBase<D2>&
r,
98 const Scalar& tolerance
102 template<
class D1,
class D2>
104 const Eigen::EigenBase<D1>&
Q,
105 const Eigen::EigenBase<D2>&
r
125 template<
class D1,
class D2>
127 const Eigen::EigenBase<D1>& C,
128 const Eigen::EigenBase<D2>& d
144 template<
class D1,
class D2,
class D3,
class D4>
146 const Eigen::MatrixBase<D1>& A,
147 const Eigen::MatrixBase<D2>& b,
148 const Eigen::EigenBase<D3>& C,
149 const Eigen::EigenBase<D4>& d
164 template<
class D1,
class D2>
166 const Eigen::EigenBase<D1>& C,
167 const Eigen::EigenBase<D2>& d
176 bool solve(Eigen::MatrixBase<D>& x);
185 bool solveY(Eigen::MatrixBase<D>& y);
198 bool guess(Eigen::MatrixBase<D>& y);
Quadratic Programming solver using active set and null-space projections.
bool solve(Eigen::MatrixBase< D > &x)
Solve the optimization problem.
VectorXs da
Subset of dy, corresponding to active constraints.
MatrixXs Qy
Modified matrix of coefficients for the objective function.
bool guess(Eigen::MatrixBase< D > &y)
Find an initial solution to start the active-set algorithm.
const int nr
Number of rows in the objective.
VectorXs xeq
A particular solution to the equality constraints.
const Scalar tol
Small tolerance used in calculations.
int mi
Number of inequality constraints.
VectorXs ry
Modified vector of coefficients for the objective function.
VectorXs r
Vector of coefficients for the objective function.
VectorXs yu
Unconstrained minimum of the objective.
MatrixXs Cy
Modified inequality constraints matrix.
bool updateInequalities(const Eigen::EigenBase< D1 > &C, const Eigen::EigenBase< D2 > &d)
Update inequality constraints to the problem.
std::vector< int > active
List of constraints in the active set.
void resetActiveSet()
Clear the current active set, preventing warm starts.
VectorXs dy
Modified inequality constraints vector.
VectorXs yk
Current guess of the decision variables.
MatrixXs Z
Matrix that projects into the kernel of the equality constraints matrix.
int ny
Number of variables after removing the equality constraints.
const int nx
Number of decision variables.
void clearConstraints()
Removes constraints and clear the active set.
bool setConstraints(const Eigen::EigenBase< D1 > &C, const Eigen::EigenBase< D2 > &d)
Add inequality constraints to the problem.
int me
number of equality constraints.
bool solveY(Eigen::MatrixBase< D > &y)
Solve the problem in the y variable.
bool initActiveSet()
Initialize the active-set from the current solution.
MatrixXs Ca
Subset of Cy, corresponding to active constraints.
std::vector< int > inactive
List of constraints not in the active set.
void updateObjective(const Eigen::EigenBase< D1 > &Q, const Eigen::EigenBase< D2 > &r)
Updates the objective matrix.
MatrixXs Q
Matrix of coefficients for the objective function.
Main namespace of this project, containing all utilities.