From f1703db4aacfa4923bf1318d0b5017789f140f86 Mon Sep 17 00:00:00 2001 From: krunalchande Date: Tue, 20 Jan 2015 22:19:14 -0500 Subject: [PATCH] Added comments --- gtsam_unstable/linear/QPSolver.cpp | 8 +++++--- gtsam_unstable/nonlinear/NonlinearInequalityFactorGraph.h | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/gtsam_unstable/linear/QPSolver.cpp b/gtsam_unstable/linear/QPSolver.cpp index 84ef6cb3a..de28d8fe8 100644 --- a/gtsam_unstable/linear/QPSolver.cpp +++ b/gtsam_unstable/linear/QPSolver.cpp @@ -158,12 +158,14 @@ boost::tuple QPSolver::computeStepSize( QPState QPSolver::iterate(const QPState& state) const { static bool debug = false; - // Solve with the current working set + // Algorithm 16.3 from Nocedal06book. + // Solve with the current working set eqn 16.39, but instead of solving for p solve for x VectorValues newValues = solveWithCurrentWorkingSet(state.workingSet); if (debug) newValues.print("New solution:"); // If we CAN'T move further + // if p_k = 0 is the original condition, modified by Duy to say that the state update is zero. if (newValues.equals(state.values, 1e-7)) { // Compute lambda from the dual graph if (debug) @@ -191,12 +193,12 @@ QPState QPSolver::iterate(const QPState& state) const { } } else { - // If we CAN make some progress + // If we CAN make some progress, i.e. p_k != 0 // Adapt stepsize if some inactive constraints complain about this move double alpha; int factorIx; VectorValues p = newValues - state.values; - boost::tie(alpha, factorIx) = // + boost::tie(alpha, factorIx) = // using 16.41 computeStepSize(state.workingSet, state.values, p); if (debug) cout << "alpha, factorIx: " << alpha << " " << factorIx << " " diff --git a/gtsam_unstable/nonlinear/NonlinearInequalityFactorGraph.h b/gtsam_unstable/nonlinear/NonlinearInequalityFactorGraph.h index 20196c91b..45f23d310 100644 --- a/gtsam_unstable/nonlinear/NonlinearInequalityFactorGraph.h +++ b/gtsam_unstable/nonlinear/NonlinearInequalityFactorGraph.h @@ -30,7 +30,7 @@ public: NonlinearInequalityFactorGraph() { } - /// Linearize to a LinearEqualityFactorGraph + /// Linearize to a LinearInequalityFactorGraph LinearInequalityFactorGraph::shared_ptr linearize( const Values& linearizationPoint) const { LinearInequalityFactorGraph::shared_ptr linearGraph(