Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
gtsam::LPInitSolver Class Reference

#include <LPInitSolver.h>

Public Member Functions

 LPInitSolver (const LP &lp)
 Construct with an LP problem. More...
 
VectorValues solve () const
 

Private Member Functions

InequalityFactorGraph addSlackVariableToInequalities (Key yKey, const InequalityFactorGraph &inequalities) const
 Turn Cx <= d into Cx - y <= d factors. More...
 
LP::shared_ptr buildInitialLP (Key yKey) const
 build initial LP More...
 
GaussianFactorGraph::shared_ptr buildInitOfInitGraph () const
 
std::vector< std::pair< Key, Matrix > > collectTerms (const LinearInequality &factor) const
 Collect all terms of a factor into a container. More...
 
double compute_y0 (const VectorValues &x0) const
 y = max_j ( Cj*x0 - dj ) – due to the inequality constraints y >= Cx - d More...
 

Private Attributes

const LPlp_
 

Friends

class LPInitSolverInitializationTest
 

Detailed Description

This LPInitSolver implements the strategy in Matlab: http://www.mathworks.com/help/optim/ug/linear-programming-algorithms.html#brozyzb-9 Solve for x and y: min y st Ax = b Cx - y <= d where $y \in R$, $x \in R^n$, and Ax = b and Cx <= d is the constraints of the original problem.

If the solution for this problem {x*,y*} has y* <= 0, we'll have x* a feasible initial point of the original problem otherwise, if y* > 0 or the problem has no solution, the original problem is infeasible.

The initial value of this initial problem can be found by solving min ||x||^2 s.t. Ax = b to have a solution x0 then y = max_j ( Cj*x0 - dj ) – due to the constraints y >= Cx - d

WARNING: If some xj in the inequality constraints does not exist in the equality constraints, set them as zero for now. If that is the case, the original problem doesn't have a unique solution (it could be either infeasible or unbounded). So, if the initialization fails because we enforce xj=0 in the problematic inequality constraint, we can't conclude that the problem is infeasible. However, whether it is infeasible or unbounded, we don't have a unique solution anyway.

Definition at line 52 of file LPInitSolver.h.

Constructor & Destructor Documentation

◆ LPInitSolver()

gtsam::LPInitSolver::LPInitSolver ( const LP lp)
inline

Construct with an LP problem.

Definition at line 58 of file LPInitSolver.h.

Member Function Documentation

◆ addSlackVariableToInequalities()

InequalityFactorGraph gtsam::LPInitSolver::addSlackVariableToInequalities ( Key  yKey,
const InequalityFactorGraph inequalities 
) const
private

Turn Cx <= d into Cx - y <= d factors.

Definition at line 98 of file LPInitSolver.cpp.

◆ buildInitialLP()

LP::shared_ptr gtsam::LPInitSolver::buildInitialLP ( Key  yKey) const
private

build initial LP

Definition at line 51 of file LPInitSolver.cpp.

◆ buildInitOfInitGraph()

GaussianFactorGraph::shared_ptr gtsam::LPInitSolver::buildInitOfInitGraph ( ) const
private

Build the following graph to solve for an initial value of the initial problem min ||x||^2 s.t. Ax = b

Definition at line 62 of file LPInitSolver.cpp.

◆ collectTerms()

std::vector< std::pair< Key, Matrix > > gtsam::LPInitSolver::collectTerms ( const LinearInequality factor) const
private

Collect all terms of a factor into a container.

Definition at line 88 of file LPInitSolver.cpp.

◆ compute_y0()

double gtsam::LPInitSolver::compute_y0 ( const VectorValues x0) const
private

y = max_j ( Cj*x0 - dj ) – due to the inequality constraints y >= Cx - d

Definition at line 78 of file LPInitSolver.cpp.

◆ solve()

VectorValues gtsam::LPInitSolver::solve ( ) const
Returns
a feasible initialization point

Definition at line 27 of file LPInitSolver.cpp.

Friends And Related Function Documentation

◆ LPInitSolverInitializationTest

friend class LPInitSolverInitializationTest
friend

Definition at line 85 of file LPInitSolver.h.

Member Data Documentation

◆ lp_

const LP& gtsam::LPInitSolver::lp_
private

Definition at line 54 of file LPInitSolver.h.


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


gtsam
Author(s):
autogenerated on Tue Jul 4 2023 02:46:23