gtsam  4.1.0
gtsam
QPSolver.h
Go to the documentation of this file.
1 /* ----------------------------------------------------------------------------
2 
3  * GTSAM Copyright 2010, Georgia Tech Research Corporation,
4  * Atlanta, Georgia 30332-0415
5  * All Rights Reserved
6  * Authors: Frank Dellaert, et al. (see THANKS for the full author list)
7 
8  * See LICENSE for the license information
9 
10  * -------------------------------------------------------------------------- */
11 
23 #include <limits>
24 #include <algorithm>
25 
26 namespace gtsam {
27 
29 struct QPPolicy {
32  static constexpr double maxAlpha = 1.0;
33 
35  static const GaussianFactorGraph buildCostFunction(const QP& qp,
36  const VectorValues& xk = VectorValues()) {
37  GaussianFactorGraph no_constant_factor;
38  for (auto factor : qp.cost) {
39  HessianFactor hf = static_cast<HessianFactor>(*factor);
40  no_constant_factor.push_back(hf);
41  }
42  return no_constant_factor;
43  }
44 };
45 
46 using QPSolver = ActiveSetSolver<QP, QPPolicy, QPInitSolver>;
47 
48 }
gtsam::GaussianFactorGraph
A Linear Factor Graph is a factor graph where all factors are Gaussian, i.e.
Definition: GaussianFactorGraph.h:68
gtsam::QP::cost
GaussianFactorGraph cost
Quadratic cost factors.
Definition: QP.h:32
gtsam::QP
Struct contains factor graphs of a Quadratic Programming problem.
Definition: QP.h:31
ActiveSetSolver.h
Active set method for solving LP, QP problems.
QPInitSolver.h
This finds a feasible solution for a QP problem.
gtsam::FactorGraph::push_back
IsDerived< DERIVEDFACTOR > push_back(boost::shared_ptr< DERIVEDFACTOR > factor)
Add a factor directly using a shared_ptr.
Definition: FactorGraph.h:162
gtsam::QPPolicy
Policy for ActivetSetSolver to solve Linear Programming.
Definition: QPSolver.h:29
gtsam::QPPolicy::maxAlpha
static constexpr double maxAlpha
Maximum alpha for line search x'=xk + alpha*p, where p is the cost gradient For QP,...
Definition: QPSolver.h:32
gtsam::VectorValues
This class represents a collection of vector-valued variables associated each with a unique integer i...
Definition: VectorValues.h:74
gtsam
Global functions in a separate testing namespace.
Definition: chartTesting.h:28
QP.h
Factor graphs of a Quadratic Programming problem.
gtsam::HessianFactor
A Gaussian factor using the canonical parameters (information form)
Definition: HessianFactor.h:101
gtsam::QPPolicy::buildCostFunction
static const GaussianFactorGraph buildCostFunction(const QP &qp, const VectorValues &xk=VectorValues())
Simply the cost of the QP problem.
Definition: QPSolver.h:35