gtsam/gtsam_unstable/linear/QPSolver.h

43 lines
1.3 KiB
C
Raw Normal View History

2014-12-23 08:49:32 +08:00
/* ----------------------------------------------------------------------------
* GTSAM Copyright 2010, Georgia Tech Research Corporation,
* Atlanta, Georgia 30332-0415
* All Rights Reserved
* Authors: Frank Dellaert, et al. (see THANKS for the full author list)
* See LICENSE for the license information
* -------------------------------------------------------------------------- */
2015-02-25 11:09:31 +08:00
/**
2016-06-17 11:49:14 +08:00
* @file QPSolver.h
* @brief Policy of ActiveSetSolver to solve Quadratic Programming Problems
* @author Duy Nguyen Ta
* @author Ivan Dario Jimenez
* @date 6/16/16
2014-04-16 04:27:19 +08:00
*/
#include <gtsam_unstable/linear/QP.h>
#include <gtsam_unstable/linear/ActiveSetSolver.h>
2016-06-17 11:49:14 +08:00
#include <gtsam_unstable/linear/QPInitSolver.h>
#include <limits>
#include <algorithm>
2014-11-26 16:04:34 +08:00
2014-04-16 04:27:19 +08:00
namespace gtsam {
2016-06-17 11:49:14 +08:00
/// Policy for ActivetSetSolver to solve Linear Programming \sa QP problems
struct QPPolicy {
2016-06-17 18:54:18 +08:00
/// Maximum alpha for line search x'=xk + alpha*p, where p is the cost gradient
/// For QP, maxAlpha = 1 is the minimum point of the quadratic cost
2016-06-17 11:49:14 +08:00
static constexpr double maxAlpha = 1.0;
2016-06-17 11:49:14 +08:00
/// Simply the cost of the QP problem
static const GaussianFactorGraph& buildCostFunction(
const QP& qp, const VectorValues& xk = VectorValues()) {
return qp.cost;
2016-06-16 22:48:06 +08:00
}
};
2016-06-17 11:49:14 +08:00
using QPSolver = ActiveSetSolver<QP, QPPolicy, QPInitSolver>;
}