QPInitSolver.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 
20 #pragma once
21 
23 
24 namespace gtsam {
25 
32 class QPInitSolver {
33  const QP& qp_;
34 public:
36  QPInitSolver(const QP& qp) : qp_(qp) {}
37 
39  VectorValues solve() const {
40  // Make an LP with any linear cost function. It doesn't matter for
41  // initialization.
42  LP initProblem;
43  // make an unrelated key for a random variable cost
44  Key newKey = maxKey(qp_) + 1;
45  initProblem.cost = LinearCost(newKey, Vector::Ones(1));
46  initProblem.equalities = qp_.equalities;
47  initProblem.inequalities = qp_.inequalities;
48  LPInitSolver initSolver(initProblem);
49  return initSolver.solve();
50  }
51 };
52 
53 
54 }
EqualityFactorGraph equalities
Linear equality constraints: cE(x) = 0.
Definition: LP.h:55
InequalityFactorGraph inequalities
Linear inequality constraints: cI(x) <= 0.
Definition: LP.h:56
VectorValues solve() const
Definition: QPInitSolver.h:39
Key maxKey(const PROBLEM &problem)
Definition: LP.h:51
LinearCost cost
Linear cost factor.
Definition: LP.h:54
VectorValues solve() const
traits
Definition: chartTesting.h:28
InequalityFactorGraph inequalities
linear inequality constraints: cI(x) <= 0
Definition: QP.h:34
EqualityFactorGraph equalities
linear equality constraints: cE(x) = 0
Definition: QP.h:33
QPInitSolver(const QP &qp)
Constructor with a QP problem.
Definition: QPInitSolver.h:36
Definition: QP.h:31
std::uint64_t Key
Integer nonlinear key type.
Definition: types.h:102
This finds a feasible solution for an LP problem.


gtsam
Author(s):
autogenerated on Tue Jul 4 2023 02:35:26