jrl::qp::GoldfarbIdnaniSolver Class Reference

#include <jrl-qp/GoldfarbIdnaniSolver.h>

Inheritance diagram for jrl::qp::GoldfarbIdnaniSolver:
Collaboration diagram for jrl::qp::GoldfarbIdnaniSolver:

Classes

struct  Problem
 

Public Member Functions

 GoldfarbIdnaniSolver ()
 
 GoldfarbIdnaniSolver (int nbVar, int nbCstr, bool useBounds)
 
virtual ~GoldfarbIdnaniSolver ()=default
 
TerminationStatus solve (MatrixRef G, const VectorConstRef &a, const MatrixConstRef &C, const VectorConstRef &bl, const VectorConstRef &bu, const VectorConstRef &xl, const VectorConstRef &xu)
 
- Public Member Functions inherited from jrl::qp::DualSolver
 DualSolver ()
 
 DualSolver (int nbVar, int nbCstr, bool useBounds)
 
virtual ~DualSolver ()=default
 
void resize (int nbVar, int nbCstr, bool useBounds)
 
void options (const SolverOptions &options)
 
WConstVector solution () const
 
WConstVector multipliers () const
 
double objectiveValue () const
 
int iterations () const
 
const std::vector< ActivationStatus > & activeSet () const
 
void resetActiveSet ()
 

Protected Member Functions

internal::InitTermination init_ () override
 
internal::SelectedConstraint selectViolatedConstraint_ (const VectorConstRef &x) const override
 
void computeStep_ (VectorRef z, VectorRef r, const internal::SelectedConstraint &sc) const override
 
StepLength computeStepLength_ (const internal::SelectedConstraint &sc, const VectorConstRef &x, const VectorConstRef &u, const VectorConstRef &z, const VectorConstRef &r) const override
 
bool addConstraint_ (const internal::SelectedConstraint &sc) override
 
bool removeConstraint_ (int l) override
 
double dot_ (const internal::SelectedConstraint &sc, const VectorConstRef &z) override
 
void resize_ (int nbVar, int nbCstr, bool useBounds) override
 
virtual void initActiveSet ()
 
void addInitialConstraint (const internal::SelectedConstraint &sc)
 
- Protected Member Functions inherited from jrl::qp::DualSolver
TerminationStatus solve ()
 
TerminationStatus terminate (TerminationStatus status)
 
internal::InitTermination init ()
 
internal::SelectedConstraint selectViolatedConstraint (const VectorConstRef &x) const
 
void computeStep (VectorRef z, VectorRef r, const internal::SelectedConstraint &sc) const
 
StepLength computeStepLength (const internal::SelectedConstraint &sc, const VectorConstRef &x, const VectorConstRef &u, const VectorConstRef &z, const VectorConstRef &r) const
 
bool addConstraint (const internal::SelectedConstraint &sc)
 
bool removeConstraint (int l, VectorRef u)
 
virtual double dot (const internal::SelectedConstraint &sc, const VectorConstRef &z)
 

Protected Attributes

internal::Workspace work_d_
 
internal::Workspace work_J_
 
internal::Workspace work_R_
 
Problem pb_
 
- Protected Attributes inherited from jrl::qp::DualSolver
SolverOptions options_
 
utils::Logger log_
 
int it_
 
int nbVar_
 
internal::ActiveSet A_
 
double f_
 
internal::Workspace work_x_
 
internal::Workspace work_z_
 
internal::Workspace work_u_
 
internal::Workspace work_r_
 
bool needToExpandMultipliers_
 

Detailed Description

Implementation of the Goldfarb-Idnani dual QP solver.

Constructor & Destructor Documentation

◆ GoldfarbIdnaniSolver() [1/2]

jrl::qp::GoldfarbIdnaniSolver::GoldfarbIdnaniSolver ( )

◆ GoldfarbIdnaniSolver() [2/2]

jrl::qp::GoldfarbIdnaniSolver::GoldfarbIdnaniSolver ( int  nbVar,
int  nbCstr,
bool  useBounds 
)

Pre-allocate the data for a problem with nbVar variables, nbCstr (general) constraints, and bounds if useBounds is true.

◆ ~GoldfarbIdnaniSolver()

virtual jrl::qp::GoldfarbIdnaniSolver::~GoldfarbIdnaniSolver ( )
virtualdefault

Member Function Documentation

◆ addConstraint_()

bool jrl::qp::GoldfarbIdnaniSolver::addConstraint_ ( const internal::SelectedConstraint sc)
overrideprotectedvirtual

Add a constraint to the active set and update the computation data accordingly.

Implements jrl::qp::DualSolver.

◆ addInitialConstraint()

void jrl::qp::GoldfarbIdnaniSolver::addInitialConstraint ( const internal::SelectedConstraint sc)
protected

◆ computeStep_()

void jrl::qp::GoldfarbIdnaniSolver::computeStep_ ( VectorRef  z,
VectorRef  r,
const internal::SelectedConstraint sc 
) const
overrideprotectedvirtual

Compute a primal step z and dual step r, given n+

Implements jrl::qp::DualSolver.

◆ computeStepLength_()

DualSolver::StepLength jrl::qp::GoldfarbIdnaniSolver::computeStepLength_ ( const internal::SelectedConstraint sc,
const VectorConstRef x,
const VectorConstRef u,
const VectorConstRef z,
const VectorConstRef r 
) const
overrideprotectedvirtual

Compute a step length and update x and u given the data n+, z and r.

Implements jrl::qp::DualSolver.

◆ dot_()

double jrl::qp::GoldfarbIdnaniSolver::dot_ ( const internal::SelectedConstraint sc,
const VectorConstRef z 
)
overrideprotectedvirtual

Compute the dot product between the vector corresponding to sc and z.

Implements jrl::qp::DualSolver.

◆ init_()

internal::InitTermination jrl::qp::GoldfarbIdnaniSolver::init_ ( )
overrideprotectedvirtual

Compute the initial iterate, the corresponding objective value and initialize any relevant data of the derived class.

Implements jrl::qp::DualSolver.

◆ initActiveSet()

void jrl::qp::GoldfarbIdnaniSolver::initActiveSet ( )
protectedvirtual

◆ removeConstraint_()

bool jrl::qp::GoldfarbIdnaniSolver::removeConstraint_ ( int  l)
overrideprotectedvirtual

Remove the l-th active constraint from the active set and update the computation data accordingly.

Implements jrl::qp::DualSolver.

◆ resize_()

void jrl::qp::GoldfarbIdnaniSolver::resize_ ( int  nbVar,
int  nbCstr,
bool  useBounds 
)
overrideprotectedvirtual

Resize the data managed by the derived class.

Implements jrl::qp::DualSolver.

◆ selectViolatedConstraint_()

internal::SelectedConstraint jrl::qp::GoldfarbIdnaniSolver::selectViolatedConstraint_ ( const VectorConstRef x) const
overrideprotectedvirtual

Select the violated constraint to be considered for the current iteration.

Implements jrl::qp::DualSolver.

◆ solve()

TerminationStatus jrl::qp::GoldfarbIdnaniSolver::solve ( MatrixRef  G,
const VectorConstRef a,
const MatrixConstRef C,
const VectorConstRef bl,
const VectorConstRef bu,
const VectorConstRef xl,
const VectorConstRef xu 
)

Solve the problem min. 0.5 x^T G x + a^T x s.t. bl <= C^T x <= bu xl <= x <= xu

Member Data Documentation

◆ pb_

Problem jrl::qp::GoldfarbIdnaniSolver::pb_
protected

◆ work_d_

internal::Workspace jrl::qp::GoldfarbIdnaniSolver::work_d_
mutableprotected

◆ work_J_

internal::Workspace jrl::qp::GoldfarbIdnaniSolver::work_J_
protected

◆ work_R_

internal::Workspace jrl::qp::GoldfarbIdnaniSolver::work_R_
protected

The documentation for this class was generated from the following files: