Quadratic Programming Solver. More...

#include <QuadraticProgrammingSolver.hpp>

Public Member Functions

void setQuadraticTerm (const arma::mat &)
 Sets matrix Q. More...
 
void setLinearTerm (const arma::mat &)
 Sets vector L. More...
 
void setEqualityConstrainsMatrix (const arma::mat &)
 Sets matrix E. More...
 
void setEqualityConstrainsVector (const arma::mat &)
 Sets vector b. More...
 
void setNonEqualityConstrainsMatrix (const arma::mat &)
 Sets matrix N. More...
 
void setNonEqualityConstrainsLowerVector (const arma::mat &)
 Sets vector c. More...
 
void setNonEqualityConstrainsUpperVector (const arma::mat &)
 Sets vector d. More...
 
void setArgumentLowerConstrains (const arma::mat &)
 Sets vector e. More...
 
void setArgumentUpperConstrains (const arma::mat &)
 Sets vector f. More...
 
void setInfo (const bool input)
 Sets silent_ variable. More...
 
arma::mat solve ()
 Solves quadratic problem. More...
 

Private Member Functions

void MatrixToArray (int *, int *, double *, const arma::mat &)
 Matrix adapter. More...
 
void SymetricMatrixToArray (int *, int *, double *, const arma::mat &)
 Symetric matrix adapter. More...
 
void Matrix1dToArray (double *, const arma::mat &)
 Column matrix adapter. More...
 

Private Attributes

arma::mat quadratic_term_
 Matrix Q, representing the quadratic term of cost function. More...
 
arma::mat linear_term_
 Matrix L, representing the linear term of cost function. More...
 
arma::mat equality_constrains_matrix_
 Matrix E, representing an equality constrain. More...
 
arma::mat equality_constrains_vector_
 Vector b. More...
 
arma::mat non_equality_constrains_matrix_
 Matrix N, representing an non-equality constrain. More...
 
arma::mat non_equality_constrains_lower_vector_
 Vector c. More...
 
arma::mat non_equality_constrains_upper_vector_
 Vector d. More...
 
arma::mat argument_lower_constrains_
 Vector e. More...
 
arma::mat argument_upper_constrains_
 Vector f. More...
 
bool silent_
 If true solve function prints status of each iteration. More...
 

Detailed Description

Quadratic Programming Solver.

An algorithm implemented in QuadraticProgrammingSolver solves following problem:

\[ \min_{x} \frac{1}{2}x^T Q x + L^T x \]

subject to:
$E x = b $
$c <= N x <= d $
$e <= x <= f $
where:

  • $Q$ is symmetric, positive-definite matrix representing quadratic term
  • $L$ is a vector representing linear term
  • $E$ is a matrix representing an equality constrain
  • $N$ is a matrix representing non-equality constrain

More information about algorithm see OOQP manual [27] (link)

Remarks
Class uses algorithms implemented in OOQP
Examples:
QPSolverExample.cpp.

Member Function Documentation

void julian::QuadraticProgrammingSolver::Matrix1dToArray ( double *  A,
const arma::mat &  B 
)
private

Column matrix adapter.

Function adapts armadillo matrix to sparse matrix used by OOQP

void julian::QuadraticProgrammingSolver::MatrixToArray ( int *  row,
int *  col,
double *  A,
const arma::mat &  B 
)
private

Matrix adapter.

Function adapts armadillo matrix to sparse matrix used by OOQP

void julian::QuadraticProgrammingSolver::setArgumentLowerConstrains ( const arma::mat &  input)

Sets vector e.

Sets vector e

Examples:
QPSolverExample.cpp.
void julian::QuadraticProgrammingSolver::setArgumentUpperConstrains ( const arma::mat &  input)

Sets vector f.

Sets vector f

Examples:
QPSolverExample.cpp.
void julian::QuadraticProgrammingSolver::setEqualityConstrainsMatrix ( const arma::mat &  input)

Sets matrix E.

Sets matrix E.

void julian::QuadraticProgrammingSolver::setEqualityConstrainsVector ( const arma::mat &  input)

Sets vector b.

Sets vector b.

void julian::QuadraticProgrammingSolver::setInfo ( const bool  input)

Sets silent_ variable.

Sets silent_ variable

Examples:
QPSolverExample.cpp.
void julian::QuadraticProgrammingSolver::setLinearTerm ( const arma::mat &  input)

Sets vector L.

Sets vector L.

Examples:
QPSolverExample.cpp.
void julian::QuadraticProgrammingSolver::setNonEqualityConstrainsLowerVector ( const arma::mat &  input)

Sets vector c.

Sets vector c

Examples:
QPSolverExample.cpp.
void julian::QuadraticProgrammingSolver::setNonEqualityConstrainsMatrix ( const arma::mat &  input)

Sets matrix N.

Sets matrix N.

Examples:
QPSolverExample.cpp.
void julian::QuadraticProgrammingSolver::setNonEqualityConstrainsUpperVector ( const arma::mat &  input)

Sets vector d.

Sets vector d

Examples:
QPSolverExample.cpp.
void julian::QuadraticProgrammingSolver::setQuadraticTerm ( const arma::mat &  input)

Sets matrix Q.

Sets matrix Q.

Examples:
QPSolverExample.cpp.
arma::mat julian::QuadraticProgrammingSolver::solve ( )

Solves quadratic problem.

Algorithm used is primal-dual interior-point. Returns the vector of numbers $x$ which minimizes expression $\frac{1}{2}x^T Q x + L^T x $

Examples:
QPSolverExample.cpp.
void julian::QuadraticProgrammingSolver::SymetricMatrixToArray ( int *  row,
int *  col,
double *  A,
const arma::mat &  B 
)
private

Symetric matrix adapter.

Function adapts armadillo matrix to sparse matrix used by OOQP

Member Data Documentation

arma::mat julian::QuadraticProgrammingSolver::argument_lower_constrains_
private

Vector e.

arma::mat julian::QuadraticProgrammingSolver::argument_upper_constrains_
private

Vector f.

arma::mat julian::QuadraticProgrammingSolver::equality_constrains_matrix_
private

Matrix E, representing an equality constrain.

arma::mat julian::QuadraticProgrammingSolver::equality_constrains_vector_
private

Vector b.

arma::mat julian::QuadraticProgrammingSolver::linear_term_
private

Matrix L, representing the linear term of cost function.

arma::mat julian::QuadraticProgrammingSolver::non_equality_constrains_lower_vector_
private

Vector c.

arma::mat julian::QuadraticProgrammingSolver::non_equality_constrains_matrix_
private

Matrix N, representing an non-equality constrain.

arma::mat julian::QuadraticProgrammingSolver::non_equality_constrains_upper_vector_
private

Vector d.

arma::mat julian::QuadraticProgrammingSolver::quadratic_term_
private

Matrix Q, representing the quadratic term of cost function.

bool julian::QuadraticProgrammingSolver::silent_
private

If true solve function prints status of each iteration.


The documentation for this class was generated from the following files:
  • C:/Unix/home/OEM/jULIAN/src/mathematics/numericalAlgorithms/QuadraticProgrammingSolver.hpp
  • C:/Unix/home/OEM/jULIAN/src/mathematics/numericalAlgorithms/QuadraticProgrammingSolver.cpp